Upgrade 7.2 to 7.4 (product_price_list_dates)

When applying the update I get this error:

Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/trytond/model/modelsql.py", line 899, in db_insert
    cursor.execute(*table.insert(
  File "/usr/lib/python3.12/site-packages/trytond/backend/postgresql/database.py", line 76, in execute
    cursor.execute(self, sql, args)
psycopg2.errors.ExclusionViolation: llave en conflicto viola la restricción de exclusión «ir_model_button_name_model_exclude»
DETAIL:  La llave (name, model)=(open_lines, product.price_list) está en conflicto con la llave existente (name, model)=(open_lines, product.price_list).


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/trytond/convert.py", line 463, in parse_xmlstream
    self.sax_parser.parse(source)
  File "/usr/lib/python3.12/xml/sax/expatreader.py", line 105, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python3.12/xml/sax/xmlreader.py", line 124, in parse
    self.feed(buffer)
  File "/usr/lib/python3.12/xml/sax/expatreader.py", line 211, in feed
    self._parser.Parse(data, isFinal)
  File "./Modules/pyexpat.c", line 475, in EndElement
  File "/usr/lib/python3.12/xml/sax/expatreader.py", line 344, in end_element
    self._cont_handler.endElement(name)
  File "/usr/lib/python3.12/site-packages/trytond/convert.py", line 518, in endElement
    self.taghandler = self.taghandler.endElement(name)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/trytond/convert.py", line 314, in endElement
    self.mh.import_record(
  File "/usr/lib/python3.12/site-packages/trytond/convert.py", line 693, in import_record
    self.create_records(model, [values], [fs_id])
  File "/usr/lib/python3.12/site-packages/trytond/convert.py", line 698, in create_records
    records = Model.create(vlist)
              ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/trytond/res/ir.py", line 139, in create
    result = super().create(vlist)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/trytond/ir/model.py", line 1021, in create
    result = super(ModelButton, cls).create(vlist)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/trytond/model/fields/fmany2one.py", line 45, in create
    return super().create(vlist)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/trytond/model/modelsql.py", line 275, in wrapper
    return func(cls, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/trytond/model/modelsql.py", line 990, in create
    new_ids.extend(db_insert(
  File "/usr/lib/python3.12/site-packages/trytond/model/modelsql.py", line 926, in db_insert
    raise_func(
  File "/usr/lib/python3.12/site-packages/trytond/transaction.py", line 50, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/trytond/model/modelsql.py", line 608, in __raise_integrity_error
    raise SQLConstraintError(gettext(error))
trytond.model.modelsql.SQLConstraintError: The name of the button must be unique per model. - 

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

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.12/trytond-admin", line 33, in <module>
    admin.run(options)
  File "/usr/lib/python3.12/site-packages/trytond/admin.py", line 59, in run
    pool.init(update=options.update, lang=list(lang),
  File "/usr/lib/python3.12/site-packages/trytond/pool.py", line 144, in init
    restart = not load_modules(
                  ^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/trytond/modules/__init__.py", line 402, in load_modules
    _load_modules(update)
  File "/usr/lib/python3.12/site-packages/trytond/modules/__init__.py", line 372, in _load_modules
    load_module_graph(graph, pool, update, lang, indexes)
  File "/usr/lib/python3.12/site-packages/trytond/modules/__init__.py", line 217, in load_module_graph
    tryton_parser.parse_xmlstream(fp)
  File "/usr/lib/python3.12/site-packages/trytond/convert.py", line 465, in parse_xmlstream
    raise ParsingError("in %s" % self.current_state()) from e
trytond.convert.ParsingError: in record 'product_price_list.price_list_open_lines_button'

What friend Sergi comments is due to a change in the module (product_price_list_dates) to (product_price_list), that change requires an adjustment, but I don’t know what or where.
Thanks in advance for your comments.

1 Like

We should include a manual migration step for Move "Open Lines" to product_price_list module (#13527) · Issues · Tryton / Tryton · GitLab :

DELETE FROM "ir_model_button" WHERE "name" = 'open_lines' AND "model" = 'product.price_list';

I’ll add it to Add manual migration to documentation (!1993) · Merge requests · Tryton / Tryton · GitLab

Here is Add missing migration of open lines button of product price list (!1994) · Merge requests · Tryton / Tryton · GitLab

Thank you dear, there is still something to polish, a new error appears for product_price_list_dates:

Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/trytond/convert.py", line 463, in parse_xmlstream
    self.sax_parser.parse(source)
  File "/usr/lib/python3.12/xml/sax/expatreader.py", line 105, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python3.12/xml/sax/xmlreader.py", line 124, in parse
    self.feed(buffer)
  File "/usr/lib/python3.12/xml/sax/expatreader.py", line 211, in feed
    self._parser.Parse(data, isFinal)
  File "./Modules/pyexpat.c", line 475, in EndElement
  File "/usr/lib/python3.12/xml/sax/expatreader.py", line 344, in end_element
    self._cont_handler.endElement(name)
  File "/usr/lib/python3.12/site-packages/trytond/convert.py", line 518, in endElement
    self.taghandler = self.taghandler.endElement(name)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/trytond/convert.py", line 314, in endElement
    self.mh.import_record(
  File "/usr/lib/python3.12/site-packages/trytond/convert.py", line 687, in import_record
    self.write_records(module, model,
  File "/usr/lib/python3.12/site-packages/trytond/convert.py", line 742, in write_records
    Model.write(*to_update)
  File "/usr/lib/python3.12/site-packages/trytond/ir/ui/view.py", line 285, in write
    super(View, cls).write(views, values, *args)
  File "/usr/lib/python3.12/site-packages/trytond/model/fields/fmany2one.py", line 56, in write
    super().write(*args)
  File "/usr/lib/python3.12/site-packages/trytond/model/fields/fmany2one.py", line 56, in write
    super().write(*args)
  File "/usr/lib/python3.12/site-packages/trytond/model/fields/fmany2one.py", line 56, in write
    super().write(*args)
  File "/usr/lib/python3.12/site-packages/trytond/model/modelsql.py", line 275, in wrapper
    return func(cls, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/trytond/model/modelsql.py", line 1471, in write
    cls._validate(sub_records, field_names=all_field_names)
  File "/usr/lib/python3.12/site-packages/trytond/transaction.py", line 50, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/trytond/model/modelstorage.py", line 1408, in _validate
    validate_domain(field)
  File "/usr/lib/python3.12/site-packages/trytond/model/modelstorage.py", line 1311, in validate_domain
    validate_relation_domain(
  File "/usr/lib/python3.12/site-packages/trytond/model/modelstorage.py", line 1387, in validate_relation_domain
    raise DomainValidationError(
trytond.model.modelstorage.DomainValidationError: The value "Form" for field "View Type" in record "Price List Line Context (Price List Line Context (Form))" of "View" is not valid according to its domain. - 

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

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.12/trytond-admin", line 33, in <module>
    admin.run(options)
  File "/usr/lib/python3.12/site-packages/trytond/admin.py", line 59, in run
    pool.init(update=options.update, lang=list(lang),
  File "/usr/lib/python3.12/site-packages/trytond/pool.py", line 144, in init
    restart = not load_modules(
                  ^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/trytond/modules/__init__.py", line 402, in load_modules
    _load_modules(update)
  File "/usr/lib/python3.12/site-packages/trytond/modules/__init__.py", line 372, in _load_modules
    load_module_graph(graph, pool, update, lang, indexes)
  File "/usr/lib/python3.12/site-packages/trytond/modules/__init__.py", line 217, in load_module_graph
    tryton_parser.parse_xmlstream(fp)
  File "/usr/lib/python3.12/site-packages/trytond/convert.py", line 465, in parse_xmlstream
    raise ParsingError("in %s" % self.current_state()) from e
trytond.convert.ParsingError: in record 'product_price_list_dates.price_list_line_context_view_form'

It should be fixed by Add missing migration of open lines button of product price list (!1994) · Merge requests · Tryton / Tryton · GitLab

Grateful once again, adding those lines in /usr/lib/python3.12/site-packages/trytond/modules/product_price_list_dates/product.xml they solved everything.

although it gives a warning at the end that says: ERROR trytond.convert could not deactivate 372@ir.action.act_window from stock_lot.act_lots_by_warehouse_relate (You are trying to write to the "Window Action" registers "372" which do not exist. - ) 3761 140685033817920 [2024-11-25 17:52:18,618] INFO trytond.modules all modules loaded

but it allows you to start and continue updating modules within the system

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.