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] update all multi-company security rules #4356

Closed
remi-filament opened this issue Mar 20, 2024 · 6 comments
Closed

[14.0] update all multi-company security rules #4356

remi-filament opened this issue Mar 20, 2024 · 6 comments

Comments

@remi-filament
Copy link
Contributor

Odoo added yesterday on v14 a big change (in terms of numbers of rules concernés, should not change anything functionnally) by updating all multi-company to improve performances : odoo/odoo#157861
(This will most probably be forward ported to mater versions in the coming days)

Since a lot of these rules are noupdate=true, I guess it should be added to migration scripts (and maybe even d'or v14.0 to v14.0 updates). Because of the number of impacted rules, I am not sure what would be the n'est way-forward ? Maybe the easiest way would be to replace regex on all rules containing company_ids ?

@remi-filament
Copy link
Contributor Author

Your point of view on this one would be highly appreciated @legalsylvain @StefanRijnhart @pedrobaeza

Thanks !

@pedrobaeza
Copy link
Member

Yes, we should add them. The best way may be to relaunch an analysis that compares all the noupdate data and rewrite the files.

And for existing DBs, we may do a general replace with an script.

@remi-filament
Copy link
Contributor Author

Thank you @pedrobaeza
I am wondering if we rewrite noupdate files, is there a chance we could lose updates that were made manually to those files (for instance removing some fields that should not be updated) while writing migration scripts ?

@pedrobaeza
Copy link
Member

Yes, the diff should then be checked manually to comment again what has been disabled across modules.

@remi-filament
Copy link
Contributor Author

remi-filament commented Mar 27, 2024

v14.0 fixed with #4358

for v15

I have analyzed changes between v14 commit and v15 commit, and only new rules (which were not present in v14) differ, so from an OpenUpgrade perspective there should be no changes since these should be created during upgrade). The following XML ids are modified in v15 commit with respect to v14 commit :

  • NEW fleet.ir_rule_fleet_report
  • NEW hr_timesheet_attendance.hr_timesheet_attendance_report_restricted_company_rule
  • NEW hr_work_entry_contract.ir_rule_hr_work_entry_multi_company
  • NEW lunch.ir_rule_lunch_order_multi_company
  • DEL lunch.ir_rule_lunch_report_multi_company
  • NEW resource.resource_resource_multi_company
  • NEW resource.resource_calendar_leaves_rule_multi_company
  • NEW stock.stock_storage_category_rule

for v16

there are new changes so, I should create PR for the following XML IDs:

  • account.account_bank_statement_comp_rule
  • account.account_bank_statement_line_comp_rule
  • hr_holidays.hr_leave_rule_multicompany
  • hr_holidays.hr_leave_allocation_rule_multicompany
  • stock.stock_location_route_comp_rule

The following were either added in v16 or removed in v16 so should be handled by ORM during migration :

  • DEL account.analytic_default_comp_rule
  • DEL analytic.analytic_group_comp_rule
  • DEL analytic.analytic_tag_comp_rule
  • NEW analytic.analytic_plan_comp_rule
  • NEW analytic.analytic_distribution_model_comp_rule
  • NEW event_sale.event_sale_report_comp_rule
  • NEW hr.hr_plan_company_rule
  • NEW hr.hr_plan_activity_type_company_rule
  • NEW hr_holidays.hr_leave_stress_day_rule_multi_company
  • NEW hr_skills.hr_employee_skill_report_multicompany
  • NEW loyalty.sale_loyalty_card_company_rule
  • NEW loyalty.sale_loyalty_program_company_rule
  • NEW loyalty.sale_loyalty_reward_company_rule
  • NEW loyalty.sale_loyalty_rule_company_rule
  • NEW note.ir_rule_note_note_multi_company

for v17.0

There since migration scripts have not be written yet, I should take care of only updating noupdate_changes.xml for the following :

  • project.project_comp_rule
  • project.task_comp_rule
  • project.report_project_task_user_report_comp_rule

To be noted that they added in v17.0 updates on project rules but not on product rules...

For existing DB

Now the above is true if DB from v14.0 onwards were already updated to get updated company rules. I am not sure how to script the update of all these noupdate security rules though...

@legalsylvain
Copy link
Contributor

Thanks for the analysis !

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

No branches or pull requests

3 participants