[18.0][IMP] product_contract - remove unnecessary defaults#1315
[18.0][IMP] product_contract - remove unnecessary defaults#1315anthonissen-a wants to merge 1 commit intoOCA:18.0from
Conversation
|
Hi @sbejaoui, |
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
pedrobaeza
left a comment
There was a problem hiding this comment.
Looking at the code, we are not going to have the proper value in the line init, as the compute is not assigning any default value.
|
Hi @pedrobaeza, thanks for your review. |
|
I understood the contrary: the default is applied instead of the compute. |
|
Exactly, and therefore the |
|
But that can't be done if the compute is not providing the same default value, which is not the case. |
|
@pedrobaeza Please read again the offical doc warning (see my post upper).
Are you saying that we should move the default values in the "init" values of the compute? For instance It could make sense even for the compute acting as an onchange on the view that if you change the product to a non contract product. As you want plausible default values. |
|
OK to renew the compute method |
|
Do you have a case where these values are used in another context than with products of type contract ? Otherwise, the values of these fields will be overwritten by the compute when a product of type contract is set. |

The default attributes are no longer necessary since the fields are set by the compute method with a precompute attribute.