Skip to content

Commit

Permalink
[IMP] stock_ux: propagate carrier by default
Browse files Browse the repository at this point in the history
closes #401

Signed-off-by: Juan Carreras <jc@adhoc.com.ar>
  • Loading branch information
bruno-zanotti committed Sep 15, 2023
1 parent 9dbc625 commit 8f86f83
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stock_ux/__manifest__.py
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
'name': 'Stock UX',
'version': "16.0.2.9.0",
'version': "16.0.2.10.0",
'category': 'Warehouse Management',
'sequence': 14,
'summary': '',
Expand Down
1 change: 1 addition & 0 deletions stock_ux/models/__init__.py
Expand Up @@ -11,3 +11,4 @@
from . import stock_move_line
from . import stock_picking_type
from . import res_config_settings
from . import stock_rule
18 changes: 18 additions & 0 deletions stock_ux/models/stock_rule.py
@@ -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'

0 comments on commit 8f86f83

Please sign in to comment.