From 281c0b7052bc503dbf8a94e287b50d4300a6e17d Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sat, 4 Mar 2017 22:34:31 +0100 Subject: [PATCH] Cut ref field to 32 chars, to avoid trouble with PDF webkit accounting reports --- account_usability/account.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/account_usability/account.py b/account_usability/account.py index 5f58ac0..63a7bf5 100644 --- a/account_usability/account.py +++ b/account_usability/account.py @@ -152,6 +152,13 @@ class AccountAnalyticAccount(models.Model): class AccountMove(models.Model): _inherit = 'account.move' + # When ref is too long, the PDF general ledger report becomes + # unreadable + ref = fields.Char(size=32) + # If you want to migrate existing data : + # update account_move set ref=left(ref,32) where ref is not null; + # update account_move_line set ref=left(ref,32) where ref is not null; + @api.onchange('date') def date_onchange(self): if self.date: