Skip to content
Snippets Groups Projects
Commit b6a2c0a4 authored by Kinjal Mehta's avatar Kinjal Mehta Committed by Yannick Tivisse
Browse files

[IMP] stock_account: Set default value of `Inventory Valuation` on a product...

[IMP] stock_account: Set default value of `Inventory Valuation` on a product category from the res config

While Creating a new product category, default value of "Inventory Valuation" field should be Taken from "Inventory Valuation" configuration from settings of 'Inventory'.
parent ce91c5b6
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,11 @@ class StockConfigSettings(models.TransientModel):
(1, 'Include landed costs in product costing computation')], "Landed Costs",
help="""Install the module that allows to affect landed costs on pickings, and split them onto the different products.""")
@api.multi
def set_property_valuation_on_product_category(self):
data = {0: 'manual_periodic', 1: 'real_time'}
return self.env['ir.values'].set_default('product.category', 'property_valuation', data[self.group_stock_inventory_valuation])
@api.onchange('module_stock_landed_costs')
def onchange_landed_costs(self):
if self.module_stock_landed_costs:
......
......@@ -18,7 +18,7 @@
<group name="account_property" position="before">
<group>
<group string="Inventory Valuation">
<field name="property_cost_method" groups="stock_account.group_inventory_valuation"/>
<field name="property_cost_method" attrs="{'invisible': [('property_valuation', '=', 'manual_periodic')]}"/>
<field name="property_valuation"/>
</group>
</group>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment