~unifield-team/unifield-wm/us-826

« back to all changes in this revision

Viewing changes to unifield_setup/installer/restrictive_country.py

  • Committer: matthieu.choplin at msf
  • Date: 2012-08-30 07:48:00 UTC
  • mto: This revision was merged to the branch mainline in revision 1118.
  • Revision ID: matthieu.choplin@geneva.msf.org-20120830074800-l442bu42mt0yzutn
[uf-1374]- change the write and create by an _sql_constraint on the financing contract check dates

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
    
133
133
    def unlink(self, cr, uid, ids, context=None):
134
134
        for restrict in self.browse(cr, uid, ids, context=context):
135
 
            for product in restrict.restrict_id.product_ids:
136
 
                # Raise an error only if the restriction box is checked
137
 
                if product.restricted_country:
138
 
                    raise osv.except_osv(_('Error'), _('You cannot remove this restriction because it is in use in product(s)'))
 
135
            if restrict.restrict_id.product_ids:
 
136
                raise osv.except_osv(_('Error'), _('You cannot remove this restriction because it is in use in product(s)'))
139
137
            
140
138
        return super(res_country_restriction_memory, self).unlink(cr, uid, ids, context=context)
141
139