diff --git a/sale_quotation_number/models/sale_order.py b/sale_quotation_number/models/sale_order.py index 6e5f7c88697..b48634d8c06 100644 --- a/sale_quotation_number/models/sale_order.py +++ b/sale_quotation_number/models/sale_order.py @@ -43,8 +43,11 @@ def copy(self, default=None): return super().copy(default) def action_confirm(self): + sequence = self.env["ir.sequence"].search( + [("code", "=", "sale.quotation")], limit=1 + ) for order in self: - if self.name[:2] != "SQ": + if sequence and self.name[: len(sequence.prefix)] != sequence.prefix: continue if order.state not in ("draft", "sent") or order.company_id.keep_name_so: continue