[FIX] stock_secondary_unit: Fix key error in vals

This commit is contained in:
Sergio Teruel
2019-06-05 10:29:59 +02:00
committed by Jesús Alan Ramos Rodríguez
parent efdd436682
commit 96624abde0
2 changed files with 2 additions and 2 deletions

View File

@@ -3,7 +3,7 @@
{
'name': 'Stock Secondary Unit',
'summary': 'Get product quantities in a secondary unit',
'version': '12.0.1.0.0',
'version': '12.0.1.0.1',
'development_status': 'Beta',
'category': 'stock',
'website': 'https://github.com/OCA/stock-logistics-warehouse',

View File

@@ -35,7 +35,7 @@ class StockMoveLine(models.Model):
@api.model
def create(self, vals):
move = self.env['stock.move'].browse(vals['move_id'])
move = self.env['stock.move'].browse(vals.get('move_id', False))
if move.secondary_uom_id:
uom = self.env['uom.uom'].browse(vals['product_uom_id'])
factor = move.secondary_uom_id.factor * uom.factor