/usr/lib/python2.7/dist-packages/trytond/modules/account_be/account.py is in tryton-modules-account-be 4.2.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 | # 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 sql.operators import Concat
from sql.functions import Position
from trytond.pool import Pool, PoolMeta
from trytond.transaction import Transaction
__all__ = ['AccountTemplate']
class AccountTemplate:
__metaclass__ = PoolMeta
__name__ = 'account.account.template'
@classmethod
def __register__(cls, module_name):
pool = Pool()
ModelData = pool.get('ir.model.data')
cursor = Transaction().connection.cursor()
model_data = ModelData.__table__()
# Migration from 3.4: translation of the account chart
cursor.execute(*model_data.select(model_data.id,
where=((model_data.fs_id == 'be')
& (model_data.module == 'account_be'))))
if cursor.fetchone():
cursor.execute(*model_data.update(
columns=[model_data.fs_id],
values=[Concat(model_data.fs_id, '_fr')],
where=((Position('_fr', model_data.fs_id) == 0)
& (model_data.module == 'account_be'))))
super(AccountTemplate, cls).__register__(module_name)
|