Skip to content

[19.0][MIG] hr_dms_field: Migration to 19.0 - #489

Open
mmircoli-nexapp wants to merge 20 commits into
OCA:19.0from
mmircoli-nexapp:19.0-mig-hr_dms_field
Open

mmircoli-nexapp wants to merge 20 commits into
OCA:19.0from
mmircoli-nexapp:19.0-mig-hr_dms_field

Conversation

@mmircoli-nexapp

Copy link
Copy Markdown
Contributor

Migration of hr_dms_field to 19.0

Changes:

victoralmau and others added 20 commits June 22, 2026 16:51
TT46804

[UPD] Update hr_dms_field.pot

[BOT] post-merge updates
Currently translated at 100.0% (6 of 6 strings)

Translation: dms-15.0/dms-15.0-hr_dms_field
Translate-URL: https://translation.odoo-community.org/projects/dms-15-0/dms-15-0-hr_dms_field/es/
…roups + Refactoring

Now the process will be as follows:
- The auto-generated access group will be created.
- The user will be defined in explicit_user_ids of the group
created in the previous step.

In the directory created (from the corresponding record) the auto-generated
group (for the user to have access) + the access groups that the template
had will be used.

[UPD] Update hr_dms_field.pot

[BOT] post-merge updates
TT48870

[UPD] Update hr_dms_field.pot

[BOT] post-merge updates
Translated using Weblate (Italian)

Currently translated at 100.0% (7 of 7 strings)

Translation: dms-16.0/dms-16.0-hr_dms_field
Translate-URL: https://translation.odoo-community.org/projects/dms-16-0/dms-16-0-hr_dms_field/it/
… the creation in install mode

[UPD] Update hr_dms_field.pot

[BOT] post-merge updates

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: dms-16.0/dms-16.0-hr_dms_field
Translate-URL: https://translation.odoo-community.org/projects/dms-16-0/dms-16-0-hr_dms_field/
We need to avoid applying a template except when testing functionality
with dms_field* modules to avoid the error that a directory with the same
name already exists (example: create partner).

Related to OCA#378

[BOT] post-merge updates
… by default)

[UPD] Update hr_dms_field.pot

[BOT] post-merge updates

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: dms-16.0/dms-16.0-hr_dms_field
Translate-URL: https://translation.odoo-community.org/projects/dms-16-0/dms-16-0-hr_dms_field/
Currently translated at 80.0% (8 of 10 strings)

Translation: dms-16.0/dms-16.0-hr_dms_field
Translate-URL: https://translation.odoo-community.org/projects/dms-16-0/dms-16-0-hr_dms_field/es/
Currently translated at 100.0% (10 of 10 strings)

Translation: dms-16.0/dms-16.0-hr_dms_field
Translate-URL: https://translation.odoo-community.org/projects/dms-16-0/dms-16-0-hr_dms_field/it/
Currently translated at 90.0% (9 of 10 strings)

Translation: dms-18.0/dms-18.0-hr_dms_field
Translate-URL: https://translation.odoo-community.org/projects/dms-18-0/dms-18-0-hr_dms_field/es/
Currently translated at 100.0% (10 of 10 strings)

Translation: dms-18.0/dms-18.0-hr_dms_field
Translate-URL: https://translation.odoo-community.org/projects/dms-18-0/dms-18-0-hr_dms_field/sl/
@foamsoap1

Copy link
Copy Markdown

Thanks for the migration. On the current 19.0 branch (81a6b1e, Odoo 19.0-20260810) this PR head (2c31149) fails to install; the following patch makes it install and its 5 tests pass (--with-demo):

  1. models/hr_employee.py: Odoo 19 removed the abstract model hr.employee.base (TypeError: Model 'hr.employee.base' does not exist in registry). The mixin is now applied to hr.employee and hr.employee.public directly; the JS patch mapping hr.employee.publichr.employee keeps working unchanged.
  2. security/security.xml: base.privilege_hidden does not exist in 19 — technical groups simply carry no privilege_id.
  3. views/hr_employee_view.xml: the public employee form has no user_id field anymore; anchored on mobile_phone.
  4. views/res_config_settings_view.xml: HR settings use <setting> tags in 19; the employee_rights_setting_container block is gone, so the option is added as a <setting> after enrich_employee_setting.
