Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][MIG] project_deadline: Migrations #895

Closed

Conversation

bizzappdev
Copy link

No description provided.

tarteo and others added 30 commits February 7, 2022 12:03
[FIX] Flake

[ADD] Use fields_view_get

[ADD] Use fields_view_get

[ADD] Tests

[FIX] Quick create form bug

[ADD] usage description
Currently translated at 100.0% (5 of 5 strings)

Translation: project-12.0/project-12.0-project_deadline
Translate-URL: https://translation.odoo-community.org/projects/project-12-0/project-12-0-project_deadline/hr/
Currently translated at 80.0% (4 of 5 strings)

Translation: project-12.0/project-12.0-project_deadline
Translate-URL: https://translation.odoo-community.org/projects/project-12-0/project-12-0-project_deadline/es/
Currently translated at 100.0% (5 of 5 strings)

Translation: project-12.0/project-12.0-project_deadline
Translate-URL: https://translation.odoo-community.org/projects/project-12-0/project-12-0-project_deadline/sl/
Currently translated at 100.0% (5 of 5 strings)

Translation: project-12.0/project-12.0-project_deadline
Translate-URL: https://translation.odoo-community.org/projects/project-12-0/project-12-0-project_deadline/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: project-13.0/project-13.0-project_deadline
Translate-URL: https://translation.odoo-community.org/projects/project-13-0/project-13-0-project_deadline/
Currently translated at 100.0% (8 of 8 strings)

Translation: project-14.0/project-14.0-project_deadline
Translate-URL: https://translation.odoo-community.org/projects/project-14-0/project-14-0-project_deadline/es_AR/
Currently translated at 62.5% (5 of 8 strings)

Translation: project-14.0/project-14.0-project_deadline
Translate-URL: https://translation.odoo-community.org/projects/project-14-0/project-14-0-project_deadline/fr_FR/
Currently translated at 62.5% (5 of 8 strings)

Translation: project-14.0/project-14.0-project_deadline
Translate-URL: https://translation.odoo-community.org/projects/project-14-0/project-14-0-project_deadline/fr/
Currently translated at 80.0% (4 of 5 strings)

Translation: project-14.0/project-14.0-project_deadline
Translate-URL: https://translation.odoo-community.org/projects/project-14-0/project-14-0-project_deadline/es/
Currently translated at 100.0% (5 of 5 strings)

Translation: project-14.0/project-14.0-project_deadline
Translate-URL: https://translation.odoo-community.org/projects/project-14-0/project-14-0-project_deadline/es/
simonstromb and others added 2 commits February 7, 2022 12:03
@bizzappdev bizzappdev mentioned this pull request Feb 7, 2022
32 tasks
@bizzappdev bizzappdev changed the title [15.0][MIG] project_deadline: Migrations [WIP][15.0][MIG] project_deadline: Migrations Feb 7, 2022
@bizzappdev bizzappdev force-pushed the 15.0-mig-project-deadline-BAD-RUS branch 2 times, most recently from 60e9cca to 746c29c Compare February 7, 2022 13:04
@bizzappdev bizzappdev force-pushed the 15.0-mig-project-deadline-BAD-RUS branch from cf73cee to 8e3c9ef Compare February 10, 2022 11:23
@bizzappdev bizzappdev changed the title [WIP][15.0][MIG] project_deadline: Migrations [15.0][MIG] project_deadline: Migrations Mar 2, 2022
@rafaelbn
Copy link
Member

rafaelbn commented Apr 5, 2022

/ocabot migration project_deadline

@OCA-git-bot OCA-git-bot added this to the 15.0 milestone Apr 5, 2022
@rafaelbn
Copy link
Member

rafaelbn commented Apr 5, 2022

Thank you @bizzappdev !

I know is not the same approach but when this modules was developed we didn't have same as know in v15

@OCA/project-service-maintainers we have to try (just try) to think in what we have new in v15 and adapt OCA modules trying not to repeat or overwrite https://github.com/odoo/odoo/blob/15.0/addons/project/models/project.py

@CRogos
Copy link
Contributor

CRogos commented Jul 21, 2022

I agree with @rafaelbn and as far as I understand the code, the fields are named the same and the views are OK.

I've tried to merge the modules with OpenUpgrade in the post-migration.py, but I always get these error message. Can anyone help?

from openupgradelib import openupgrade

namespec = [("project_deadline", "project")]


@openupgrade.migrate()
def migrate(env, version):
    openupgrade.update_module_names(env.cr, namespec, merge_modules=True)

But I always get this error message

