diff --git a/modules/party/party.py b/modules/party/party.py index ac7beff344..138bfd663e 100644 --- a/modules/party/party.py +++ b/modules/party/party.py @@ -53,6 +53,7 @@ class Party( 'get_code_readonly') code_alnum = fields.Char("Code Alphanumeric", readonly=True) code_digit = fields.Integer("Code Digit", readonly=True) + code_digit._sql_type = 'BIGINT' lang = fields.MultiValue( fields.Many2One('ir.lang', "Language", help="Used to translate communications with the party.")) @@ -306,7 +307,8 @@ class Party( re.sub(r'[\W_]', '', self.code) if self.code is not None else None) try: - values['code_digit'] = int(re.sub(r'\D', '', self.code or '')) + values['code_digit'] = int( + re.sub(r'\D', '', self.code or '')[-18:]) except ValueError: values['code_digit'] = None return values