diff --git a/addons/project/project.py b/addons/project/project.py index c44af563d79..d11c76ed9c9 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -758,6 +758,7 @@ class task(osv.osv): 'sequence': 10, 'active': True, 'user_id': lambda obj, cr, uid, context: uid, + 'project_id':lambda self, cr, uid, context: context.get('active_id',False), 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'project.task', context=c) } diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 2e426eb5f1e..07d4688ec13 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -255,7 +255,9 @@ class project_issue(crm.crm_case, osv.osv): user = self.pool.get('res.users').browse(cr, uid, uid, context=context) if user.context_project_id: return user.context_project_id.id - return False + else: + project_id = context.get('active_id',False) + return project_id def on_change_project(self, cr, uid, ids, project_id, context=None): return {} diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py index 05605e38a03..6cf7693d611 100644 --- a/addons/project_long_term/project_long_term.py +++ b/addons/project_long_term/project_long_term.py @@ -123,6 +123,7 @@ class project_phase(osv.osv): _defaults = { 'state': 'draft', 'sequence': 10, + 'project_id':lambda self, cr, uid, context: context.get('active_id',False), 'product_uom': lambda self,cr,uid,c: self.pool.get('product.uom').search(cr, uid, [('name', '=', _('Day'))], context=c)[0] } _order = "project_id, date_start, sequence" diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index 7777cc130e9..5e5285b1816 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -29,7 +29,7 @@ from tools.translate import _ class project_project(osv.osv): _inherit = 'project.project' - def _amt_to_invoice(self, cr, uid, ids,field_name, arg, context=None): + def _to_invoice(self, cr, uid, ids,field_name, arg, context=None): res = {} aal_pool = self.pool.get("account.analytic.line") for project in self.browse(cr,uid,ids,context=context): @@ -50,8 +50,8 @@ class project_project(osv.osv): _columns = { 'timesheets' : fields.boolean('Timesheets',help = "If you check this field timesheets appears in kanban view"), - 'amt_to_invoice': fields.function(_amt_to_invoice,string="Amount to Invoice",multi="sums"), - 'hrs_to_invoice': fields.function(_amt_to_invoice,string="Hours to Invoice",multi="sums") + 'amt_to_invoice': fields.function(_to_invoice,string="Amount to Invoice",multi="sums"), + 'hrs_to_invoice': fields.function(_to_invoice,string="Hours to Invoice",multi="sums") } _defaults = { 'timesheets' : True, diff --git a/addons/project_timesheet/project_timesheet_view.xml b/addons/project_timesheet/project_timesheet_view.xml index 26be054180f..52aaa01b99b 100644 --- a/addons/project_timesheet/project_timesheet_view.xml +++ b/addons/project_timesheet/project_timesheet_view.xml @@ -33,6 +33,7 @@ + @@ -58,7 +59,7 @@
Amount -
+
Hours