Merge lp:~openerp-dev/openobject-addons/trunk-bug-891532-bde into lp:openobject-addons

Proposed by Bharat Devnani (Open ERP)
Status: Merged
Merged at revision: 5743
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-891532-bde
Merge into: lp:openobject-addons
Diff against target: 54 lines (+15/-6)
1 file modified
hr_payroll_account/hr_payroll_account.py (+15/-6)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-891532-bde
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+82528@code.launchpad.net

Description of the change

Hello Sir,

I have made copy method in hr_payroll_account/hr_payroll_account.py inorder to make move_id field false when the payslip is duplicated.

Thanks & Regards,
Devnani Bharat R.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hr_payroll_account/hr_payroll_account.py'
--- hr_payroll_account/hr_payroll_account.py 2011-11-11 21:11:27 +0000
+++ hr_payroll_account/hr_payroll_account.py 2011-11-17 13:04:58 +0000
@@ -39,7 +39,16 @@
39 'journal_id': fields.many2one('account.journal', 'Expense Journal',states={'draft': [('readonly', False)]}, readonly=True, required=True),39 'journal_id': fields.many2one('account.journal', 'Expense Journal',states={'draft': [('readonly', False)]}, readonly=True, required=True),
40 'move_id': fields.many2one('account.move', 'Accounting Entry', readonly=True),40 'move_id': fields.many2one('account.move', 'Accounting Entry', readonly=True),
41 }41 }
42 42
43 def copy(self, cr, uid, id, default=None, context=None):
44 if default is None:
45 default = {}
46 default = default.copy()
47 default.update({
48 'move_id': False
49 })
50 return super(hr_payslip, self).copy(cr, uid, id, default, context=context)
51
43 def create(self, cr, uid, vals, context=None):52 def create(self, cr, uid, vals, context=None):
44 if context is None:53 if context is None:
45 context = {}54 context = {}
@@ -95,9 +104,9 @@
95 partner_id = False104 partner_id = False
96 debit_account_id = line.salary_rule_id.account_debit.id105 debit_account_id = line.salary_rule_id.account_debit.id
97 credit_account_id = line.salary_rule_id.account_credit.id106 credit_account_id = line.salary_rule_id.account_credit.id
98 107
99 if debit_account_id:108 if debit_account_id:
100 109
101 debit_line = (0, 0, {110 debit_line = (0, 0, {
102 'name': line.name,111 'name': line.name,
103 'date': timenow,112 'date': timenow,
@@ -113,9 +122,9 @@
113 })122 })
114 line_ids.append(debit_line)123 line_ids.append(debit_line)
115 debit_sum += debit_line[2]['debit'] - debit_line[2]['credit']124 debit_sum += debit_line[2]['debit'] - debit_line[2]['credit']
116 125
117 if credit_account_id:126 if credit_account_id:
118 127
119 credit_line = (0, 0, {128 credit_line = (0, 0, {
120 'name': line.name,129 'name': line.name,
121 'date': timenow,130 'date': timenow,
@@ -147,7 +156,7 @@
147 'credit': debit_sum - credit_sum,156 'credit': debit_sum - credit_sum,
148 })157 })
149 line_ids.append(adjust_credit)158 line_ids.append(adjust_credit)
150 159
151 elif debit_sum < credit_sum:160 elif debit_sum < credit_sum:
152 acc_id = slip.journal_id.default_debit_account_id.id161 acc_id = slip.journal_id.default_debit_account_id.id
153 if not acc_id:162 if not acc_id:

Subscribers

People subscribed via source and target branches

to all changes: