[trunk] Chart of Account Configuration wizard may fail if executed from Accounting > Configuration menu)

Bug #535157 reported by Omar (Pexego)
68
This bug affects 12 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Medium
Nicolas Vanhoren (OpenERP)
Declined for Trunk by Xavier (Open ERP)

Bug Description

It's not possible to use the "Generate chart of Accounts from a Chart Template" wizard (wizard.multi.charts.accounts) directly, it only works if used during the installation.

Full description:

The wizard "Generate chart of Accounts from a Chart Template" of account module inherits of res.config, this wizard not is an installation wizard, when you finish to install account you can generate your accounts with this wizard, the installation or configuration was completed then when you execute this wizard it executes action_next with next button, in first line of this function call to _set_previous_todo(cr, uid, state='done') and in this function (_set_previous_todo) executes:
previous_todo = self._next_action(cr, uid) this function it searches for open ir.actions.todo but as I said before the installation is finised and it doesn't found anything open then the behavior is:
 if not previous_todo:
      raise LookupError(_("Couldn't find previous ir.actions.todo"))

And the wizard doesn't continue. I think it is an bug in this behavior or in the wizard that mustn't inherit of res.config.

Thanks

Tags: pexego
Revision history for this message
Omar (Pexego) (omar7r) wrote :
summary: - [base trunk] incorrect behavior about previous ir.action.todo
+ [base trunk] incorrect behavior about previous ir.actions.todo
Changed in openobject-server:
importance: Undecided → Medium
milestone: none → 6.0
status: New → Confirmed
Changed in openobject-server:
assignee: nobody → Xavier (Open ERP) (xmo)
summary: - [base trunk] incorrect behavior about previous ir.actions.todo
+ [Trunk] Configuration wizard fails if no next action is available!
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote : Re: [Trunk] Configuration wizard fails if no next action is available!

> this wizard not is an installation wizard, when you finish to install account you can generate your accounts with this wizard, the installation or configuration was completed

Nope. This wizard is a configuration item (hence inheriting from res.config, in fact it installs chart of accounts and is thus an installer) and it's part of the initial configuration. Same as every other res.config.

> this function it searches for open ir.actions.todo but as I said before the installation is finised and it doesn't found anything

It should find something: the res.config generating charts of accounts, whose state hasn't been changed yet. Otherwise it would not have executed that config item in the first place.

Further, I can not reproduce this issue at this point. This might have been a bug in the early days of the new config. Do you still have this problem?

Revision history for this message
camellzone (camellzone) wrote :

With the last modules and server updates, the issue continue happening, at lest when launch wizard for generate chart of accounts.
For reproduce this, create database with CRM only, after install account module and launch the wizard.

Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

Any progress on this? This seems to be broking the Spanish localization since 5.2dev, as the chart of accounts can't be created properly on 6.0dev.

Revision history for this message
Carlos Liebana (carlos-liebana) wrote :

I think this bug is not Medium, but High or Critical.

Thanks.

Revision history for this message
Susana (sizquierdo-gmail) wrote :

Tihis bug is critical for spanish localization.

Revision history for this message
Raimon Esteve (www.zikzakmedia.com) (resteve) wrote :

