[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 Rocío Vega
parent ade4acc4d7
commit 4c84b5d72c
3 changed files with 3 additions and 3 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

View File

@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.14: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<title>Stock Secondary Unit</title>
<style type="text/css">