From 06ae4d8913a7df3ab9f549707a1c0f59e0ff3f78 Mon Sep 17 00:00:00 2001 From: "Khushboo Bhatt (Open ERP)" Date: Fri, 12 Oct 2012 14:35:27 +0530 Subject: [PATCH] [IMP]project_timesheet:added method for setting default type of invoicing bzr revid: kbh@tinyerp.com-20121012090527-zn9ngz25ylbio2nx --- addons/project_timesheet/project_timesheet.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index 3e72a7e7522..724944d9994 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -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()