Skip to content

Commit

Permalink
Merge PR #3535 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by HaraldPanten
  • Loading branch information
OCA-git-bot committed Jan 14, 2025
2 parents b001b66 + 4404538 commit a3e4d9d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sale_quotation_number/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ def create(self, vals_list):
if not vals.get("name"):
if self.is_using_quotation_number(vals):
company_id = vals.get("company_id", self.env.company.id)
sequence = (
self.with_company(company_id)
.env["ir.sequence"]
.next_by_code("sale.quotation")
)
sequence = self.with_company(company_id).get_quotation_seq()
vals["name"] = sequence or "/"
return super().create(vals_list)

Expand All @@ -43,6 +39,10 @@ def copy(self, default=None):
default["origin"] = self.name
return super().copy(default)

@api.model
def get_quotation_seq(self):
return self.env["ir.sequence"].next_by_code("sale.quotation")

def action_confirm(self):
sequence = self.env["ir.sequence"].search(
[("code", "=", "sale.quotation")], limit=1
Expand Down

0 comments on commit a3e4d9d

Please sign in to comment.