Skip to content

Commit

Permalink
Update sale_automatic_workflow/models/sale_order.py
Browse files Browse the repository at this point in the history
Co-authored-by: Akim Juillerat <[email protected]>
  • Loading branch information
2 people authored and JordiBForgeFlow committed Jan 9, 2024
1 parent 2f5474a commit 1f329b9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions sale_automatic_workflow/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ class SaleOrder(models.Model):
@api.model
def default_get(self, fields):
res = super(SaleOrder, self).default_get(fields)
default_workflow = self.env["sale.workflow.process"].search(
[("default", "=", True)], limit=1
)
if default_workflow:
res["workflow_process_id"] = default_workflow.id
if "workflow_process_id" in fields:
default_workflow = self.env["sale.workflow.process"].search(
[("default", "=", True)], limit=1
)
if default_workflow:
res["workflow_process_id"] = default_workflow.id
return res

# TODO: v15 -> make this module dependent on sale_delivery_state and
Expand Down

0 comments on commit 1f329b9

Please sign in to comment.