/usr/lib/python3/dist-packages/trytond/modules/party/configuration.py is in tryton-modules-party 4.6.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | # This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.model import ModelView, ModelSQL, ModelSingleton, fields
from trytond.model import MultiValueMixin, ValueMixin
from trytond import backend
from trytond.tools.multivalue import migrate_property
__all__ = ['Configuration', 'ConfigurationSequence', 'ConfigurationLang']
party_sequence = fields.Many2One('ir.sequence', 'Party Sequence',
domain=[
('code', '=', 'party.party'),
],
help="Used to generate the party code.")
party_lang = fields.Many2One("ir.lang", 'Party Language',
help="The default language for new parties.")
class Configuration(ModelSingleton, ModelSQL, ModelView, MultiValueMixin):
'Party Configuration'
__name__ = 'party.configuration'
party_sequence = fields.MultiValue(party_sequence)
party_lang = fields.MultiValue(party_lang)
class _ConfigurationValue(ModelSQL):
_configuration_value_field = None
@classmethod
def __register__(cls, module_name):
TableHandler = backend.get('TableHandler')
exist = TableHandler.table_exist(cls._table)
super(_ConfigurationValue, cls).__register__(module_name)
if not exist:
cls._migrate_property([], [], [])
@classmethod
def _migrate_property(cls, field_names, value_names, fields):
field_names.append(cls._configuration_value_field)
value_names.append(cls._configuration_value_field)
migrate_property(
'party.configuration', field_names, cls, value_names,
fields=fields)
class ConfigurationSequence(_ConfigurationValue, ModelSQL, ValueMixin):
'Party Configuration Sequence'
__name__ = 'party.configuration.party_sequence'
party_sequence = party_sequence
_configuration_value_field = 'party_sequence'
@classmethod
def check_xml_record(cls, records, values):
return True
class ConfigurationLang(_ConfigurationValue, ModelSQL, ValueMixin):
'Party Configuration Lang'
__name__ = 'party.configuration.party_lang'
party_lang = party_lang
_configuration_value_field = 'party_lang'
|