Mustufa Rangwala (Open ERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-payslip-run-mra into 
lp:openobject-addons.

Requested reviews:
  Mustufa Rangwala (Open ERP) (mra-tinyerp)
  qdp (OpenERP) (qdp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-payslip-run-mra/+merge/75483

Payslip Run:

Add journal_id on payslips.run object and used it in generation of payslips 
from payslip runs.
Minor usabilities issues and code cleaning.

Thanks,
Mustufa 
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-payslip-run-mra/+merge/75483
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-payslip-run-mra.
=== modified file 'hr_payroll/hr_payroll.py'
--- hr_payroll/hr_payroll.py	2011-09-14 14:24:50 +0000
+++ hr_payroll/hr_payroll.py	2011-09-15 05:59:24 +0000
@@ -211,6 +211,7 @@
 class hr_payslip_run(osv.osv):
 
     _name = 'hr.payslip.run'
+    _description = 'Payslip Run'
     _columns = {
         'name': fields.char('Name', size=64, required=True, readonly=True, states={'draft': [('readonly', False)]}),
         'slip_ids': fields.one2many('hr.payslip', 'payslip_run_id', 'Payslips', required=False, readonly=True, states={'draft': [('readonly', False)]}),

=== modified file 'hr_payroll/hr_payroll_view.xml'
--- hr_payroll/hr_payroll_view.xml	2011-09-14 12:31:08 +0000
+++ hr_payroll/hr_payroll_view.xml	2011-09-15 05:59:24 +0000
@@ -663,8 +663,8 @@
             <field name="type">search</field>
             <field name="arch" type="xml">
                 <search string="Search Payslip Runs">
-                    <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft runs"/>
-                    <filter icon="terp-camera_test" string="Done" domain="[('state','=','done')]" help="Done runs"/>
+                    <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Payslip Runs"/>
+                    <filter icon="terp-camera_test" string="Done" domain="[('state','=','close')]" help="Done Payslip Runs"/>
                     <separator orientation="vertical"/>
                     <field name="name"/>
                     <field name="date_start"/>
@@ -683,6 +683,7 @@
                     <field name="date_start"/>
                     <field name="date_end"/>
                     <field name="credit_note"/>
+                    <field name="state"/>
                 </tree>
             </field>
         </record>

=== modified file 'hr_payroll_account/__init__.py'
--- hr_payroll_account/__init__.py	2011-01-14 00:11:01 +0000
+++ hr_payroll_account/__init__.py	2011-09-15 05:59:24 +0000
@@ -21,5 +21,6 @@
 ##############################################################################
 
 import hr_payroll_account
+import wizard
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file

=== modified file 'hr_payroll_account/hr_payroll_account.py'
--- hr_payroll_account/hr_payroll_account.py	2011-07-11 22:40:10 +0000
+++ hr_payroll_account/hr_payroll_account.py	2011-09-15 05:59:24 +0000
@@ -39,6 +39,13 @@
         'journal_id': fields.many2one('account.journal', 'Expense Journal',states={'draft': [('readonly', False)]}, readonly=True, required=True),
         'move_id': fields.many2one('account.move', 'Accounting Entry', readonly=True),
     }
+    
+    def create(self, cr, uid, vals, context=None):
+        if context is None:
+            context = {}
+        if 'journal_id' in context:
+            vals.update({'journal_id': context.get('journal_id')})
+        return super(hr_payslip, self).create(cr, uid, vals, context=context)
 
     def onchange_contract_id(self, cr, uid, ids, date_from, date_to, employee_id=False, contract_id=False, context=None):
         contract_obj = self.pool.get('hr.contract')
@@ -174,5 +181,14 @@
     }
 hr_contract()
 
+class hr_payslip_run(osv.osv):
+
+    _inherit = 'hr.payslip.run'
+    _description = 'Payslip Run'
+    _columns = {
+        'journal_id': fields.many2one('account.journal', 'Expense Journal', states={'draft': [('readonly', False)]}, readonly=True, required=True),
+    }
+
+hr_payslip_run()
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== modified file 'hr_payroll_account/hr_payroll_account_view.xml'
--- hr_payroll_account/hr_payroll_account_view.xml	2011-07-11 16:38:39 +0000
+++ hr_payroll_account/hr_payroll_account_view.xml	2011-09-15 05:59:24 +0000
@@ -51,6 +51,46 @@
                 </xpath>
             </field>
         </record>
-
+        
+    <!-- Payslip Run View -->
+
+        <record id="hr_payslip_run_search_inherit" model="ir.ui.view">
+            <field name="name">hr.payslip.run.search.inherit</field>
+            <field name="model">hr.payslip.run</field>
+            <field name="type">search</field>
+            <field name="inherit_id" ref="hr_payroll.hr_payslip_run_filter"/>
+            <field name="arch" type="xml">
+                <field name="date_end" position="after">
+                	<newline/>
+                    <field name="journal_id" widget="selection"/>
+                </field>
+            </field>
+        </record>
+
+        <record id="hr_payslip_run_tree_inherit" model="ir.ui.view">
+            <field name="name">hr.payslip.run.tree.inherit</field>
+            <field name="model">hr.payslip.run</field>
+            <field name="type">tree</field>
+            <field name="inherit_id" ref="hr_payroll.hr_payslip_run_tree"/>
+            <field name="arch" type="xml">
+                <field name="date_end" position="after">
+                    <field name="journal_id"/>
+                </field>
+            </field>
+        </record>
+
+        <record id="hr_payslip_run_form_inherit" model="ir.ui.view">
+            <field name="name">hr.payslip.run.form.inherit</field>
+            <field name="model">hr.payslip.run</field>
+            <field name="type">form</field>
+            <field name="inherit_id" ref="hr_payroll.hr_payslip_run_form"/>
+            <field name="arch" type="xml">
+                <field name="date_end" position="after">
+                	<newline/>
+                    <field name="journal_id"/>
+                </field>
+            </field>
+        </record>
+        
     </data>
 </openerp>

=== added directory 'hr_payroll_account/wizard'
=== added file 'hr_payroll_account/wizard/__init__.py'
--- hr_payroll_account/wizard/__init__.py	1970-01-01 00:00:00 +0000
+++ hr_payroll_account/wizard/__init__.py	2011-09-15 05:59:24 +0000
@@ -0,0 +1,25 @@
+#-*- coding:utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution    
+#    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+#    d$
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import hr_payroll_payslips_by_employees
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file

=== added file 'hr_payroll_account/wizard/hr_payroll_payslips_by_employees.py'
--- hr_payroll_account/wizard/hr_payroll_payslips_by_employees.py	1970-01-01 00:00:00 +0000
+++ hr_payroll_account/wizard/hr_payroll_payslips_by_employees.py	2011-09-15 05:59:24 +0000
@@ -0,0 +1,40 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import  osv
+
+class hr_payslip_employees(osv.osv_memory):
+
+    _inherit ='hr.payslip.employees'
+    
+    def compute_sheet(self, cr, uid, ids, context=None):
+        run_pool = self.pool.get('hr.payslip.run')
+        if context is None:
+            context = {}
+        if context and context.get('active_id', False):
+            run_data = run_pool.read(cr, uid, context['active_id'], ['journal_id'])
+        journal_id =  run_data.get('journal_id', False)[0]
+        context.update({'journal_id': journal_id})
+        return super(hr_payslip_employees, self).compute_sheet(cr, uid, ids, context=context)
+
+hr_payslip_employees()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file

_______________________________________________
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