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

[14.0][MIG] hr #2789

Merged
merged 3 commits into from
Dec 11, 2021
Merged

[14.0][MIG] hr #2789

merged 3 commits into from
Dec 11, 2021

Conversation

MiquelRForgeFlow
Copy link
Contributor

Supersedes #2777 (I couldn't edit that PR).

Copy link

@RaulOForgeFlow RaulOForgeFlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@flotho
Copy link
Member

flotho commented Nov 28, 2021

Hi @MiquelRForgeFlow ,

I'm not sure if it should be there but I faced the following error using your scripts :

 loading hr/views/res_users.xml 
2021-11-28 23:13:02,142 586749 DEBUG defacto_14 odoo.tools.translate: translation went wrong for ""Element '%s' cannot be located in parent view"", skipped 
2021-11-28 23:13:02,151 586749 INFO defacto_14 odoo.addons.base.models.ir_ui_view: Element '<xpath expr="//field[@name='odoobot_state']">' cannot be located in parent view

View name: res.users.preferences.form.inherit
Error context:
 view: ir.ui.view(3429,)
 xmlid: res_users_view_form_simple_modif
 view.model: res.users
 view.parent: ir.ui.view(3428,)
 file: /home/florent.thomas/DEV/_EclipseOdoo/Defacto14/odoo/addons/hr/views/res_users.xml
 
