Randhir Mayatra (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa-demo_hr-rma into 
lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa.

Requested reviews:
  Amit Patel (OpenERP) (apa-tiny)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-message-sub-type-apa-demo_hr-rma/+merge/122456

Hello Sir,

I have add the data for the subtype into hr module.

Thank you.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-message-sub-type-apa-demo_hr-rma/+merge/122456
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-message-sub-type-apa.
=== modified file 'hr_holidays/hr_holidays.py'
--- hr_holidays/hr_holidays.py	2012-08-27 08:37:05 +0000
+++ hr_holidays/hr_holidays.py	2012-09-03 07:28:27 +0000
@@ -368,36 +368,36 @@
         for obj in self.browse(cr, uid, ids, context=context):
             self.message_post(cr, uid, ids, 
                         _("The %s request has been <b>created</b> and is waiting for confirmation.")
-                        % ('leave' if obj.type == 'remove' else 'allocation',), context=context)
+                        % ('leave' if obj.type == 'remove' else 'allocation',), subtype="new", context=context)
         return True
     
     def holidays_confirm_notificate(self, cr, uid, ids, context=None):
         for obj in self.browse(cr, uid, ids):
             self.message_post(cr, uid, [obj.id], _("The %s request has been <b>confirmed</b> and is waiting for validation by the manager.")
-                    % ('leave' if obj.type == 'remove' else 'allocation',), context=context)
+                    % ('leave' if obj.type == 'remove' else 'allocation',), subtype="pending", context=context)
     
     def holidays_validate_notificate(self, cr, uid, ids, context=None):
         for obj in self.browse(cr, uid, ids):
             if obj.holiday_status_id.double_validation:
                 self.message_post(cr, uid, [obj.id], 
                     _("The %s request has been <b>approved</b>. A second validation is necessary and is now pending.")
-                    % ('leave' if obj.type == 'remove' else 'allocation',), context=context)
+                    % ('leave' if obj.type == 'remove' else 'allocation',), subtype="pending", context=context)
             else:
                 self.message_post(cr, uid, [obj.id], 
                     _("The %s request has been <b>approved</b>. The validation process is now over.")
-                    % ('leave' if obj.type == 'remove' else 'allocation',), context=context)
+                    % ('leave' if obj.type == 'remove' else 'allocation',), subtype="closed", context=context)
     
     def holidays_valid2_notificate(self, cr, uid, ids, context=None):
         for obj in self.browse(cr, uid, ids):
             self.message_post(cr, uid, [obj.id], 
                     _("The %s request has been <b>double validated</b>. The validation process is now over.")
-                    % ('leave' if obj.type == 'remove' else 'allocation',), context=context)
+                    % ('leave' if obj.type == 'remove' else 'allocation',), subtype="closed", context=context)
     
     def holidays_refuse_notificate(self, cr, uid, ids, approval, context=None):
         for obj in self.browse(cr, uid, ids):
             self.message_post(cr, uid, [obj.id], 
                     _("The %s request has been <b>refused</b>. The validation process is now over.")
-                    % ('leave' if obj.type == 'remove' else 'allocation',), context=context)
+                    % ('leave' if obj.type == 'remove' else 'allocation',), subtype="cancelled", context=context)
     
 hr_holidays()
 

=== modified file 'hr_holidays/hr_holidays_data.xml'
--- hr_holidays/hr_holidays_data.xml	2012-08-30 14:18:52 +0000
+++ hr_holidays/hr_holidays_data.xml	2012-09-03 07:28:27 +0000
@@ -49,5 +49,34 @@
             <field name="limit">True</field>
             <field name="color_name">brown</field>
         </record>
+        <!--Sub type data -->
+        <record id="mail.mail_subtype_new" model="mail.message.subtype">
+            <field name="name">new</field>
+            <field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
+            <field name="default" eval="False"/>
+        </record>    
+        <record id="mail.mail_subtype_pending" model="mail.message.subtype">
+            <field name="name">pending</field>
+            <field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
+            <field name="default" eval="False"/>
+        </record>
+        <record id="mail.mail_subtype_closed" model="mail.message.subtype">
+            <field name="name">closed</field>
+            <field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
+        </record>
+        <record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
+            <field name="name">cancelled</field>
+            <field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
+            <field name="default" eval="False"/>
+        </record>
+        <record id="mail.mail_subtype_email" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
+        </record>
+        <record id="mail.mail_subtype_comment" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
+        </record>
+        <record id="mail.mail_subtype_other" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('hr_holidays.model_hr_holidays'))]"/>
+        </record>
     </data>
 </openerp>

