[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
This commit is contained in:
committed by
Martin Trigaux
parent
bcc517b6eb
commit
5a992857b8
@@ -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')
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user