Skip to Content
Menu
This question has been flagged
2 Replies
1010 Views

Issue:

Just upgraded from Odoo13 to Odoo14

In Odoo14, I get an error when using the NL btw statement.

I can create and save the statement without problem

However when clicking the “update” button to compute the btw statement lines, the system gives an error message related to l10n_nl_vat_statement.py. See details of the error message below.

In Odoo13 I did not get this error message.

 

Modules used:

Netherlands BTW statement, l10n_nl_tax_statement, by Onestein, version 14.0.1.0.0

(in combination with Odoo 14 Accounting by Odoo Mates, Odoo SA, version 14.0.8.0.0)

 

Analysis done so far

Reinstall the modules

Validate the configuration of the vat setup (although I am not sure what to look for)

 

Detailed error message

Odoo Server Error

Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 237, in _dispatch

    result = request.dispatch()

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 685, in dispatch

    result = self._call_function(**self.params)

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 361, in _call_function

    return checked_call(self.db, *args, **kwargs)

  File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 94, in wrapper

    return f(dbname, *args, **kwargs)

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 349, in checked_call

    result = self.endpoint(*a, **kw)

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 914, in __call__

    return self.method(*args, **kw)

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 533, in response_wrap

    response = f(*args, **kw)

  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1398, in call_button

    action = self._call_kw(model, method, args, kwargs)

  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1386, in _call_kw

    return call_kw(request.env[model], method, args, kwargs)

  File "/usr/lib/python3/dist-packages/odoo/api.py", line 399, in call_kw

    result = _call_kw_multi(method, model, args, kwargs)

  File "/usr/lib/python3/dist-packages/odoo/api.py", line 386, in _call_kw_multi

    result = method(recs, *args, **kwargs)

  File "/var/lib/odoo/addons/14.0/l10n_nl_tax_statement/models/l10n_nl_vat_statement.py", line 410, in statement_update

    self._set_statement_lines(lines, move_lines)

  File "/var/lib/odoo/addons/14.0/l10n_nl_tax_statement/models/l10n_nl_vat_statement.py", line 437, in _set_statement_lines

    tags_map = self._get_tags_map()

  File "/var/lib/odoo/addons/14.0/l10n_nl_tax_statement/models/l10n_nl_vat_statement.py", line 388, in _get_tags_map

    matching.update({tag.id: (res_code.group(0), "omzet")})

Exception

 

The above exception was the direct cause of the following exception:

 

Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 641, in _handle_exception

    return super(JsonRequest, self)._handle_exception(exception)

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 317, in _handle_exception

    raise exception.with_traceback(None) from new_cause

AttributeError: 'NoneType' object has no attribute 'group'

 

Anyone have any ideas?


Avatar
Discard
Author Best Answer

Thanks for your thorough analysis and your extended answer Waleed. It is well-appreciated.

The account tags should be there, given that they were present in the 13.0 version (before I converted to 14.0). However, your comments have convinced me that I better do a thorough comparison between a vanilla 14.0 (including the module for standard dutch chart of accounts) and my current database. That will take some time, so it may be a while before I post a final answer. Thanks for taking the time to answer my question !

Avatar
Discard

Thanks for reply, When you install I10_nl chart of account all taxes tags created automatically and formatted this formatted this way: “+1a (omzet)”, “+1a (btw)”, “-1a (omzet)”, “-1a (btw)”, “+2a (omzet)”, “+2a (btw)”, etc… This tags should be there and I have checked it in Odoo 13.0 I10_nl COA and I can see it. You need to check the account_account_tag table with the below query:

select * from account_account_tag
where country_id=165 and applicability='taxes';

Author

Thoroughly checked my setup. Refreshed by skills on pgadmin. And refreshed my memory. Had the same problem during upgrade from 12.0 to 13.0. It turned out to be an error in the code.

12.0 to 13.0 upgrade: https://github.com/OCA/l10n-netherlands/issues/318

Reported a bug in version 14.0: https://github.com/OCA/l10n-netherlands/issues/350

In the mean time I manually fixed the code in my installation and is now looking good.

I reported

Best Answer

The error raised from file  l10n_nl_vat_statement.py in line 388, the res_code  has no attribute 'group'. As per the code you have to have NL BTW Tags Configuration and the code search in account tags for taxes tags for Netherlands country which match require expression (r"[+,-]?\d\w") and I think you don't have these tags in your DB.

You can check the configuration section in the description of the  l10n_nl_tax_statement module:  

This module makes use of the tax tags (eg.: 1a, 1b, 1c, 1d, 2a…) as prescribed by the Dutch tax laws.

If the default Odoo Dutch chart of accounts is installed (module l10n_nl) then these tags are automatically present in the database.

If a non-standard chart of accounts is installed, you have to manually create the tax tags and properly set them into the tax definition. The name of the tags must be formatted this way: “+1a (omzet)”, “+1a (btw)”, “-1a (omzet)”, “-1a (btw)”, “+2a (omzet)”, “+2a (btw)”, etc…


Avatar
Discard
Related Posts Replies Views Activity
1
Aug 24
366
0
Aug 24
136
0
Aug 24
172
0
Apr 24
201
1
Sep 22
1197