[IMP] When landed costs are installed, it should automatically generate accounting...
authorJosse Colpaert <jco@odoo.com>
Mon, 1 Sep 2014 14:46:09 +0000 (16:46 +0200)
committerJosse Colpaert <jco@odoo.com>
Wed, 3 Sep 2014 17:18:17 +0000 (19:18 +0200)
addons/stock_account/res_config.py
addons/stock_account/res_config_view.xml

index a6076be..af97309 100644 (file)
@@ -38,4 +38,10 @@ class stock_config_settings(osv.osv_memory):
             help="""Install the module that allows to affect landed costs on pickings, and split them onto the different products."""),
     }
 
+
+    def onchange_landed_costs(self, cr, uid, ids, module_landed_costs, context=None):
+        if module_landed_costs:
+            return {'value': {'group_stock_inventory_valuation': True}}
+        return {}
+
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
index 4a48349..7c515c0 100644 (file)
@@ -19,7 +19,7 @@
                                 <label for="module_stock_invoice_directly"/>
                             </div>
                             <div>
-                                <field name="module_stock_landed_costs" class="oe_inline"/>
+                                <field name="module_stock_landed_costs" on_change="onchange_landed_costs(module_stock_landed_costs)" class="oe_inline"/>
                                 <label for="module_stock_landed_costs"/>
                             </div>
                          </div>