Rifakat (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-bug-836526-rha into 
lp:openobject-addons/6.0.

Requested reviews:
  Raphael Collet (OpenERP) (rco-openerp)
Related bugs:
  Bug #836526 in OpenERP Addons: "Error when paying an employee payslip"
  https://bugs.launchpad.net/openobject-addons/+bug/836526

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-bug-836526-rha/+merge/77511

Hello,

Removed reference of expense_id from hr_payroll_account for hr.payslip as there 
no more reference field for expense.

Regards,
Rifakat
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-bug-836526-rha/+merge/77511
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-bug-836526-rha.
=== modified file 'hr_payroll_account/hr_payroll_account.py'
--- hr_payroll_account/hr_payroll_account.py	2011-07-21 13:33:14 +0000
+++ hr_payroll_account/hr_payroll_account.py	2011-09-29 12:15:45 +0000
@@ -326,24 +326,17 @@
             other_pay = slip.other_pay
             #Process all Reambuse Entries
             for line in slip.line_ids:
-                if line.type == 'otherpay' and line.expanse_id.invoice_id:
-                    if not line.expanse_id.invoice_id.move_id:
-                        raise osv.except_osv(_('Warning !'), _('Please Confirm all Expense Invoice appear for Reimbursement'))
-                    invids = [line.expanse_id.invoice_id.id]
+                if line.type == 'otherpay':
                     amount = line.total
                     acc_id = slip.bank_journal_id.default_credit_account_id and slip.bank_journal_id.default_credit_account_id.id
                     period_id = slip.period_id.id
                     journal_id = slip.bank_journal_id.id
                     name = '[%s]-%s' % (slip.number, line.name)
-                    invoice_pool.pay_and_reconcile(cr, uid, invids, amount, acc_id, period_id, journal_id, False, period_id, False, context, name)
                     other_pay -= amount
                     #TODO: link this account entries to the Payment Lines also Expense Entries to Account Lines
                     l_ids = movel_pool.search(cr, uid, [('name','=',name)], context=context)
                     line_ids += l_ids
 
-                    l_ids = movel_pool.search(cr, uid, [('invoice','=',line.expanse_id.invoice_id.id)], context=context)
-                    exp_ids += l_ids
-
             #Process for Other payment if any
             other_move_id = False
             if slip.other_pay > 0:
@@ -642,7 +635,6 @@
                         'category_id':exp.category_id.id,
                         'amount':exp.amount,
                         'slip_id':slip.id,
-                        'expanse_id':exp.id,
                         'account_id':acc
                     }
                     payslip_pool.create(cr, uid, exp_res, context=context)

_______________________________________________
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