Skip to content

Commit

Permalink
Merge PR OCA#2954 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by HaraldPanten
  • Loading branch information
OCA-git-bot committed Feb 15, 2024
2 parents b8c58bd + e284834 commit 2844818
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions sale_quotation_number/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,19 @@ def get_sale_order_seq(self):
self.ensure_one()
return self.env["ir.sequence"].next_by_code("sale.order")

def action_confirm(self):
def _action_confirm(self):
for order in self:
if not self.quotation_seq_used:
continue
if order.state not in ("draft", "sent") or order.company_id.keep_name_so:
if not (
order.state == "sale"
and order.quotation_seq_used
and not order.company_id.keep_name_so
):
continue
quo = ""
if order.origin and order.origin != "":
quo = order.origin + ", " + order.name
else:
quo = order.name
sequence = order.get_sale_order_seq()
order.write({"origin": quo, "name": sequence, "quotation_seq_used": False})
return super().action_confirm()
return super()._action_confirm()

0 comments on commit 2844818

Please sign in to comment.