[FIX] odex_takaful: automatic update
Auto-generated commit based on local changes.
This commit is contained in:
parent
0a83726576
commit
7529c15032
|
|
@ -141,6 +141,15 @@ class AccountRegisterPayment(models.TransientModel):
|
||||||
sponsorships = self.env['takaful.sponsorship'].browse(self.env.context.get('sponsorship_id'))
|
sponsorships = self.env['takaful.sponsorship'].browse(self.env.context.get('sponsorship_id'))
|
||||||
branch_ids = sponsorships.mapped('branch_custom_id.id')
|
branch_ids = sponsorships.mapped('branch_custom_id.id')
|
||||||
rec.journal_id = rec.takaful_payment_method_id.journal_id.id
|
rec.journal_id = rec.takaful_payment_method_id.journal_id.id
|
||||||
|
|
||||||
|
# Set payment_method_line_id based on payment method name
|
||||||
|
pml = self.env['account.payment.method.line'].search([
|
||||||
|
('journal_id', '=', rec.journal_id.id),
|
||||||
|
('name', '=', rec.takaful_payment_method_id.name)
|
||||||
|
], limit=1)
|
||||||
|
if pml:
|
||||||
|
rec.payment_method_line_id = pml.id
|
||||||
|
|
||||||
payment_method = rec.takaful_payment_method_id.payment_method
|
payment_method = rec.takaful_payment_method_id.payment_method
|
||||||
j_type = ""
|
j_type = ""
|
||||||
if payment_method == "cash":
|
if payment_method == "cash":
|
||||||
|
|
@ -150,6 +159,18 @@ class AccountRegisterPayment(models.TransientModel):
|
||||||
if j_type:
|
if j_type:
|
||||||
return {"domain": {"journal_id": [("type", "=", j_type), ("branch_ids", "in", branch_ids)]}}
|
return {"domain": {"journal_id": [("type", "=", j_type), ("branch_ids", "in", branch_ids)]}}
|
||||||
|
|
||||||
|
@api.onchange("journal_id")
|
||||||
|
def onchange_journal_id_set_payment_method_line(self):
|
||||||
|
"""Set payment_method_line_id based on takaful_payment_method_id name when journal changes."""
|
||||||
|
for rec in self:
|
||||||
|
if rec.journal_id and rec.takaful_payment_method_id and self.env.context.get('sponsorship_payment'):
|
||||||
|
pml = self.env['account.payment.method.line'].search([
|
||||||
|
('journal_id', '=', rec.journal_id.id),
|
||||||
|
('name', '=', rec.takaful_payment_method_id.name)
|
||||||
|
], limit=1)
|
||||||
|
if pml:
|
||||||
|
rec.payment_method_line_id = pml.id
|
||||||
|
|
||||||
@api.depends('source_amount', 'source_amount_currency', 'source_currency_id', 'company_id', 'currency_id',
|
@api.depends('source_amount', 'source_amount_currency', 'source_currency_id', 'company_id', 'currency_id',
|
||||||
'payment_date')
|
'payment_date')
|
||||||
def _compute_amount(self):
|
def _compute_amount(self):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue