Merge pull request #6183 from expsa/14.0-fix-odex_takaful-auto-20260113_145935
[IMP] odex_takaful: improve data models and business logic
This commit is contained in:
commit
ac9d7fc999
|
|
@ -993,14 +993,15 @@ class TakafulSponsorship(models.Model):
|
|||
vendor_bill_vals.append(bill_values)
|
||||
|
||||
bill_id = self.env['account.move'].sudo().create(vendor_bill_vals)
|
||||
for line in bill_id.invoice_line_ids:
|
||||
line.account_id = line._get_computed_account()
|
||||
taxes = line._get_computed_taxes()
|
||||
if taxes and line.move_id.fiscal_position_id:
|
||||
taxes = line.move_id.fiscal_position_id.map_tax(taxes, partner=line.partner_id)
|
||||
line.tax_ids = taxes
|
||||
line.product_uom_id = line._get_computed_uom()
|
||||
bill_id.action_post()
|
||||
for bill in bill_id:
|
||||
for line in bill.invoice_line_ids:
|
||||
line.account_id = line._get_computed_account()
|
||||
taxes = line._get_computed_taxes()
|
||||
if taxes and line.move_id.fiscal_position_id:
|
||||
taxes = line.move_id.fiscal_position_id.map_tax(taxes, partner=line.partner_id)
|
||||
line.tax_ids = taxes
|
||||
line.product_uom_id = line._get_computed_uom()
|
||||
bill.action_post()
|
||||
else:
|
||||
sponsorship.state = 'wait_pay'
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue