Skip to content

Commit 42c7a75

Browse files
[MIG] delivery_carrier_max_weight_constraint: Migration to 18.0
1 parent 9bc1c8e commit 42c7a75

File tree

7 files changed

+31
-24
lines changed

7 files changed

+31
-24
lines changed

delivery_carrier_max_weight_constraint/README.rst

+3
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ Contributors
7272

7373
- Nans Lefebvre <nans.lefebvre@acsone.eu>
7474
- Hughes Damry <hughes.damry@acsone.eu>
75+
- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`__
76+
77+
- Bhavesh Heliconia
7578

7679
Maintainers
7780
-----------

delivery_carrier_max_weight_constraint/__manifest__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
{
55
"name": "Constrain package maximum weight",
6-
"version": "16.0.1.0.1",
6+
"version": "18.0.1.0.0",
77
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
88
"category": "Delivery",
9-
"depends": ["delivery"],
9+
"depends": ["stock_delivery"],
1010
"website": "https://github.com/OCA/delivery-carrier",
1111
"data": [
1212
"views/res_config_settings_views.xml",
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
- Nans Lefebvre \<<nans.lefebvre@acsone.eu>\>
22
- Hughes Damry \<<hughes.damry@acsone.eu>\>
3+
- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io)
4+
- Bhavesh Heliconia

delivery_carrier_max_weight_constraint/static/description/index.html

+4
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,10 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
418418
<ul class="simple">
419419
<li>Nans Lefebvre &lt;<a class="reference external" href="mailto:nans.lefebvre&#64;acsone.eu">nans.lefebvre&#64;acsone.eu</a>&gt;</li>
420420
<li>Hughes Damry &lt;<a class="reference external" href="mailto:hughes.damry&#64;acsone.eu">hughes.damry&#64;acsone.eu</a>&gt;</li>
421+
<li><a class="reference external" href="https://www.heliconia.io">Heliconia Solutions Pvt. Ltd.</a><ul>
422+
<li>Bhavesh Heliconia</li>
423+
</ul>
424+
</li>
421425
</ul>
422426
</div>
423427
<div class="section" id="maintainers">

delivery_carrier_max_weight_constraint/tests/test_max_weight_constraint.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ def setUpClass(cls):
1414
cls.product_test = cls.env["product.product"].create(
1515
{
1616
"name": "Product TEST",
17-
"type": "product",
17+
"type": "consu",
18+
"is_storable": True,
1819
"weight": 2,
1920
"uom_id": cls.uom_kg.id,
2021
"uom_po_id": cls.uom_kg.id,
@@ -67,7 +68,7 @@ def test_strict_weight_not_set(self):
6768
"product_id": self.product_test.id,
6869
"product_uom_id": self.uom_kg.id,
6970
"picking_id": picking_ship.id,
70-
"qty_done": 6,
71+
"quantity": 6,
7172
"location_id": self.stock_location.id,
7273
"location_dest_id": self.customer_location.id,
7374
}
@@ -113,7 +114,7 @@ def test_strict_weight_set_ok(self):
113114
"product_id": self.product_test.id,
114115
"product_uom_id": self.uom_kg.id,
115116
"picking_id": picking_ship.id,
116-
"qty_done": 4,
117+
"quantity": 4,
117118
"location_id": self.stock_location.id,
118119
"location_dest_id": self.customer_location.id,
119120
}
@@ -158,7 +159,7 @@ def test_strict_weight_set_error(self):
158159
"product_id": self.product_test.id,
159160
"product_uom_id": self.uom_kg.id,
160161
"picking_id": picking_ship.id,
161-
"qty_done": 6,
162+
"quantity": 6,
162163
"location_id": self.stock_location.id,
163164
"location_dest_id": self.customer_location.id,
164165
}
@@ -207,7 +208,7 @@ def test_strict_weight_set_max_weightb_not_set(self):
207208
"product_id": self.product_test.id,
208209
"product_uom_id": self.uom_kg.id,
209210
"picking_id": picking_ship.id,
210-
"qty_done": 6,
211+
"quantity": 6,
211212
"location_id": self.stock_location.id,
212213
"location_dest_id": self.customer_location.id,
213214
}

delivery_carrier_max_weight_constraint/views/res_config_settings_views.xml

+10-16
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,19 @@
33
<record id="res_config_settings_view_form" model="ir.ui.view">
44
<field
55
name="name"
6-
>res.config.settings.view.form (in delivery_carrier_max_weight_constraint)</field>
6+
>res.config.settings.view.form (in delivery_carrier_max_weight_constraint)
7+
</field>
78
<field name="model">res.config.settings</field>
89
<field name="inherit_id" ref="stock.res_config_settings_view_form" />
910
<field name="arch" type="xml">
10-
<xpath
11-
expr="//field[@name='stock_move_email_validation']/../../.."
12-
position="inside"
13-
>
14-
<div class="col-12 col-lg-6 o_setting_box" id="strict_weight_package">
15-
<div class="o_setting_left_pane">
16-
<field name="delivery_carrier_strict_weight_package" />
17-
</div>
18-
<div class="o_setting_right_pane">
19-
<label for="delivery_carrier_strict_weight_package" />
20-
<div class="text-muted">
21-
Constrain the maximum weight of packages to be respected
22-
</div>
23-
</div>
24-
</div>
11+
<xpath expr="//setting[@id='stock_move_email']" position="after">
12+
<setting
13+
id="strict_weight_package"
14+
string="Overweight packages forbidden"
15+
help="Constrain the maximum weight of packages to be respected"
16+
>
17+
<field name="delivery_carrier_strict_weight_package" />
18+
</setting>
2519
</xpath>
2620
</field>
2721
</record>

delivery_carrier_max_weight_constraint/views/stock_package_type_views.xml

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
name="name"
66
>stock.package.type.form.delivery (in delivery_carrier_max_weight_constraint)</field>
77
<field name="model">stock.package.type</field>
8-
<field name="inherit_id" ref="delivery.stock_package_type_form_delivery" />
8+
<field
9+
name="inherit_id"
10+
ref="stock_delivery.stock_package_type_form_delivery"
11+
/>
912
<field name="arch" type="xml">
1013
<field name="shipper_package_code" position="after">
1114
<field name="is_strict_weight" />

0 commit comments

Comments
 (0)