mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[MIG] stock_inventory_discrepancy: Migration to 17.0
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Copyright 2017-2020 ForgeFlow S.L. (http://www.forgeflow.com)
|
||||
# Copyright 2017-2024 ForgeFlow S.L. (http://www.forgeflow.com)
|
||||
# Copyright 2023 Tecnativa - Carolina Fernandez
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
{
|
||||
@@ -6,7 +6,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": "16.0.1.0.0",
|
||||
"version": "17.0.1.0.0",
|
||||
"author": "ForgeFlow, Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/stock-logistics-warehouse",
|
||||
"category": "Warehouse",
|
||||
|
||||
@@ -31,7 +31,8 @@ def post_load_hook():
|
||||
self = self.sudo()
|
||||
# END HOOK
|
||||
for quant in self:
|
||||
# Create and validate a move so that the quant matches its `inventory_quantity`.
|
||||
# Create and validate a move so that the
|
||||
# quant matches its `inventory_quantity`.
|
||||
if (
|
||||
float_compare(
|
||||
quant.inventory_diff_quantity,
|
||||
@@ -47,6 +48,7 @@ def post_load_hook():
|
||||
quant.company_id
|
||||
).property_stock_inventory,
|
||||
quant.location_id,
|
||||
package_dest_id=quant.package_id,
|
||||
)
|
||||
)
|
||||
else:
|
||||
@@ -57,7 +59,7 @@ def post_load_hook():
|
||||
quant.product_id.with_company(
|
||||
quant.company_id
|
||||
).property_stock_inventory,
|
||||
out=True,
|
||||
package_id=quant.package_id,
|
||||
)
|
||||
)
|
||||
moves = (
|
||||
@@ -73,4 +75,4 @@ def post_load_hook():
|
||||
self.write({"inventory_quantity": 0, "user_id": False})
|
||||
self.write({"inventory_diff_quantity": 0})
|
||||
|
||||
StockQuant._patch_method("_apply_inventory", _apply_inventory_discrepancy)
|
||||
StockQuant._apply_inventory = _apply_inventory_discrepancy
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2017-2020 ForgeFlow S.L.
|
||||
# Copyright 2017-2024 ForgeFlow S.L.
|
||||
# (http://www.forgeflow.com)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2017-2020 ForgeFlow S.L.
|
||||
# Copyright 2017-2024 ForgeFlow S.L.
|
||||
# (http://www.forgeflow.com)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2017-2020 ForgeFlow S.L.
|
||||
# Copyright 2017-2024 ForgeFlow S.L.
|
||||
# (http://www.forgeflow.com)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2017-2020 ForgeFlow S.L.
|
||||
<!-- Copyright 2017-2024 ForgeFlow S.L.
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record id="view_location_form" model="ir.ui.view">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2017-2020 ForgeFlow S.L.
|
||||
<!-- Copyright 2017-2024 ForgeFlow S.L.
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record id="view_stock_quant_tree_inventory_editable" model="ir.ui.view">
|
||||
@@ -22,12 +22,12 @@
|
||||
<field name="inventory_diff_quantity" position="after">
|
||||
<field
|
||||
name="discrepancy_percent"
|
||||
attrs="{'invisible': ['|', ('inventory_quantity_set', '=', False), ('quantity', '=', False)]}"
|
||||
invisible="not inventory_quantity_set or not quantity"
|
||||
decoration-bf="inventory_quantity_set and has_over_discrepancy"
|
||||
optional="show"
|
||||
/>
|
||||
<field name="discrepancy_threshold" optional="show" />
|
||||
<field name="has_over_discrepancy" invisible="1" />
|
||||
<field name="has_over_discrepancy" column_invisible="True" />
|
||||
</field>
|
||||
<xpath expr="//tree" position="attributes">
|
||||
<attribute
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2017-2020 ForgeFlow S.L.
|
||||
<!-- Copyright 2017-2024 ForgeFlow S.L.
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record id="view_warehouse" model="ir.ui.view">
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
<button name="action_apply_inventory" position="attributes">
|
||||
<attribute name="invisible">True</attribute>
|
||||
</button>
|
||||
<button name="action_set_inventory_quantity_to_zero" position="attributes">
|
||||
<attribute name="invisible">True</attribute>
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
<record id="confirm_discrepancy_wizard" model="ir.ui.view">
|
||||
|
||||
Reference in New Issue
Block a user