sale_order.py 561 B

1234567891011121314151617
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from odoo import models, fields, api
  4. class SaleOrder(models.Model):
  5. _inherit = "sale.order"
  6. @api.depends('company_id', 'warehouse_id')
  7. def _compute_l10n_in_journal_id(self):
  8. super()._compute_l10n_in_journal_id()
  9. for order in self:
  10. if order.country_code == 'IN':
  11. if order.warehouse_id.l10n_in_sale_journal_id:
  12. order.l10n_in_journal_id = order.warehouse_id.l10n_in_sale_journal_id.id