patch (apply with patch -p1 from the addons root)
diff -ruN hr_dms_field/models/hr_employee.py b/hr_dms_field/models/hr_employee.py
--- a/hr_dms_field/models/hr_employee.py	2026-06-22 17:52:17
+++ b/hr_dms_field/models/hr_employee.py	2026-09-17 15:55:36
@@ -1,9 +1,19 @@
 # Copyright 2024 Tecnativa - Víctor Martínez
-# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
 
 from odoo import models
 
+# Odoo 19 removed the abstract model ``hr.employee.base`` (hr now ships
+# ``hr.mixin`` and a SQL-view ``hr.employee.public``): the mixin is applied to
+# both concrete models instead of the former shared base. The JS patch keeps
+# mapping ``hr.employee.public`` to ``hr.employee`` where directories live.
 
-class HrEmployeeBase(models.AbstractModel):
-    _name = "hr.employee.base"
-    _inherit = ["hr.employee.base", "dms.field.mixin"]
+
+class HrEmployee(models.Model):
+    _name = "hr.employee"
+    _inherit = ["hr.employee", "dms.field.mixin"]
+
+
+class HrEmployeePublicDms(models.Model):
+    _name = "hr.employee.public"
+    _inherit = ["hr.employee.public", "dms.field.mixin"]
diff -ruN hr_dms_field/security/security.xml b/hr_dms_field/security/security.xml
--- a/hr_dms_field/security/security.xml	2026-06-22 17:52:17
+++ b/hr_dms_field/security/security.xml	2026-09-17 16:02:06
@@ -3,7 +3,7 @@
     <data>
         <record id="group_hr_public_dms" model="res.groups">
             <field name="name">DMS Is accessible publicly on employee profile</field>
-            <field name="privilege_id" ref="base.privilege_hidden" />
+            <!-- Odoo 19: technical groups carry no privilege (there is no base.privilege_hidden) -->
         </record>
     </data>
     <data noupdate="1">
diff -ruN hr_dms_field/views/hr_employee_view.xml b/hr_dms_field/views/hr_employee_view.xml
--- a/hr_dms_field/views/hr_employee_view.xml	2026-06-22 17:52:17
+++ b/hr_dms_field/views/hr_employee_view.xml	2026-09-17 16:06:03
@@ -17,7 +17,8 @@
         <field name="model">hr.employee.public</field>
         <field name="inherit_id" ref="hr.hr_employee_public_view_form" />
         <field name="arch" type="xml">
-            <field name="user_id" position="after">
+            <!-- Odoo 19 public employee form has no user_id field; anchor on mobile_phone -->
+            <field name="mobile_phone" position="after">
                 <field
                     name="is_logged"
                     invisible="1"
diff -ruN hr_dms_field/views/res_config_settings_view.xml b/hr_dms_field/views/res_config_settings_view.xml
--- a/hr_dms_field/views/res_config_settings_view.xml	2026-06-22 17:52:17
+++ b/hr_dms_field/views/res_config_settings_view.xml	2026-09-17 16:07:21
@@ -6,22 +6,17 @@
         <field name="priority" eval="70" />
         <field name="inherit_id" ref="hr.res_config_settings_view_form" />
         <field name="arch" type="xml">
-            <block name="employee_rights_setting_container" position="inside">
-                <div
-                    class="col-12 col-lg-6 o_setting_box"
-                    title="Allow employees to access their DMS Documents."
+            <!-- Odoo 19 settings use <setting> tags; the 18.0 anchor
+                 block "employee_rights_setting_container" no longer exists. -->
+            <setting id="enrich_employee_setting" position="after">
+                <setting
+                    id="hr_dms_field_public_setting"
+                    string="DMS Documents on employee profile"
+                    help="Allow employees to access their DMS Documents."
                 >
-                    <div class="o_setting_left_pane">
-                        <field name="group_hr_public_dms" />
-                    </div>
-                    <div class="o_setting_right_pane">
-                        <label for="group_hr_public_dms" />
-                        <div class="text-muted">
-                            Allow employees to access their DMS Documents.
-                        </div>
-                    </div>
-                </div>
-            </block>
+                    <field name="group_hr_public_dms" />
+                </setting>
+            </setting>
         </field>
     </record>
 </odoo>

Used in production-bound work at رغوة صابون; we will switch to the merged module once this lands. Happy to push these as commits to the PR branch if useful.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants