add field canceled_date in contract
This commit is contained in:
parent
c0ff19d94b
commit
ebffc0b2e7
16
contract.py
16
contract.py
|
@ -35,6 +35,9 @@ class StaffContract(Workflow, ModelSQL, ModelView):
|
||||||
'required': Eval('state') == 'finished',
|
'required': Eval('state') == 'finished',
|
||||||
'readonly': Eval('state') == 'finished',
|
'readonly': Eval('state') == 'finished',
|
||||||
}, depends=['state'])
|
}, depends=['state'])
|
||||||
|
canceled_date = fields.Date('Canceled Date', states={
|
||||||
|
'required': Eval('state') == 'canceled',
|
||||||
|
}, depends=['state'])
|
||||||
salary = fields.Numeric('Salary', digits=(16, 2), states=STATES,
|
salary = fields.Numeric('Salary', digits=(16, 2), states=STATES,
|
||||||
help='Salary monthly of person', required=True)
|
help='Salary monthly of person', required=True)
|
||||||
kind = fields.Selection([
|
kind = fields.Selection([
|
||||||
|
@ -49,6 +52,7 @@ class StaffContract(Workflow, ModelSQL, ModelView):
|
||||||
('draft', 'Draft'),
|
('draft', 'Draft'),
|
||||||
('active', 'Active'),
|
('active', 'Active'),
|
||||||
('finished', 'Finished'),
|
('finished', 'Finished'),
|
||||||
|
('canceled', 'Canceled'),
|
||||||
], 'State', readonly=True, select=True)
|
], 'State', readonly=True, select=True)
|
||||||
payment_term = fields.Selection(
|
payment_term = fields.Selection(
|
||||||
PAYMENT_TERM, 'Payment Term', states=STATES)
|
PAYMENT_TERM, 'Payment Term', states=STATES)
|
||||||
|
@ -63,6 +67,7 @@ class StaffContract(Workflow, ModelSQL, ModelView):
|
||||||
cls._transitions |= set((
|
cls._transitions |= set((
|
||||||
('draft', 'active'),
|
('draft', 'active'),
|
||||||
('active', 'draft'),
|
('active', 'draft'),
|
||||||
|
('active', 'canceled'),
|
||||||
('active', 'finished'),
|
('active', 'finished'),
|
||||||
))
|
))
|
||||||
cls._buttons.update({
|
cls._buttons.update({
|
||||||
|
@ -75,6 +80,9 @@ class StaffContract(Workflow, ModelSQL, ModelView):
|
||||||
'finished': {
|
'finished': {
|
||||||
'invisible': Eval('state') != 'active',
|
'invisible': Eval('state') != 'active',
|
||||||
},
|
},
|
||||||
|
'canceled': {
|
||||||
|
'invisible': Eval('state') != 'active',
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -139,6 +147,14 @@ class StaffContract(Workflow, ModelSQL, ModelView):
|
||||||
for contract in records:
|
for contract in records:
|
||||||
contract._check_finish_date()
|
contract._check_finish_date()
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
@ModelView.button
|
||||||
|
@Workflow.transition('canceled')
|
||||||
|
def canceled(cls, records):
|
||||||
|
for contract in records:
|
||||||
|
if not contract.canceled_date:
|
||||||
|
raise StaffContractError(gettext('staff.msg_missing_canceled_date'))
|
||||||
|
|
||||||
def _check_finish_date(self):
|
def _check_finish_date(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
58
locale/es.po
58
locale/es.po
|
@ -2,22 +2,6 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||||
|
|
||||||
msgctxt "error:company.employee:"
|
|
||||||
msgid "Employee already exists!"
|
|
||||||
msgstr "El empleado ya existe!"
|
|
||||||
|
|
||||||
msgctxt "error:staff.contract:"
|
|
||||||
msgid "The contract sequence is missing on configuration!"
|
|
||||||
msgstr "Falta la secuencia de contrato en la configuración!"
|
|
||||||
|
|
||||||
msgctxt "error:staff.contract:"
|
|
||||||
msgid "The employee %s already has a contract in draft or active!"
|
|
||||||
msgstr "El empleado %s ya tiene un contrato activo o en borrador!"
|
|
||||||
|
|
||||||
msgctxt "error:staff.contract:"
|
|
||||||
msgid "You can not to finish a contract with end date on future!"
|
|
||||||
msgstr "No puede terminar un contrato con fecha terminación futura!"
|
|
||||||
|
|
||||||
msgctxt "field:company.employee,active:"
|
msgctxt "field:company.employee,active:"
|
||||||
msgid "Active"
|
msgid "Active"
|
||||||
msgstr "Activo"
|
msgstr "Activo"
|
||||||
|
@ -104,7 +88,7 @@ msgstr "Usuario de creación"
|
||||||
|
|
||||||
msgctxt "field:staff.configuration.sequence,id:"
|
msgctxt "field:staff.configuration.sequence,id:"
|
||||||
msgid "ID"
|
msgid "ID"
|
||||||
msgstr "UP"
|
msgstr "ID"
|
||||||
|
|
||||||
msgctxt "field:staff.configuration.sequence,rec_name:"
|
msgctxt "field:staff.configuration.sequence,rec_name:"
|
||||||
msgid "Record Name"
|
msgid "Record Name"
|
||||||
|
@ -112,7 +96,7 @@ msgstr "Nombre del registro"
|
||||||
|
|
||||||
msgctxt "field:staff.configuration.sequence,staff_contract_sequence:"
|
msgctxt "field:staff.configuration.sequence,staff_contract_sequence:"
|
||||||
msgid "Staff Contract Sequence"
|
msgid "Staff Contract Sequence"
|
||||||
msgstr ""
|
msgstr "Secuencia de Contrato"
|
||||||
|
|
||||||
msgctxt "field:staff.configuration.sequence,write_date:"
|
msgctxt "field:staff.configuration.sequence,write_date:"
|
||||||
msgid "Write Date"
|
msgid "Write Date"
|
||||||
|
@ -122,6 +106,10 @@ msgctxt "field:staff.configuration.sequence,write_uid:"
|
||||||
msgid "Write User"
|
msgid "Write User"
|
||||||
msgstr "Usuario modificación"
|
msgstr "Usuario modificación"
|
||||||
|
|
||||||
|
msgctxt "field:staff.contract,canceled_date:"
|
||||||
|
msgid "Canceled Date"
|
||||||
|
msgstr "Fecha de Anulación"
|
||||||
|
|
||||||
msgctxt "field:staff.contract,comment:"
|
msgctxt "field:staff.contract,comment:"
|
||||||
msgid "Comment"
|
msgid "Comment"
|
||||||
msgstr "Observaciones"
|
msgstr "Observaciones"
|
||||||
|
@ -318,6 +306,10 @@ msgctxt "model:ir.action,name:act_contract_form"
|
||||||
msgid "Contract"
|
msgid "Contract"
|
||||||
msgstr "Contrato"
|
msgstr "Contrato"
|
||||||
|
|
||||||
|
msgctxt "model:ir.action,name:act_holidays_form"
|
||||||
|
msgid "Holidays"
|
||||||
|
msgstr "Vacaciones"
|
||||||
|
|
||||||
msgctxt "model:ir.action,name:act_position_tree"
|
msgctxt "model:ir.action,name:act_position_tree"
|
||||||
msgid "Positions"
|
msgid "Positions"
|
||||||
msgstr "Cargos"
|
msgstr "Cargos"
|
||||||
|
@ -356,6 +348,10 @@ msgctxt "model:ir.ui.menu,name:"
|
||||||
msgid "Contracts"
|
msgid "Contracts"
|
||||||
msgstr "Contratos"
|
msgstr "Contratos"
|
||||||
|
|
||||||
|
msgctxt "model:ir.ui.menu,name:menu_assitants"
|
||||||
|
msgid "Assistants"
|
||||||
|
msgstr "Asistentes"
|
||||||
|
|
||||||
msgctxt "model:ir.ui.menu,name:menu_configuration"
|
msgctxt "model:ir.ui.menu,name:menu_configuration"
|
||||||
msgid "Configuration"
|
msgid "Configuration"
|
||||||
msgstr "Configuración"
|
msgstr "Configuración"
|
||||||
|
@ -402,7 +398,7 @@ msgstr "Configuración"
|
||||||
|
|
||||||
msgctxt "model:staff.configuration.sequence,name:"
|
msgctxt "model:staff.configuration.sequence,name:"
|
||||||
msgid "Staff Configuration Sequence"
|
msgid "Staff Configuration Sequence"
|
||||||
msgstr ""
|
msgstr "Configuracion de Secuencia"
|
||||||
|
|
||||||
msgctxt "model:staff.contract,name:"
|
msgctxt "model:staff.contract,name:"
|
||||||
msgid "Staff Contract"
|
msgid "Staff Contract"
|
||||||
|
@ -436,6 +432,10 @@ msgctxt "selection:company.employee,contracting_state:"
|
||||||
msgid "Finished"
|
msgid "Finished"
|
||||||
msgstr "Terminado"
|
msgstr "Terminado"
|
||||||
|
|
||||||
|
msgctxt "selection:company.employee,contracting_state:"
|
||||||
|
msgid "In Process"
|
||||||
|
msgstr "En proceso"
|
||||||
|
|
||||||
msgctxt "selection:company.employee,contracting_state:"
|
msgctxt "selection:company.employee,contracting_state:"
|
||||||
msgid "Rejected"
|
msgid "Rejected"
|
||||||
msgstr "Rechazado"
|
msgstr "Rechazado"
|
||||||
|
@ -456,10 +456,26 @@ msgctxt "selection:staff.contract,kind:"
|
||||||
msgid "Steady"
|
msgid "Steady"
|
||||||
msgstr "Término Fijo"
|
msgstr "Término Fijo"
|
||||||
|
|
||||||
|
msgctxt "selection:staff.contract,kind:"
|
||||||
|
msgid "internships"
|
||||||
|
msgstr "Pasantia"
|
||||||
|
|
||||||
|
msgctxt "selection:staff.contract,kind:"
|
||||||
|
msgid "learning"
|
||||||
|
msgstr "Aprendizaje"
|
||||||
|
|
||||||
|
msgctxt "selection:staff.contract,payment_term:"
|
||||||
|
msgid "Cash"
|
||||||
|
msgstr "Efectivo"
|
||||||
|
|
||||||
msgctxt "selection:staff.contract,state:"
|
msgctxt "selection:staff.contract,state:"
|
||||||
msgid "Active"
|
msgid "Active"
|
||||||
msgstr "Activo"
|
msgstr "Activo"
|
||||||
|
|
||||||
|
msgctxt "selection:staff.contract,state:"
|
||||||
|
msgid "Canceled"
|
||||||
|
msgstr "Anulado"
|
||||||
|
|
||||||
msgctxt "selection:staff.contract,state:"
|
msgctxt "selection:staff.contract,state:"
|
||||||
msgid "Draft"
|
msgid "Draft"
|
||||||
msgstr "Borrador"
|
msgstr "Borrador"
|
||||||
|
@ -520,6 +536,10 @@ msgctxt "view:staff.contract:"
|
||||||
msgid "Additional Info"
|
msgid "Additional Info"
|
||||||
msgstr "Información Adicional"
|
msgstr "Información Adicional"
|
||||||
|
|
||||||
|
msgctxt "view:staff.contract:"
|
||||||
|
msgid "Canceled"
|
||||||
|
msgstr "Anulado"
|
||||||
|
|
||||||
msgctxt "view:staff.contract:"
|
msgctxt "view:staff.contract:"
|
||||||
msgid "Draft"
|
msgid "Draft"
|
||||||
msgstr "Borrador"
|
msgstr "Borrador"
|
||||||
|
|
|
@ -15,6 +15,9 @@ this repository contains the full copyright notices and license terms. -->
|
||||||
<record model="ir.message" id="msg_finish_contract_out_date">
|
<record model="ir.message" id="msg_finish_contract_out_date">
|
||||||
<field name="text">You can not to finish a contract with end date on future!</field>
|
<field name="text">You can not to finish a contract with end date on future!</field>
|
||||||
</record>
|
</record>
|
||||||
|
<record model="ir.message" id="msg_missing_canceled_date">
|
||||||
|
<field name="text">You must define canceled date for contract!</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</tryton>
|
</tryton>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[tryton]
|
[tryton]
|
||||||
version=6.0.0
|
version=6.0.1
|
||||||
depends:
|
depends:
|
||||||
ir
|
ir
|
||||||
party
|
party
|
||||||
|
|
|
@ -22,6 +22,8 @@ this repository contains the full copyright notices and license terms. -->
|
||||||
<page string="Additional Info" id="additional_info">
|
<page string="Additional Info" id="additional_info">
|
||||||
<label name="payment_term"/>
|
<label name="payment_term"/>
|
||||||
<field name="payment_term"/>
|
<field name="payment_term"/>
|
||||||
|
<label name="canceled_date"/>
|
||||||
|
<field name="canceled_date"/>
|
||||||
<label name="company"/>
|
<label name="company"/>
|
||||||
<field name="company"/>
|
<field name="company"/>
|
||||||
<separator name="comment" colspan="4"/>
|
<separator name="comment" colspan="4"/>
|
||||||
|
@ -38,6 +40,8 @@ this repository contains the full copyright notices and license terms. -->
|
||||||
icon="tryton-ok"/>
|
icon="tryton-ok"/>
|
||||||
<button name="finished" string="Finished"
|
<button name="finished" string="Finished"
|
||||||
icon="tryton-ok"/>
|
icon="tryton-ok"/>
|
||||||
|
<button name="canceled" string="Canceled"
|
||||||
|
icon="tryton-cancel"/>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Reference in New Issue