Merge pull request #3679 from expsa/dev_odex25_accounting

Dev odex25 accounting
This commit is contained in:
ahmed-nouri051 2025-06-26 20:09:24 +02:00 committed by GitHub
commit 1395019e7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -54,12 +54,13 @@ class AccountPayment(models.Model):
res = super(AccountPayment, self).action_post()
self.env.cr.commit()
for payment in self:
payment.invalidate_cache()
payment.state = 'posted'
if payment.analytic_account_id and payment.move_id and payment.move_id.exist():
if payment.analytic_account_id and payment.move_id:
for line in payment.move_id.line_ids:
if line.account_id.id == payment.destination_account_id.id:
line.analytic_account_id = payment.analytic_account_id.id