=== modified file 'hr_recruitment/hr_recruitment.py'
--- hr_recruitment/hr_recruitment.py	2012-08-27 08:37:05 +0000
+++ hr_recruitment/hr_recruitment.py	2012-09-03 07:28:27 +0000
@@ -457,14 +457,14 @@
         """ Override of the (void) default notification method. """
         if not stage_id: return True
         stage_name = self.pool.get('hr.recruitment.stage').name_get(cr, uid, [stage_id], context=context)[0][1]
-        return self.message_post(cr, uid, ids, body= _("Stage changed to <b>%s</b>.") % (stage_name), context=context)
+        return self.message_post(cr, uid, ids, body= _("Stage changed to <b>%s</b>.") % (stage_name), subtype="stage change", context=context)
 
     def case_get_note_msg_prefix(self, cr, uid, id, context=None):
 		return 'Applicant'
 
     def case_open_send_note(self, cr, uid, ids, context=None):
         message = _("Applicant has been set <b>in progress</b>.")
-        return self.message_post(cr, uid, ids, body=message, context=context)
+        return self.message_post(cr, uid, ids, body=message, subtype="in progress", context=context)
 
     def case_close_send_note(self, cr, uid, ids, context=None):
         if context is None:
@@ -472,23 +472,23 @@
         for applicant in self.browse(cr, uid, ids, context=context):
             if applicant.emp_id:
                 message = _("Applicant has been <b>hired</b> and created as an employee.")
-                self.message_post(cr, uid, [applicant.id], body=message, context=context)
+                self.message_post(cr, uid, [applicant.id], body=message, subtype="closed", context=context)
             else:
                 message = _("Applicant has been <b>hired</b>.")
-                self.message_post(cr, uid, [applicant.id], body=message, context=context)
+                self.message_post(cr, uid, [applicant.id], body=message, subtype="closed", context=context)
         return True
 
     def case_cancel_send_note(self, cr, uid, ids, context=None):
         msg = 'Applicant <b>refused</b>.'
-        return self.message_post(cr, uid, ids, body=msg, context=context)
+        return self.message_post(cr, uid, ids, body=msg, subtype="cancelled", context=context)
 
     def case_reset_send_note(self,  cr, uid, ids, context=None):
         message =_("Applicant has been set as <b>new</b>.")
-        return self.message_post(cr, uid, ids, body=message, context=context)
+        return self.message_post(cr, uid, ids, body=message, subtype="new", context=context)
 
     def create_send_note(self, cr, uid, ids, context=None):
         message = _("Applicant has been <b>created</b>.")
-        return self.message_post(cr, uid, ids, body=message, context=context)
+        return self.message_post(cr, uid, ids, body=message, subtype="new", context=context)
 
 
 class hr_job(osv.osv):

=== modified file 'hr_recruitment/hr_recruitment_data.xml'
--- hr_recruitment/hr_recruitment_data.xml	2012-08-30 14:18:52 +0000
+++ hr_recruitment/hr_recruitment_data.xml	2012-09-03 07:28:27 +0000
@@ -1,16 +1,16 @@
 <?xml version="1.0"?>
 <openerp>
 <data noupdate="1">
-        <!-- notify all employees of module installation -->
-        <record model="mail.message" id="module_install_notification">
-            <field name="model">mail.group</field>
-            <field name="res_id" ref="mail.group_all_employees"/>
-            <field name="type">notification</field>
-            <field name="subject">Recruitment Process application installed!</field>
-            <field name="body">Manage job positions and your company's recruitment process.  This application is integrated with the Survey application to help you define interviews for different jobs.
+    <!-- notify all employees of module installation -->
+    <record model="mail.message" id="module_install_notification">
+        <field name="model">mail.group</field>
+        <field name="res_id" ref="mail.group_all_employees"/>
+        <field name="type">notification</field>
+        <field name="subject">Recruitment Process application installed!</field>
+        <field name="body">Manage job positions and your company's recruitment process.  This application is integrated with the Survey application to help you define interviews for different jobs.
 
 You can automatically receive job application though an email gateway, see the Human Resources settings.</field>
-        </record>
+    </record>
 
     <!-- Meeting Types (for interview meetings) -->
     <record model="crm.meeting.type" id="categ_meet_interview">
@@ -460,6 +460,39 @@
         <field name="alias_model_id" ref="model_hr_applicant"/>
         <field name="alias_user_id" ref="base.user_root"/>
     </record>
