Rename Uom to Unit.
This commit is contained in:
parent
1c84e448df
commit
d7f6e7851b
|
@ -27,10 +27,10 @@ class ProductSupplier(metaclass=PoolMeta):
|
|||
class PurchaseRequest(metaclass=PoolMeta):
|
||||
__name__ = 'purchase.request'
|
||||
minimum_quantity = fields.Function(fields.Float('Minimum Quantity',
|
||||
digits=(16, Eval('uom_digits', 2)), depends=['uom_digits']),
|
||||
'on_change_with_minimum_quantity', searcher='search_minimum_quantity')
|
||||
digits='unit'), 'on_change_with_minimum_quantity',
|
||||
searcher='search_minimum_quantity')
|
||||
|
||||
@fields.depends('product', 'uom')
|
||||
@fields.depends('product', 'unit')
|
||||
def on_change_with_minimum_quantity(self, name=None):
|
||||
Uom = Pool().get('product.uom')
|
||||
if not self.product:
|
||||
|
@ -38,7 +38,7 @@ class PurchaseRequest(metaclass=PoolMeta):
|
|||
for product_supplier in self.product.product_suppliers_used():
|
||||
if product_supplier.party == self.party:
|
||||
return Uom.compute_qty(self.product.purchase_uom,
|
||||
product_supplier.minimum_quantity, self.uom)
|
||||
product_supplier.minimum_quantity, self.unit)
|
||||
|
||||
@classmethod
|
||||
def search_minimum_quantity(cls, name, clause):
|
||||
|
|
|
@ -104,7 +104,7 @@ Create a need for missing product::
|
|||
>>> shipment_out.company = company
|
||||
>>> move = shipment_out.outgoing_moves.new()
|
||||
>>> move.product = product
|
||||
>>> move.uom = unit
|
||||
>>> move.unit = unit
|
||||
>>> move.quantity = 3
|
||||
>>> move.from_location = output_loc
|
||||
>>> move.to_location = customer_loc
|
||||
|
@ -158,7 +158,7 @@ Create new need for missing product::
|
|||
>>> shipment_out.company = company
|
||||
>>> move = shipment_out.outgoing_moves.new()
|
||||
>>> move.product = product
|
||||
>>> move.uom = unit
|
||||
>>> move.unit = unit
|
||||
>>> move.quantity = 7
|
||||
>>> move.from_location = output_loc
|
||||
>>> move.to_location = customer_loc
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="/form/notebook/page[@id='product']/field[@name='computed_uom']" position="after">
|
||||
<xpath expr="/form/notebook/page[@id='product']/field[@name='computed_unit']" position="after">
|
||||
<label name="minimum_quantity"/>
|
||||
<field name="minimum_quantity"/>
|
||||
</xpath>
|
||||
|
|
Loading…
Reference in New Issue