diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/l10n_in_sale_stock/models | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/l10n_in_sale_stock/models')
| -rw-r--r-- | addons/l10n_in_sale_stock/models/__init__.py | 5 | ||||
| -rw-r--r-- | addons/l10n_in_sale_stock/models/sale_order.py | 16 | ||||
| -rw-r--r-- | addons/l10n_in_sale_stock/models/stock_warehouse.py | 10 |
3 files changed, 31 insertions, 0 deletions
diff --git a/addons/l10n_in_sale_stock/models/__init__.py b/addons/l10n_in_sale_stock/models/__init__.py new file mode 100644 index 00000000..fcfd6a14 --- /dev/null +++ b/addons/l10n_in_sale_stock/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from . import sale_order +from . import stock_warehouse diff --git a/addons/l10n_in_sale_stock/models/sale_order.py b/addons/l10n_in_sale_stock/models/sale_order.py new file mode 100644 index 00000000..653724eb --- /dev/null +++ b/addons/l10n_in_sale_stock/models/sale_order.py @@ -0,0 +1,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 diff --git a/addons/l10n_in_sale_stock/models/stock_warehouse.py b/addons/l10n_in_sale_stock/models/stock_warehouse.py new file mode 100644 index 00000000..190e0b27 --- /dev/null +++ b/addons/l10n_in_sale_stock/models/stock_warehouse.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import models, fields, api + + +class Stock(models.Model): + _inherit = 'stock.warehouse' + + l10n_in_sale_journal_id = fields.Many2one('account.journal', string="Sale Journal") |
