account_move.py 424 B

123456789101112131415
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from odoo import models
  4. class AccountMoveLine(models.Model):
  5. _inherit = 'account.move.line'
  6. def _sale_prepare_sale_line_values(self, order, price):
  7. res = super()._sale_prepare_sale_line_values(order, price)
  8. if self.expense_id:
  9. res['expense_id'] = self.expense_id.id
  10. return res