-
-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by jgrandguillaume
- Loading branch information
Showing
12 changed files
with
109 additions
and
4 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...ing_type_shipping_policy_group_by/odoo/addons/stock_picking_type_shipping_policy_group_by
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../stock_picking_type_shipping_policy_group_by |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
21 changes: 21 additions & 0 deletions
21
stock_picking_type_shipping_policy_group_by/__manifest__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright 2020 Camptocamp SA | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) | ||
{ | ||
"name": "Stock Picking Type Shipping Policy - Group By Partner and Carrier", | ||
"summary": "Glue module for Picking Type Shipping Policy" | ||
" and Group Transfers by Partner and Carrier", | ||
"version": "13.0.1.0.0", | ||
"category": "Hidden", | ||
"website": "https://github.com/OCA/wms", | ||
"author": "Camptocamp, Odoo Community Association (OCA)", | ||
"license": "AGPL-3", | ||
"application": False, | ||
"installable": True, | ||
"auto_install": True, | ||
"depends": [ | ||
"stock_picking_type_shipping_policy", | ||
# in stock-logistics-workflow | ||
"stock_picking_group_by_partner_by_carrier", | ||
], | ||
"data": [], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import stock_move |
14 changes: 14 additions & 0 deletions
14
stock_picking_type_shipping_policy_group_by/models/stock_move.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright 2020 Camptocamp SA | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) | ||
from odoo import models | ||
|
||
|
||
class StockMove(models.Model): | ||
_inherit = "stock.move" | ||
|
||
def _domain_search_picking_handle_move_type(self): | ||
picking_type_move_type = self._shipping_policy_from_picking_type() | ||
if picking_type_move_type: | ||
return [("move_type", "=", picking_type_move_type)] | ||
else: | ||
return super()._domain_search_picking_handle_move_type() |
1 change: 1 addition & 0 deletions
1
stock_picking_type_shipping_policy_group_by/readme/CONTRIBUTORS.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* Guewen Baconnier <[email protected]> |
4 changes: 4 additions & 0 deletions
4
stock_picking_type_shipping_policy_group_by/readme/DESCRIPTION.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Technical module to make the following addons work properly together: | ||
|
||
* ``stock_picking_type_shipping_policy`` | ||
* ``stock_picking_group_by_partner_by_carrier`` |
Binary file added
BIN
+9.23 KB
stock_picking_type_shipping_policy_group_by/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions
2
stock_picking_type_shipping_policy_group_by/tests/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Copyright 2020 Camptocamp SA | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) |
48 changes: 48 additions & 0 deletions
48
stock_picking_type_shipping_policy_group_by/tests/test_stock_picking_type_shipping_policy.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Copyright 2020 Camptocamp SA | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) | ||
from odoo.tests import SavepointCase | ||
|
||
|
||
class TestPickingTypeShippingPolicyGroupBy(SavepointCase): | ||
@classmethod | ||
def setUpClass(cls): | ||
super().setUpClass() | ||
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) | ||
cls.warehouse = cls.env.ref("stock.warehouse0") | ||
cls.pick_type = cls.warehouse.pick_type_id | ||
cls.pick_type.group_pickings = True | ||
cls.product = cls.env.ref("product.product_product_9") | ||
cls.group = cls.env["procurement.group"].create( | ||
{"name": "Test 1", "move_type": "direct"} | ||
) | ||
|
||
def _create_single_move(self, picking_type, group, product): | ||
move_vals = { | ||
"name": product.name, | ||
"picking_type_id": picking_type.id, | ||
"product_id": product.id, | ||
"product_uom_qty": 1.0, | ||
"product_uom": product.uom_id.id, | ||
"location_id": picking_type.default_location_src_id.id, | ||
"location_dest_id": picking_type.default_location_dest_id.id, | ||
"state": "confirmed", | ||
"procure_method": "make_to_stock", | ||
"group_id": group.id, | ||
} | ||
return self.env["stock.move"].create(move_vals) | ||
|
||
def test_shipping_policy_force_picking_type_one(self): | ||
"""When the picking type changes move_type to 'one' | ||
If the picking type creates a stock.picking for move1 with move_type | ||
'one', ensure that the method that assign move2 to a new picking search | ||
using the same move_type. | ||
""" | ||
self.group.move_type = "direct" | ||
self.pick_type.shipping_policy = "force_all_products_ready" | ||
move1 = self._create_single_move(self.pick_type, self.group, self.product) | ||
move1._assign_picking() | ||
move2 = self._create_single_move(self.pick_type, self.group, self.product) | ||
move2._assign_picking() | ||
self.assertEqual(move1.picking_id, move2.picking_id) | ||
self.assertEqual(move1.picking_id.move_type, "one") |