Skip to content

Commit

Permalink
[MIG] stock_move_common_dest: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
glitchov committed Dec 2, 2022
1 parent be96239 commit a03ce5c
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 100 deletions.
2 changes: 1 addition & 1 deletion stock_move_common_dest/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Stock Move Common Destination",
"summary": "Adds field for common destination moves",
"version": "14.0.1.0.0",
"version": "16.0.1.0.0",
"category": "Warehouse Management",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"author": "Camptocamp, Odoo Community Association (OCA)",
Expand Down
57 changes: 0 additions & 57 deletions stock_move_common_dest/i18n/it.po

This file was deleted.

19 changes: 3 additions & 16 deletions stock_move_common_dest/i18n/stock_move_common_dest.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-12-01 15:27+0000\n"
"PO-Revision-Date: 2022-12-01 15:27+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand All @@ -30,21 +32,6 @@ msgstr ""
msgid "Common destination moves"
msgstr ""

#. module: stock_move_common_dest
#: model:ir.model.fields,field_description:stock_move_common_dest.field_stock_move__display_name
msgid "Display Name"
msgstr ""

#. module: stock_move_common_dest
#: model:ir.model.fields,field_description:stock_move_common_dest.field_stock_move__id
msgid "ID"
msgstr ""

#. module: stock_move_common_dest
#: model:ir.model.fields,field_description:stock_move_common_dest.field_stock_move____last_update
msgid "Last Modified on"
msgstr ""

#. module: stock_move_common_dest
#: model:ir.model,name:stock_move_common_dest.model_stock_move
msgid "Stock Move"
Expand Down
6 changes: 3 additions & 3 deletions stock_move_common_dest/models/stock_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class StockMove(models.Model):

def _flush_common_dest_move_query(self):
# flush is necessary before a SELECT
self.flush(["move_orig_ids", "move_dest_ids"])
self.flush_recordset(["move_orig_ids", "move_dest_ids"])

def _common_dest_move_query(self):
sql = """SELECT smmr.move_orig_id move_id
Expand All @@ -41,8 +41,8 @@ def _common_dest_move_query(self):
@api.depends(
"move_dest_ids",
"move_dest_ids.picking_id",
"move_dest_ids.picking_id.move_lines",
"move_dest_ids.picking_id.move_lines.move_orig_ids",
"move_dest_ids.picking_id.move_ids",
"move_dest_ids.picking_id.move_ids.move_orig_ids",
)
def _compute_common_dest_move_ids(self):
self._flush_common_dest_move_query()
Expand Down
1 change: 1 addition & 0 deletions stock_move_common_dest/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* Akim Juillerat <[email protected]>
* Hughes Damry <[email protected]>
38 changes: 15 additions & 23 deletions stock_move_common_dest/tests/test_move_common_dest.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright 2020 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
from odoo.tests import SavepointCase
from odoo.tests import TransactionCase


class TestCommonMoveDest(SavepointCase):
class TestCommonMoveDest(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
Expand Down Expand Up @@ -35,28 +35,20 @@ def setUpClass(cls):
def _init_inventory(self):
# Product 1 on shelf 1
# Product 2 on shelf 2
inventory = self.env["stock.inventory"].create({"name": "Test init"})
inventory.action_start()
product_location_list = [
(self.product_1, self.stock_shelf_location),
(self.product_2, self.stock_shelf_2_location),
vals_list = [
{
"product_id": self.product_1.id,
"inventory_quantity": 10.0,
"location_id": self.stock_shelf_location.id,
},
{
"product_id": self.product_2.id,
"inventory_quantity": 10.0,
"location_id": self.stock_shelf_2_location.id,
},
]
lines_vals = list()
for product, location in product_location_list:
lines_vals.append(
(
0,
0,
{
"product_id": product.id,
"product_uom_id": product.uom_id.id,
"product_qty": 10.0,
"location_id": location.id,
},
)
)
inventory.write({"line_ids": lines_vals})
inventory.action_validate()
quants = self.env["stock.quant"].create(vals_list)
quants.action_apply_inventory()

def _create_pickings(self):
# Create delivery order
Expand Down

0 comments on commit a03ce5c

Please sign in to comment.