From 4d4a964a71cc5f0df2b781e36d9f988ae4d1a446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Grand-Guillaume?= Date: Wed, 16 Jul 2014 15:10:46 +0200 Subject: [PATCH] Add init method to initialize a value in claim 'number' (avoiding tests to crash) --- crm_claim_rma/crm_claim_rma.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crm_claim_rma/crm_claim_rma.py b/crm_claim_rma/crm_claim_rma.py index dd30a00b..e62d7276 100644 --- a/crm_claim_rma/crm_claim_rma.py +++ b/crm_claim_rma/crm_claim_rma.py @@ -338,6 +338,12 @@ class claim_line(orm.Model): class crm_claim(orm.Model): _inherit = 'crm.claim' + def init(self, cr): + cr.execute(""" + UPDATE "crm_claim" SET "number"=id::varchar WHERE ("number" is NULL) + OR ("number" = '/'); + """) + def _get_sequence_number(self, cr, uid, context=None): seq_obj = self.pool.get('ir.sequence') res = seq_obj.get(cr, uid, 'crm.claim.rma', context=context) or '/'