Set party lang as a configuration option
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -11,6 +11,8 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<form string="Party Configuration">
|
||||
<label name="party_sequence"/>
|
||||
<field name="party_sequence"/>
|
||||
<label name="party_lang" />
|
||||
<field name="party_lang" widget="selection" />
|
||||
</form>
|
||||
]]>
|
||||
</field>
|
||||
|
||||
@@ -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 '')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user