error "You cannot remove/deactivate an account which is set on a customer or supplier." is not helpful or correct
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_
5 | property_
(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_
1948 | product.category | property_
(2 rows)
The responsible code is here: http://
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
- Phil Frost (community): Disapprove
- OpenERP Core Team: Pending requested
-
Diff: 12 lines (+1/-1)1 file modifiedaccount/account.py (+1/-1)
Changed in openobject-addons: | |
assignee: | nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3) |
importance: | Undecided → Low |
status: | New → Confirmed |
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