product_variant_default_code

in product-variant · source on GitHub

Allow to automatically generate the variant default code

Category: Product · AvancOSC · Shine IT · Tecnativa · Akretion · AGPL-3

16.0✓Installs
17.0✓Installs
18.0✓Installs
19.0✓Installs
20.0×Not in this series
SeriesStatusDetailsCode
16.0✓Installs · run 2026-08-21 · 16.0.1.1.4on GitHub
17.0✓Installs · run 2026-08-20 · 17.0.1.0.0on GitHub
18.0✓Installs · run 2026-08-19 · 18.0.1.0.0on GitHub
19.0✓Installs · run 2026-08-19 · 19.0.1.0.0on GitHub
20.0—Not testedno branch

Odoo 20.0 dev — development line

A different statement from the table above. There: the module as published, on a released platform. Here: the module’s code with its manifest version mechanically raised, on a platform that has not been released and changes daily.

StatusDetails
✗failsThe same code installs on 19.0; on the development line it does not. The difference belongs to the platform. (views_xml) · failed in a file of this module: product_variant_default_code/views/product_view.xml · version 19.0.1.0.0 → 19.5.1.0.0, code unchanged · run 2026-09-11 · odoo 19.5 · modidx/odoo:master-deps-20260910

Log excerpt, 20.0 dev

