[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
This commit is contained in:
Christophe Matthieu
2013-11-14 11:20:33 +01:00
parent 427c6915cf
commit 3ef7c80aa6
3 changed files with 2 additions and 26 deletions
+1 -1
View File
@@ -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):
-15
View File
@@ -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:
+1 -10
View File
@@ -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']),
]
}