Merge lp:~openerp-dev/openobject-addons/trunk-bug-1021130-amp into lp:openobject-addons

Proposed by Amit Parik
Status: Rejected
Rejected by: Fabien (Open ERP)
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1021130-amp
Merge into: lp:openobject-addons
Diff against target: 27 lines (+1/-9)
1 file modified
hr_payroll/hr_payroll.py (+1/-9)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1021130-amp
Reviewer Review Type Date Requested Status
Fabien (Open ERP) Disapprove
Review via email: mp+120962@code.launchpad.net

Description of the change

Hello,

Fixes the copy method problem on this branch.
Salary structure has a 'rule_ids" m2m field, but we have written a copy method before adding this m2m field, that's why when we have duplicating "Salary Structure" it gives a traceback.

This fix will solve this problem. But this should be also fix form server side when we have inherit the object which have already defined the copy method then this type of traceback will generated. I will post this bug on server side too.

Thank you!

To post a comment you must log in.
Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

you can not define the many2many field before having defined the related object.
I also don't think it's the reason of the crash.

review: Disapprove

Unmerged revisions

7009. By Amit Parik

[FIX] hr_payroll : Improved the fix

7008. By Amit Parik

[MERGE]: Merge with lp:openobject-addons

7007. By Amit Parik

[FIX] hr_payroll : Fixes the copy method problem on salary structure

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_payroll/hr_payroll.py'
2--- hr_payroll/hr_payroll.py 2012-08-07 11:31:37 +0000
3+++ hr_payroll/hr_payroll.py 2012-08-23 10:49:46 +0000
4@@ -51,6 +51,7 @@
5 'note': fields.text('Description'),
6 'parent_id':fields.many2one('hr.payroll.structure', 'Parent'),
7 'children_ids':fields.one2many('hr.payroll.structure', 'parent_id', 'Children'),
8+ 'rule_ids':fields.many2many('hr.salary.rule', 'hr_structure_salary_rule_rel', 'struct_id', 'rule_id', 'Salary Rules'),
9 }
10
11 def _get_parent(self, cr, uid, context=None):
12@@ -947,15 +948,6 @@
13
14 hr_payslip_line()
15
16-class hr_payroll_structure(osv.osv):
17-
18- _inherit = 'hr.payroll.structure'
19- _columns = {
20- 'rule_ids':fields.many2many('hr.salary.rule', 'hr_structure_salary_rule_rel', 'struct_id', 'rule_id', 'Salary Rules'),
21- }
22-
23-hr_payroll_structure()
24-
25 class hr_employee(osv.osv):
26 '''
27 Employee

Subscribers

People subscribed via source and target branches

to all changes: