Merge lp:~openerp-dev/openobject-addons/7.0-bug-1167878-sgo into lp:openobject-addons/7.0

Proposed by Sanjay Gohel (Open ERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-bug-1167878-sgo
Merge into: lp:openobject-addons/7.0
Diff against target: 49 lines (+17/-17)
1 file modified
project_timesheet/project_timesheet.py (+17/-17)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-bug-1167878-sgo
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+159762@code.launchpad.net

Description of the change

Hello,

       Improve indentation and make it 4 space instead of 3 space.

Thank You.
Sanjay Gohel(SGO)

To post a comment you must log in.

Unmerged revisions

9040. By Sanjay Gohel (Open ERP)

[IMP]make 4 space identation insted of 3 space as per gud coding convention

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'project_timesheet/project_timesheet.py'
2--- project_timesheet/project_timesheet.py 2012-12-18 22:50:15 +0000
3+++ project_timesheet/project_timesheet.py 2013-04-19 06:33:29 +0000
4@@ -270,29 +270,29 @@
5 res_partner()
6
7 class account_analytic_line(osv.osv):
8- _inherit = "account.analytic.line"
9-
10- def get_product(self, cr, uid, context=None):
11+ _inherit = "account.analytic.line"
12+
13+ def get_product(self, cr, uid, context=None):
14 emp_obj = self.pool.get('hr.employee')
15 emp_ids = emp_obj.search(cr, uid, [('user_id', '=', uid)], context=context)
16 if emp_ids:
17 employee = emp_obj.browse(cr, uid, emp_ids, context=context)[0]
18 if employee.product_id:return employee.product_id.id
19 return False
20-
21- _defaults = {'product_id': get_product,}
22-
23- def on_change_account_id(self, cr, uid, ids, account_id):
24- res = {}
25- if not account_id:
26- return res
27- res.setdefault('value',{})
28- acc = self.pool.get('account.analytic.account').browse(cr, uid, account_id)
29- st = acc.to_invoice.id
30- res['value']['to_invoice'] = st or False
31- if acc.state == 'close' or acc.state == 'cancelled':
32- raise osv.except_osv(_('Invalid Analytic Account !'), _('You cannot select a Analytic Account which is in Close or Cancelled state.'))
33- return res
34+
35+ _defaults = {'product_id': get_product,}
36+
37+ def on_change_account_id(self, cr, uid, ids, account_id):
38+ res = {}
39+ if not account_id:
40+ return res
41+ res.setdefault('value',{})
42+ acc = self.pool.get('account.analytic.account').browse(cr, uid, account_id)
43+ st = acc.to_invoice.id
44+ res['value']['to_invoice'] = st or False
45+ if acc.state == 'close' or acc.state == 'cancelled':
46+ raise osv.except_osv(_('Invalid Analytic Account !'), _('You cannot select a Analytic Account which is in Close or Cancelled state.'))
47+ return res
48
49 account_analytic_line()
50