44
44
'date_start': lambda *a: (datetime.datetime.today() + relativedelta(months=-3)).strftime('%Y-%m-%d')
47
def _check_unicity(self, cr, uid, ids, context={}):
50
for account in self.browse(cr, uid, ids, context=context):
51
bad_ids = self.search(cr, uid, [('category', '=', account.category),('|'),('name', '=ilike', account.name),('code', '=ilike', account.code)])
52
if len(bad_ids) and len(bad_ids) > 1:
47
#def _check_unicity(self, cr, uid, ids, context={}):
50
# for account in self.browse(cr, uid, ids, context=context):
51
# bad_ids = self.search(cr, uid, [('category', '=', account.category),('|'),('name', '=ilike', account.name),('code', '=ilike', account.code)])
52
# if len(bad_ids) and len(bad_ids) > 1:
57
(_check_unicity, 'You cannot have the same code or name between analytic accounts in the same category!', ['code', 'name', 'category']),
57
# (_check_unicity, 'You cannot have the same code or name between analytic accounts in the same category!', ['code', 'name', 'category']),
60
60
def copy(self, cr, uid, id, default={}, context=None, done_list=[], local=False):
61
61
account = self.browse(cr, uid, id, context=context)