feat: Add bypass_user_restriction context to sale.order's _action_launch_stock_rule and stock.picking's and mrp.production's create methods.
This commit is contained in:
parent
ea5a37bb70
commit
6ce00d0f2f
@ -15,3 +15,7 @@ class MrpProduction(models.Model):
|
||||
|
||||
def button_mark_done(self):
|
||||
return super(MrpProduction, self.with_context(bypass_user_restriction=True)).button_mark_done()
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
return super(MrpProduction, self.with_context(bypass_user_restriction=True)).create(vals_list)
|
||||
|
||||
@ -8,3 +8,6 @@ class SaleOrder(models.Model):
|
||||
|
||||
def _action_confirm(self):
|
||||
return super(SaleOrder, self.with_context(bypass_user_restriction=True))._action_confirm()
|
||||
|
||||
def _action_launch_stock_rule(self, previous_product_uom_qty=False):
|
||||
return super(SaleOrder, self.with_context(bypass_user_restriction=True))._action_launch_stock_rule(previous_product_uom_qty=previous_product_uom_qty)
|
||||
|
||||
@ -15,3 +15,7 @@ class StockPicking(models.Model):
|
||||
|
||||
def button_validate(self):
|
||||
return super(StockPicking, self.with_context(bypass_user_restriction=True)).button_validate()
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
return super(StockPicking, self.with_context(bypass_user_restriction=True)).create(vals_list)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user