[IMP] hr_contract: remove unused field
+ Add helper method to retrieve the contract wage. Those methods are supposed to be overriden in some cases. closes odoo/odoo#48258 Taskid: 2222984 Related: odoo/enterprise#9454 Related: odoo/upgrade#980 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
@@ -31,7 +31,6 @@ class Contract(models.Model):
|
||||
default=lambda self: self.env.company.resource_calendar_id.id, copy=False,
|
||||
domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]")
|
||||
wage = fields.Monetary('Wage', required=True, tracking=True, help="Employee's monthly gross wage.")
|
||||
advantages = fields.Text('Advantages')
|
||||
notes = fields.Text('Notes')
|
||||
state = fields.Selection([
|
||||
('draft', 'New'),
|
||||
@@ -185,6 +184,14 @@ class Contract(models.Model):
|
||||
for contract in self:
|
||||
contract.employee_id.sudo().write({'contract_id': contract.id})
|
||||
|
||||
def _get_contract_wage(self):
|
||||
self.ensure_one()
|
||||
return self[self._get_contract_wage_field()]
|
||||
|
||||
def _get_contract_wage_field(self):
|
||||
self.ensure_one()
|
||||
return 'wage'
|
||||
|
||||
def write(self, vals):
|
||||
res = super(Contract, self).write(vals)
|
||||
if vals.get('state') == 'open':
|
||||
|
||||
@@ -207,8 +207,8 @@
|
||||
<field name="wage" nolabel="1"/>
|
||||
<span>/ month</span>
|
||||
</div>
|
||||
<field name="advantages" nolabel="1" placeholder="Advantages..." colspan="2" invisible="1"/>
|
||||
</group>
|
||||
<group string="Yearly Advantages" name="yearly_advantages"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
|
||||
Reference in New Issue
Block a user