error "You cannot remove/deactivate an account which is set on a customer or supplier." is not helpful or correct

Bug #1096439 reported by Phil Frost
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Low
OpenERP R&D Addons Team 3

Bug Description

To reproduce:

- install 7.0
- install the account application
- in the account setup wizard, use the "Custom" CoA
- attempt to delete the account "Product Sales" or "Expenses"

The following error is displayed:

"Warning!

You cannot remove/deactivate an account which is set on a customer or supplier."

There are two things wrong with this. Firstly, though it seems pretty clear what the problem is, it doesn't give the user enough information to do anything about it. What customer or supplier is referencing the account?

Secondly, it's actually not even a customer or supplier that's referencing the account, contrary to the error. Actually, it's referenced by a product category:

# select id, name from account_account where name in ('Product Sales', 'Expenses');
 id | name
-----+---------------
  19 | Product Sales
  23 | Expenses
(2 rows)

# select id, name, type, fields_id, value_reference, res_id from ir_property where value_reference like '%23' or value_reference like '%19';
 id | name | type | fields_id | value_reference | res_id
----+--------------------------------+----------+-----------+--------------------+--------
  4 | property_account_expense_categ | many2one | 1947 | account.account,23 |
  5 | property_account_income_categ | many2one | 1948 | account.account,19 |
(2 rows)

# select id, model, name, relation, field_description from ir_model_fields where id in (1947, 1948);
  id | model | name | relation | field_description
------+------------------+--------------------------------+-----------------+-------------------
 1947 | product.category | property_account_expense_categ | account.account | Expense Account
 1948 | product.category | property_account_income_categ | account.account | Income Account
(2 rows)

The responsible code is here: http://bazaar.launchpad.net/~openerp/openobject-addons/7.0/view/head:/account/account.py#L637

The code there says "Checking whether the account is set as a property to any Partner or not" but actually just checks for any property at all.

Related branches

Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Hiral Patel (OpenERP) (hip-openerp) wrote :

Hello,

           It has been Fixed in http://bazaar.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1096439-hip
           Revno: 8496
           Revision ID: <email address hidden>

Thanks,
hip

Changed in openobject-addons:
status: Confirmed → Fix Committed
Revision history for this message
Phil Frost (bitglue) wrote :

The proposed change just changes a wrong error to a vague one. A user does not know what a "property" is, and it doesn't address the problem that the error does not give the user enough information to do anything about the error. I had to dig manually through the database to find out specifically which thing was referencing the account I was attempting to delete. This is beyond most users; they will expect the error message to tell them what they need to do if they want to delete the account.

Revision history for this message
Devvyn Murphy (devvyn) wrote :

Changing the phrasing of the error message to something more technical and less specific does not fix the bug. Perhaps making the error message more verbose and specific would go a long way toward preventing end users from pulling out their hair in confused frustration. A drilldown on the problem object would be ideal.

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.