콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
1738 화면

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

아바타
취소
관련 게시물 답글 화면 활동
1
4월 24
3503
1
11월 22
5372
2
3월 15
4122
2
8월 25
348
1
12월 23
3091