2022-07-21 22:02:27,063 11 INFO c4a8-dev-sprint-15-test-5431457 odoo.modules.migration: module project_deadline: Running migration [15.0.1.0.0>] post-migration
2022-07-21 22:02:27,065 11 INFO c4a8-dev-sprint-15-test-5431457 OpenUpgrade: project_deadline: post-migration script called with version 14.0.1.0.0
2022-07-21 22:02:27,066 11 DEBUG c4a8-dev-sprint-15-test-5431457 OpenUpgrade: 0 rows affected after 0:00:00.000258 running DELETE FROM ir_model_constraint WHERE module = 796
2022-07-21 22:02:27,066 11 DEBUG c4a8-dev-sprint-15-test-5431457 OpenUpgrade: 0 rows affected after 0:00:00.000211 running DELETE FROM ir_model_relation WHERE module = 796
2022-07-21 22:02:27,067 11 DEBUG c4a8-dev-sprint-15-test-5431457 OpenUpgrade: 5 rows affected after 0:00:00.001117 running UPDATE ir_model_data SET module = 'project' WHERE module = 'project_deadline' AND name NOT IN (SELECT name FROM ir_model_data WHERE module = 'project')
2022-07-21 22:02:27,069 11 DEBUG c4a8-dev-sprint-15-test-5431457 OpenUpgrade: 98 rows affected after 0:00:00.001714 running UPDATE ir_model_data SET name = name || '_openupgrade_' || id, module = 'project', noupdate = FALSE WHERE module = 'project_deadline'
2022-07-21 22:02:27,069 11 DEBUG c4a8-dev-sprint-15-test-5431457 OpenUpgrade: 0 rows affected after 0:00:00.000216 running UPDATE ir_module_module_dependency SET name = 'project' WHERE name = 'project_deadline'
2022-07-21 22:02:27,070 11 DEBUG c4a8-dev-sprint-15-test-5431457 OpenUpgrade: 0 rows affected after 0:00:00.000364 running UPDATE ir_translation SET module = 'project' WHERE module = 'project_deadline'
2022-07-21 22:02:27,070 11 DEBUG c4a8-dev-sprint-15-test-5431457 OpenUpgrade: 0 rows affected after 0:00:00.000291 running UPDATE ir_module_module m1 SET state=m2.state, latest_version=m2.latest_version FROM ir_module_module m2 WHERE m1.name='project' AND m2.name='project_deadline' AND m1.state='uninstalled'
2022-07-21 22:02:27,073 11 DEBUG c4a8-dev-sprint-15-test-5431457 OpenUpgrade: 1 rows affected after 0:00:00.002254 running DELETE FROM ir_module_module WHERE name = 'project_deadline'
2022-07-21 22:02:27,073 11 DEBUG c4a8-dev-sprint-15-test-5431457 OpenUpgrade: 1 rows affected after 0:00:00.000230 running DELETE FROM ir_model_data WHERE module = 'base' AND model='ir.module.module' AND name = 'module_project_deadline'
2022-07-21 22:02:27,076 11 INFO c4a8-dev-sprint-15-test-5431457 odoo.addons.base.models.ir_translation: module project_deadline: no translation for language en_GB
2022-07-21 22:02:27,077 11 INFO c4a8-dev-sprint-15-test-5431457 odoo.addons.base.models.ir_translation: module project_deadline: no translation for language de
2022-07-21 22:02:27,090 11 WARNING c4a8-dev-sprint-15-test-5431457 odoo.modules.loading: Transient module states were reset
2022-07-21 22:02:27,094 11 ERROR c4a8-dev-sprint-15-test-5431457 odoo.modules.registry: Failed to load registry
2022-07-21 22:02:27,095 11 CRITICAL c4a8-dev-sprint-15-test-5431457 odoo.service.server: Failed to initialize database `c4a8-dev-sprint-15-test-5431457`. 
Traceback (most recent call last):
  File "/home/odoo/src/odoo/odoo/api.py", line 886, in get
    return field_cache[record._ids[0]]
KeyError: 796

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/odoo/src/odoo/odoo/fields.py", line 1057, in __get__
    value = env.cache.get(record, self)
  File "/home/odoo/src/odoo/odoo/api.py", line 889, in get
    raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: 'ir.module.module(796,).name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/odoo/src/odoo/odoo/service/server.py", line 1260, in preload_registries
    registry = Registry.new(dbname, update_module=update_module)
  File "/home/odoo/src/odoo/odoo/modules/registry.py", line 87, in new
    odoo.modules.load_modules(registry, force_demo, status, update_module)
  File "/home/odoo/src/odoo/odoo/modules/loading.py", line 470, in load_modules
    processed_modules += load_marked_modules(cr, graph,
  File "/home/odoo/src/odoo/odoo/modules/loading.py", line 363, in load_marked_modules
    loaded, processed = load_module_graph(
  File "/home/odoo/src/odoo/odoo/modules/loading.py", line 295, in load_module_graph
    module.write({'state': 'installed', 'latest_version': ver})
  File "/home/odoo/src/odoo/addons/website/models/ir_module_module.py", line 82, in write
    if module.name.startswith('theme_') and vals.get('state') == 'installed':
  File "/home/odoo/src/odoo/odoo/fields.py", line 1087, in __get__
    raise MissingError("\n".join([
odoo.exceptions.MissingError: Record does not exist or has been deleted.
(Record: ir.module.module(796,), User: 1)

@github-actions
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Dec 11, 2022
@github-actions github-actions bot closed this Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.