Skip to content

Commit

Permalink
[MIG] stock_by_warehouse: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xmglord authored and luisg123v committed Mar 12, 2024
1 parent 7192cf9 commit 228e1d2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion stock_by_warehouse/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Stock by Warehouse",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"summary": """
Know the stock in all your warehouses with a simple click
from the product form.
Expand Down
2 changes: 1 addition & 1 deletion stock_by_warehouse/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _compute_qty_available_not_reserved(self):
quants = (
self.env["stock.quant"]
.with_context(lang=False)
.read_group(domain_quant, fields=["product_id", "quantity", "reserved_quantity"], groupby="product_id")
._read_group(domain_quant, groupby='product_id', aggregates=['quantity:sum', 'reserved_quantity:sum'])
)

res = {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">

<t t-name="stock_by_warehouse.ShowWarehouseInfo" owl="1">
<t t-name="stock_by_warehouse.ShowWarehouseInfo">
<div>
<p t-if="this.props.byLocation" class="availability_product my-0 mr-2">
The product is available in: <t t-out="show" /> locations.
Expand All @@ -24,7 +24,7 @@
</div>
</t>

<t t-name="stock_by_warehouse.ProductWarehousePopOver" owl="1">
<t t-name="stock_by_warehouse.ProductWarehousePopOver">
<h3 t-if="this.props.title" class="o_popover_header" t-out="this.props.title" />
<div class="popover-body stock-by-warehouse-widget">
<div class="panel clearfix container">
Expand Down Expand Up @@ -85,7 +85,7 @@
</div>
</t>

<t t-name="stock_by_warehouse.StockAvailabilityPopOver" owl="1">
<t t-name="stock_by_warehouse.StockAvailabilityPopOver">
<h3 t-if="this.props.title" class="o_popover_header" t-out="this.props.title" />
<div class="popover-body stock-by-warehouse-widget">
<div t-if="this.props.title">
Expand Down
9 changes: 3 additions & 6 deletions stock_by_warehouse/views/product_product_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,16 @@
name="warehouses_stock"
widget="warehouse"
groups="stock.group_stock_multi_warehouses"
attrs="{'invisible': [('detailed_type', '!=', 'product')]}"
/>
invisible="detailed_type != 'product'"/>
<label
for="warehouses_stock_location"
groups="stock.group_stock_multi_warehouses"
attrs="{'invisible': [('detailed_type', '!=', 'product')]}"
/>
invisible="detailed_type != 'product'"/>
<div
name="location_widget"
class="d-flex"
groups="stock.group_stock_multi_warehouses"
attrs="{'invisible': [('detailed_type', '!=', 'product')]}"
>
invisible="detailed_type != 'product'">
<field name="warehouses_stock_location" widget="warehouse" options='{"by_location": True}' />
<field name="warehouses_stock_recompute" widget="boolean_toggle" />
</div>
Expand Down
6 changes: 2 additions & 4 deletions stock_by_warehouse/views/product_template_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@
<label
for="warehouses_stock"
groups="stock.group_stock_multi_warehouses"
attrs="{'invisible': [('detailed_type', '!=', 'product')]}"
/>
invisible="detailed_type != 'product'"/>
<div
name="warehouse_widget"
class="d-flex"
groups="stock.group_stock_multi_warehouses"
attrs="{'invisible': [('detailed_type', '!=', 'product')]}"
>
invisible="detailed_type != 'product'">
<field name="warehouses_stock" widget="warehouse" />
<field name="warehouses_stock_recompute" widget="boolean_toggle" />
</div>
Expand Down

0 comments on commit 228e1d2

Please sign in to comment.