Repository navigation
[18.0][ADD] crm_project_create_from_template - #754
edescalona wants to merge 1 commit into
Conversation
f28ca6e to
930675d
Compare
930675d to
7bb7f3a
Compare
rrebollo
left a comment
There was a problem hiding this comment.
Two points before merge.
Packaging: one field and one branch on the existing wizard; I would have expected an [IMP] to crm_project_create, not a new addon. If the reason is the hard project_template dependency an [IMP] would add, say so in the body and that settles it.
wizards/crm_create_project.py:21 — the sudo copy reads a template the salesman names, so a project he cannot see is copied into one he can. Reproduced on 18.0.
The rest matches the PR.
| self.ensure_one() | ||
| if not self.project_template_id: | ||
| return super().create_project() | ||
| project = self.project_template_id.sudo().copy( |
There was a problem hiding this comment.
The sudo() exists so a salesman can create a project: crm.create.project is granted to group_sale_salesman, while project.project gives group_project_user read only and creation to the manager (project/security/ir.model.access.csv:2-3). Escalating the lead's create is fine; reading a template the user names is not — is_template is a UI domain and the copy carries its description and tasks. Core guards before escalating (mail/controllers/thread.py:65) or drops sudo after the copy (html_editor/controllers/main.py:399), so check read access, or make templates readable by rule.
| project = self.project_template_id.sudo().copy( | |
| self.project_template_id.check_access("read") | |
| project = self.project_template_id.sudo().copy( |
… optional templates
7bb7f3a to
0de60b3
Compare
|
Hi @rrebollo could you please review again? Thanks |
@BinhexTeam
T23827
The module extends
crm_project_createby adding a project template selector to thecrm.create.projectwizard. When a template is selected, the created project is copied from that template, including its tasks, while keeping the CRM-specific values prepared by the base wizard such as project name, partner, company, description, and billable configuration.If no template is selected, the standard behavior from
crm_project_createis preserved.