Skip to Content
मेन्यू
This question has been flagged

Hi to all. 


I'm making some fields hidden or not available to users than can access the settings menu. I can make it work inheriting the module's res.config.settings view and setting the fields or sections I do not want to show to that users invisible, or assigning it to another specific group; it's working ok for the res.config.settings, base_setup and invoicing modules. 


However, when I try to do the same with POS, any field, block, setting, or any other part of the view raises an error stating i.e. "Field "pos_auto_validate_terminal_payment" does not exist in model "res.config.settings""

Below the inherited view code in full: 

<?xml version="1.0" encoding="utf-8"?>

<odoo>

<data>

<record id="pos_res_config_settings_view_form_inherited" model="ir.ui.view">

<field name="name">my_module.pos_res_config_settings_view_form</field>

<field name="model">res.config.settings</field>

<field name="inherit_id" ref="point_of_sale.res_config_settings_view_form"/>

<field name="arch" type="xml">

<xpath expr="//field[@name='pos_auto_validate_terminal_payment']" position="attributes">

<attribute name="invisible">1</attribute>

</xpath>

</field>

</record>

</data>

</odoo>

Below an extract of the log of the module update intent: 

2025-08-06 20:31:57,213 98382 ERROR ? odoo.modules.registry: Failed to load registry 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 110, in new
    odoo.modules.load_modules(registry, force_demo, status, update_module)
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 481, in load_modules
    processed_modules += load_marked_modules(env, graph,
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 366, in load_marked_modules
    loaded, processed = load_module_graph(
                        ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 229, in load_module_graph
    load_data(env, idref, mode, kind='data', package=package)
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 73, in load_data
    tools.convert_file(env, package.name, filename, idref, mode, noupdate, kind)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 627, in convert_file
    convert_xml_import(env, module, fp, idref, mode, noupdate)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 693, in convert_xml_import
    obj.parse(doc.getroot())
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 613, in parse
    self._tag_root(de)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 556, in _tag_root
    f(rec)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 567, in _tag_root
    raise ParseError(msg) from None  # Restart with "--log-handler odoo.tools.convert:DEBUG" for complete traceback
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
odoo.tools.convert.ParseError: while parsing /workspace/my_module/views/point_of_sale.res_config_settings_view_form.xml:4
Error while validating view near:

                            <block title="Companies" name="companies_setting_container">
                                <field name="company_id" invisible="1"/>
                                <setting id="company_details_settings">
                                    <field name="company_name" nolabel="1" class="fw-bold"/>
                                    <br/>

Field "pos_auto_validate_terminal_payment" does not exist in model "res.config.settings"

View error context:
{'file': '/workspace/my_module/views/point_of_sale.res_config_settings_view_form.xml',
'line': 52,
'name': 'my_module.pos_res_config_settings_view_form',
'view': ir.ui.view(1504,),
'view.model': 'res.config.settings',
'view.parent': ir.ui.view(1081,),
'xmlid': 'pos_res_config_settings_view_form_inherited'}

2025-08-06 20:31:57,214 - ERROR - Exception during request handling.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 2213, in __call__
    response = request._serve_db()
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1766, in _serve_db
    self.registry = Registry(self.db).check_signaling()
                    ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 89, in __new__
    return cls.new(db_name)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/decorator.py", line 232, in fun
    return caller(func, *(extras + args), **kw)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/tools/func.py", line 87, in locked
    return func(inst, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 110, in new
    odoo.modules.load_modules(registry, force_demo, status, update_module)
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 481, in load_modules
    processed_modules += load_marked_modules(env, graph,
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 366, in load_marked_modules
    loaded, processed = load_module_graph(
                        ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 229, in load_module_graph
    load_data(env, idref, mode, kind='data', package=package)
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 73, in load_data
    tools.convert_file(env, package.name, filename, idref, mode, noupdate, kind)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 627, in convert_file
    convert_xml_import(env, module, fp, idref, mode, noupdate)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 693, in convert_xml_import
    obj.parse(doc.getroot())
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 613, in parse
    self._tag_root(de)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 556, in _tag_root
    f(rec)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 567, in _tag_root
    raise ParseError(msg) from None  # Restart with "--log-handler odoo.tools.convert:DEBUG" for complete traceback
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
odoo.tools.convert.ParseError: while parsing /workspace/my_module/views/point_of_sale.res_config_settings_view_form.xml:4
Error while validating view near:

                            <block title="Companies" name="companies_setting_container">
                                <field name="company_id" invisible="1"/>
                                <setting id="company_details_settings">
                                    <field name="company_name" nolabel="1" class="fw-bold"/>
                                    <br/>

Field "pos_auto_validate_terminal_payment" does not exist in model "res.config.settings"

View error context:
{'file': '/workspace/my_module/views/point_of_sale.res_config_settings_view_form.xml',
'line': 52,
'name': 'my_module.pos_res_config_settings_view_form',
'view': ir.ui.view(1504,),
'view.model': 'res.config.settings',
'view.parent': ir.ui.view(1081,),
'xmlid': 'pos_res_config_settings_view_form_inherited'}

2025-08-06 20:31:57,214 98382 ERROR ? odoo.http: Exception during request handling.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 2213, in __call__
    response = request._serve_db()
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 1766, in _serve_db
    self.registry = Registry(self.db).check_signaling()
                    ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 89, in __new__
    return cls.new(db_name)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/decorator.py", line 232, in fun
    return caller(func, *(extras + args), **kw)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/tools/func.py", line 87, in locked
    return func(inst, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 110, in new
    odoo.modules.load_modules(registry, force_demo, status, update_module)
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 481, in load_modules
    processed_modules += load_marked_modules(env, graph,
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 366, in load_marked_modules
    loaded, processed = load_module_graph(
                        ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 229, in load_module_graph
    load_data(env, idref, mode, kind='data', package=package)
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 73, in load_data
    tools.convert_file(env, package.name, filename, idref, mode, noupdate, kind)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 627, in convert_file
    convert_xml_import(env, module, fp, idref, mode, noupdate)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 693, in convert_xml_import
    obj.parse(doc.getroot())
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 613, in parse
    self._tag_root(de)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 556, in _tag_root
    f(rec)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 567, in _tag_root
    raise ParseError(msg) from None  # Restart with "--log-handler odoo.tools.convert:DEBUG" for complete traceback
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
odoo.tools.convert.ParseError: while parsing /workspace/my_module/views/point_of_sale.res_config_settings_view_form.xml:4
Error while validating view near:

                            <block title="Companies" name="companies_setting_container">
                                <field name="company_id" invisible="1"/>
                                <setting id="company_details_settings">
                                    <field name="company_name" nolabel="1" class="fw-bold"/>
                                    <br/>

Field "pos_auto_validate_terminal_payment" does not exist in model "res.config.settings"

View error context:
{'file': '/workspace/my_module/views/point_of_sale.res_config_settings_view_form.xml',
'line': 52,
'name': 'my_module.pos_res_config_settings_view_form',
'view': ir.ui.view(1504,),
'view.model': 'res.config.settings',
'view.parent': ir.ui.view(1081,),
'xmlid': 'pos_res_config_settings_view_form_inherited'}


I tried with many other fields, and happens the same. When I try with some block, or settings sections, raises the same error, reflecting it on the first field of the block or sections. 

Any help or advice on how to approach the error is appreciated.

Avatar
Discard

 

Vielen Dank für Ihre Nachricht.

Ich bin derzeit nicht verfügbar und habe keinen Zugriff auf meine E-Mails.

In allen geschäftbezogenen Fällen wenden Sie sich bitte an Frau Carina Metzger E-Mail: carina.metzger@imig.com oder

Telefon: +49 (0) 151 / 51056057.

 

 

 

Best Answer

Hi,

Declare a dependency on point_of_sale in your manifest

You must explicitly declare a dependency on point_of_sale in your module's __manifest__.py. This ensures your module loads after point_of_sale, which will ensure the fields from PoS are already injected into res.config.settings.

Update your __manifest__.py:

{

    'name': 'My Module',

    'version': '1.0',

    'depends': [

        'base',

        'point_of_sale',  # Add this line!

    ],

    'data': [

        'views/point_of_sale.res_config_settings_view_form.xml',

    ],

}

Without this dependency, your module might load before point_of_sale, and the fields added by PoS into res.config.settings will not exist yet, leading to the error.


i hope it is helpfull

Avatar
Discard
Best Answer

Hi,


Try the following.


- Add 'point_of_sale' in the module dependencies (__manifest__.py file).

      'depends': ['base', 'point_of_sale']


- Instead of modifying individual fields, you can hide the entire POS settings block with a condition like:

      <xpath expr="//div[hasclass('pos_settings_block')]" position="attributes">

  <attribute name="groups">your_security_group</attribute>

</xpath>


Hope it helps

Avatar
Discard
Related Posts Replies Views Activity
2
जन॰ 25
1428
1
दिस॰ 24
1317
0
दिस॰ 24
1018
1
अप्रैल 25
6763
1
जन॰ 21
2374