Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] stock_ux: propagate carrier by default
closes #401 Signed-off-by: Juan Carreras <jc@adhoc.com.ar>
- Loading branch information
1 parent
9dbc625
commit 8f86f83
Showing
3 changed files
with
20 additions
and
1 deletion.
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
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,18 @@ | ||
############################################################################## | ||
# For copyright and license notices, see __manifest__.py file in module root | ||
# directory | ||
############################################################################## | ||
from odoo import models, fields, api | ||
|
||
|
||
class StockRule(models.Model): | ||
_inherit = 'stock.rule' | ||
|
||
propagate_carrier = fields.Boolean(compute="_compute_propagate_carrier", store=True, readonly=False) | ||
|
||
@api.depends('picking_type_id.code') | ||
def _compute_propagate_carrier(self): | ||
""" Make True by default if picking code is outgoing | ||
""" | ||
self.propagate_carrier = self.picking_type_id.code == 'outgoing' | ||
|