Forum

Benvenuto!

Questo è il forum ufficiale dell'Associazione Odoo Italia. Dopo esserti registrato potrai partecipare ponendo domande o rispondendo a quelle esistenti. Non scordarti di compilare il tuo profilo e consultare le linee guida prima di iniziare a scrivere.

0

[14] Openupgrade da 13 a 14

Avatar
Enrico Maria Chellini

Buon giorno, sto cercando di passare da 12 a 14 con open upgrade, intanto ho cercato di importare il database sulla 13 , vedi questo post:

https://www.odoo-italia.org/forum/forum-1/question/13-fatturazione-elettronica-3420

In teoria openupgrade si è concluso senza errori da 12 a 13,  poi  se apro odoo13 mi da errore perchè credo non siano presenti i moduli della fatturazione elettronica italiana, qui devo capire un po' di cose.

In ogni caso nella 14, ho scaricato openupgrade

git clone https://github.com/OCA/OpenUpgrade.git

poi  ho caricato i moduli per la 14

git checkout 14.0

reinstallato le librerie

pip3 install --ignore-installed git+https://github.com/OCA/openupgradelib.git@master

ma dentro openupgrade non hoil file odoo-bin , come per le precedenti versioni,
ne tanto meno la cartella addons

cosi il comando che usavo per fare l'upgrade non funziona:

OpenUpgrade/odoo-bin --addons-path OpenUpgrade/addons --database odoo 
--xmlrpc-port 8079 --update all --stop-after-init --logfile /tmp/migration.log

Cosa mi sono perso?

Grazie

Enrico

Avatar
Abbandona
2 Risposte
0
Avatar
Enrico Maria Chellini
Migliore risposta

provato ma ho questo errore :

2022-12-29 10:34:02,037 192593 INFO ? odoo: database: default@default:default  
2022-12-29 10:34:02,047 192593 CRITICAL ? odoo.modules.module: Couldn't load module openupgrade_framework  
2022-12-29 10:34:02,047 192593 CRITICAL ? odoo.modules.module: No module named 'odoo.addons.openupgrade_framework'  
2022-12-29 10:34:02,048 192593 ERROR ? odoo.service.server: Failed to load server-wide module `openupgrade_framework`.  
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/service/server.py", line 1151, in load_server_wide_modules
    odoo.modules.module.load_openerp_module(m)
  File "/usr/lib/python3/dist-packages/odoo/modules/module.py", line 385, in load_openerp_module
    __import__('odoo.addons.' + module_name)
PIÙ:

2022-12-29 10:34:18,897 192593 WARNING odoo odoo.modules.loading: Transient module states were reset  
2022-12-29 10:34:18,898 192593 ERROR odoo odoo.modules.registry: Failed to load registry  
2022-12-29 10:34:18,898 192593 CRITICAL odoo odoo.service.server: Failed to initialize database `odoo`.  
Traceback (most recent call last):
 File "/usr/lib/python3/dist-packages/odoo/tools/cache.py", line 85, in lookup
   r = d[key]
 File "/usr/lib/python3/dist-packages/odoo/tools/func.py", line 71, in wrapper
   return func(self, *args, **kwargs)
 File "/usr/lib/python3/dist-packages/odoo/tools/lru.py", line 34, in __getitem__
   a = self.d[obj]
KeyError: ('ir.model.data', <function IrModelData.xmlid_lookup at 0x7f3d325b8d30>, 'base.module_category_services_timesheets')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 677, in _tag_root
   f(rec)
 File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 564, in _tag_record
   f_val = self.id_get(f_ref)
 File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 660, in id_get
   res = self.model_id_get(id_str, raise_if_not_found)
 File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 666, 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 1938, in xmlid_to_res_model_res_id
   return self.xmlid_lookup(xmlid)[1:3]
 File "<decorator-gen-35>", line 2, in xmlid_lookup
 File "/usr/lib/python3/dist-packages/odoo/tools/cache.py", line 90, in lookup
   value = d[key] = self.method(*args, **kwargs)
 File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_model.py", line 1931, in xmlid_lookup
   raise ValueError('External ID not found in the system: %s' % xmlid)
