OCA / contract

GNU Affero General Public License v3.0
173 stars 528 forks source link

[16][IMP] Contract: Smart Button "Contracts" not displayed on Contact until an invoice is published #1143

Open fcvalgar opened 1 week ago

fcvalgar commented 1 week ago

Module contract

Describe the bug

The "Contracts" smart button on the contact form view does not appear when a contract is created and in progress. It only becomes visible after an associated invoice is published.

To Reproduce

Affected versions: Odoo 16

Steps to reproduce the behavior:

Expected behavior:

Additional context This issue limits the ability to view ongoing contracts directly from the contact form unless an invoice has been published.

MT-7885 @moduon

rafaelbn commented 1 week ago

Hello @OCA/project-service-maintainers !

Do you agree in this improvement? 😄

Let me know please! ❤️

Thank you!

rousseldenis commented 1 week ago

@rafaelbn This is due to :

image

So the customer_rankshould be updated when we create a contract IMHO (that's logical). But IMHO too, we should not rely on customer rank to display the smart button.

rafaelbn commented 6 days ago

Thank you for answering @rousseldenis !

But IMHO too, we should not rely on customer rank to display the smart button.

fcvalgar commented 5 days ago

To avoid relying on the customer_rank field for the visibility of the smart button, we propose modifying its logic to directly use the contract model.

We can implement a method to check for active contracts associated with the customer.

@rafaelbn This is due to :

image

So the customer_rankshould be updated when we create a contract IMHO (that's logical). But IMHO too, we should not rely on customer rank to display the smart button.