mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[MIG] stock_picking_completion_info: Migration to 13.0
This commit is contained in:
@@ -0,0 +1 @@
|
||||
../../../../stock_picking_completion_info
|
||||
6
setup/stock_picking_completion_info/setup.py
Normal file
6
setup/stock_picking_completion_info/setup.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['setuptools-odoo'],
|
||||
odoo_addon=True,
|
||||
)
|
||||
@@ -4,7 +4,7 @@
|
||||
"name": "Stock Picking Completion Info",
|
||||
"summary": "Display on current document completion information according "
|
||||
"to next operations",
|
||||
"version": "12.0.1.0.0",
|
||||
"version": "13.0.1.0.0",
|
||||
"development_status": "Alpha",
|
||||
"category": "Warehouse Management",
|
||||
"website": "https://github.com/OCA/stock-logistics-warehouse",
|
||||
|
||||
@@ -71,3 +71,16 @@ class StockPicking(models.Model):
|
||||
picking.completion_info = "last_picking"
|
||||
continue
|
||||
picking.completion_info = "no"
|
||||
|
||||
|
||||
class StockMove(models.Model):
|
||||
|
||||
_inherit = "stock.move"
|
||||
|
||||
def write(self, vals):
|
||||
super().write(vals)
|
||||
if "state" in vals:
|
||||
# invalidate cache, the api.depends do not allow to find all
|
||||
# the conditions to invalidate the field
|
||||
self.env["stock.picking"].invalidate_cache(fnames=["completion_info"])
|
||||
return True
|
||||
|
||||
@@ -10,7 +10,7 @@ class TestStockPickingCompletionInfo(SavepointCase):
|
||||
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
|
||||
cls.partner_delta = cls.env.ref("base.res_partner_4")
|
||||
cls.warehouse = cls.env.ref("stock.warehouse0")
|
||||
cls.warehouse.write({"outgoing_shipments": "pick_pack_ship"})
|
||||
cls.warehouse.write({"delivery_steps": "pick_pack_ship"})
|
||||
cls.customers_location = cls.env.ref("stock.stock_location_customers")
|
||||
cls.output_location = cls.env.ref("stock.stock_location_output")
|
||||
cls.packing_location = cls.env.ref("stock.location_pack_zone")
|
||||
@@ -32,9 +32,7 @@ class TestStockPickingCompletionInfo(SavepointCase):
|
||||
def _init_inventory(self, same_location=True):
|
||||
# Product 1 on shelf 1
|
||||
# Product 2 on shelf 2
|
||||
inventory = self.env["stock.inventory"].create(
|
||||
{"name": "Test init", "filter": "partial"}
|
||||
)
|
||||
inventory = self.env["stock.inventory"].create({"name": "Test init"})
|
||||
inventory.action_start()
|
||||
if not same_location:
|
||||
product_location_list = [
|
||||
|
||||
Reference in New Issue
Block a user