Skip to content

Commit cd8a2bd

Browse files
committed
[MIG] purchase_location_by_line: Migration to 16.0
1 parent 40f4770 commit cd8a2bd

File tree

6 files changed

+9
-10
lines changed

6 files changed

+9
-10
lines changed

purchase_location_by_line/__manifest__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
{
77
"name": "Purchase Location by Line",
88
"summary": "Allows to define a specific destination location on each PO line",
9-
"version": "15.0.1.0.0",
9+
"version": "16.0.1.0.0",
1010
"author": "ForgeFlow, Odoo Community Association (OCA)",
1111
"website": "https://github.com/OCA/purchase-workflow",
1212
"category": "Purchase Management",
1313
"depends": ["purchase_stock", "purchase_delivery_split_date"],
1414
"license": "AGPL-3",
15-
"data": ["views/purchase_view.xml"],
15+
"data": ["views/purchase_views.xml"],
1616
"installable": True,
1717
}

purchase_location_by_line/models/purchase.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def _first_picking_copy_vals(self, key, lines):
2020
"""The data to be copied to new pickings is updated with data from the
2121
grouping key. This method is designed for extensibility, so that
2222
other modules can store more data based on new keys."""
23-
vals = super(PurchaseOrderLine, self)._first_picking_copy_vals(key, lines)
23+
vals = super()._first_picking_copy_vals(key, lines)
2424
for key_element in key:
2525
if "location_dest_id" in key_element.keys():
2626
vals["location_dest_id"] = key_element["location_dest_id"].id
@@ -33,9 +33,7 @@ def _get_group_keys(self, order, line, picking=False):
3333
dictionary element with the field that you want to group by. This
3434
method is designed for extensibility, so that other modules can add
3535
additional keys or replace them by others."""
36-
key = super(PurchaseOrderLine, self)._get_group_keys(
37-
order, line, picking=picking
38-
)
36+
key = super()._get_group_keys(order, line, picking=picking)
3937
default_picking_location_id = line.order_id._get_destination_location()
4038
default_picking_location = self.env["stock.location"].browse(
4139
default_picking_location_id
@@ -47,11 +45,11 @@ def _get_sorted_keys(self, line):
4745
"""Return a tuple of keys to use in order to sort the order lines.
4846
This method is designed for extensibility, so that other modules can
4947
add additional keys or replace them by others."""
50-
keys = super(PurchaseOrderLine, self)._get_sorted_keys(line)
48+
keys = super()._get_sorted_keys(line)
5149
return keys + (line.location_dest_id.id,)
5250

5351
def _create_stock_moves(self, picking):
54-
res = super(PurchaseOrderLine, self)._create_stock_moves(picking)
52+
res = super()._create_stock_moves(picking)
5553
for line in self:
5654
default_picking_location_id = line.order_id._get_destination_location()
5755
default_picking_location = self.env["stock.location"].browse(

purchase_location_by_line/models/stock_picking.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def _update_picking_from_group_key(self, key):
1313
"""The picking is updated with data from the grouping key.
1414
This method is designed for extensibility, so that other modules
1515
can store more data based on new keys."""
16-
super(StockPicking, self)._update_picking_from_group_key(key)
16+
super()._update_picking_from_group_key(key)
1717
for rec in self:
1818
for key_element in key:
1919
if (

purchase_location_by_line/readme/CONTRIBUTORS.rst

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
* Hizbul Bahar <hizbul25@gmail.com>
33
* Harald Panten <harald.panten@sygel.es>
44
* Juany Davila <juany.davila@forgeflow.com>
5+
* Manuel Regidor <manuel.regidor@sygel.es>

purchase_location_by_line/tests/test_purchase_delivery.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class TestDeliverySingle(TransactionCase):
1111
def setUp(self):
12-
super(TestDeliverySingle, self).setUp()
12+
super().setUp()
1313
# Products
1414
p1 = self.env.ref("product.product_product_13")
1515
p2 = self.env.ref("product.product_product_25")

0 commit comments

Comments
 (0)