fix migration accounting issue

This commit is contained in:
ronozoro 2024-07-21 13:45:08 +03:00
parent 6585d25e26
commit abc7540740
No known key found for this signature in database
GPG Key ID: 7C2BDED35C62C0F3
1 changed files with 5 additions and 6 deletions

View File

@ -249,12 +249,11 @@ class AccountPayment(models.Model):
def action_post(self):
''' update petty cash expenses state '''
if self.payment_petty_cash_id:
self.payment_petty_cash_id.write({'state': 'done'})
if self.petty_cash_id:
self.petty_cash_id.write({'is_paid': True})
print("petty_cash_remaining",self.petty_cash_id.petty_cash_remaining)
print("amount",self.amount)
for rec in self:
if rec.payment_petty_cash_id:
rec.payment_petty_cash_id.write({'state': 'done'})
if rec.petty_cash_id:
rec.petty_cash_id.write({'is_paid': True})
return super().action_post()
def _prepare_move_line_default_vals(self, write_off_line_vals=None):