← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 789984] Re: Wrong effective date on journal entry when importing invoices in bank statement

 

** Changed in: openobject-addons
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP Project Group.
https://bugs.launchpad.net/bugs/789984

Title:
  Wrong effective date on journal entry when importing invoices in bank
  statement

Status in OpenERP Addons (modules):
  Fix Released

Bug description:
  When you have account_payment (depends on account_voucher) installed
  you can select invoices into a bank statement. When you confirm the
  bank statement effective date of the journal entries generated are
  wrong. Now effective date is the date of an invoice but it obviously
  should be the date of the bank statement line.

  <speculation>
  The problem is originated in account_voucher module file account_voucher.py where account.bank.statement method create_move_from_st_line is overwritten. If a statement line have voucher_id the method does not create account_move_line with correct date but instead updates already existing account_move_line object. It only updates statement_id value but not date. 
  There is a obvious reason not to set new date in that module; account_move_line object does not let you change date in lines which are not in draft state. 

  With following patches journal entries works as expected. But
  overwriting write -method in account_move_line and let a date to be
  changed is not a good idea for sure.

  account_voucher/account_voucher.py
  951c951
  <             return move_line_obj.write(cr, uid, [x.id for x in v.move_ids], {'statement_id': st_line.statement_id.id}, context=context)
  ---
  >             return move_line_obj.write(cr, uid, [x.id for x in v.move_ids], {'statement_id': st_line.statement_id.id, 'date': st_line.date}, context=context)

  account/account_move_line.py
  1139c1139
  <             if ('account_id' in vals) or ('journal_id' in vals) or ('period_id' in vals) or ('move_id' in vals) or ('debit' in vals) or ('credit' in vals) or ('date' in vals):
  ---
  >             if ('account_id' in vals) or ('journal_id' in vals) or ('period_id' in vals) or ('move_id' in vals) or ('debit' in vals) or ('credit' in vals):

  </speculation>

  The OpenERP version I'm using is 6.0.2

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/789984/+subscriptions


References