diff --git a/addons/stock_landed_costs/stock_landed_costs.py b/addons/stock_landed_costs/stock_landed_costs.py index 4a0a2ee7acc..8d79ff2a422 100644 --- a/addons/stock_landed_costs/stock_landed_costs.py +++ b/addons/stock_landed_costs/stock_landed_costs.py @@ -107,9 +107,6 @@ class stock_landed_cost(osv.osv): self.write(cr, uid, cost.id, {'state': 'open'}, context=context) return True - def button_cancel(self, cr ,uid, ids, context=None): - return True - def compute_landed_cost(self, cr, uid, ids, context=None): line_obj = self.pool.get('stock.valuation.adjustment.lines') for cost in self.browse(cr, uid, ids, context=None): @@ -155,7 +152,7 @@ class stock_landed_cost_lines(osv.osv): _name = 'stock.landed.cost.lines' _description = 'Stock Landed Cost Lines' - def onchange_product_id(self, cr, uid, ids, product_id=False, price_unit=0.0, account_id=False, context=None): + def onchange_product_id(self, cr, uid, ids, product_id=False, context=None): result = {} if not product_id: return {'value': {'quantity': 0.0, 'price_unit': 0.0}} @@ -164,6 +161,7 @@ class stock_landed_cost_lines(osv.osv): result['name'] = product.name result['split_method'] = product.split_method result['price_unit'] = product.standard_price + result['account_id'] = product.property_account_expense and product.property_account_expense.id or False return {'value': result} _columns = { diff --git a/addons/stock_landed_costs/stock_landed_costs_view.xml b/addons/stock_landed_costs/stock_landed_costs_view.xml index 5e1abae68fe..3cceaa1413b 100644 --- a/addons/stock_landed_costs/stock_landed_costs_view.xml +++ b/addons/stock_landed_costs/stock_landed_costs_view.xml @@ -10,8 +10,7 @@
@@ -37,7 +36,7 @@ + on_change="onchange_product_id(product_id)"/> @@ -49,7 +48,7 @@ - + @@ -144,7 +143,7 @@ - +