spanish localization :(

Revision history for this message
camellzone (camellzone) wrote :

Not only for spanish localization, for example, if skip generation of accounts after is impossible generation this relaunch the wizard.

Revision history for this message
Julian Robbins (joolsr) wrote :

Yes I have had this bug too with English British locales set.

Revision history for this message
tchiboo (tchiboo) wrote :

I have a such problem, and this error :

Traceback (most recent call last):
  File "/home/entreprises/openobject-server/bin/netsvc.py", line 435, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "/home/entreprises/openobject-server/bin/service/web_services.py", line 586, in dispatch
    res = fn(db, uid, *params)
  File "/home/entreprises/openobject-server/bin/osv/osv.py", line 57, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/entreprises/openobject-server/bin/osv/osv.py", line 133, in execute
    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/entreprises/openobject-server/bin/osv/osv.py", line 123, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/entreprises/openobject-server/bin/osv/orm.py", line 2058, in create
    self._columns[field].set_memory(cr, self, id_new, field, vals[field], user, context)
  File "/home/entreprises/openobject-server/bin/osv/fields.py", line 404, in set_memory
    if act[0] == 0:
KeyError: 0

(appearing when I try to create the chart of accounts)

Revision history for this message
tchiboo (tchiboo) wrote :

Hi,

I've this error in french too.

Revision history for this message
Renato Lima - http://www.akretion.com (renatonlima) wrote :

Hello,

We can't load brazilian account chart too :-(

summary: - [Trunk] Configuration wizard fails if no next action is available!
+ [trunk] Configuration wizard fails if no next action is available!
+ (cannot create chart of accounts)
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote : Re: [trunk] Configuration wizard fails if no next action is available! (cannot create chart of accounts)

Errors on the Generate Chart of Accounts screen using the *web* client have absolutely nothing to do with this issue, or with installation wizards, it's a bug in the web client. If things break with a KeyError in the web client when trying to load a chart of account, it's a web client issue, not an issue with configuration wizards. Try the exact same screen in the GTK client, it will work.

See https://bugs.launchpad.net/openobject-client-web/+bug/611467 for this web client bug.

If *that* is the actual issue, I'm closing this bug as invalid. If it's not, feel free to reopen it and fix the description.

Changed in openobject-server:
status: Confirmed → Invalid
Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

Xavier:

The problem is not on the web client, when this bug was reported the web client wasn't even usable... This was tested with the GTK client.

tchiboo is confirming this bug, plus commenting that he has also the bug 611467 ("I have a such problem, and this error"), so they are two different bugs, this one is as valid as the other one.

The problem here is that the "create chart of accounts" wizard only works from the installation screen, it doesn't work afterwards cause it raises a "Couldn't find previous ir.actions.todo" exception if the wizard is called alone!

There are localizations (like the Spanish one) that require the chart of accounts to be created *after* the installation, PLUS, with this bug you cannot create multiple chart of accounts or add a new chart of accounts to a company with demo data.

A lot of people has confirmed this bug, so please, take the time to read the bug description next time.

Changed in openobject-server:
status: Invalid → Confirmed
summary: [trunk] Configuration wizard fails if no next action is available!
- (cannot create chart of accounts)
+ (cannot create chart of accounts after installation)
description: updated
description: updated
Revision history for this message
tchiboo (tchiboo) wrote : Re: [trunk] Configuration wizard fails if no next action is available! (cannot create chart of accounts after installation)

any news ?

Revision history for this message
Santi Argüeso(Pexego) (santiago-pexego) wrote :

What about this?. No news?. I think it is not so dificult to fix.

Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

@Borja López Soilán

First, I would like to thank your for your additional input on this matter.

Second, considering you seem quite anal on parsing comments you might want to note the following from mine:
> If that is the actual issue
The curt reply was therefore unrequired, especially in the light of

Third,
> A lot of people has confirmed this bug, so please, take the time to read the bug description next time.
I did and that is the issue, and that is also why complete repro cases can be the difference between a bug rotting or being fixed: the report is technically incorrect. To wit:

> It's not possible to use the "Generate chart of Accounts from a Chart Template" wizard (wizard.multi.charts.accounts) directly, it only works if used during the installation.

It is and has always been possible to directly relaunch any configuration wizard at any moment from Administration > Configuration > Configuration Wizards.

What does not work is to launch this specific wizard it via Accounting > Configuration > Templates. I am guessing this contributed to this issue not being given extreme amounts of attention considering the wizard was re-executable.

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

Some more info: this issue occurs only when you try to open an installer wizard while all ir.actions.todo entries are marked as "done". This does not look like a showstopper for developing the localization module itself.

Quick manual workaround: mark the corresponding "config wizard" as "Todo" in Administration > Configuration > Configuration Wizard. You may also start it directly from there.

Proper workaround: instead of opening the view directly, the menuitem in the Accounting Configuration (currently named "New Company Financial Settings") should be a server action (like the one that launches the config wizard in Administration > Configuration > Start Configuration) that marks the corresponding ir.actions.todo entries as "todo" and only afterwards opens the view.

@Nicolas: can you make this change? (reassigning to you)

Now it would be quite interesting to know why the spanish localization needs to install its charts of accounts *after* Accounting module has been installed. Normally it should simply be detected and displayed in the list of available Charts of Accounts, and do its job from the main account installer. Anyone shed some light here?

Thanks!

PS: moved to openobject-addons, this is not a bug in the server as far as I can see

affects: openobject-server → openobject-addons
Changed in openobject-addons:
assignee: Xavier (Open ERP) (xmo) → Nicolas Vanhoren (niv-openerp)
milestone: 6.0 → none
status: Confirmed → In Progress
milestone: none → 6.0
summary: - [trunk] Configuration wizard fails if no next action is available!
- (cannot create chart of accounts after installation)
+ [trunk] Chart of Account Configuration wizard may fail if executed from
+ Accounting > Configuration menu)
Revision history for this message
Omar (Pexego) (omar7r) wrote :

Hi,

This bug is in the server because, the bug is in base module.

If you don't want fix this bug with the patch, you should show an exception with this information, it shouldn't break.
I think that, it doesn't cost you anything to fix it, the patch works fine and it doesn't block any other behaviour.
We have two templates of chart of accounts in the same module and many modules related with it, that is we need to configure our localization, We don't install only l10n_chart_ES. Usually our customer is an small or medium business, for this costumer, we install an installer module that it has dependencies of l10n_chart_ES and more modules, then, we generate the correspondent chart of account, selecting between templates, from this wizard.

