[IMP] website_sale: domain to display product in shop, overwrited in website_event

bzr revid: chm@openerp.com-20131115160828-pjv3gessa5sxu2ap
This commit is contained in:
Christophe Matthieu 2013-11-15 17:08:28 +01:00
parent 419c7c6b32
commit 85014499a5
3 changed files with 7 additions and 2 deletions

View File

@ -23,7 +23,7 @@ from openerp.osv import fields, osv
from openerp.tools.translate import _
class product(osv.osv):
_inherit = 'product.product'
_inherit = 'product.template'
_columns = {
'event_ok': fields.boolean('Event Subscription', help='Determine if a product needs to create automatically an event registration at the confirmation of a sales order line.'),
'event_type_id': fields.many2one('event.type', 'Type of Event', help='Select event types so when we use this product in sales order lines, it will filter events of this type only.'),

View File

@ -26,6 +26,7 @@ from openerp.tools.translate import _
from openerp.addons import website_sale
from openerp.addons.website.models import website
from openerp.addons.website.controllers.main import Website as controllers
from openerp.addons.website_sale.controllers.main import Ecommerce as Ecommerce
controllers = controllers()
@ -35,6 +36,9 @@ from openerp import tools
import urllib
Ecommerce.domain += [('product_variant_ids.event_ticket_ids', '=', False), ('event_ok', '=', False)]
class website_event(http.Controller):
@website.route(['/event/', '/event/page/<int:page>/'], type='http', auth="public", multilang=True)
def events(self, page=1, **searches):

View File

@ -92,6 +92,7 @@ class CheckoutInfo:
class Ecommerce(http.Controller):
_order = 'website_sequence desc, website_published desc'
domain = [("sale_ok", "=", True)]
def get_attribute_ids(self):
attributes_obj = request.registry.get('product.attribute')
@ -322,7 +323,7 @@ class Ecommerce(http.Controller):
self.change_pricelist(post.get('promo'))
product_obj = request.registry.get('product.template')
domain = [("sale_ok", "=", True)]
domain = list(self.domain)
# remove product_product_consultant from ecommerce editable mode, this product never be publish
ref = request.registry.get('ir.model.data').get_object_reference(request.cr, SUPERUSER_ID, 'product', 'product_product_consultant')