-    
+    <!--Data for the sub type -->
+    <record id="mail.mail_subtype_new" model="mail.message.subtype">
+            <field name="name">new</field>
+            <field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
+            <field name="default" eval="False"/>
+    </record>
+    <record id="mail.mail_subtype_closed" model="mail.message.subtype">
+            <field name="name">closed</field>
+            <field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
+    </record>
+    <record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
+        <field name="name">cancelled</field>
+        <field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
+        <field name="default" eval="False"/>
+    </record>
+    <record id="mail.mail_subtype_stage_change" model="mail.message.subtype">
+    <field name="name">stage change</field>
+        <field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
+        <field name="default" eval="False"/>
+    </record>
+    <record id="mail.mail_subtype_in_progress" model="mail.message.subtype">
+        <field name="name">in progress</field>
+        <field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
+        <field name="default" eval="False"/>
+    </record>
+    <record id="mail.mail_subtype_email" model="mail.message.subtype">
+        <field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
+    </record>
+    <record id="mail.mail_subtype_comment" model="mail.message.subtype">
+        <field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
+    </record>
+    <record id="mail.mail_subtype_other" model="mail.message.subtype">
+        <field name="model_ids" eval="[(4,ref('hr_recruitment.model_hr_applicant'))]"/>
+    </record>
 </data>
 </openerp>

=== modified file 'hr_timesheet_invoice/hr_timesheet_invoice.py'
--- hr_timesheet_invoice/hr_timesheet_invoice.py	2012-08-17 10:03:02 +0000
+++ hr_timesheet_invoice/hr_timesheet_invoice.py	2012-09-03 07:28:27 +0000
@@ -95,25 +95,25 @@
     def set_close(self, cr, uid, ids, context=None):
         self.write(cr, uid, ids, {'state':'close'}, context=context)
         message = _("Contract has been <b>closed</b>.")
-        self.message_post(cr, uid, ids, body=message, context=context)
+        self.message_post(cr, uid, ids, body=message, subtype="closed" , context=context)
         return True
 
     def set_cancel(self, cr, uid, ids, context=None):
         self.write(cr, uid, ids, {'state':'cancelled'}, context=context)
         message = _("Contract has been <b>cancelled</b>.")
-        self.message_post(cr, uid, ids, body=message, context=context)
+        self.message_post(cr, uid, ids, body=message, subtype="cancelled", context=context)
         return True
 
     def set_open(self, cr, uid, ids, context=None):
         self.write(cr, uid, ids, {'state':'open'}, context=context)
         message = _("Contract has been <b>opened</b>.")
-        self.message_post(cr, uid, ids, body=message, context=context)
+        self.message_post(cr, uid, ids, body=message, subtype="open", context=context)
         return True
 
     def set_pending(self, cr, uid, ids, context=None):
         self.write(cr, uid, ids, {'state':'pending'}, context=context)
         message = _("Contract has been set as <b>pending</b>.")
-        self.message_post(cr, uid, ids, body=message, context=context)
+        self.message_post(cr, uid, ids, body=message, subtype="pending", context=context)
         return True
 
 account_analytic_account()

=== modified file 'hr_timesheet_invoice/hr_timesheet_invoice_data.xml'
--- hr_timesheet_invoice/hr_timesheet_invoice_data.xml	2011-01-14 00:11:01 +0000
+++ hr_timesheet_invoice/hr_timesheet_invoice_data.xml	2012-09-03 07:28:27 +0000
@@ -16,5 +16,32 @@
             <field name="customer_name">50%</field>
             <field name="factor">50.0</field>
         </record>
+        <record id="mail.mail_subtype_closed" model="mail.message.subtype">
+            <field name="name">closed</field>
+            <field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
+        </record>
+        <record id="mail.mail_subtype_pending" model="mail.message.subtype">
+            <field name="name">pending</field>
+            <field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
+            <field name="default" eval="False"/>
+        </record>
+        <record id="mail.mail_subtype_open" model="mail.message.subtype">
+            <field name="name">open</field>
+            <field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
+        </record>
+        <record id="mail.mail_subtype_cancelled" model="mail.message.subtype">
+            <field name="name">cancelled</field>
+            <field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
+            <field name="default" eval="False"/>
+        </record>
+        <record id="mail.mail_subtype_email" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
+        </record>
+        <record id="mail.mail_subtype_comment" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
+        </record>
+        <record id="mail.mail_subtype_other" model="mail.message.subtype">
+            <field name="model_ids" eval="[(4,ref('hr_timesheet_invoice.model_account_analytic_account'))]"/>
+        </record>
     </data>
 </openerp>

_______________________________________________
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