Skip to content

Commit

Permalink
[ADD][hr_contract_signature] Add signature date
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienpeiffer committed Oct 20, 2015
1 parent 5590126 commit 1b0de38
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion hr_contract_signature/models/hr_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#
##############################################################################

from openerp import models, fields
from openerp import models, fields, api


class hr_contract(models.Model):
Expand All @@ -33,3 +33,10 @@ class hr_contract(models.Model):
contract_signed = fields.Boolean(
string='Contract Signed',
help='Set this when the contract is signed by the contractor')
signature_date = fields.Date()

@api.onchange('signature_date')
@api.one
def onchange_signature_date(self):
if self.signature_date:
self.contract_signed = True
2 changes: 2 additions & 0 deletions hr_contract_signature/views/hr_contract_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<field name="arch" type="xml">
<field name="type_id" position="after">
<field name="contract_signed"/>
<field name="signature_date"/>
</field>
</field>
</record>
Expand All @@ -21,6 +22,7 @@
<field name="arch" type="xml">
<field name="type_id" position="after">
<field name="contract_signed"/>
<field name="signature_date"/>
</field>
</field>
</record>
Expand Down

0 comments on commit 1b0de38

Please sign in to comment.