Khushboo Bhatt(openerp) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-polish2_analysis_view_hr_holidays-kbh 
into lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-polish2_analysis_view_hr_holidays-kbh/+merge/82140

==== summury ===
==hr_holidays  Analysis Report ===

* changes in hr_holidays.py
 - added year and month columns in hr_holidays class.

*changes in hr_holidays_view.xml
 - added year and month-1 fields which are referenced from hr_holidays.py.
 - putting separator between year and month button in search view.

*changes in available_holidays_view.xml
 - make the year,month button Default_search_year:1,Default_search_month:1 in 
these files.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-polish2_analysis_view_hr_holidays-kbh/+merge/82140
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-polish2_analysis_view_hr_holidays-kbh.
=== modified file 'hr_holidays/hr_holidays.py'
--- hr_holidays/hr_holidays.py	2011-11-14 12:22:44 +0000
+++ hr_holidays/hr_holidays.py	2011-11-14 13:19:44 +0000
@@ -111,6 +111,10 @@
 
     _columns = {
         'name': fields.char('Description', required=True, size=64),
+        'year': fields.char('Year', size=4, readonly=True),
+        'month': fields.selection([('01', 'January'), ('02', 'February'), ('03', 'March'), ('04', 'April'),
+            ('05', 'May'), ('06', 'June'), ('07', 'July'), ('08', 'August'), ('09', 'September'),
+            ('10', 'October'), ('11', 'November'), ('12', 'December')], 'Month', readonly=True),
         'state': fields.selection([('draft', 'New'), ('confirm', 'Waiting Approval'), ('refuse', 'Refused'),
             ('validate1', 'Waiting Second Approval'), ('validate', 'Approved'), ('cancel', 'Cancelled')],
             'State', readonly=True, help='The state is set to \'Draft\', when a holiday request is created.\
@@ -378,10 +382,10 @@
    def _get_remaining_days(self, cr, uid, ids, name, args, context=None):
         cr.execute("""SELECT
                 sum(h.number_of_days) as days,
-                h.employee_id 
+                h.employee_id
             from
                 hr_holidays h
-                join hr_holidays_status s on (s.id=h.holiday_status_id) 
+                join hr_holidays_status s on (s.id=h.holiday_status_id)
             where
                 h.state='validate' and
                 s.limit=False and

=== modified file 'hr_holidays/hr_holidays_view.xml'
--- hr_holidays/hr_holidays_view.xml	2011-11-09 18:12:56 +0000
+++ hr_holidays/hr_holidays_view.xml	2011-11-14 13:19:44 +0000
@@ -8,12 +8,19 @@
             <field name="arch" type="xml">
                 <search string="Search Leave">
                     <group>
+                        <filter icon="terp-go-year" name="year" string="Year"
+                            domain="[('year','=',time.strftime('%%Y'))]"/>
+                        <separator orientation="vertical"/>
+                        <filter string="Month" icon="terp-go-month" name="This Month" domain="[('date_from','&lt;=',(datetime.date.today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('date_from','&gt;=',(datetime.date.today()-relativedelta(day=1)).strftime('%%Y-%%m-%%d'))]"/>
+
+                        <filter icon="terp-go-month" string="    Month-1    "
+                            domain="[('create_date','&lt;=', (datetime.date.today() - relativedelta(day=31, months=1)).strftime('%%Y-%%m-%%d')),('create_date','&gt;=',(datetime.date.today() - relativedelta(day=1,months=1)).strftime('%%Y-%%m-%%d'))]"/>
+                        <separator orientation="vertical"/>
+
                         <filter icon="terp-check" domain="[('state','=','draft')]" string="To Confirm"/>
                         <filter icon="terp-camera_test" domain="[('state','=','confirm')]" string="To Approve" name="approve"/>
                         <filter icon="terp-camera_test" domain="[('state','=','validate')]" string="Validated" name="validated"/>
                         <separator orientation="vertical"/>
-                        <filter string="This Month" icon="terp-go-month" name="This Month" domain="[('date_from','&lt;=',(datetime.date.today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('date_from','&gt;=',(datetime.date.today()-relativedelta(day=1)).strftime('%%Y-%%m-%%d'))]"/>
-                        <separator orientation="vertical"/>
                         <field name="employee_id">
                             <filter icon="terp-personal" name="my_leaves" domain="[('employee_id.user_id','=', uid)]" help="My Leaves"/>
                         </field>

=== modified file 'hr_holidays/report/available_holidays_view.xml'
--- hr_holidays/report/available_holidays_view.xml	2011-01-21 06:59:40 +0000
+++ hr_holidays/report/available_holidays_view.xml	2011-11-14 13:19:44 +0000
@@ -8,15 +8,15 @@
             <field name="view_type">form</field>
             <field name="view_mode">tree,form</field>
             <field name="view_id" eval="view_holiday_simple"/>
-            <field name="context">{'search_default_group_employee': 1, 'search_default_group_type': 1}</field>
+            <field name="context">{"search_default_year": 1,"search_default_This Month": 1,'search_default_group_employee': 1, 'search_default_group_type': 1}</field>
             <field name="domain">[('holiday_type','=','employee')]</field>
             <field name="search_view_id" ref="view_hr_holidays_filter"/>
         </record>
 
         <menuitem
-            name="Leaves Analysis" 
-            id="menu_hr_available_holidays_report_tree" 
-            action="action_hr_available_holidays_report" 
+            name="Leaves Analysis"
+            id="menu_hr_available_holidays_report_tree"
+            action="action_hr_available_holidays_report"
             parent="menu_hr_reporting_holidays"/>
 
 

_______________________________________________
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