From 5a992857b8d512eb15337b18be408af696ee6c4e Mon Sep 17 00:00:00 2001 From: George Daramouskas Date: Mon, 23 Jan 2017 13:07:14 +0200 Subject: [PATCH] [FIX] payment: do not rely on English as default language If the database is create in monolangue and `en_US` is not present, the default value computation crashes as tries to assign a value not present in the selection (all installed languages). Use the environment language as default (same as the default of res.partner). It may be empty but not a value not existant in the database. Fixes #15165 Closes #15176 --- addons/payment/models/payment_acquirer.py | 2 +- doc/cla/individual/daramousk.md | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 doc/cla/individual/daramousk.md diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py index 0bbf0e27f1e..57da5f743e3 100644 --- a/addons/payment/models/payment_acquirer.py +++ b/addons/payment/models/payment_acquirer.py @@ -429,7 +429,7 @@ class PaymentTransaction(models.Model): # duplicate partner / transaction data to store the values at transaction time partner_id = fields.Many2one('res.partner', 'Partner', track_visibility='onchange') partner_name = fields.Char('Partner Name') - partner_lang = fields.Selection(_lang_get, 'Language', default='en_US') + partner_lang = fields.Selection(_lang_get, 'Language', default=lambda self: self.env.lang) partner_email = fields.Char('Email') partner_zip = fields.Char('Zip') partner_address = fields.Char('Address') diff --git a/doc/cla/individual/daramousk.md b/doc/cla/individual/daramousk.md new file mode 100644 index 00000000000..6a38655a8bf --- /dev/null +++ b/doc/cla/individual/daramousk.md @@ -0,0 +1,11 @@ +Greece, 2017-01-22 + +I hereby agree to the terms of the Odoo Individual Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +George Daramouskas george.daramouskas@gmail.com https://github.com/daramousk \ No newline at end of file