Valencia Rodrigues (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-opw-6348-vro into 
lp:openobject-addons/6.0.

Requested reviews:
  Jay Vora (OpenERP) (jvo-openerp)
  Anup(OpenERP) (ach-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-6348-vro/+merge/66067

'Company Contribution' was never being calculated or stored during salary 
computation, despite the presence of the field in the structure and view.

Steps to reproduce:
1. Create a company contribution linked to a salary head from Human 
Resources/Configuration/Payroll/Company Contributions.
2. Include the salary head in a salary structure.
3. Include the salary structure in a contract and assign this contract to a 
user.
4. Create a pay slip for this user from Human Resources/Payroll/Employee 
Payslip.
5. Click "Compute Sheet" (or "Recompute Sheet"). This generates pay slip lines.
6. In the pay slip lines, check the field "Company Contribution".

This revision fixes the issue.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-6348-vro/+merge/66067
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-opw-6348-vro.
=== modified file 'hr_payroll/hr_payroll.py'
--- hr_payroll/hr_payroll.py	2011-01-14 00:11:01 +0000
+++ hr_payroll/hr_payroll.py	2011-06-28 05:08:27 +0000
@@ -852,7 +852,16 @@
                     others += amount
                 elif line.type == 'otherpay':
                     others += amount
-                slip_line_obj.write(cr, uid, [line.id], {'total':amount}, context=context)
+
+                company_contrib = 0.0
+                company_contrib_item = 0.0
+                register_pool = self.pool.get('company.contribution')
+                for contrib_line in line.category_id.contribute_ids:
+                    if contrib_line.register_id:
+                        company_contrib_item = register_pool.compute(cr, uid, contrib_line.id, amount, context)
+                    company_contrib += company_contrib_item
+
+                slip_line_obj.write(cr, uid, [line.id], {'total':amount, 'company_contrib':company_contrib}, context=context)
 
             record = {
                 'allounce':allow,

_______________________________________________
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