From 3ef7c80aa62ed126db7b37d8435cb38718a7a975 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 14 Nov 2013 11:20:33 +0100 Subject: [PATCH] [WIP] website: remove contraints with many2one to res.partner field. The website field must use a contact/address widget without force user to publish the partner bzr revid: chm@openerp.com-20131114102033-dfmv019mmqow0ebt --- addons/product/product.py | 2 +- addons/website_event/models/event.py | 15 --------------- addons/website_hr_recruitment/models/hr_job.py | 11 +---------- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index 7216b88b33f..3220d695239 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -431,7 +431,7 @@ class product_template(osv.osv): help="Small-sized image of the product. It is automatically "\ "resized as a 64x64px image, with aspect ratio preserved. "\ "Use this field anywhere a small image is required."), - 'product_variant_ids': fields.one2many('product.product', 'product_tmpl_id', 'Product Variants'), + 'product_variant_ids': fields.one2many('product.product', 'product_tmpl_id', 'Product Variants', required=True), } def _get_uom_id(self, cr, uid, *args): diff --git a/addons/website_event/models/event.py b/addons/website_event/models/event.py index 13a16162877..b405c73b291 100644 --- a/addons/website_event/models/event.py +++ b/addons/website_event/models/event.py @@ -60,21 +60,6 @@ class event(osv.osv): 'website_published': False, } - # def _check_organizer_id_published(self, cr, uid, ids, context=None): - # for obj in self.browse(cr, uid, ids, context=context): - # if obj.website_published and obj.organizer_id and not obj.organizer_id.website_published: - # return False - # return True - # def _check_address_id_published(self, cr, uid, ids, context=None): - # for obj in self.browse(cr, uid, ids, context=context): - # if obj.website_published and obj.address_id and not obj.address_id.website_published: - # return False - # return True - # _constraints = [ - # (_check_organizer_id_published, "This event can't be published if the field Orginizer is not website published.", ['organizer_id','website_published']), - # (_check_address_id_published, "This event can't be published if the field Location is not website published.", ['address_id','website_published']), - # ] - def google_map_img(self, cr, uid, ids, zoom=8, width=298, height=298, context=None): partner = self.browse(cr, uid, ids[0], context=context) if partner.address_id: diff --git a/addons/website_hr_recruitment/models/hr_job.py b/addons/website_hr_recruitment/models/hr_job.py index 8c341467354..54d5f20c925 100644 --- a/addons/website_hr_recruitment/models/hr_job.py +++ b/addons/website_hr_recruitment/models/hr_job.py @@ -9,13 +9,4 @@ class hr_job(osv.osv): _columns = { 'website_published': fields.boolean('Available in the website'), 'website_description': fields.html('Description for the website'), - } - - def _check_address_id_published(self, cr, uid, ids, context=None): - for obj in self.browse(cr, uid, ids, context=context): - if obj.website_published and obj.address_id and not obj.address_id.website_published: - return False - return True - _constraints = [ - (_check_address_id_published, "This Jobpost can't be published if the field Job Location is not website published.", ['address_id','website_published']), - ] \ No newline at end of file + } \ No newline at end of file