trytonpsk-staff_payroll_co/event_category.py

30 lines
1 KiB
Python
Raw Normal View History

2021-04-22 23:50:45 +02:00
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
2020-04-16 00:38:42 +02:00
from trytond.model import fields
from trytond.pool import PoolMeta
from trytond.pyson import Eval
__all__ = ['EventCategory']
2021-04-22 23:50:45 +02:00
STATES_PAYROLL = {'invisible': ~Eval('payroll_effect')}
2020-04-16 00:38:42 +02:00
2021-04-22 23:50:45 +02:00
class EventCategory(metaclass=PoolMeta):
2020-04-16 00:38:42 +02:00
__name__ = 'staff.event_category'
payroll_effect = fields.Boolean('Payroll Effect')
discount_method = fields.Selection([
2021-04-22 23:50:45 +02:00
('', ''),
('uom', 'UoM'),
('fixed_amount', 'Fixed Amount'),
], 'Discount Method', select=True, states=STATES_PAYROLL)
2020-04-16 00:38:42 +02:00
wage_type = fields.Many2One('staff.wage_type', 'Wage Type',
states=STATES_PAYROLL)
2021-04-22 23:50:45 +02:00
discount_pay = fields.Boolean('Discount Pay', states=STATES_PAYROLL)
wage_type_discount = fields.Many2One('staff.wage_type',
'Wage Type Discount', states=STATES_PAYROLL)
2020-04-16 00:38:42 +02:00
@classmethod
def __setup__(cls):
super(EventCategory, cls).__setup__()