Commits

Raimon Esteve (Zikzakmedia) committed ec58138

Rename sale_shop_res_user_rel table to sale_shop_res_user

  • Participants
  • Parent commits 26c6cb2

Comments (0)

Files changed (3)

 def register():
     Pool.register(
         SaleShop,
-        SaleShopResUserRel,
+        SaleShopResUser,
         Sale,
         User,
         module='sale_shop', type_='model')
 from trytond.pool import Pool
 from trytond.pyson import Eval, Bool
 
-__all__ = ['SaleShop', 'SaleShopResUserRel']
+__all__ = ['SaleShop', 'SaleShopResUser']
 
 class SaleShop(ModelSQL, ModelView):
     'Sale Shop'
                 }))
 
 
-class SaleShopResUserRel(ModelSQL):
+class SaleShopResUser(ModelSQL):
     'Sale Shop - Res User'
     __name__ = 'sale.shop-res.user'
-    _table = 'sale_shop_res_user_rel'
+    _table = 'sale_shop_res_user'
     shop = fields.Many2One('sale.shop', 'Shop',
-            ondelete='RESTRICT', select=1, required=True)
+            ondelete='CASCADE', select=True, required=True)
     user = fields.Many2One('res.user', 'User',
             ondelete='RESTRICT', required=True)
             'shop',
             'shops',
         ])
-
-    @classmethod
-    def write(cls, users, vals):
-        return super(User, cls).write(users, vals)
-