Skip to content

Commit

Permalink
Merge PR OCA#789 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by sbidoul
  • Loading branch information
OCA-git-bot committed Dec 20, 2023
2 parents a8ab63c + ede1d6f commit 498fd2c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions stock_release_channel/models/stock_release_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,13 +485,14 @@ def assign_release_channel(self, picking):
for channel in picking._find_release_channel_possible_candidate():
current = picking
domain = channel._prepare_domain()
if not domain and not channel.code:
code = channel.sudo().code
if not domain and not code:
current.release_channel_id = channel
if domain:
current = picking.filtered_domain(domain)
if not current:
continue
if channel.code:
if code:
current = channel._eval_code(current)
if not current:
continue
Expand Down Expand Up @@ -536,7 +537,8 @@ def _eval_context(self, pickings):
return eval_context

def _eval_code(self, pickings):
expr = self.code.strip()
code = self.sudo().code
expr = code.strip()
eval_context = self._eval_context(pickings)
try:
safe_eval(expr, eval_context, mode="exec", nocopy=True)
Expand Down

0 comments on commit 498fd2c

Please sign in to comment.