contract icon indicating copy to clipboard operation
contract copied to clipboard

[16.0] [IMP] _compute_auto_renew on quotation sent

Open victor-champonnois opened this issue 1 year ago • 4 comments

This allows to make the product contract settings work on ecommerce orders. The product auto-renew settings are only applied on product change. This doesn't happen for sale orders created from the ecommerce. This PR force the computation of auto-renew settings on checkout.

victor-champonnois avatar Jan 10 '25 16:01 victor-champonnois

Hi @sbejaoui, some modules you are maintaining are being modified, check this out!

OCA-git-bot avatar Jan 10 '25 16:01 OCA-git-bot

@huguesdk actually just fixing the api depends by adding the ones you suggest does not suffice to trigger the method call. I don't know why though, it's just what I experience on my tests.

victor-champonnois avatar Mar 24 '25 15:03 victor-champonnois

if i understand correctly, when a sale order is created from the e-commerce, ._compute_auto_renew() is not called? i think this is because there are only 3 fields that use this compute method (although it computes other ones) and they are all 3 writable and have a default value. this means that there is indeed nothing to compute at creation time. for it to work, in addition with the changes from my previous comment, these fields should be redefined as (writable and storable) computed fields using ._compute_auto_renew as compute method since they are all set in this method:

  • product_uom_qty
  • recurring_rule_type
  • recurring_invoicing_type
  • date_start
  • date_end

anyway, i think that there is a design problem in this model. ok to leave it like this for now.

huguesdk avatar Mar 25 '25 14:03 huguesdk

@huguesdk thank you for your analysis, I think you are right. OK to leave it like that in this PR

victor-champonnois avatar Mar 27 '25 08:03 victor-champonnois

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. If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

github-actions[bot] avatar Jul 27 '25 12:07 github-actions[bot]