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