2018-01-08 19:13:55 +01:00
|
|
|
# The COPYRIGHT file at the top level of this repository contains the full
|
|
|
|
# copyright notices and license terms.
|
2017-07-14 17:09:10 +02:00
|
|
|
from trytond.model import fields
|
2013-09-27 14:19:14 +02:00
|
|
|
from trytond.pool import PoolMeta
|
|
|
|
|
2017-07-14 17:00:02 +02:00
|
|
|
__all__ = ['Account', 'FiscalYear', 'Period']
|
2013-09-27 14:19:14 +02:00
|
|
|
|
|
|
|
|
2017-03-30 12:28:48 +02:00
|
|
|
class Account:
|
2016-03-29 11:43:11 +02:00
|
|
|
__metaclass__ = PoolMeta
|
2013-09-27 14:19:14 +02:00
|
|
|
__name__ = 'account.account'
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def __setup__(cls):
|
|
|
|
super(Account, cls).__setup__()
|
|
|
|
value = ('efective', 'Efective')
|
2018-01-08 19:13:55 +01:00
|
|
|
if value not in cls.kind.selection:
|
2013-09-27 14:19:14 +02:00
|
|
|
cls.kind.selection.append(value)
|
2017-07-14 17:00:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
class FiscalYear:
|
|
|
|
__metaclass__ = PoolMeta
|
|
|
|
__name__ = 'account.fiscalyear'
|
|
|
|
code = fields.Char('Code', size=None)
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def search_rec_name(cls, name, clause):
|
|
|
|
if clause[1].startswith('!') or clause[1].startswith('not '):
|
|
|
|
bool_op = 'AND'
|
|
|
|
else:
|
|
|
|
bool_op = 'OR'
|
|
|
|
return [bool_op,
|
|
|
|
('code',) + tuple(clause[1:]),
|
|
|
|
(cls._rec_name,) + tuple(clause[1:]),
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
class Period:
|
|
|
|
__metaclass__ = PoolMeta
|
|
|
|
__name__ = 'account.period'
|
|
|
|
code = fields.Char('Code', size=None)
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def search_rec_name(cls, name, clause):
|
|
|
|
if clause[1].startswith('!') or clause[1].startswith('not '):
|
|
|
|
bool_op = 'AND'
|
|
|
|
else:
|
|
|
|
bool_op = 'OR'
|
|
|
|
return [bool_op,
|
|
|
|
('code',) + tuple(clause[1:]),
|
|
|
|
(cls._rec_name,) + tuple(clause[1:]),
|
|
|
|
]
|