[FIX] stock_landed_costs : You cannot validate a landed cost which has no valuation line.

bzr revid: mdi@tinyerp.com-20140424121656-8wb2mefhh7ons92d
This commit is contained in:
DJ Patel 2014-04-24 17:46:56 +05:30
parent d0fc220091
commit 5f4876e7be
1 changed files with 3 additions and 0 deletions

View File

@ -153,6 +153,9 @@ class stock_landed_cost(osv.osv):
def button_validate(self, cr ,uid, ids, context=None):
quant_obj = self.pool.get('stock.quant')
for cost in self.browse(cr, uid, ids, context=context):
if not cost.valuation_adjustment_lines:
raise osv.except_osv(_('Error!'),_('You cannot validate a landed cost which has no valuation line.'))
quant_dict = {}
for line in cost.valuation_adjustment_lines:
per_unit = line.final_cost / line.quantity