diff --git a/models/account_invoice.py b/models/account_invoice.py index ffc6e1731dfeb9052ca7b62206c9f564eeab1822..7344169325996ad7dd400554b650aa89753b6ac9 100644 --- a/models/account_invoice.py +++ b/models/account_invoice.py @@ -17,6 +17,11 @@ import logging _logger = logging.getLogger(__name__) +class AccountInvoiceLine(models.Model): + _inherit = 'account.invoice.line' + + expense_line_id = fields.Many2one('ranch.expenses.line', 'Expenses') + class AccountInvoice(models.Model): _inherit = 'account.invoice' diff --git a/wizard/ranch_purchase_data_invoice_wizard.py b/wizard/ranch_purchase_data_invoice_wizard.py index b5e3c918731a75cbd6b4bd65b41c0cfa713a64cc..cff88ab5dd0d621dea8f80dcd18ae526a64f212a 100644 --- a/wizard/ranch_purchase_data_invoice_wizard.py +++ b/wizard/ranch_purchase_data_invoice_wizard.py @@ -250,6 +250,7 @@ class PurchaseDataInvoiceWizard(models.TransientModel): 'name': expenses_line.name_get()[0][1], 'account_id': product.property_account_expense.id or product.categ_id.property_account_expense_categ.id, #'account_analytic_id': line.analytic_account_id.id, + 'expense_line_id': expenses_line.id, 'price_unit': wizard_expenses_line.invoiced_amount, 'quantity': 1.0, 'uos_id': False,