Example #1
0
 def create(self,cr, uid, vals, context=None):
     new_id = False
     new_id=Model.create(self,cr, uid, vals, context)
     if vals['default_brand'] and vals['product_id'] and new_id:
         cr.execute('Update kderp_brand_name set \
                             default_brand=False\
                         where product_id=%s and id<>%s' % (vals['product_id'],new_id))
     return new_id
Example #2
0
 def create(self, cr, uid, vals, context={}):        
     id_test=Model.create(self, cr, uid, vals, context=context)
     new_id=self.pool.get('kderp.contract.currency').create_currency(cr,uid,id_test,context)
     self.pool.get('ir.rule').clear_cache(cr,uid)
     return id_test