Rename inventory count field quantity_added to quantity

issue7873
review287621002
This commit is contained in:
David Harper committed 2021-04-11 22:25:13 +01:00
1 parent ca9d4a3b63
commit 6ba228f54c
4 files changed
+15 -14

No files matched your search

+1
View File
@@ -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
+9 -9
View File
@@ -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))
+3 -3
View File
@@ -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')
+2 -2
View File
@@ -6,7 +6,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="product"/>
<label name="total_quantity"/>
<field name="total_quantity" symbol="uom"/>
<label name="quantity_added"/>
<field name="quantity_added" symbol="uom"/>
<label name="quantity"/>
<field name="quantity" symbol="uom"/>
<field name="line" colspan="-1" invisible="1"/>
</form>