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

[FW][FIX] sale_project: editable views for action_view_task #163594

Closed

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Apr 26, 2024

Steps to reproduce

  • Install sale_project,industry_fsm,web_studio
  • Open quotation S00023
  • Click on the Tasks stat button
  • Open studio
  • Go to views
  • Enable the gantt view

=> Unable to complete the operation: duplicate key value violates unique constraint "act_window_view_unique_mode_per_action"

Cause of the issue

The action record already contains the gantt view, but it is replaced inside the python action.

In previous version, the user was entering this condition and thus had no problem editing the views

Solution

Instead of replacing the entire action['views'], we can remap the view ids to the ones we want.

One side effect of this though is that the gantt,activity,map views will be available by default.


opw-3800071

Forward-Port-Of: #163170

Steps to reproduce
==================

- Install sale_project,industry_fsm,web_studio
- Open quotation S00023
- Click on the Tasks stat button
- Open studio
- Go to views
- Enable the gantt view

=> Unable to complete the operation: duplicate key value violates unique constraint "act_window_view_unique_mode_per_action"

Cause of the issue
==================

The [action record] already contains the gantt view, but it is replaced
inside the python [action].

In [previous] version, the user was entering this condition and thus had
no problem editing the views

Solution
========

Instead of replacing the entire action['views'], we can remap the view
ids to the ones we want.

One side effect of this though is that the `gantt,activity,map` views
will be available by default.

---

[action record]: https://github.com/odoo/enterprise/blob/1df090289f3c45c200d133734989a6d9a8073145/project_enterprise/views/project_task_views.xml#L227
[action]: https://github.com/odoo/odoo/blob/1a9302dc3a9b0d9323612c10e0f3a91300bb89fd/addons/sale_project/models/sale_order.py#L154
[previous]: https://github.com/odoo/odoo/blob/8dbcd3d955e7270fc26a6141e8fce751029e5a4b/addons/sale_project/models/sale_order.py#L133-L141

opw-3800071

X-original-commit: e331798
@robodoo robodoo added the forwardport This PR was created by @fw-bot label Apr 26, 2024
@robodoo
Copy link
Contributor

robodoo commented Apr 26, 2024

@fw-bot
Copy link
Contributor Author

fw-bot commented Apr 26, 2024

This PR targets 17.0 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Apr 26, 2024
robodoo pushed a commit that referenced this pull request Apr 27, 2024
Steps to reproduce
==================

- Install sale_project,industry_fsm,web_studio
- Open quotation S00023
- Click on the Tasks stat button
- Open studio
- Go to views
- Enable the gantt view

=> Unable to complete the operation: duplicate key value violates unique constraint "act_window_view_unique_mode_per_action"

Cause of the issue
==================

The [action record] already contains the gantt view, but it is replaced
inside the python [action].

In [previous] version, the user was entering this condition and thus had
no problem editing the views

Solution
========

Instead of replacing the entire action['views'], we can remap the view
ids to the ones we want.

One side effect of this though is that the `gantt,activity,map` views
will be available by default.

---

[action record]: https://github.com/odoo/enterprise/blob/1df090289f3c45c200d133734989a6d9a8073145/project_enterprise/views/project_task_views.xml#L227
[action]: https://github.com/odoo/odoo/blob/1a9302dc3a9b0d9323612c10e0f3a91300bb89fd/addons/sale_project/models/sale_order.py#L154
[previous]: https://github.com/odoo/odoo/blob/8dbcd3d955e7270fc26a6141e8fce751029e5a4b/addons/sale_project/models/sale_order.py#L133-L141

opw-3800071

closes #163594

X-original-commit: e331798
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
@robodoo
Copy link
Contributor

robodoo commented Apr 27, 2024

@hubvd @xavierbol staging failed: ci/runbot (view more at https://runbot.odoo.com/runbot/build/61927995)

@xavierbol
Copy link
Contributor

robodoo retry

@robodoo robodoo closed this in f07c1a6 Apr 29, 2024
willylohws pushed a commit to willylohws/odoo that referenced this pull request May 1, 2024
Steps to reproduce
==================

- Install sale_project,industry_fsm,web_studio
- Open quotation S00023
- Click on the Tasks stat button
- Open studio
- Go to views
- Enable the gantt view

=> Unable to complete the operation: duplicate key value violates unique constraint "act_window_view_unique_mode_per_action"

Cause of the issue
==================

The [action record] already contains the gantt view, but it is replaced
inside the python [action].

In [previous] version, the user was entering this condition and thus had
no problem editing the views

Solution
========

Instead of replacing the entire action['views'], we can remap the view
ids to the ones we want.

One side effect of this though is that the `gantt,activity,map` views
will be available by default.

---

[action record]: https://github.com/odoo/enterprise/blob/1df090289f3c45c200d133734989a6d9a8073145/project_enterprise/views/project_task_views.xml#L227
[action]: https://github.com/odoo/odoo/blob/1a9302dc3a9b0d9323612c10e0f3a91300bb89fd/addons/sale_project/models/sale_order.py#L154
[previous]: https://github.com/odoo/odoo/blob/8dbcd3d955e7270fc26a6141e8fce751029e5a4b/addons/sale_project/models/sale_order.py#L133-L141

opw-3800071

closes odoo#163594

X-original-commit: e331798
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwardport This PR was created by @fw-bot OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants