Daily updates from Odoo
Wednesday, July 17, 2019
2 changes · master
Resolved issues and error corrections
This fixes a problem that could prevent authorized users from creating a new company when timesheet holidays were installed. The system now handles the automatic background project setup correctly, so company creation succeeds even when the user does not directly manage projects.
Original PR description
[FIX] base: Allow to create company with ir.model.access ======== The group `base.group_erp_manager` grants the permission to create a company according to the `ir.model.access`. However, with only…
[FIX] base: Allow to create company with ir.model.access ======== The group `base.group_erp_manager` grants the permission to create a company according to the `ir.model.access`. However, with only this group, a user cannot create a company because the group does not give permission to `res.partner`. For creating a company, access to `res.partner` is required for two things: 1. Create the linked `res.partner` 2. Write the name of the company which is a related field of `partner_id.name`, readonly=False, stored=True. Using a simple `sudo` would be enough to solve 1. but 2. is problematic since the write is performed by a low level inverse orm method at the company creation. The solution is that `base.group_erp_manager` implies `base.group_partner_manager`. [FIX] project_timesheet_holidays: Allow to create a company ========== It is currently impossible to create a company. The reason being that the newly created company is not yet in context `allowed_company_ids`. Therefore, every consequent access to a record protected with a multi company `ir.rule` fails for that company. Here, the module automatically creates a project in that company and later read that project to check a constraint. The read raises an AccessError, hence the company is not created. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This fix prevents Odoo from trying to update existing records that were only linked as default values in a form. It helps avoid save errors when those linked records are locked or not meant to be edited, such as posted accounting entries.
Original PR description
Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr