Skip to content

Commit

Permalink
[IMP] subscription_oca: refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyasProgrammer committed Sep 26, 2023
1 parent ae08508 commit 2996dd0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions subscription_oca/models/sale_subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,8 @@ def write(self, values):
def create(self, values):
if "recurring_rule_boundary" in values:
if not values["recurring_rule_boundary"]:
template_id = self.env["sale.subscription.template"].search(
[("id", "=", values["template_id"])]
template_id = self.env["sale.subscription.template"].browse(
values["template_id"]
)
date_start = values["date_start"]
if not isinstance(values["date_start"], date):
Expand All @@ -464,7 +464,7 @@ def create(self, values):
values["date_start"] = values["recurring_next_date"]
values["stage_id"] = (
self.env["sale.subscription.stage"]
.search([("type", "=", "pre")], order="sequence desc")[-1]
.search([("type", "=", "pre")], order="sequence desc", limit=1)
.id
)
return super(SaleSubscription, self).create(values)

0 comments on commit 2996dd0

Please sign in to comment.