[imp] discrpency by product avg

This commit is contained in:
Don Kendall
2021-11-18 09:31:15 -05:00
committed by Carolina Fernandez
parent 0322e764ff
commit e2daa7ecf5
3 changed files with 8 additions and 4 deletions

View File

@@ -5,7 +5,7 @@
"summary": "Adds the capability to show the discrepancy of every line in "
"an inventory and to block the inventory validation when the "
"discrepancy is over a user defined threshold.",
"version": "14.0.1.0.0",
"version": "14.0.1.1.0",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"category": "Warehouse",

View File

@@ -14,6 +14,7 @@ class StockInventoryLine(models.Model):
"theoretical quantity on hand.",
digits="Product Unit of Measure",
default=0,
compute_sudo=True,
)
discrepancy_percent = fields.Float(
string="Discrepancy percent (%)",
@@ -21,6 +22,9 @@ class StockInventoryLine(models.Model):
digits=(3, 2),
help="The discrepancy expressed in percent with theoretical quantity "
"as basis",
group_operator="avg",
store=True,
compute_sudo=True,
)
discrepancy_threshold = fields.Float(
string="Threshold (%)",

View File

@@ -56,9 +56,9 @@
<field name="inherit_id" ref="stock.stock_inventory_line_tree" />
<field name="arch" type="xml">
<field name="product_qty" position="after">
<field name="discrepancy_qty" />
<field name="discrepancy_percent" />
<field name="discrepancy_threshold" />
<field name="discrepancy_qty" optional="show" />
<field name="discrepancy_percent" optional="show" />
<field name="discrepancy_threshold" optional="show" />
<field name="has_over_discrepancy" invisible="1" />
</field>
<xpath expr="//tree" position="attributes">