2021-11-28 23:13:02,158 586749 WARNING defacto_14 odoo.modules.loading: Transient module states were reset 
2021-11-28 23:13:02,163 586749 ERROR defacto_14 odoo.modules.registry: Failed to load registry 
2021-11-28 23:13:02,163 586749 CRITICAL defacto_14 odoo.service.server: Failed to initialize database `defacto_14`. 
Traceback (most recent call last):
  File "/home/florent.thomas/DEV/Odoo_Server_And_Libs/Servers_14/OCB/odoo/tools/convert.py", line 677, in _tag_root
    f(rec)
  File "/home/florent.thomas/DEV/Odoo_Server_And_Libs/Servers_14/OCB/odoo/tools/convert.py", line 580, in _tag_record
    record = model._load_records([data], self.mode == 'update')
  File "/home/florent.thomas/DEV/Odoo_Server_And_Libs/Servers_14/OCB/odoo/models.py", line 4201, in _load_records
    data['record']._load_records_write(data['values'])
  File "/home/florent.thomas/DEV/Odoo_Server_And_Libs/Servers_14/OCB/odoo/addons/base/models/ir_ui_view.py", line 1842, in _load_records_write
    super(View, self)._load_records_write(values)
  File "/home/florent.thomas/DEV/Odoo_Server_And_Libs/Servers_14/OCB/odoo/models.py", line 4138, in _load_records_write
    self.write(values)
  File "/home/florent.thomas/DEV/Odoo_Server_And_Libs/Servers_14/OCB/odoo/addons/base/models/ir_ui_view.py", line 500, in write
    res = super(View, self).write(self._compute_defaults(vals))
  File "/home/florent.thomas/DEV/Odoo_Server_And_Libs/Servers_14/OCB/odoo/models.py", line 3696, in write
    fields[0].determine_inverse(real_recs)
  File "/home/florent.thomas/DEV/Odoo_Server_And_Libs/Servers_14/OCB/odoo/fields.py", line 1187, in determine_inverse
    getattr(records, self.inverse)()
  File "/home/florent.thomas/DEV/Odoo_Server_And_Libs/Servers_14/OCB/odoo/addons/base/models/ir_ui_view.py", line 300, in _inverse_arch
    view.write(data)
  File "/home/florent.thomas/DEV/Odoo_Server_And_Libs/Servers_14/OCB/odoo/addons/base/models/ir_ui_view.py", line 500, in write
    res = super(View, self).write(self._compute_defaults(vals))
  File "/home/florent.thomas/DEV/Odoo_Server_And_Libs/Servers_14/OCB/odoo/models.py", line 3686, in write
    real_recs._validate_fields(vals, inverse_fields)
  File "/home/florent.thomas/DEV/Odoo_Server_And_Libs/Servers_14/OCB/odoo/models.py", line 1266, in _validate_fields
    check(self)
  File "/home/florent.thomas/DEV/Odoo_Server_And_Libs/Servers_14/OCB/odoo/addons/base/models/ir_ui_view.py", line 408, in _check_xml
    raise ValidationError(_(
  File "/home/florent.thomas/DEV/Odoo_Server_And_Libs/Servers_14/OCB/odoo/addons/base/models/ir_ui_view.py", line 385, in _check_xml
    view_def = view.read_combined(['arch'])
  File "/home/florent.thomas/DEV/Odoo_Server_And_Libs/Servers_14/OCB/odoo/addons/base/models/ir_ui_view.py", line 809, in read_combined
    arch = root.apply_view_inheritance(arch_tree, self.model)
  File "/home/florent.thomas/DEV/Odoo_Server_And_Libs/Servers_14/OCB/odoo/addons/base/models/ir_ui_view.py", line 750, in apply_view_inheritance
    return self._apply_view_inheritance(source, inherit_tree)
  File "/home/florent.thomas/DEV/Odoo_Server_And_Libs/Servers_14/OCB/odoo/addons/base/models/ir_ui_view.py", line 758, in _apply_view_inheritance
    source = view.apply_inheritance_specs(source, arch_tree)
  File "/home/florent.thomas/DEV/Odoo_Server_And_Libs/Libs_14/OCA-server-tools/base_view_inheritance_extension/models/ir_ui_view.py", line 45, in apply_inheritance_specs
    source = handled_by(source, specs)
  File "/home/florent.thomas/DEV/Odoo_Server_And_Libs/Servers_14/OCB/odoo/addons/base/models/ir_ui_view.py", line 735, in apply_inheritance_specs
    self.handle_view_error(str(e))
  File "/home/florent.thomas/DEV/Odoo_Server_And_Libs/Servers_14/OCB/odoo/addons/base/models/ir_ui_view.py", line 673, in handle_view_error
    raise ValueError(formatted_message).with_traceback(from_traceback) from from_exception
odoo.exceptions.ValidationError: Erreur lors de la validation de la vue:

Element '<xpath expr="//field[@name='odoobot_state']">' cannot be located in parent view

View name: res.users.preferences.form.inherit
Error context:
 view: ir.ui.view(3429,)
 xmlid: res_users_view_form_simple_modif
 view.model: res.users
 view.parent: ir.ui.view(3428,)
 file: /home/florent.thomas/DEV/_EclipseOdoo/Defacto14/odoo/addons/hr/views/res_users.xml

In v14 the hr.res_users_view_form_simple_modif view has no more the same usage and res_users_view_form_profile is pointing to another view https://github.com/OCA/OCB/blob/14.0/addons/mail_bot_hr/views/res_users_views.xml#L17

What is your recommandation ?

@flotho
Copy link
Member

flotho commented Nov 29, 2021

another one

channel_views.xml 
2021-11-29 00:19:14,750 596048 INFO defacto_14 odoo.modules.loading: loading hr/views/res_users.xml 
2021-11-29 00:19:14,784 596048 DEBUG defacto_14 odoo.tools.translate: translation went wrong for ""Element '%s' cannot be located in parent view"", skipped 
2021-11-29 00:19:14,793 596048 INFO defacto_14 odoo.addons.base.models.ir_ui_view: Element '<footer>' cannot be located in parent view

View name: res.users.preferences.form.inherit
Error context:
 view: ir.ui.view(3429,)
 xmlid: res_users_view_form_simple_modif
 view.model: res.users
 view.parent: ir.ui.view(3428,)
 file: /home/florent.thomas/DEV/_EclipseOdoo/Defacto14/odoo/addons/hr/views/res_users.xml
 

@MiquelRForgeFlow
Copy link
Contributor Author

MiquelRForgeFlow commented Nov 29, 2021

What is your recommandation ?

That one we fixed it with ForgeFlow/odoo@c80f3cb, still waiting odoo to accept the corresponding PR

@MiquelRForgeFlow
Copy link
Contributor Author

The other one fixed with ForgeFlow/odoo@b8d215c.

- Add more comments to the analysis work file
- Refine company_id assignation using department's company first
- Don't load noupdate records without changes

TT29982
@pedrobaeza pedrobaeza merged commit 0bdf142 into OCA:14.0 Dec 11, 2021
@pedrobaeza pedrobaeza deleted the 14.0-mig-hr branch December 11, 2021 18:21
@zurawsm3
Copy link

What is your recommandation ?

That one we fixed it with ForgeFlow/odoo@c80f3cb, still waiting odoo to accept the corresponding PR

Link to code does not work. I have the same error as @flotho has.
@MiquelRForgeFlow Can You show how to solve the problem?

@MiquelRForgeFlow
Copy link
Contributor Author

MiquelRForgeFlow commented Aug 30, 2022

execute this query before migration and you will avoid this stupid view errors

DELETE FROM ir_ui_view iuv
USING ir_model_data imd
WHERE imd.model = 'ir.ui.view' AND imd.res_id = iuv.id AND imd.noupdate IS DISTINCT FROM TRUE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants