diff --git a/addons/stock_landed_costs/data/stock_landed_cost_data.xml b/addons/stock_landed_costs/data/stock_landed_cost_data.xml index 8746c5e026fa511e0169b5e6417bd3087862c23c..8b417fa3637a113e47d795c32d530db1cbd2e4b8 100644 --- a/addons/stock_landed_costs/data/stock_landed_cost_data.xml +++ b/addons/stock_landed_costs/data/stock_landed_cost_data.xml @@ -13,6 +13,7 @@ <field name="code">stock.landed.cost</field> <field name="prefix">LC/%(year)s/</field> <field name="padding">4</field> - </record> + <field name="company_id" eval="False"/> + </record> </data> </odoo> diff --git a/addons/stock_landed_costs/models/stock_landed_cost.py b/addons/stock_landed_costs/models/stock_landed_cost.py index 880a3bb999410853692f9ec048d36500080a3f39..17cbe9df4cff935101cf03e390c712922739cfd7 100644 --- a/addons/stock_landed_costs/models/stock_landed_cost.py +++ b/addons/stock_landed_costs/models/stock_landed_cost.py @@ -68,7 +68,7 @@ class LandedCost(models.Model): 'account.journal', 'Account Journal', required=True, states={'done': [('readonly', True)]}, default=lambda self: self._default_account_journal_id()) company_id = fields.Many2one('res.company', string="Company", - related='account_journal_id.company_id', readonly=False) + related='account_journal_id.company_id') stock_valuation_layer_ids = fields.One2many('stock.valuation.layer', 'stock_landed_cost_id') vendor_bill_id = fields.Many2one( 'account.move', 'Vendor Bill', copy=False, domain=[('type', '=', 'in_invoice')]) diff --git a/addons/stock_landed_costs/views/stock_landed_cost_views.xml b/addons/stock_landed_costs/views/stock_landed_cost_views.xml index edeaab0e7ad2cad688c62fdc6040c693d3c7df9c..6cc6cd52bec0364b19fde1cd676e4290726b4838 100644 --- a/addons/stock_landed_costs/views/stock_landed_cost_views.xml +++ b/addons/stock_landed_costs/views/stock_landed_cost_views.xml @@ -33,6 +33,7 @@ <group> <label for="account_journal_id" string="Journal"/> <field name="account_journal_id" nolabel="1"/> + <field name="company_id" groups="base.group_multi_company"/> <field name="account_move_id" attrs="{'invisible': [('account_move_id', '=', False)]}"/> <field name="vendor_bill_id"/> </group>