odoo/odoo#191344
Created by Jeel Patel (jeep)
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/template: Contact runbot team on discord for help.
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- label
- odoo-dev:18.0-sale-pdf-quote-builder-tab-not-showing-jeep
- head
- e3e5d2441bd4f240e7274e4246c4ec65ed8fead1
- merged
- 3 months ago by Sales, Morgane Demesmaeker
odoo/odoo | |
---|---|
18.0 | #191344 |
saas-18.1 | #195028 |
saas-18.2 | |
saas-18.3 | |
master | #195286 |
[FIX] sale_pdf_quote_builder: quote builder tab not visible immediately
Steps to Reproduce:
- Ensure no headers or footers are in Configuration > Headers/Footers.
- Create a new Sale Order (SO).
- Add a partner to the SO.
- Add a product to the SO that has a document linked to it.
- The Quote Builder
tab does not appear until the SO is saved and reopened.
Issue:
The Quote Builder
tab did not appear immediately after adding a product with linked documents. This required saving and reopening the SO to make the tab visible, causing inconvenience to users.
Cause:
The _compute_available_product_document_ids
method lacked an @api.depends
decorator for fields product_id
and product_template_id
. As a result, the dependent field is_pdf_quote_builder_available
was not updated dynamically.
Fix:
Added the @api.depends
decorator to _compute_available_product_document_ids
, ensuring the computation is triggered immediately when product_id
or product_template_id
changes. This ensures that
is_pdf_quote_builder_available
is recalculated dynamically, making the Quote Builder
tab visible immediately.
- Also added
compute_sudo
onavailable_product_document_ids
field to ensure
available documents consistancy even though users have different access.