diff --git a/modules/purchase/CHANGELOG b/modules/purchase/CHANGELOG
index 152783c500..009ec2d783 100644
--- a/modules/purchase/CHANGELOG
+++ b/modules/purchase/CHANGELOG
@@ -1,3 +1,4 @@
+* Rename UOM to Unit for product supplier
* Use price from last purchase as product price
* Add a button to create invoices manually
diff --git a/modules/purchase/product.py b/modules/purchase/product.py
index 2ec050cdc4..37b733a3b0 100644
--- a/modules/purchase/product.py
+++ b/modules/purchase/product.py
@@ -264,7 +264,7 @@ class Product(metaclass=PoolMeta):
for price in product_supplier.prices:
if price.match(quantity, product_uom, pattern):
unit_price = price.unit_price
- default_uom = product_supplier.uom
+ default_uom = product_supplier.unit
default_currency = product_supplier.currency
if unit_price is not None:
unit_price = Uom.compute_price(
@@ -365,8 +365,8 @@ class ProductSupplier(
"If empty the lead time of the supplier is used.")
currency = fields.Many2One('currency.currency', 'Currency', required=True,
ondelete='RESTRICT')
- uom = fields.Function(
- fields.Many2One('product.uom', "UOM"), 'on_change_with_uom')
+ unit = fields.Function(
+ fields.Many2One('product.uom', "Unit"), 'on_change_with_unit')
@classmethod
def __setup__(cls):
@@ -458,7 +458,7 @@ class ProductSupplier(
@fields.depends(
'product', '_parent_product.purchase_uom',
'template', '_parent_template.purchase_uom')
- def on_change_with_uom(self, name=None):
+ def on_change_with_unit(self, name=None):
if self.product:
return self.product.purchase_uom
elif self.template:
@@ -522,9 +522,10 @@ class ProductSupplierPrice(
unit_price = Monetary(
"Unit Price", currency='currency', required=True, digits=price_digits)
- uom = fields.Function(fields.Many2One('product.uom', 'UOM',
- help="The unit in which the quantity is specified."),
- 'on_change_with_uom')
+ unit = fields.Function(fields.Many2One(
+ 'product.uom', "Unit",
+ help="The unit in which the quantity is specified."),
+ 'on_change_with_unit')
currency = fields.Function(
fields.Many2One('currency.currency', 'Currency'),
'on_change_with_currency')
@@ -539,8 +540,8 @@ class ProductSupplierPrice(
return 0.0
@fields.depends('product_supplier', '_parent_product_supplier.product')
- def on_change_with_uom(self, name=None):
- return self.product_supplier.uom if self.product_supplier else None
+ def on_change_with_unit(self, name=None):
+ return self.product_supplier.unit if self.product_supplier else None
@fields.depends('product_supplier', '_parent_product_supplier.currency')
def on_change_with_currency(self, name=None):
@@ -551,11 +552,11 @@ class ProductSupplierPrice(
def get_pattern():
return {}
- def match(self, quantity, uom, pattern):
+ def match(self, quantity, unit, pattern):
pool = Pool()
Uom = pool.get('product.uom')
test_quantity = Uom.compute_qty(
- self.product_supplier.uom, self.quantity, uom)
+ self.product_supplier.unit, self.quantity, unit)
if test_quantity > abs(quantity):
return False
return super(ProductSupplierPrice, self).match(pattern)
diff --git a/modules/purchase/view/product_supplier_form.xml b/modules/purchase/view/product_supplier_form.xml
index fe758faabf..6d4439dd89 100644
--- a/modules/purchase/view/product_supplier_form.xml
+++ b/modules/purchase/view/product_supplier_form.xml
@@ -29,5 +29,5 @@ this repository contains the full copyright notices and license terms. -->
-
+
diff --git a/modules/purchase/view/product_supplier_price_form.xml b/modules/purchase/view/product_supplier_price_form.xml
index e4681520c0..092c546a09 100644
--- a/modules/purchase/view/product_supplier_price_form.xml
+++ b/modules/purchase/view/product_supplier_price_form.xml
@@ -8,7 +8,7 @@ this repository contains the full copyright notices and license terms. -->
-
+
diff --git a/modules/purchase/view/product_supplier_price_list_sequence.xml b/modules/purchase/view/product_supplier_price_list_sequence.xml
index 3887ccfefb..7cfbd440d1 100644
--- a/modules/purchase/view/product_supplier_price_list_sequence.xml
+++ b/modules/purchase/view/product_supplier_price_list_sequence.xml
@@ -3,6 +3,6 @@
this repository contains the full copyright notices and license terms. -->
-
+
diff --git a/modules/purchase/view/product_supplier_price_tree.xml b/modules/purchase/view/product_supplier_price_tree.xml
index e0470da7f1..0a7929e1f9 100644
--- a/modules/purchase/view/product_supplier_price_tree.xml
+++ b/modules/purchase/view/product_supplier_price_tree.xml
@@ -3,6 +3,6 @@
this repository contains the full copyright notices and license terms. -->
-
+
diff --git a/modules/purchase_product_quantity/product.py b/modules/purchase_product_quantity/product.py
index a62d74e0ff..c567fe2438 100644
--- a/modules/purchase_product_quantity/product.py
+++ b/modules/purchase_product_quantity/product.py
@@ -31,7 +31,7 @@ class ProductSupplier(metaclass=PoolMeta):
'on_change_with_quantity_digits')
@fields.depends(
- 'uom',
+ 'unit',
'product', '_parent_product.default_uom',
'template', '_parent_template.default_uom')
def on_change_with_quantity_digits(self, name=None):
@@ -44,15 +44,15 @@ class ProductSupplier(metaclass=PoolMeta):
else:
return
rounding = default_uom.rounding
- if self.uom:
+ if self.unit:
rounding = Uom.compute_qty(
- default_uom, rounding, self.uom, round=False)
+ default_uom, rounding, self.unit, round=False)
return -Decimal(str(rounding)).as_tuple().exponent
def adapt_quantity(self, quantity, unit, round=True):
pool = Pool()
Uom = pool.get('product.uom')
- quantity = Uom.compute_qty(unit, quantity, self.uom, round=False)
+ quantity = Uom.compute_qty(unit, quantity, self.unit, round=False)
if self.quantity_minimal:
if quantity < self.quantity_minimal:
quantity = self.quantity_minimal
@@ -61,5 +61,5 @@ class ProductSupplier(metaclass=PoolMeta):
quantity % self.quantity_rounding, self.quantity_digits)
if remainder and remainder != self.quantity_rounding:
quantity += (self.quantity_rounding - remainder)
- quantity = Uom.compute_qty(self.uom, quantity, unit, round=round)
+ quantity = Uom.compute_qty(self.unit, quantity, unit, round=round)
return quantity
diff --git a/modules/purchase_product_quantity/view/product_supplier_form.xml b/modules/purchase_product_quantity/view/product_supplier_form.xml
index 13d9a68ba0..804e766fc3 100644
--- a/modules/purchase_product_quantity/view/product_supplier_form.xml
+++ b/modules/purchase_product_quantity/view/product_supplier_form.xml
@@ -4,8 +4,8 @@ this repository contains the full copyright notices and license terms. -->
-
+
-
+