~ecommerce-addons-core-editors/e-commerce-addons/github-6.1

« back to all changes in this revision

Viewing changes to product_custom_attributes_shop/product.py

  • Committer: Alexandre Fayolle @ camptocamp
  • Date: 2012-08-21 09:19:48 UTC
  • mfrom: (268.1.2)
  • Revision ID: git-v1:a84a3476adab6ae5c94877bea706c7a3fc996147
merge from fix branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
                        %('", "'.join([categ.name for categ in shop.exportable_root_category_ids]), shop.name))
79
79
 
80
80
    def create(self, cr, uid, vals, context=None):
81
 
        if not context: context={}
 
81
        if context is None: context={}
82
82
        if not context.get('do_not_check_active_field_on_shop'):
83
83
            vals['categ_ids'] = vals.get('categ_ids', [(6,0,[])])[0][2]
84
84
            self.check_if_activable(cr, uid, vals, context=context)
85
85
        return super(product_product, self).create(cr, uid, vals, context=context)
86
86
 
87
87
    def write(self, cr, uid, ids, vals, context=None):
88
 
        if not context: context={}
 
88
        if context is None: context={}
89
89
        need_check = False
90
90
        if not context.get('do_not_check_active_field_on_shop'):
91
91
            for key in vals.keys():