[6.1 / 7.0 / trunk] bank statements with the duplicate numbers

Bug #1094227 reported by Stéphane Bidoul (Acsone)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Low
OpenERP R&D Addons Team 3

Bug Description

I tested this with 6.1 and 7.0 but it probably applies to 6.0 and trunk too.

When the user creates a bank statement, he can assign the bank statement number manually. When the bank statement is confirmed, the generated accounting entries are derived from the bank statement number by appending /+number. There is no constraint preventing two bank statements to have the same number, therefore it becomes possible to have journal entries with the same number too.

How to reproduce:
- 7.0 with demo data
- create a bank statement with one item and give it the name BS1 (instead of the default /)
- create a second bank statement with on item and give it the same name BS1 (instead of the default /)
- confirm both bank statements
-> two accounting entries with the same number BS1/1 are generated

Proposed fix: add the following constraint on account_bank_statement:

    _sql_constraints = [
        ('name_journal_uniq', 'unique (name,journal_id)', 'The name of the Bank Statement must be unique per journal !')
    ]

-sbi

Related branches

Changed in openobject-addons:
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

Hello,

IMO, the importance should be higher than "low", since this can possibly created a corrupted accounting database.

-sbi

Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Dharti Ratani(OpenERP) (dhr-openerp) wrote :

Hello,

         Fixed in branch : https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1094227-dhr and will besoon merged in trunk.
         Rev no : 8489
         Revid : <email address hidden>

Thanks

Changed in openobject-addons:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.