ajay javiya (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-10click-hr-fix-aja into
lp:~openerp-dev/openobject-addons/trunk-10click-hr.
Requested reviews:
Jigar Amin (OpenERP) (jam-openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-10click-hr-fix-aja/+merge/131830
Hello,
Add onchange method for:
->Create and edit a contact: the mail, phone, mobile in the Contact form should
be applied automatically in the Application form when selecting a contact
->My Leave Requests: when creating a new leave request from the calendar view,
the 2nd calendar view should update automatically with an on_change when
changing the first date
Thank You.
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-10click-hr-fix-aja/+merge/131830
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-10click-hr.
=== modified file 'hr_holidays/hr_holidays.py'
--- hr_holidays/hr_holidays.py 2012-10-12 11:42:58 +0000
+++ hr_holidays/hr_holidays.py 2012-10-29 08:37:23 +0000
@@ -199,7 +199,13 @@
raise osv.except_osv(_('Warning!'),_('You cannot delete a leave which is in %s state!')%(rec.state))
return super(hr_holidays, self).unlink(cr, uid, ids, context)
- def onchange_date_from(self, cr, uid, ids, date_to, date_from):
+ def onchange_date_from(self, cr, uid, ids, date_from):
+ date_to = False
+ if date_from:
+ date_to = date_from
+ return {'value':{'date_to': date_to}}
+
+ def onchange_date_to(self, cr, uid, ids, date_to, date_from):
result = {}
if date_to and date_from:
diff_day = self._get_number_of_days(date_from, date_to)
=== modified file 'hr_holidays/hr_holidays_view.xml'
--- hr_holidays/hr_holidays_view.xml 2012-10-12 05:51:06 +0000
+++ hr_holidays/hr_holidays_view.xml 2012-10-29 08:37:23 +0000
@@ -104,8 +104,8 @@
<label for="number_of_days_temp" string="Duration"/>
<div>
<group col="3">
- <field name="date_from" nolabel="1" on_change="onchange_date_from(date_to, date_from)" required="1" class="oe_inline"/><label string="-" class="oe_inline" />
- <field name="date_to" nolabel="1" on_change="onchange_date_from(date_to, date_from)" required="1" class="oe_inline"/>
+ <field name="date_from" nolabel="1" on_change="onchange_date_from(date_from)" required="1" class="oe_inline"/><label string="-" class="oe_inline" />
+ <field name="date_to" nolabel="1" on_change="onchange_date_to(date_to, date_from)" required="1" class="oe_inline"/>
</group>
<div>
<field name="number_of_days_temp" class="oe_inline"/> days
=== modified file 'hr_recruitment/hr_recruitment.py'
--- hr_recruitment/hr_recruitment.py 2012-10-15 09:02:00 +0000
+++ hr_recruitment/hr_recruitment.py 2012-10-29 08:37:23 +0000
@@ -259,6 +259,17 @@
stage_id = stage_ids and stage_ids[0] or False
return {'value': {'stage_id': stage_id}}
+ def onchange_partner_id(self, cr, uid, ids, partner_id, context=None):
+ data = {'partner_phone': False,
+ 'partner_mobile': False,
+ 'email_from': False}
+ if partner_id:
+ addr = self.pool.get('res.partner').browse(cr, uid, partner_id, context)
+ data.update({'partner_phone': addr.phone,
+ 'partner_mobile': addr.mobile,
+ 'email_from': addr.email})
+ return {'value': data}
+
def stage_find(self, cr, uid, cases, section_id, domain=[], order='sequence', context=None):
""" Override of the base.stage method
Parameter of the stage search taken from the lead:
=== modified file 'hr_recruitment/hr_recruitment_view.xml'
--- hr_recruitment/hr_recruitment_view.xml 2012-10-25 15:10:13 +0000
+++ hr_recruitment/hr_recruitment_view.xml 2012-10-29 08:37:23 +0000
@@ -135,7 +135,7 @@
<group>
<group>
<field name="partner_id"
- on_change="onchange_partner_id(partner_id, email_from)"/>
+ on_change="onchange_partner_id(partner_id)"/>
<field name="email_from" widget="email"/>
<field name="partner_phone"/>
<field name="partner_mobile"/>
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp