← Back to team overview

openerp-india team mailing list archive

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

 

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.

-- 
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):
  Fix Committed

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


References