[6.1 stable] l10n_fr_rib : Cannot create a bank account!

Bug #1016690 reported by Quentin THEURET @Amaris
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP Publisher's Warranty Team

Bug Description

[Stable version on 22, June 2012 from openerp.com]

I cannot create a bank account from the configuration menu.

I went to 'Configuration' menu, on the dashboard, I click on 'Configure Bank account'. Fill the bank account form and click to save. I had this traceback :
Traceback (most recent call last):
  File "/home/quentin/Development/OpenERP/Stable/6.1/openerp-server/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/quentin/Development/OpenERP/Stable/6.1/openerp-server/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/quentin/Development/OpenERP/Stable/6.1/openerp-server/openerp/osv/osv.py", line 164, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/quentin/Development/OpenERP/Stable/6.1/openerp-server/openerp/addons/base_iban/base_iban.py", line 88, in create
    return super(res_partner_bank, self).create(cr, uid, vals, context)
  File "/home/quentin/Development/OpenERP/Stable/6.1/openerp-server/openerp/addons/account/account_bank.py", line 34, in create
    self.post_write(cr, uid, [result], context=context)
  File "/home/quentin/Development/OpenERP/Stable/6.1/openerp-server/openerp/addons/account/account_bank.py", line 70, in post_write
    name = self._prepare_name(bank)
  File "/home/quentin/Development/OpenERP/Stable/6.1/openerp-server/openerp/addons/account/account_bank.py", line 44, in _prepare_name
    return (bank.bank_name or '') + ' ' + bank.acc_number
TypeError: coercing to Unicode: need string or buffer, bool found
2012-06-22 18:53:27,928 6120 ERROR ? openerp.netsvc: coercing to Unicode: need string or buffer, bool found

Please see the attached screencast for more explanations.

Revision history for this message
Quentin THEURET @Amaris (qtheuret) wrote :
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Quentin,

This error traceback will raised only when acc_number is passed as a "False".
As I see the acc_number is required ('acc_number': fields.char('Account Number', size=64, required=True),) So It will never passed as a False.

Have you customize the code..? Or install any extra module..?

Thanks and waiting for your reply!

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Quentin THEURET @Amaris (qtheuret) wrote :

Hello Amit,

No, I use the orginial code from OpenERP. I didn't install some extra modules, just base and account.

Changed in openobject-addons:
status: Incomplete → Confirmed
importance: Undecided → Medium
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

Quentin,

I confirm the bug but this does not happen on base+account modules.

Looking at your video, its more clear that you are using l10n_fr_rib module.

This module is altering the manatoriness of the acc_number to be False.

Look at the revision: http://bazaar.launchpad.net/~openerp/openobject-addons/6.1/revision/6427.1.1

Hence, the possible solutions could be:
1. Setting the field back to required True.
2. Point 1 could be said as wrong because the rib module does not need acc_number anymore.
3. However, altering the not null constraint on 'base' field is not to advisable although the RIB module does not need it.
4. Set a default value on acc_number and hide it from the view if this helps. But again, point 3 would block us.
5. Override _prepare_name() and replace acc_number by rib.
6. But again, for 'Normal Account Type', the acc_number should be available for entry.

Hence,I recommend :
Point 5 and point 6(use attrs).

Lets hear for the voice of community and decision can be made later on.

Thanks,
Serpent Consulting Services.

summary: - [6.1 stable] Cannot create a bank account
+ [6.1 stable] l10n_fr_rib : Cannot create a bank account!
Revision history for this message
Dominique Chabord (dominique-chabord) wrote :

Hello,

any chance to get fix integrated ?
thank you

Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

Akretion team needs to share the comments here.

Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

As this module has been added by Alexis, Its necessary to know his opinion.

Thanks.

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

As explained previously by Serpent CS, l10n_fr_rib removes the required attribute on the acc_number field, which kind of breaks the encapsulation principle. This should be changed eventually, but probably requires deeper changes that would not be acceptable in stable versions.
In the meantime, a quick fix is to be more lenient with missing acc_number values in the core addons.

The quick fix was applied in addons 7.0 at revision 8635 revision-id: <email address hidden>.

Thanks for reporting!

Note: closing the bug, the OPW team can still backport the fix in 6.1 for any customer requesting it.

Changed in openobject-addons:
milestone: none → 7.0
status: Confirmed → Fix Released
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

Thanks Olivier!

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.