Other case could be that, our costumer is multi-company and his companies uses different chart of account we need use another time this wizard for generate the chart of account for new company, it is possible in 6.0 or not? Then, why have we to do that workaround for it?, the patch is very simple.

There are many people, not only in Spanish localization, see the comments, they usually use this wizard after installation.

Omar (Pexego) (omar7r)
affects: openobject-addons → openobject-server
Changed in openobject-server:
milestone: 6.0 → none
Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :
Download full text (4.5 KiB)

First of all:

@Xavier sorry for getting a bit "anal" about this :)

As you are saying, we were trying to use the wizard available "Accounting -> Configuration -> Templates". That is the way we where used to create the chart of accounts (I'll explain "why" next), and (for us) it was the most obvious way to create a new chart of accounts if the installation wizard was skipped.

Second:

@Olivier

"Now it would be quite interesting to know why the spanish localization needs to install its charts of accounts *after* Accounting module has been installed."

Yeah, its weird and unconfortable to skip the accounting module configuration and launch the wizard later. I'll better explain why we got to do so...

### REASON A - The periods problem ###########

  The "Accounting Application Configuration" wizard does try to set up both the chart of accounts and the initial fiscal year and periods. And it always creates periods named like this "MM/YYYY" where MM is the month and YYYY is the year.

  On Spain, due to the way we close the fiscal years we need to have 3 special periods per year: "opening", "profit & losses" and "closing" periods: We create two special movements on the year being closed that balance all the accounts (every account balance must be 0 when the year is closed), and one special movement on the year being opened (that copies the old balance before closing to the new yeard). Yeah, its stupid (though not so much, it verifies that the full chart is balanced), but it is the way we are required to work.

  Periods, when 3-monthly (90% of the companies), are usually labeled on Spain like this: 1TYY, 2TYY, 3TYY, 4TYY for each quarter AYY for opening, PGYY for profit&losses, and CYY for closing (where YY is the fiscal year). Those 'quarter' names ("1T", "2T"...) are the usual ones on the Spanish accounting and oficial fiscal reports.

  So, the periods being created by the wizard aren't the ones expected for a Spanish company.

  What do we do instead of letting the wizard create the periods for us?: We just use a module called "l10n_ES_pyme_account" (by Zikzakmedia) that (installs all the other modules required by the Spanish accounting, configures payment types and some other master tables, and then) creates the fiscal years and periods when installed.

### REASON B - The "legacy" problem ###########

  Don't know why, but on the extra-addons there is this module called "l10n_chart_sp" that is supposed to provide the "Spain - Chart of Account".
  On the Spanish localization project we have instead "l10n_chart_ES" providing "Spain - Chart of Accounts 2008".

  So, when we get to the "Accounting Application Configuration" wizard we get two options to install: "Spain - Chart of Account" or "Spain - Chart of Accounts 2008" which is confusing (most people won't know which one is the right one!).

  Why did it happen?: "l10n_chart_sp" looks like an incomplete ultra-simplified and non oficial version of the old (pre-2008) Spanish Chart of Accounts. So my supposition is: somebody created it before OpenERP was ported to Bazar/Launchpad, and Ced ported it on 2007-08-10 to LaunchPad, but nobody supported it... so the Spanish community...

Read more...

Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

More info: I think we can solve the problems with the Spanish localization, so it may use the accounting installation wizard:

About REASON A, I think that it may be worked around by:
  - Allowing the users to skip the fiscal year / period creation (as now there is a single wizard).
  - Overwriting the create_period3 method of the 'account.fiscalyear' object on the Spanish localization (or any localization needing special periods). This should work as long as the installer wizard installs the localization module before creating the fiscal year and periods.

About REASON B: I just seen on the code, that if the module is named "l10n_es" (instead of l10n_chart_es) OpenERP would suggest Spanish users to install "Spain - Chart of Accounts 2008" by default. So, with a bit of refactoring (renaming this module [or better: improving the install wizard, so it checks for l10n_chart_XX modules too] and removing the l10n_chart_sp module) we may solve this.

About REASON C: I discovered that if I add an XML like this:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
 <record id="config_call_account_template_es" model="ir.actions.todo">
            <field name="name">Crear el plan de cuentas a partir de una plantilla</field>
            <field name="note">Ahora puede crear el plan de cuentas a partir de una de las plantillas instaladas.</field>
            <field name="action_id" ref="account.action_wizard_multi_chart"/>
            <field name="state">open</field>
     </record>
    </data>
</openerp>

Then the "create chart of accounts from template" step shows during the installation wizard: So problem C solved.

Note: I'll try to create a 6.0 version of the Spanish chart of accounts with those proposed fixes, but anyway the original problem is still valid: the wizard can not be called directly from the accounting configuration (nor you can not create two chart of accounts without creating two fiscal years!).

Changed in openobject-server:
status: In Progress → Fix Released
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.