19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:32:12 +01:00
parent 79f83631d5
commit 73afc09215
6267 changed files with 1534193 additions and 1130106 deletions

View file

@ -0,0 +1,33 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
from odoo.fields import Domain
class WebsiteCheckoutStep(models.Model):
_name = 'website.checkout.step'
_description = 'Website Checkout Step'
_inherit = ['website.published.multi.mixin']
name = fields.Char(required=True, translate=True)
sequence = fields.Integer()
step_href = fields.Char(string="Href", required=True)
main_button_label = fields.Char(translate=True)
back_button_label = fields.Char(translate=True)
website_id = fields.Many2one('website', ondelete='cascade')
def _get_next_checkout_step(self, allowed_steps_domain):
""" Get the next step in the checkout flow based on the sequence."""
next_step_domain = Domain.AND(
[allowed_steps_domain, [('sequence', '>', self.sequence)]]
)
return self.search(next_step_domain, order='sequence', limit=1)
def _get_previous_checkout_step(self, allowed_steps_domain):
""" Get the previous step in the checkout flow based on the sequence."""
previous_step_domain = Domain.AND(
[allowed_steps_domain, [('sequence', '<', self.sequence)]]
)
return self.search(previous_step_domain, order='sequence DESC', limit=1)