← Back to team overview

openerp-india team mailing list archive

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

 

Public bug reported:

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.

** Affects: openobject-addons
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1096439

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

Status in OpenERP Addons (modules):
  New

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.

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


Follow ups

References