[19.0][IMP] subscription_oca: change customer wizard#1452
[19.0][IMP] subscription_oca: change customer wizard#1452alvaro-domatix wants to merge 1 commit into
Conversation
61738ff to
42373eb
Compare
jorgeglez1990
left a comment
There was a problem hiding this comment.
A functional review has been carried out, and it was detected that when changing the customer to another one with a specific pricelist assigned, the line price is updated correctly, but the invoice total is not recalculated or updated.
It would be preferable to develop this functionality in a separate addon that inherits from the corresponding module, in order to avoid modifying the base module.
42373eb to
145a216
Compare
Add a transient wizard to change the customer on one or more subscriptions from the list-view action menu. * `sale.subscription.change.partner.wizard` (transient). The affected subscriptions default from `active_ids`, so the same wizard serves single-record and bulk operations. * `action_apply` refuses closed subscriptions, skips records whose customer does not actually change, writes the new partner and (optionally) the customer's pricelist and the recomputed fiscal position in a single write, and posts an audit line on each subscription's chatter. * The fiscal position is resolved through `sale.subscription._get_fiscal_position_from_partner`, a plain method reused by the existing onchange, instead of relying on onchange side effects for persistence. The change applies to the subscription and its future invoices and orders; invoices already issued are not reassigned. The action is bound to `sale.subscription` (list, form) and its ACL is granted to `sales_team.group_sale_manager` only, since changing the customer of a contract is a sensitive operation.
145a216 to
c8764aa
Compare
|
Hi @jorgeglez1990, thanks for catching this. I investigated and the root cause is in the core, not in the wizard itself: The fix is in #1474 — On the separate-addon point: the wizard is a small, self-contained extension of the base, and the bug above turned out to be pre-existing in the core rather than introduced by it; I'd lean towards keeping it here, but happy to split it out if you still see value in it. |
Adds a wizard to change the customer of one or more subscriptions from the list/form action menu.
It refuses closed subscriptions, skips records whose customer does not actually change, optionally updates the pricelist and the recomputed fiscal position in the same write, and posts a note in the chatter of each subscription. Invoices already issued keep their original partner; only the subscription and its future invoices and orders are affected.
The action is restricted to sale managers, since changing the customer of a running contract is a sensitive operation.