Skip to content

Commit

Permalink
[MIG] stock_warehouse_flow: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
peluko00 committed Jun 21, 2024
1 parent aac5b7a commit 9ed21f6
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 58 deletions.
3 changes: 3 additions & 0 deletions stock_warehouse_flow/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ Contributors
- Sébastien Alix <[email protected]>
- Jacques-Etienne Baudoux <[email protected]>
- Michael Tietz (MT Software) <[email protected]>
- `APSL-Nagarro <https://apsl.tech>`__:

- Antoni Marroig <[email protected]>

Maintainers
-----------
Expand Down
2 changes: 1 addition & 1 deletion stock_warehouse_flow/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"author": "Camptocamp, BCIM, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/wms",
"category": "Warehouse Management",
"version": "16.0.1.0.2",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"depends": [
# core
Expand Down
11 changes: 7 additions & 4 deletions stock_warehouse_flow/models/stock_warehouse_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,11 @@ def _generate_delivery_route(self):
self.pack_type_id.sequence_id.prefix += f"{self.sequence_prefix}/"
# Create a dedicated 'Packing Zone/SUB' location
if not self.pack_stock_loc_id:
self.pack_stock_loc_id = self.warehouse_id.wh_pack_stock_loc_id.copy(
warehouse = self.warehouse_id
self.pack_stock_loc_id = warehouse.wh_pack_stock_loc_id.copy(
{
"name": self.sequence_prefix,
"location_id": self.warehouse_id.wh_pack_stock_loc_id.id,
"location_id": warehouse.wh_pack_stock_loc_id.id,
"active": True,
}
)
Expand Down Expand Up @@ -465,8 +466,10 @@ def _get_rule_from_delivery_route(self, html_exc=False):
}
if html_exc:
args = {
"picking_type": f"<strong>{self.to_picking_type_id.display_name}</strong>",
"delivery_route": f"<strong>{self.delivery_route_id.display_name}</strong>",
"picking_type": "<strong>"
+ "{self.to_picking_type_id.display_name}</strong>",
"delivery_route": "<strong>"
+ "{self.delivery_route_id.display_name}</strong>",
}
raise UserError(
_(
Expand Down
3 changes: 3 additions & 0 deletions stock_warehouse_flow/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
- Sébastien Alix \<<[email protected]>\>
- Jacques-Etienne Baudoux \<<[email protected]>\>
- Michael Tietz (MT Software) \<<[email protected]>\>
- [APSL-Nagarro](https://apsl.tech):
- Antoni Marroig \<<[email protected]>\>

4 changes: 4 additions & 0 deletions stock_warehouse_flow/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,10 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
<li>Sébastien Alix &lt;<a class="reference external" href="mailto:sebastien.alix&#64;camptocamp.com">sebastien.alix&#64;camptocamp.com</a>&gt;</li>
<li>Jacques-Etienne Baudoux &lt;<a class="reference external" href="mailto:je&#64;bcim.be">je&#64;bcim.be</a>&gt;</li>
<li>Michael Tietz (MT Software) &lt;<a class="reference external" href="mailto:mtietz&#64;mt-software.de">mtietz&#64;mt-software.de</a>&gt;</li>
<li><a class="reference external" href="https://apsl.tech">APSL-Nagarro</a>:<ul>
<li>Antoni Marroig &lt;<a class="reference external" href="mailto:amarroig&#64;apsl.net">amarroig&#64;apsl.net</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
2 changes: 1 addition & 1 deletion stock_warehouse_flow/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def _run_procurement(self, product, qty, carrier=None):

def _validate_picking(self, picking):
for move_line in picking.move_line_ids:
move_line.qty_done = move_line.reserved_uom_qty
move_line.picked = True
picking._action_done()

def _prepare_split_test(self, qty=None):
Expand Down
8 changes: 5 additions & 3 deletions stock_warehouse_flow/tests/test_warehouse_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ def test_no_rule_found_on_delivery_route(self):
self.assertTrue(flow.warning)
# Check that an error is raised when processing the move
exception_msg = (
f"No rule corresponding to .*{flow.to_picking_type_id.display_name}.* operation type "
f"has been found on delivery route .*{flow.delivery_route_id.display_name}.*.\n"
"Please check your configuration."
"No rule corresponding to ."
+ "*{flow.to_picking_type_id.display_name}.* operation type "
+ "has been found on delivery route ."
+ "*{flow.delivery_route_id.display_name}.*.\n"
+ "Please check your configuration."
)
with self.assertRaisesRegex(UserError, exception_msg):
self._run_procurement(self.product, 10, flow.carrier_ids)
Expand Down
2 changes: 1 addition & 1 deletion stock_warehouse_flow/views/delivery_carrier.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
icon="fa-refresh"
class="oe_stat_button"
type="object"
attrs="{'invisible': [('flow_ids', '=', [])]}"
invisible="not flow_ids"
/>
</div>
</field>
Expand Down
73 changes: 25 additions & 48 deletions stock_warehouse_flow/views/stock_warehouse_flow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
name="web_ribbon"
title="Archived"
bg_color="bg-danger"
attrs="{'invisible': [('active', '=', True)]}"
invisible="active"
/>
<div class="oe_title">
<label for="name" />
Expand All @@ -24,10 +24,7 @@
<group>
<group name="info" colspan="4">
<group>
<field
name="warehouse_id"
attrs="{'readonly': [('delivery_route_id', '!=', False)]}"
/>
<field name="warehouse_id" readonly="delivery_route_id" />
</group>
<group>
<field name="sequence" />
Expand All @@ -37,10 +34,7 @@
</group>
<group name="from" string="From">
<field name="from_picking_type_id" />
<div
colspan="2"
attrs="{'invisible': [('from_picking_type_id', '=', False)]}"
>
<div colspan="2" invisible="not from_picking_type_id">
<span class="text-muted"> => </span>
<field name="from_location_src_id" nolabel="1" class="oe_inline" />
<span class="text-muted"> to </span>
Expand All @@ -53,52 +47,41 @@
options="{'model': 'stock.move', 'in_dialog': true}"
/>
<field name="split_method" string="Max quantity multiple" />
<label
for="qty"
attrs="{'invisible': [('split_method', '!=', 'simple')]}"
/>
<label for="qty" invisible="split_method != 'simple'" />
<div name="qty" class="o_row">
<field
name="qty"
attrs="{'required': [('split_method', '=', 'simple')], 'invisible': [('split_method', '!=', 'simple')]}"
required="split_method == 'simple'"
invisible="split_method != 'simple'"
/>
<field
name="uom_id"
options="{'no_open': True, 'no_create': True}"
groups="uom.group_uom"
attrs="{'required': [('split_method', '=', 'simple')], 'invisible': [('split_method', '!=', 'simple')]}"
required="split_method == 'simple'"
invisible="split_method != 'simple'"
/>
</div>
</group>
<group name="to" string="To">
<field
name="delivery_steps"
attrs="{'invisible': [('delivery_route_id', '!=', False)]}"
/>
<field name="delivery_steps" invisible="delivery_route_id" />
<field
name="sequence_prefix"
attrs="{'invisible': [('delivery_route_id', '!=', False)], 'required': [('delivery_route_id', '=', False)]}"
/>
<field
name="delivery_route_id"
attrs="{'invisible': [('delivery_route_id', '=', False)]}"
/>
<field
name="to_picking_type_id"
attrs="{'invisible': [('delivery_route_id', '=', False)]}"
invisible="delivery_route_id"
required="not delivery_route_id"
/>
<field name="delivery_route_id" invisible="not delivery_route_id" />
<field name="to_picking_type_id" invisible="not delivery_route_id" />
<field
name="to_output_stock_loc_id"
attrs="{
'readonly': [('delivery_route_id', '!=', False)],
'invisible': [('delivery_steps', '=', 'ship_only')],
}"
readonly="delivery_route_id"
invisible="delivery_steps == 'ship_only'"
/>
<field
name="warning"
class="alert alert-warning"
role="alert"
attrs="{'invisible': [('warning', '=', False)]}"
invisible="not warning"
nolabel="1"
colspan="2"
/>
Expand All @@ -107,7 +90,7 @@
type="object"
string="Generate route"
class="oe_highlight"
attrs="{'invisible': [('delivery_route_id', '!=', False)]}"
invisible="delivery_route_id"
/>
</group>
</group>
Expand Down Expand Up @@ -139,30 +122,24 @@
<group string="Locations" name="locations">
<field
name="pack_stock_loc_id"
attrs="{
'readonly': [('delivery_route_id', '!=', False)],
'invisible': [('delivery_steps', '!=', 'pick_pack_ship')],
}"
readonly="delivery_route_id"
invisible="delivery_steps != 'pick_pack_ship'"
/>
<field
name="output_stock_loc_id"
attrs="{'invisible': [('output_stock_loc_id', '=', False)]}"
invisible="not output_stock_loc_id"
/>
</group>
<group string="Operation Types" name="picking_types">
<field
name="pick_type_id"
attrs="{
'readonly': [('delivery_route_id', '!=', False)],
'invisible': [('delivery_steps', '=', 'ship_only')],
}"
readonly="delivery_route_id"
invisible="delivery_steps == 'ship_only'"
/>
<field
name="pack_type_id"
attrs="{
'readonly': [('delivery_route_id', '!=', False)],
'invisible': [('delivery_steps', '!=', 'pick_pack_ship')],
}"
readonly="delivery_route_id"
invisible="delivery_steps != 'pick_pack_ship'"
/>
<field name="out_type_id" />
</group>
Expand All @@ -185,7 +162,7 @@
<field name="move_domain" />
<field name="carrier_ids" widget="many2many_tags" />
<field name="to_picking_type_id" />
<field name="warning" invisible="1" />
<field name="warning" column_invisible="1" />
</tree>
</field>
</record>
Expand Down

0 comments on commit 9ed21f6

Please sign in to comment.