[12.0][IMP] account_spread_cost_revenue, auto spread on validate invoice

This commit is contained in:
Kitti U
2020-05-17 21:37:40 +07:00
parent 3e7eb50781
commit 40f0c605b6
11 changed files with 338 additions and 1 deletions

View File

@@ -7,6 +7,11 @@ from odoo import api, models
class AccountInvoice(models.Model):
_inherit = 'account.invoice'
def action_invoice_open(self):
for invoice in self:
invoice.invoice_line_ids.create_auto_spread()
return super().action_invoice_open()
@api.multi
def action_move_create(self):
"""Invoked when validating the invoices."""