diff --git a/configuration.py b/configuration.py index 97e148dea7..120c090844 100644 --- a/configuration.py +++ b/configuration.py @@ -14,5 +14,8 @@ class Configuration(ModelSingleton, ModelSQL, ModelView): ('company', 'in', [Eval('company'), False]), ('code', '=', 'party.party'), ], required=True)) + party_lang = fields.Property(fields.Many2One("ir.lang", 'Party Language', + help=('The value set on this field will preset the language on new ' + 'parties'))) Configuration() diff --git a/configuration.xml b/configuration.xml index 7fcb04d385..416e826d74 100644 --- a/configuration.xml +++ b/configuration.xml @@ -11,6 +11,8 @@ this repository contains the full copyright notices and license terms. -->
]]> diff --git a/party.py b/party.py index 0bf3b298b0..2d27960423 100644 --- a/party.py +++ b/party.py @@ -87,6 +87,11 @@ class Party(ModelSQL, ModelView): 'write_uid', 'write_date']) return [address_obj.default_get(fields_names)] + def default_lang(self): + config_obj = self.pool.get('party.configuration') + config = config_obj.browse(1) + return config.party_lang.id + def on_change_with_vat_code(self, vals): return (vals.get('vat_country') or '') + (vals.get('vat_number') or '')