Divyesh Makwana(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-nel_issue_04-mdi into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-nel_issue_04-mdi/+merge/127989

Hello

I have done the following changes:

1. Create a new project and click on 'Timesheet' button. You will get this 
"Record your timesheets for the project '%s'". Instead of name of the project.

2. Fix the integrity error when we embeded 'Timesheet Line' created through 
project.

Thanks,
Divyesh


-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-nel_issue_04-mdi/+merge/127989
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-nel_issue_04-mdi.
=== modified file 'project_timesheet/project_timesheet.py'
--- project_timesheet/project_timesheet.py	2012-10-03 14:38:09 +0000
+++ project_timesheet/project_timesheet.py	2012-10-04 11:46:24 +0000
@@ -46,12 +46,15 @@
 
     def open_timesheets(self, cr, uid, ids, context=None):
         """ open Timesheets view """
+        mod_obj = self.pool.get('ir.model.data')
+        act_obj = self.pool.get('ir.actions.act_window')
+
         project = self.browse(cr, uid, ids[0], context)
         view_context = {
             'search_default_account_id': [project.analytic_account_id.id],
             'default_account_id': project.analytic_account_id.id,
         }
-        help = _("""<p class="oe_view_nocontent_create">Record your timesheets for the project '%s'.</p>""")
+        help = _("""<p class="oe_view_nocontent_create">Record your timesheets for the project '%s'.</p>""") % (project.name,)
         try:
             if project.to_invoice and project.partner_id:
                 help+= _("""<p>Timesheets on this project may be invoiced to %s, according to the terms defined in the contract.</p>""" ) % (project.partner_id.name,)
@@ -59,16 +62,13 @@
             # if the user do not have access rights on the partner
             pass
 
-        return {
-            'type': 'ir.actions.act_window',
-            'name': _('Timesheets'),
-            'res_model': 'hr.analytic.timesheet',
-            'view_type': 'form',
-            'view_mode': 'tree,form',
-            'context': view_context,
-            'nodestroy': True,
-            'help': help
-        }
+        result = mod_obj.get_object_reference(cr, uid, 'hr_timesheet', 'act_hr_timesheet_line_evry1_all_form')
+        id = result and result[1] or False
+        result = act_obj.read(cr, uid, [id], context=context)[0]
+        result['name'] = _('Timesheets')
+        result['context'] = view_context
+        result['help'] = help
+        return result
 
 project_project()
 

_______________________________________________
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

Reply via email to