ValueError: External ID not found in the system: base.module_category_services_timesheets

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 1201, in preload_registries
   registry = Registry.new(dbname, update_module=update_module)
 File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 89, in new
   odoo.modules.load_modules(registry._db, force_demo, status, update_module)
 File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 400, in load_modules
   loaded_modules, processed_modules = load_module_graph(
 File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 222, in load_module_graph
   load_data(cr, idref, mode, kind='data', package=package)
 File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 69, in load_data
   tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind)
 File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 733, in convert_file
   convert_xml_import(cr, module, fp, idref, mode, noupdate)
 File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 799, in convert_xml_import
   obj.parse(doc.getroot())
 File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 719, in parse
   self._tag_root(de)
 File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 677, in _tag_root
   f(rec)
 File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 681, in _tag_root
   raise ParseError('while parsing %s:%s, near\n%s' % (
odoo.tools.convert.ParseError: while parsing /usr/lib/python3/dist-packages/odoo/addons/base/data/ir_module_module.xml:19, near
<record model="ir.module.module" id="base.module_timesheet_grid">
           <field name="name">timesheet_grid</field>
           <field name="shortdesc">Timesheets</field>
           <field name="sequence">65</field>
           <field name="category_id" ref="base.module_category_services_timesheets"/>
           <field name="application" eval="True"/>
           <field name="summary">Track time &amp; costs</field>
           <field name="license">OEEL-1</field>
           <field name="author">Odoo S.A.</field>
           <field name="to_buy" eval="True"/>
           <field name="icon">/base/static/img/icons/timesheet_grid.png</field>
           <field name="website">https://www.odoo.com/page/timesheet-mobile-app?utm_source=db&amp;utm_medium=module</field>
       </record>



Enrico

Avatar
Abbandona
0
Avatar
Alberto Carollo
Migliore risposta

Come hai installato Odoo 14 ? Se hai usato pip puoi fare:

pip install odoo14_addon_openupgrade_framework
pip install odoo14_addon_openupgrade_scripts

Puoi guardare le istruzioni per lanciare la migrazione qui: https://oca.github.io/OpenUpgrade/index.html

Avatar
Abbandona
0
Avatar
Enrico Maria Chellini
Migliore risposta

ok, fatto.  ma adesso  ho i seguenti errori :


2022-12-29 11:21:05,305 241212 ERROR odoo odoo.sql_db: bad query: INSERT INTO "res_groups" ("id", "create_uid", "create_date", "write_
uid", "write_date", "category_id", "name") VALUES (nextval('res_groups_id_seq'), 1, (now() at time zone 'UTC'), 1, (now() at time zone
 'UTC'), 14, 'Discount on lines') RETURNING id
ERROR: ERRORE:  un valore chiave duplicato viola il vincolo univoco "res_groups_name_uniq"
DETTAGLI: La chiave (category_id, name)=(14, Discount on lines) esiste già.
  
2022-12-29 11:21:05,315 241212 WARNING odoo odoo.modules.loading: Transient module states were reset  
2022-12-29 11:21:05,321 241212 ERROR odoo odoo.modules.registry: Failed to load registry  
2022-12-29 11:21:05,321 241212 CRITICAL odoo odoo.service.server: Failed to initialize database `odoo`.  
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 677, in _tag_root
    f(rec)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 580, in _tag_record
    record = model._load_records([data], self.mode == 'update')
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 4236, in _load_records
    records = self._load_records_create([data['values'] for data in to_create])
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 4152, in _load_records_create
    return self.create(values)
  File "<decorator-gen-107>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 329, in _model_create_single
    return self.browse().concat(*(create(self, vals) for vals in arg))
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 329, in <genexpr>
    return self.browse().concat(*(create(self, vals) for vals in arg))
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/res_users.py", line 1131, in create
    user = super(GroupsView, self).create(values)
  File "<decorator-gen-105>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 347, in _model_create_multi
    return create(self, [arg])
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/res_users.py", line 1035, in create
    groups = super(GroupsImplied, self).create(vals_list)
  File "<decorator-gen-65>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 348, in _model_create_multi
    return create(self, arg)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_fields.py", line 534, in create
    recs = super().create(vals_list)
  File "<decorator-gen-13>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 348, in _model_create_multi
    return create(self, arg)
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3876, in create
    records = self._create(data_list)
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3982, in _create
    cr.execute(query, params)
  File "<decorator-gen-3>", line 2, in execute
  File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 101, in check
    return f(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 300, in execute
    res = self._obj.execute(query, params)
psycopg2.errors.UniqueViolation: ERRORE:  un valore chiave duplicato viola il vincolo univoco "res_groups_name_uniq"
DETTAGLI: La chiave (category_id, name)=(14, Discount on lines) esiste già.


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 1201, in preload_registries
    registry = Registry.new(dbname, update_module=update_module)
  File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 89, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 455, in load_modules
    processed_modules += load_marked_modules(cr, graph,
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 347, in load_marked_modules
    loaded, processed = load_module_graph(
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 222, in load_module_graph
    load_data(cr, idref, mode, kind='data', package=package)
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 69, in load_data
    tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 733, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 799, in convert_xml_import
    obj.parse(doc.getroot())
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 719, in parse
    self._tag_root(de)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 677, in _tag_root
    f(rec)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 681, in _tag_root
    raise ParseError('while parsing %s:%s, near\n%s' % (
odoo.tools.convert.ParseError: while parsing /usr/lib/python3/dist-packages/odoo/addons/product/security/product_security.xml:26, near
<record id="group_discount_per_so_line" model="res.groups">
        <field name="name">Discount on lines</field>
        <field name="category_id" ref="base.module_category_hidden"/>
    </record>


Cosi ho provato a cancellare e ricaricare il database e mi ha dato in fase di upload il seguente errore:


Database restore error: ERRORE: la colonna "order" non esiste RIGA 1: SELECT "model", "name", "order", "info", "state", "transient... ^

Provato a lancaire il comando di upgrade e è usciti l'errore sopra riportato.


enrico


Avatar
Abbandona
0
Avatar
Alberto Carollo
Migliore risposta

Caro Enrico, proprio in questo sta la difficoltà della migrazione. Cito testuale dalla guida:

Run the upgrade and check for errors. You will probably learn a lot about your data and have to do some manual clean up before and after the upgrade. Expect to repeat the process several times as you encounter errors, clean up your data, and try again.


Avatar
Abbandona
0
Avatar
Enrico Maria Chellini
Migliore risposta

È  si, in questo caso maggiore difficoltà perchè non ho riscontro se funziona la 13.0.

dunque: "clean up your data", cerco di capire come,

se poi hai qualche suggerimento in merito è ben accetto.

In ogni caso Grazie per adesso.

Enrico

Avatar
Abbandona
0
Avatar
Enrico Maria Chellini
Migliore risposta

allora sono ripartito dalla 12, dove ho installato database_cleanup

l'unica cosa che non mi fa purgare è una tabella ir_values

segnalando questo errore:


Odoo Server Error

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 656, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 314, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 698, in dispatch
    result = self._call_function(**self.params)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 346, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 98, in wrapper
    return f(dbname, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 941, in __call__
    return self.method(*args, **kw)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 519, in response_wrap
    response = f(*args, **kw)
  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 967, in call_button
    action = self._call_kw(model, method, args, {})
  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 955, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 759, in call_kw
    return _call_kw_multi(method, model, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 746, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/odoo/addons/database_cleanup/models/purge_tables.py", line 86, in purge
    IdentifierAdapter(line.name),)
  File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 148, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 225, in execute
    res = self._obj.execute(query, params)
psycopg2.InternalError: ERRORE:  non è possibile eliminare tabella ir_values perché altri oggetti dipendono da esso
DETTAGLI: vincolo wizard_export_fatturapa_report_print_menu_fkey su tabella wizard_export_fatturapa dipende da tabella ir_values
NOTA: Usa DROP ... CASCADE per eliminare anche gli oggetti dipendenti.
DROP  ir_values CASCADE
non mi funziona


Avatar
Abbandona
0
Avatar
Enrico Maria Chellini
Migliore risposta

nell'upgrade della 13 non si è bloccato il processo con un errore, ma analizzando il file di log  ho i seguenti errori .


2022-12-29 16:39:27,180 878 ERROR odoo odoo.sql_db: bad query: INSERT INTO "res_groups" ("id", "create_uid", "create_date", "write_ui$
ERROR: ERRORE:  un valore chiave duplicato viola il vincolo univoco "res_groups_name_uniq"
DETTAGLI: La chiave (category_id, name)=(14, Discount on lines) esiste già.

2022-12-29 16:39:27,182 878 ERROR odoo odoo.modules.registry: Failed to load registry
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/convert.py", line 717, in parse
    self._tag_root(de)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/convert.py", line 679, in _tag_root
    f(rec)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/convert.py", line 679, in _tag_root
    f(rec)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/convert.py", line 582, in _tag_record
    record = model._load_records([data], self.mode == 'update')
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/models.py", line 4203, in _load_records
    records = self._load_records_create([data['values'] for data in to_create])
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/models.py", line 4104, in _load_records_create
    return self.create(values)
  File "<decorator-gen-91>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/api.py", line 320, in _model_create_single
    return self.browse().concat(*(create(self, vals) for vals in arg))
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/api.py", line 320, in <genexpr>
    return self.browse().concat(*(create(self, vals) for vals in arg))
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/addons/base/models/res_users.py", line 1045, in create
    user = super(GroupsView, self).create(values)
  File "<decorator-gen-89>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/api.py", line 338, in _model_create_multi
    return create(self, [arg])
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/addons/base/models/res_users.py", line 949, in create
    groups = super(GroupsImplied, self).create(vals_list)
File "<decorator-gen-3>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/api.py", line 339, in _model_create_multi
    return create(self, arg)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/models.py", line 3828, in create
    records = self._create(data_list)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/models.py", line 3934, in _create
    cr.execute(query, params)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/sql_db.py", line 173, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/sql_db.py", line 250, in execute
    res = self._obj.execute(query, params)
psycopg2.IntegrityError: ERRORE:  un valore chiave duplicato viola il vincolo univoco "res_groups_name_uniq"
DETTAGLI: La chiave (category_id, name)=(14, Discount on lines) esiste già.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/modules/registry.py", line 87, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/modules/loading.py", line 489, in load_modules
    force, status, report, loaded_modules, update_module, models_to_check, upg_registry)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/modules/loading.py", line 368, in load_marked_modules
    upg_registry=upg_registry,
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/modules/loading.py", line 248, in load_module_graph
    load_data(cr, idref, mode, kind='data', package=package, report=report)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/modules/loading.py", line 72, in load_data
    tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/convert.py", line 741, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/convert.py", line 808, in convert_xml_import
    obj.parse(doc.getroot())
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/convert.py", line 726, in parse
    exc_info[2]
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/pycompat.py", line 13, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/convert.py", line 717, in parse
    self._tag_root(de)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/convert.py", line 679, in _tag_root
  f(rec)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/convert.py", line 582, in _tag_record
    record = model._load_records([data], self.mode == 'update')
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/models.py", line 4203, in _load_records
    records = self._load_records_create([data['values'] for data in to_create])
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/models.py", line 4104, in _load_records_create
    return self.create(values)
  File "<decorator-gen-91>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/api.py", line 320, in _model_create_single  
    return self.browse().concat(*(create(self, vals) for vals in arg))
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/api.py", line 320, in <genexpr>
    return self.browse().concat(*(create(self, vals) for vals in arg))
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/addons/base/models/res_users.py", line 1045, in create
    user = super(GroupsView, self).create(values)
  File "<decorator-gen-89>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/api.py", line 338, in _model_create_multi
    return create(self, [arg])
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/addons/base/models/res_users.py", line 949, in create
    groups = super(GroupsImplied, self).create(vals_list)
  File "<decorator-gen-3>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/api.py", line 339, in _model_create_multi
    return create(self, arg)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/models.py", line 3828, in create
    records = self._create(data_list)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/models.py", line 3934, in _create
    cr.execute(query, params)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/sql_db.py", line 173, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/sql_db.py", line 250, in execute
    res = self._obj.execute(query, params)
odoo.tools.convert.ParseError: "ERRORE:  un valore chiave duplicato viola il vincolo univoco "res_groups_name_uniq"
DETTAGLI: La chiave (category_id, name)=(14, Discount on lines) esiste già.
" while parsing /usr/lib/python3/dist-packages/odoo/addons/product/security/product_security.xml:2, near
<odoo>

2022-12-29 16:39:27,184 878 CRITICAL odoo odoo.service.server: Failed to initialize database `odoo`.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/convert.py", line 717, in parse
    self._tag_root(de)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/convert.py", line 679, in _tag_root
    f(rec)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/convert.py", line 679, in _tag_root
    f(rec)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/convert.py", line 582, in _tag_record
    record = model._load_records([data], self.mode == 'update')
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/models.py", line 4203, in _load_records
    records = self._load_records_create([data['values'] for data in to_create])
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/models.py", line 4104, in _load_records_create
    return self.create(values)
  File "<decorator-gen-91>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/api.py", line 320, in _model_create_single
    return self.browse().concat(*(create(self, vals) for vals in arg))
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/api.py", line 320, in <genexpr>
    return self.browse().concat(*(create(self, vals) for vals in arg))
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/addons/base/models/res_users.py", line 1045, in create
user = super(GroupsView, self).create(values)
  File "<decorator-gen-89>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/api.py", line 338, in _model_create_multi
    return create(self, [arg])
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/addons/base/models/res_users.py", line 949, in create
    groups = super(GroupsImplied, self).create(vals_list)
  File "<decorator-gen-3>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/api.py", line 339, in _model_create_multi
    return create(self, arg)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/models.py", line 3828, in create
    records = self._create(data_list)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/models.py", line 3934, in _create
    cr.execute(query, params)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/sql_db.py", line 173, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/sql_db.py", line 250, in execute
    res = self._obj.execute(query, params)
psycopg2.IntegrityError: ERRORE:  un valore chiave duplicato viola il vincolo univoco "res_groups_name_uniq"
DETTAGLI: La chiave (category_id, name)=(14, Discount on lines) esiste già.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/service/server.py", line 1194, in preload_registries
    registry = Registry.new(dbname, update_module=update_module)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/modules/registry.py", line 87, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/modules/loading.py", line 489, in load_modules
    force, status, report, loaded_modules, update_module, models_to_check, upg_registry)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/modules/loading.py", line 368, in load_marked_modules
    upg_registry=upg_registry,
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/modules/loading.py", line 248, in load_module_graph
    load_data(cr, idref, mode, kind='data', package=package, report=report)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/modules/loading.py", line 72, in load_data
    tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/convert.py", line 741, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/convert.py", line 808, in convert_xml_import
    obj.parse(doc.getroot())
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/convert.py", line 726, in parse
    exc_info[2]
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/pycompat.py", line 13, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/convert.py", line 717, in parse
    self._tag_root(de)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/convert.py", line 679, in _tag_root
    f(rec)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/convert.py", line 679, in _tag_root
    f(rec)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/tools/convert.py", line 582, in _tag_record
    record = model._load_records([data], self.mode == 'update')
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/models.py", line 4203, in _load_records
    records = self._load_records_create([data['values'] for data in to_create])
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/models.py", line 4104, in _load_records_create
    return self.create(values)
  File "<decorator-gen-91>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/api.py", line 320, in _model_create_single
    return self.browse().concat(*(create(self, vals) for vals in arg))
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/api.py", line 320, in <genexpr>
    return self.browse().concat(*(create(self, vals) for vals in arg))
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/addons/base/models/res_users.py", line 1045, in create
    user = super(GroupsView, self).create(values)
File "<decorator-gen-89>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/api.py", line 338, in _model_create_multi
    return create(self, [arg])
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/addons/base/models/res_users.py", line 949, in create
    groups = super(GroupsImplied, self).create(vals_list)
  File "<decorator-gen-3>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/api.py", line 339, in _model_create_multi
    return create(self, arg)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/models.py", line 3828, in create
    records = self._create(data_list)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/models.py", line 3934, in _create
    cr.execute(query, params)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/sql_db.py", line 173, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/OpenUpgrade/odoo/sql_db.py", line 250, in execute
    res = self._obj.execute(query, params)
odoo.tools.convert.ParseError: "ERRORE:  un valore chiave duplicato viola il vincolo univoco "res_groups_name_uniq"
DETTAGLI: La chiave (category_id, name)=(14, Discount on lines) esiste già.
" while parsing /usr/lib/python3/dist-packages/odoo/addons/product/security/product_security.xml:2, near&
Avatar
Abbandona
0
Avatar
Enrico Maria Chellini
Migliore risposta

l'upgrade della 14 invece ha dato il seguente errore che sembra lo stesso della 13 , che posso fare?:

022-12-29 17:09:45,709 391882 ERROR odoo odoo.sql_db: bad query: INSERT INTO "res_groups" ("id", "create_uid", "create_date", "write_
uid", "write_date", "category_id", "name") VALUES (nextval('res_groups_id_seq'), 1, (now() at time zone 'UTC'), 1, (now() at time zone
 'UTC'), 14, 'Discount on lines') RETURNING id
ERROR: ERRORE:  un valore chiave duplicato viola il vincolo univoco "res_groups_name_uniq"
DETTAGLI: La chiave (category_id, name)=(14, Discount on lines) esiste già.
  
2022-12-29 17:09:45,719 391882 WARNING odoo odoo.modules.loading: Transient module states were reset  
2022-12-29 17:09:45,730 391882 ERROR odoo odoo.modules.registry: Failed to load registry  
2022-12-29 17:09:45,730 391882 CRITICAL odoo odoo.service.server: Failed to initialize database `odoo`.  
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 677, in _tag_root
    f(rec)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 580, in _tag_record
    record = model._load_records([data], self.mode == 'update')
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 4236, in _load_records
    records = self._load_records_create([data['values'] for data in to_create])
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 4152, in _load_records_create
    return self.create(values)
  File "<decorator-gen-107>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 329, in _model_create_single
    return self.browse().concat(*(create(self, vals) for vals in arg))
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 329, in <genexpr>
    return self.browse().concat(*(create(self, vals) for vals in arg))
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/res_users.py", line 1131, in create
    user = super(GroupsView, self).create(values)
  File "<decorator-gen-105>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 347, in _model_create_multi
    return create(self, [arg])
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/res_users.py", line 1035, in create
    groups = super(GroupsImplied, self).create(vals_list)
  File "<decorator-gen-65>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 348, in _model_create_multi
    return create(self, arg)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_fields.py", line 534, in create
    recs = super().create(vals_list)
  File "<decorator-gen-13>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 348, in _model_create_multi
    return create(self, arg)
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3876, in create
    records = self._create(data_list)
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3982, in _create
    cr.execute(query, params)
  File "<decorator-gen-3>", line 2, in execute
  File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 101, in check
    return f(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 300, in execute
    res = self._obj.execute(query, params)
psycopg2.errors.UniqueViolation: ERRORE:  un valore chiave duplicato viola il vincolo univoco "res_groups_name_uniq"
DETTAGLI: La chiave (category_id, name)=(14, Discount on lines) esiste già.


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 1201, in preload_registries
    registry = Registry.new(dbname, update_module=update_module)
  File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 89, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 455, in load_modules
    processed_modules += load_marked_modules(cr, graph,
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 347, in load_marked_modules
    loaded, processed = load_module_graph(
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 222, in load_module_graph
    load_data(cr, idref, mode, kind='data', package=package)
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 69, in load_data
    tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 733, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 799, in convert_xml_import
    obj.parse(doc.getroot())
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 719, in parse
    self._tag_root(de)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 677, in _tag_root
    f(rec)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 681, in _tag_root
    raise ParseError('while parsing %s:%s, near\n%s' % (
odoo.tools.convert.ParseError: while parsing /usr/lib/python3/dist-packages/odoo/addons/product/security/product_security.xml:26, near
Avatar
Abbandona
0
Avatar
Enrico Maria Chellini
Migliore risposta

qui

https://www.nuxly.com/actualites/migration-dune-base-de-donnees-odoo-12-vers-odoo-13/

dice:

  • ERROR: duplicate key value violates unique constraint « res_groups_name_uniq »
    DETAIL:  Key (category_id, name)=(3, Discount on lines) already exists.
DELETE FROM public.res_groups
WHERE name ='Discount on lines';


Immagino lo dovrei fare sulla 12 prima di migrare il database,

come trovo quel parametro da eliminare su odoo senza passae dalla riga di comando?

Grazie

Avatar
Abbandona
0
Avatar
Enrico Maria Chellini
Migliore risposta

eseguito a  da linea di comando sulla 12, importato sulla 13 - processo di upgrade , poi importato sulla 14, processo di upgrade con il seguente errore:


2022-12-29 17:49:12,840 413244 ERROR odoo odoo.sql_db: bad query: ALTER TABLE "fatturapa_payment_data" ADD FOREIGN KEY ("invoice_id")
REFERENCES "account_move"("id") ON DELETE cascade
ERROR: ERRORE:  la INSERT o l'UPDATE sulla tabella "fatturapa_payment_data" viola il vincolo di chiave esterna "fatturapa_payment_data
_invoice_id_fkey"
DETTAGLI: La chiave (invoice_id)=(15) non è presente nella tabella "account_move".

  
2022-12-29 17:49:12,845 413244 WARNING odoo odoo.modules.loading: Transient module states were reset  
2022-12-29 17:49:12,849 413244 ERROR odoo odoo.modules.registry: Failed to load registry  
2022-12-29 17:49:12,850 413244 CRITICAL odoo odoo.service.server: Failed to initialize database `odoo`.  
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/service/server.py", line 1201, in preload_registries
    registry = Registry.new(dbname, update_module=update_module)
  File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 89, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 455, in load_modules
    processed_modules += load_marked_modules(cr, graph,
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 347, in load_marked_modules
    loaded, processed = load_module_graph(
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 199, in load_module_graph
    registry.init_models(cr, model_names, {'module': package.name}, new_install)
  File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 420, in init_models
    self.check_foreign_keys(cr)
  File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 504, in check_foreign_keys
    sql.add_foreign_key(cr, table1, column1, table2, column2, ondelete)
  File "/usr/lib/python3/dist-packages/odoo/tools/sql.py", line 170, in add_foreign_key
    cr.execute(query.format(tablename1, columnname1, tablename2, columnname2, ondelete))
  File "<decorator-gen-3>", line 2, in execute
  File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 101, in check
    return f(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 300, in execute
    res = self._obj.execute(query, params)
psycopg2.errors.ForeignKeyViolation: ERRORE:  la INSERT o l'UPDATE sulla tabella "fatturapa_payment_data" viola il vincolo di chiave e
sterna "fatturapa_payment_data_invoice_id_fkey"
DETTAGLI: La chiave (invoice_id)=(15) non è presente nella tabella "account_move".


Avatar
Abbandona
0
Avatar
Alberto Carollo
Migliore risposta

Nella versione 14 Openupgrade è già integrato nel codice sorgente, puoi lanciare così:

bin/odoo -d nomedb --load=base,web,openupgrade_framework -u all --stop-after-init




Avatar
Abbandona