diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index cea58b1b1cb..91b9caac751 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -136,7 +136,7 @@
diff --git a/addons/sale_stock/sale_stock.py b/addons/sale_stock/sale_stock.py
index 04006e46e5e..1dc2718634e 100644
--- a/addons/sale_stock/sale_stock.py
+++ b/addons/sale_stock/sale_stock.py
@@ -172,15 +172,17 @@ class SaleOrderLine(models.Model):
@api.multi
def _check_package(self):
- default_uom = self.product_id.product_uom
+ default_uom = self.product_id.uom_id
pack = self.product_packaging
qty = self.product_uom_qty
- q = self.product_id.product_uom._compute_qty(pack.qty, default_uom)
+ q = self.env['product.uom']._compute_qty_obj(default_uom, pack.qty, self.product_uom)
if qty and q and (qty % q):
newqty = qty - (qty % q) + q
return {
- 'title': _('Warning!'),
- 'message': _("This product is packaged by %d %s. You should sell %d %s.") % (pack.qty, default_uom, newqty, default_uom)
+ 'warning': {
+ 'title': _('Warning'),
+ 'message': _("This product is packaged by %d . You should sell %d .") % (pack.qty, newqty),
+ },
}
return {}