Pinakin Nayi (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-10-hr-click-2-bde-timesheet-hsa into 
lp:~openerp-dev/openobject-addons/trunk-10-hr-click-2-bde.

Requested reviews:
  Bharat Devnani (Open ERP) (bde-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-10-hr-click-2-bde-timesheet-hsa/+merge/133885

Hello Sir,

 I improved hr_timesheet_sheet and add chatter.

Thanks,
pna
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-10-hr-click-2-bde-timesheet-hsa/+merge/133885
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-10-hr-click-2-bde.
=== modified file 'hr_holidays/hr_holidays.py'
--- hr_holidays/hr_holidays.py	2012-11-08 09:24:51 +0000
+++ hr_holidays/hr_holidays.py	2012-11-12 10:04:36 +0000
@@ -412,7 +412,7 @@
 
     def create_notificate(self, cr, uid, ids, context=None):
         for obj in self.browse(cr, uid, ids, context=context):
-            self.message_post(cr, uid, ids,
+            self.message_post(cr, uid, [obj.id],
                 _("Request <b>created</b>, waiting confirmation."), context=context)
         return True
 

=== modified file 'hr_timesheet_sheet/hr_timesheet_sheet.py'
--- hr_timesheet_sheet/hr_timesheet_sheet.py	2012-10-30 05:03:23 +0000
+++ hr_timesheet_sheet/hr_timesheet_sheet.py	2012-11-12 10:04:36 +0000
@@ -95,6 +95,7 @@
             if (abs(sheet.total_difference) < di) or not di:
                 wf_service = netsvc.LocalService("workflow")
                 wf_service.trg_validate(uid, 'hr_timesheet_sheet.sheet', sheet.id, 'confirm', cr)
+                self.confirm_send_note(cr, uid, ids, context)
             else:
                 raise osv.except_osv(_('Warning!'), _('Please verify that the total difference of the sheet is lower than %.2f.') %(di,))
         return True
@@ -221,6 +222,20 @@
             department_id = self.pool.get('hr.employee').browse(cr, uid, employee_id, context=context).department_id.id
         return {'value': {'department_id': department_id}}
 
+    # ------------------------------------------------
+    # OpenChatter methods and notifications
+    # ------------------------------------------------
+    
+    def needaction_domain_get(self, cr, uid, ids, context=None):
+        emp_obj = self.pool.get('hr.employee')
+        empids = emp_obj.search(cr, uid, [('parent_id.user_id', '=', uid)], context=context)
+        dom = ['&', ('state', '=', 'confirm'), ('employee_id', 'in', empids)]
+        return dom
+
+    def confirm_send_note(self, cr, uid, ids, context=None):
+        for obj in self.browse(cr, uid, ids, context=context):
+            self.message_post(cr, uid, [obj.id], body=_("Timesheet has been Submitted by %s .") % (obj.employee_id.name), context=context)
+
 hr_timesheet_sheet()
 
 class account_analytic_line(osv.osv):

=== modified file 'hr_timesheet_sheet/hr_timesheet_sheet_view.xml'
--- hr_timesheet_sheet/hr_timesheet_sheet_view.xml	2012-10-29 15:08:09 +0000
+++ hr_timesheet_sheet/hr_timesheet_sheet_view.xml	2012-11-12 10:04:36 +0000
@@ -115,7 +115,7 @@
                                     <field invisible="1" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)"/>
                                     <field invisible="1" name="amount"/>
                                     <field invisible="1" name="general_account_id"/>
-                                    <field invisible="1" name="user_id" required="1"/>
+                                    <field invisible="1" name="user_id"/>
                                 </tree>
                                 <form string="Timesheet Activities" version="7.0">
                                     <field name="date"/>

_______________________________________________
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