forked from OCA/wms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
1,046 additions
and
0 deletions.
There are no files selected for viewing
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 |
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,18 @@ | ||
# Copyright 2020 Camptocamp | ||
# License OPL-1 | ||
|
||
{ | ||
"name": "Stock Release Channels", | ||
"summary": "Manage workload in WMS with release channels", | ||
"version": "13.0.1.0.0", | ||
"license": "OPL-1", | ||
"author": "Camptocamp", | ||
"website": "https://www.camptocamp.com", | ||
"depends": ["sale_stock", "stock_available_to_promise_release", "ddmrp"], | ||
"data": [ | ||
"security/stock_release_channel.xml", | ||
"views/stock_release_channel_views.xml", | ||
"views/stock_picking_views.xml", | ||
"data/stock_release_channel_data.xml", | ||
], | ||
} |
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,10 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo noupdate="1"> | ||
|
||
<record model="stock.release.channel" id="stock_release_channel_default"> | ||
<field name="name">Default</field> | ||
<field name="sequence">999</field> | ||
<field name="rule_domain">[]</field> | ||
</record> | ||
|
||
</odoo> |
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,3 @@ | ||
from . import sale_order_line | ||
from . import stock_picking | ||
from . import stock_release_channel |
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,19 @@ | ||
# Copyright 2020 Camptocamp | ||
# License OPL-1 | ||
|
||
from odoo import models | ||
|
||
|
||
class SaleOrderLine(models.Model): | ||
_inherit = "sale.order.line" | ||
|
||
def _action_launch_stock_rule(self, previous_product_uom_qty=False): | ||
result = super()._action_launch_stock_rule( | ||
previous_product_uom_qty=previous_product_uom_qty | ||
) | ||
pickings = self.move_ids.picking_id | ||
# ensure we assign a channel on any picking OUT generated for the sale, | ||
# if moves are assigned to an existing transfer, we recompute the | ||
# channel | ||
pickings.assign_release_channel() | ||
return result |
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 | ||
# License OPL-1 | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class StockPicking(models.Model): | ||
_inherit = "stock.picking" | ||
|
||
release_channel_id = fields.Many2one( | ||
comodel_name="stock.release.channel", index=True, ondelete="restrict" | ||
) | ||
|
||
# TODO queue.job (with identity key) | ||
def assign_release_channel(self): | ||
self.env["stock.release.channel"].assign_release_channel(self) | ||
|
||
def _create_backorder(self): | ||
backorders = super()._create_backorder() | ||
self.env["stock.release.channel"].assign_release_channel(backorders) | ||
return backorders |
Oops, something went wrong.