From 99ab9d5918431c01e223d86fdb90f39ca36608d2 Mon Sep 17 00:00:00 2001 From: Raimon Esteve Date: Fri, 14 Oct 2022 09:33:15 +0200 Subject: [PATCH 1/3] Upgrade issue11745.diff to fix stock_location_move module --- issue11745.diff | 53 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/issue11745.diff b/issue11745.diff index 91fda09..f7929e2 100644 --- a/issue11745.diff +++ b/issue11745.diff @@ -26,7 +26,7 @@ index 9067c31..ae467d3 100644 @@ -2264,11 +2264,15 @@ class ShipmentInternal(ShipmentAssignMixin, Workflow, ModelSQL, ModelView): def default_company(): return Transaction().context.get('company') - + - @fields.depends('planned_date', 'planned_start_date', 'company') + @fields.depends('from_location', 'to_location', 'company') def on_change_with_transit_location(self, name=None): @@ -44,7 +44,7 @@ index 9067c31..ae467d3 100644 @@ -2278,11 +2282,14 @@ class ShipmentInternal(ShipmentAssignMixin, Workflow, ModelSQL, ModelView): if self.from_location and self.from_location.warehouse: return self.from_location.warehouse.id - + - @fields.depends('planned_date', 'from_location', 'to_location') + @fields.depends( + 'planned_date', 'from_location', 'to_location', @@ -71,21 +71,21 @@ index 311d8f3..fe8e262 100644 + >>> internal_loc = Location( + ... name="Internal", type='storage', parent=storage_loc.parent) >>> internal_loc.save() - + Create stock user:: @@ -116,7 +117,7 @@ Create Internal Shipment from lost_found location:: >>> lost_found_shipment.state 'done' - + -Check that now whe can finish the older shipment:: +Check that now we can finish the older shipment:: - + >>> shipment.click('assign_try') True @@ -130,72 +131,6 @@ Check that now whe can finish the older shipment:: >>> shipment.done_by == employee True - + -Add lead time inside the warehouse:: - - >>> set_user(1) @@ -153,7 +153,7 @@ index 311d8f3..fe8e262 100644 - True - Duplicate Internal Shipment:: - + >>> shipment_copy, = shipment.duplicate() diff --git a/trytond/trytond/modules/stock/tests/scenario_stock_shipment_internal_transit.rst b/trytond/trytond/modules/stock/tests/scenario_stock_shipment_internal_transit.rst @@ -290,3 +290,42 @@ index 23d58f5..03663d2 100644 suite.addTests(doctest.DocFileSuite('scenario_stock_reporting.rst', tearDown=doctest_teardown, encoding='utf-8', checker=doctest_checker, + +diff --git a/trytond/trytond/modules/stock_location_move/tests/scenario_stock_location_move.rst b/trytond/trytond/modules/stock_location_move/tests/scenario_stock_location_move.rst +index bc577e8..b2c1bcd 100644 +--- a/trytond/trytond/modules/stock_location_move/tests/scenario_stock_location_move.rst ++++ b/trytond/trytond/modules/stock_location_move/tests/scenario_stock_location_move.rst +@@ -97,10 +97,13 @@ Concurrently move pallet:: + + Add lead time inside the warehouse:: + ++ >>> warehouse1 = storage_loc.warehouse ++ >>> warehouse2, = warehouse1.duplicate() ++ + >>> LeadTime = Model.get('stock.location.lead_time') + >>> lead_time = LeadTime() +- >>> lead_time.warehouse_from = storage_loc.warehouse +- >>> lead_time.warehouse_to = storage_loc.warehouse ++ >>> lead_time.warehouse_from = warehouse1 ++ >>> lead_time.warehouse_to = warehouse2 + >>> lead_time.lead_time = datetime.timedelta(1) + >>> lead_time.save() + +@@ -109,8 +112,8 @@ Move pallet from storage1 to storage2 with lead_time:: + >>> Shipment = Model.get('stock.shipment.internal') + >>> shipment = Shipment() + >>> shipment.planned_date = tomorrow +- >>> shipment.from_location = storage1 +- >>> shipment.to_location = storage2 ++ >>> shipment.from_location = warehouse1.storage_location ++ >>> shipment.to_location = warehouse2.storage_location + >>> shipment.locations.append(Location(pallet.id)) + >>> shipment.click('wait') + >>> shipment.click('assign_try') +@@ -123,5 +126,5 @@ Move pallet from storage1 to storage2 with lead_time:: + + >>> shipment.click('done') + >>> pallet.reload() +- >>> pallet.parent == storage2 ++ >>> pallet.parent == warehouse2.storage_location + True From 6f8c770b0d5c29d2c01a3563416a54a437191186 Mon Sep 17 00:00:00 2001 From: Juanjo Garcia Date: Wed, 26 Oct 2022 15:56:21 +0200 Subject: [PATCH 2/3] Add new patch, issue11745. Task #067485 --- issue11750.diff | 15 +++++++++++++++ series | 2 ++ 2 files changed, 17 insertions(+) create mode 100644 issue11750.diff diff --git a/issue11750.diff b/issue11750.diff new file mode 100644 index 0000000..88db0d9 --- /dev/null +++ b/issue11750.diff @@ -0,0 +1,15 @@ +diff --git a/trytond/trytond/modules/stock/period.py b/trytond/trytond/modules/stock/period.py +index 54e5f4b..a411320 100644 +--- a/trytond/trytond/modules/stock/period.py ++++ b/trytond/trytond/modules/stock/period.py +@@ -152,7 +152,9 @@ class Period(Workflow, ModelSQL, ModelView): + values[field] = key[i] + to_create.append(values) + if to_create: +- Cache.create(to_create) ++ to_create = [x for x in to_create if x['internal_quantity']] ++ for sub_to_create in grouped_slice(to_create): ++ Cache.create(list(sub_to_create)) + + + class Cache(ModelSQL, ModelView): diff --git a/series b/series index 3b7d2b5..9d6d269 100644 --- a/series +++ b/series @@ -62,3 +62,5 @@ issue10532.diff # [stock_supply + stock_supply_production] Add warehouses select issue11181.diff # [stock] Require unit price also for view location like for storage (only 6.0) issue11745.diff # [stock] Moves of internal shipment are not valid when switching between transit and no transit + +issue11750.diff # [stock] 'create' method execution frozen or extremly slow From 70cf6088e8c9b40394ea30b0f4e60f0dbd1b1ae4 Mon Sep 17 00:00:00 2001 From: Jared Esparza Date: Wed, 2 Nov 2022 16:09:10 +0100 Subject: [PATCH 3/3] Add allow_none_list_price.diff | #060143 --- allow_none_list_price.diff | 13 +++++++++++++ series | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 allow_none_list_price.diff diff --git a/allow_none_list_price.diff b/allow_none_list_price.diff new file mode 100644 index 0000000..ef8e84d --- /dev/null +++ b/allow_none_list_price.diff @@ -0,0 +1,13 @@ +diff --git a/product.py b/product.py +index edb0f67..dcb0197 100644 +--- a/trytond/trytond/modules/sale_price_list/product.py ++++ b/trytond/trytond/modules/sale_price_list/product.py +@@ -37,7 +37,7 @@ class Product(metaclass=PoolMeta): + uom = self.sale_uom + unit_price = price_list.compute( + customer, self, unit_price, quantity, uom) +- if price_list.tax_included and taxes: ++ if price_list.tax_included and taxes and unit_price is not None: + unit_price = Tax.reverse_compute(unit_price, taxes) + return unit_price + diff --git a/series b/series index 9d6d269..599c330 100644 --- a/series +++ b/series @@ -64,3 +64,5 @@ issue11181.diff # [stock] Require unit price also for view location like for sto issue11745.diff # [stock] Moves of internal shipment are not valid when switching between transit and no transit issue11750.diff # [stock] 'create' method execution frozen or extremly slow + +allow_none_list_price.diff # [sale_price_list] allow set none as price list in a sale with tax_included=True product_price_list \ No newline at end of file