Skip to content

Commit

Permalink
[FIX] account_interest: Fix in analytic line ids for invoice line
Browse files Browse the repository at this point in the history
  • Loading branch information
rov-adhoc committed May 7, 2024
1 parent b047873 commit 9102828
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions account_interests/models/res_company_interest.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ def _get_move_line_domains(self, to_date):
return move_line_domain

def create_invoices(self, to_date, groupby='partner_id'):
import pdb
pdb.set_trace()
self.ensure_one()

journal = self.env['account.journal'].search([
Expand Down Expand Up @@ -177,7 +179,8 @@ def create_invoices(self, to_date, groupby='partner_id'):
move_vals = self._prepare_interest_invoice(
partner, debt, to_date, journal)
move = self.env['account.move'].create(move_vals)

move.invoice_line_ids._create_analytic_lines()

if self.automatic_validation:
try:
move.action_post()
Expand Down Expand Up @@ -225,7 +228,8 @@ def _prepare_interest_invoice(self, partner, debt, to_date, journal):
"price_unit": self.rate * debt,
"partner_id": partner.id,
"name": self.interest_product_id.name + '.\n' + comment,
"analytic_line_ids": [(self.analytic_line_ids.id, )],
#"analytic_line_ids": [(self.analytic_line_ids.id, )] if self.analytic_line_ids.id else False,
"analytic_distribution": {self.analytic_line_ids.id: 100.0} if self.analytic_line_ids.id else False,
"tax_ids": [(6, 0, tax_id.ids)]
})],
}
Expand Down

0 comments on commit 9102828

Please sign in to comment.