Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
1564 Представления

is it possible to hide out-of-stock items/variants on website?

Аватар
Отменить
Лучший ответ

Hi,

Inherit the WebsiteSale controller

Create a custom module or add this to an existing one:

from odoo.addons.website_sale.controllers.main import WebsiteSale

from odoo.http import request


class WebsiteSaleCustom(WebsiteSale):


    def _get_search_domain(self, search, category, attrib_values, **kwargs):

        domain = super()._get_search_domain(search, category, attrib_values, **kwargs)

        domain += [('qty_available', '>', 0)]

        return domain


You can also use 'virtual_available' instead of 'qty_available' if you want to account for incoming stock.


ihope it is use full

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
апр. 24
3353
1
нояб. 22
2862
2
мар. 15
3985
1
дек. 23
2856
1
нояб. 23
2116