Review: Needs Fixing
You shouldn't modify the action on project.project. The reason is because:
- the field 'to_invoice' is defined in module hr_timesheet_invoice, and
- there is no direct dependency between modules project and
hr_timesheet_invoice.
Moreover, the parameter 'res' is artificial there and totally undocumented :-(
Instead, you should override method onchange_partner_id only in module
project_timesheet:
def onchange_partner_id(self, cr, uid, ids, part=False, context=None):
res = super(project_project, self).onchange_partner_id(cr, uid, ids, part,
context)
if part and ('value' in res):
factor_id = ... # the id of the invoice factor "Yes
(100%)"
add 'to_invoice':factor_id to res['value']
return res
Raphael
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-usability-onchange_partner_set_invoice_task_work-aar/+merge/68784
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-usability.
_______________________________________________
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