[IMP]project_timesheet:added method for setting default type of invoicing

bzr revid: kbh@tinyerp.com-20121012090527-zn9ngz25ylbio2nx
This commit is contained in:
Khushboo Bhatt (Open ERP) 2012-10-12 14:35:27 +05:30
parent fce8bb9c29
commit 06ae4d8913
1 changed files with 9 additions and 0 deletions

View File

@ -302,9 +302,18 @@ class account_analytic_line(osv.osv):
return employee.product_id.uom_id.id
return False
def _default_invoice(self, cr, uid, context=None):
proxy = self.pool.get('hr_timesheet_invoice.factor')
record_ids = proxy.search(cr, uid, [('customer_name', '=', '100%')], context=context)
invoice = proxy.browse(cr, uid, record_ids[0], context=context)
if invoice:
return invoice.id
return False
_defaults = {
'product_id': _default_product,
'product_uom_id': _default_product_uom,
'to_invoice': _default_invoice
}
account_analytic_line()