From 4eef88a2cc22808e5ac831e306392ea5530f2f39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 23 Nov 2012 18:00:20 +0100 Subject: [PATCH] Store default language in database review592004 --- invoice.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/invoice.py b/invoice.py index c8a112440e..c719334627 100644 --- a/invoice.py +++ b/invoice.py @@ -12,7 +12,6 @@ from trytond.pyson import If, Eval, Bool, Id from trytond.tools import reduce_ids from trytond.transaction import Transaction from trytond.pool import Pool -from trytond.config import CONFIG from trytond.rpc import RPC __all__ = ['Invoice', 'InvoicePaymentLine', 'InvoiceLine', @@ -356,10 +355,11 @@ class Invoice(Workflow, ModelSQL, ModelView): return self.invoice_date or Date.today() def on_change_with_party_lang(self, name=None): + Config = Pool().get('ir.configuration') if self.party: if self.party.lang: return self.party.lang.code - return CONFIG['language'] + return Config.get_language() @classmethod def get_type_name(self, invoices, name): @@ -1443,9 +1443,10 @@ class InvoiceLine(ModelSQL, ModelView): return 'line' def on_change_with_party_lang(self, name=None): + Config = Pool().get('ir.configuration') if self.party and self.party.lang: return self.party.lang.code - return CONFIG['language'] + return Config.get_language() def on_change_with_unit_digits(self, name=None): if self.unit: