diff --git a/CHANGELOG b/CHANGELOG index ea2317245b..226b7fdd5d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Rename inventory count quantity_added to quantity * Add document source on move of product quantities by warehouse * Add relate from assigned shipment to products quantities by warehouse * Show quantities by warehouse for many products diff --git a/inventory.py b/inventory.py index dc55d37a01..29f1f9ae67 100644 --- a/inventory.py +++ b/inventory.py @@ -600,7 +600,7 @@ class Count(Wizard): values['uom'] = line.uom.id values['unit_digits'] = line.unit_digits if line.uom.rounding == 1: - values['quantity_added'] = 1 + values['quantity'] = 1 return values def get_line_domain(self, inventory): @@ -623,12 +623,12 @@ class Count(Wizard): return values def transition_add(self): - if self.quantity.line and self.quantity.quantity_added: + if self.quantity.line and self.quantity.quantity: line = self.quantity.line if line.quantity: - line.quantity += self.quantity.quantity_added + line.quantity += self.quantity.quantity else: - line.quantity = self.quantity.quantity_added + line.quantity = self.quantity.quantity line.save() return 'search' @@ -682,15 +682,15 @@ class CountQuantity(ModelView): readonly=True, depends=['unit_digits'], help="The total amount of the line counted so far.") - quantity_added = fields.Float( - "Added Quantity", digits=(16, Eval('unit_digits', 2)), required=True, + quantity = fields.Float( + "Quantity", digits=(16, Eval('unit_digits', 2)), required=True, depends=['unit_digits'], help="The quantity to add to the existing count.") unit_digits = fields.Integer("Unit Digits", readonly=True) - @fields.depends('quantity_added', 'line') - def on_change_quantity_added(self): + @fields.depends('quantity', 'line') + def on_change_quantity(self): if self.line: self.total_quantity = ( - (self.line.quantity or 0) + (self.quantity_added or 0)) + (self.line.quantity or 0) + (self.quantity or 0)) diff --git a/tests/scenario_stock_inventory_count.rst b/tests/scenario_stock_inventory_count.rst index b70ac02feb..feb5dce6c2 100644 --- a/tests/scenario_stock_inventory_count.rst +++ b/tests/scenario_stock_inventory_count.rst @@ -82,7 +82,7 @@ Count inventory:: ... name='stock.inventory,%s.product.product,%s.count_create' % ( ... inventory.id, product.id)).save() >>> count.execute('quantity') - >>> count.form.quantity_added + >>> count.form.quantity 1 >>> count.form.total_quantity 1 @@ -99,9 +99,9 @@ Count inventory:: ... name='stock.inventory,%s.product.product,%s.count_create' % ( ... inventory.id, product2.id)).save() >>> count.execute('quantity') - >>> count.form.quantity_added + >>> count.form.quantity >>> count.form.total_quantity - >>> count.form.quantity_added = 10 + >>> count.form.quantity = 10 >>> count.form.total_quantity 10.0 >>> count.execute('add') diff --git a/view/inventory_count_quantity_form.xml b/view/inventory_count_quantity_form.xml index 4df82b288c..7df3362597 100644 --- a/view/inventory_count_quantity_form.xml +++ b/view/inventory_count_quantity_form.xml @@ -6,7 +6,7 @@ this repository contains the full copyright notices and license terms. -->