diff --git a/addons/website_sale/models/website.py b/addons/website_sale/models/website.py index 30058ab121d..dd250bad9f1 100644 --- a/addons/website_sale/models/website.py +++ b/addons/website_sale/models/website.py @@ -564,14 +564,9 @@ class Website(models.Model): return self.is_view_active('website_sale.address_b2b') - def _get_checkout_steps(self, current_step=None): + def _get_checkout_step_list(self): """ Return an ordered list of steps according to the current template rendered. - If `current_step` is provided, returns only the corresponding step. - - Note: self.ensure_one() - - :param str current_step: The xmlid of the current step, defaults to None. :rtype: list :return: A list with the following structure: [ @@ -620,6 +615,19 @@ class Website(models.Model): 'back_button': _lt("Back to cart"), 'back_button_href': '/shop/cart', })) + return steps + + def _get_checkout_steps(self, current_step=None): + """ Return an ordered list of steps according to the current template rendered. + If `current_step` is provided, returns only the corresponding step. + Note: self.ensure_one() + :param str current_step: The xmlid of the current step, defaults to None. + :rtype: list + :return: A list containing the steps generated by :meth:`_get_checkout_step_list`. + """ + self.ensure_one() + + steps = self._get_checkout_step_list() if current_step: return next(step for step in steps if current_step in step[0])[1]