2026-09-11 00:59:12,073 1 INFO job_293d35d30635 odoo.modules.loading: loading product_variant_default_code/data/ir_config_parameter.xml
2026-09-11 00:59:12,092 1 INFO job_293d35d30635 odoo.modules.loading: loading product_variant_default_code/views/product_attribute_view.xml
2026-09-11 00:59:12,169 1 INFO job_293d35d30635 odoo.modules.loading: loading product_variant_default_code/views/product_view.xml
2026-09-11 00:59:12,367 1 WARNING job_293d35d30635 odoo.modules.loading: Transient module states were reset
2026-09-11 00:59:12,368 1 ERROR job_293d35d30635 odoo.registry: Failed to load registry
2026-09-11 00:59:12,368 1 CRITICAL job_293d35d30635 odoo.service.server: Failed to initialize database `job_293d35d30635`.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 628, in _tag_root
    f(rec)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 443, in _tag_record
    f_val = self.id_get(f_ref, raise_if_not_found=nodeattr2bool(rec, 'forcecreate', True))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 612, in id_get
    return self.model_id_get(id_str, raise_if_not_found)[1]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 616, in model_id_get
    return self.env['ir.model.data']._xmlid_to_res_model_res_id(id_str, raise_if_not_found=raise_if_not_found)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_model.py", line 2298, in _xmlid_to_res_model_res_id
    return self._xmlid_lookup(xmlid)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/orm/cache.py", line 86, in lookup
    return self.lookup(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/orm/cache.py", line 145, in lookup
    value = self.method(*args, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_model.py", line 2291, in _xmlid_lookup
    raise ValueError('External ID not found in the system: %s' % xmlid)
ValueError: External ID not found in the system: product.product_variant_easy_edit_view

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

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/service/server.py", line 1559, in preload_registries
    registry = Registry.new(dbname, update_module=update_module, install_modules=config['init'], upgrade_modules=config['update'], reinit_modules=config['reinit'])
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/tools/func.py", line 67, in locked
    return func(inst, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/odoo/orm/registry.py", line 222, in new
    contextvars.Context().run(
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 446, in load_modules
    load_module_graph(
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 211, in load_module_graph
    load_data(env, idref, 'init', kind='data', package=package)
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 56, in load_data
    convert_file(env, package.name, filename, idref, mode, noupdate=kind == 'demo')
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 716, in convert_file
    convert_xml_import(env, module, fp, idref, mode, noupdate)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 815, in convert_xml_import
    obj.parse(doc.getroot())
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 686, in parse
    self._tag_root(de)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 641, in _tag_root
    raise ParseError('while parsing %s:%s, somewhere inside\n%s' % (
odoo.tools.convert.ParseError: while parsing /mnt/pool/product_variant_default_code/views/product_view.xml:35, somewhere inside
<record id="product_variant_easy_edit_view" model="ir.ui.view">
        <field name="model">product.product</field>
        <field name="inherit_id" ref="product.product_variant_easy_edit_view"/>
        <field name="arch" type="xml">
            <field name="default_code" position="before">
                <field name="manual_code"/>
            </field>
        </field>
    </record>
2026-09-11 00:59:12,373 1 INFO job_293d35d30635 odoo.service.server.ThreadedServer: Initiating shutdown
2026-09-11 00:59:12,373 1 INFO job_293d35d30635 odoo.service.server.ThreadedServer: Hit CTRL-C again or send a second signal to force the shutdown.
2026-09-11 00:59:12,374 1 INFO job_293d35d30635 odoo.addons.bus.websocket: Disconnecting 0 websockets
2026-09-11 00:59:12,476 1 INFO job_293d35d30635 odoo.sql_db: ConnectionPool(read/write;used=0/count=0/max=64): Closed 1 connections

Provenance: __manifest__.py sha256 cbb29ba646c2a9a3… · tree of 41 files without the manifest, sha256 770ae8ed3b94775d…

This does not say the module is compatible with Odoo 20.0, and does not say it installs on Odoo 20.0 — on a stock platform it will not, until its maintainer raises the version. Why we raise the version

Odoo 20.0 — the branch itself

The same frozen code, run again against the real 20.0 branch. The run above used Odoo’s development line before the branch was cut; this one used the branch, pinned to one commit.

StatusDetails
✗failsThe same code installs on 19.0; on the development line it does not. The difference belongs to the platform. (views_xml) · failed in a file of this module: product_variant_default_code/views/product_view.xml · version 19.0.1.0.0 → 20.0.1.0.0, code unchanged · run 2026-09-18 · odoo 20.0 · modidx/odoo:20.0-deps-20260918

Log excerpt, 20.0 dev

2026-09-18 22:27:25,302 1 INFO job_6c66e27d66d9 odoo.modules.loading: loading product_variant_default_code/data/ir_config_parameter.xml
2026-09-18 22:27:25,321 1 INFO job_6c66e27d66d9 odoo.modules.loading: loading product_variant_default_code/views/product_attribute_view.xml
2026-09-18 22:27:25,434 1 INFO job_6c66e27d66d9 odoo.modules.loading: loading product_variant_default_code/views/product_view.xml
2026-09-18 22:27:25,661 1 WARNING job_6c66e27d66d9 odoo.modules.loading: Transient module states were reset
2026-09-18 22:27:25,662 1 ERROR job_6c66e27d66d9 odoo.registry: Failed to load registry
2026-09-18 22:27:25,662 1 CRITICAL job_6c66e27d66d9 odoo.service.server: Failed to initialize database `job_6c66e27d66d9`.
Traceback (most recent call last):
  File "/opt/odoo/odoo/tools/convert.py", line 630, in _tag_root
    f(rec)
  File "/opt/odoo/odoo/tools/convert.py", line 443, in _tag_record
    f_val = self.id_get(f_ref, raise_if_not_found=nodeattr2bool(rec, 'forcecreate', True))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/tools/convert.py", line 614, in id_get
    return self.model_id_get(id_str, raise_if_not_found)[1]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/tools/convert.py", line 618, in model_id_get
    return self.env['ir.model.data']._xmlid_to_res_model_res_id(id_str, raise_if_not_found=raise_if_not_found)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/addons/base/models/ir_model.py", line 2352, in _xmlid_to_res_model_res_id
    return self._xmlid_lookup(xmlid)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/orm/cache.py", line 86, in lookup
    return self.lookup(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/orm/cache.py", line 145, in lookup
    value = self.method(*args, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/addons/base/models/ir_model.py", line 2345, in _xmlid_lookup
    raise ValueError('External ID not found in the system: %s' % xmlid)
ValueError: External ID not found in the system: product.product_variant_easy_edit_view

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

Traceback (most recent call last):
  File "/opt/odoo/odoo/service/server.py", line 1520, in preload_registries
    registry = Registry.new(dbname, update_module=update_module, install_modules=config['init'], upgrade_modules=config['update'], reinit_modules=config['reinit'])
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/tools/func.py", line 67, in locked
    return func(inst, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/orm/registry.py", line 222, in new
    contextvars.Context().run(
  File "/opt/odoo/odoo/modules/loading.py", line 449, in load_modules
    load_module_graph(
  File "/opt/odoo/odoo/modules/loading.py", line 211, in load_module_graph
    load_data(env, idref, 'init', kind='data', package=package)
  File "/opt/odoo/odoo/modules/loading.py", line 56, in load_data
    convert_file(env, package.name, filename, idref, mode, noupdate=kind == 'demo')
  File "/opt/odoo/odoo/tools/convert.py", line 718, in convert_file
    convert_xml_import(env, module, fp, idref, mode, noupdate)
  File "/opt/odoo/odoo/tools/convert.py", line 817, in convert_xml_import
    obj.parse(doc.getroot())
  File "/opt/odoo/odoo/tools/convert.py", line 688, in parse
    self._tag_root(de)
  File "/opt/odoo/odoo/tools/convert.py", line 643, in _tag_root
    raise ParseError('while parsing %s:%s, somewhere inside\n%s' % (
odoo.tools.convert.ParseError: while parsing /mnt/pool/product_variant_default_code/views/product_view.xml:35, somewhere inside
<record id="product_variant_easy_edit_view" model="ir.ui.view">
        <field name="model">product.product</field>
        <field name="inherit_id" ref="product.product_variant_easy_edit_view"/>
        <field name="arch" type="xml">
            <field name="default_code" position="before">
                <field name="manual_code"/>
            </field>
        </field>
    </record>
2026-09-18 22:27:25,667 1 INFO job_6c66e27d66d9 odoo.service.server.ThreadedServer: Initiating shutdown
2026-09-18 22:27:25,668 1 INFO job_6c66e27d66d9 odoo.service.server.ThreadedServer: Hit CTRL-C again or send a second signal to force the shutdown.
2026-09-18 22:27:25,668 1 INFO job_6c66e27d66d9 odoo.addons.bus.websocket: Disconnecting 0 websockets
2026-09-18 22:27:25,772 1 INFO job_6c66e27d66d9 odoo.sql_db: ConnectionPool(read/write;used=0/count=0/max=64): Closed 1 connections

Provenance: __manifest__.py sha256 cbb29ba646c2a9a3… · tree of 41 files without the manifest, sha256 770ae8ed3b94775d…

This does not say the module is compatible with Odoo 20.0, and does not say it installs on Odoo 20.0 — on a stock platform it will not, until its maintainer raises the version. Why we raise the version

The module’s code on 19.0

Lines of codepython 727 · xml 140
Testsyes: 1 file(s), 386 lines
Migration scriptsno
Models0 new · 5 extensions

Lines are physical, blanks and comments included, as wc -l. Tests are test_*.py files under tests/. Models are lines holding _name = and _inherit =. These are facts about the code, not a judgement: more lines is neither better nor worse. Measured 2026-08-28 on tree c7d591c56821.

Depends on

ModuleStatusChecked
productcoreships with Odoo

History

Last change2026-07-25
Code commits, 12 months42
Most activePedro M. Baeza, João Marques, Kev-Roche
Files42

Translation and bot commits are excluded from the commit count.

Result looks wrong? Tell us — we will show the log or run it again. Report a wrong result

Get told when this module changes state

Data updated 2026-10-07 13:00 UTC · build 4aa2dbe · we publish the install log with a date, not a vendor rating · CSV and JSON are open

Questions or a wrong result: open an issue or hello@allservices.one

Privacy · Terms

Independent project. Not affiliated with Odoo S.A. or the Odoo Community Association.