[IMP] subscription_oca:set invoice currency to subscription pricelist and ensure company context in create_invoice#1433
Conversation
|
Hi, @sbidoul @CristianoMafraJunior @thib-d @yvaucher check this functionality added to subscription oca and approve please |
|
Hi @rickard-w please checks this functionality please ! |
9d60448 to
bc31d17
Compare
|
@OCA-git-bot mainteiners contract approve |
|
/ocabot merge --no-bump |
|
Hi @stferraro. Your command failed:
Ocabot commands
More information
|
|
Hi @stferraro |
|
Hi @rickard-w , thanks for your comment please approve this PR |
|
Hi @pedrobaeza, when you have a chance, could you please review this PR? Otherwise, could you tag someone who can review and approve it? |
I don't have the permission to approve. And honstly, I don't know if I have the skills either :) |
|
This PR has the |
|
Hi @yvaucher please check this pr approve and merge! |
|
@stferraro The merge process could not start, because command |
1 similar comment
|
@stferraro The merge process could not start, because command |
49c06fe to
e6bbb06
Compare
…icelist and ensure company context in create_invoice
…icelist and ensure company context in create_invoice
…icelist and ensure company context in create_invoice
e6bbb06 to
e09e56e
Compare
|
/ocabot merge --no-bump |
|
Hi @stferraro. Your command failed:
Ocabot commands
More information
|
|
/ocabot merge nobump |
|
Sorry @stferraro you are not allowed to merge. To do so you must either have push permissions on the repository, or be a declared maintainer of all modified addons. If you wish to adopt an addon and become it's maintainer, open a pull request to add your GitHub login to the |
|
Hi, @alvaro-domatix this PR has been approved for a while but I don't have merge permissions on this repo (I'm not yet a declared maintainer of /ocabot merge patch Thanks a lot for your time! |
|
Sorry @stferraro you are not allowed to merge. To do so you must either have push permissions on the repository, or be a declared maintainer of all modified addons. If you wish to adopt an addon and become it's maintainer, open a pull request to add your GitHub login to the |
In multi-company and multi-currency setups, invoices generated from subscriptions may not consistently enforce:
The subscription pricelist currency on the created invoice.
The subscription company context during invoice creation.
This can lead to inconsistent invoice values or cross-company context issues in downstream implementations.
Describe the solution you'd like
Implement the following in subscription_oca:
Ensure invoice values explicitly set currency_id from subscription.pricelist_id.currency_id when preparing account.move values.
Ensure create_invoice runs under subscription.company_id context (with_company) before creating the invoice.
Also add unit tests to validate:
Invoice currency matches subscription pricelist currency.
Invoice company matches subscription company in multi-company scenarios.
Multi-Company Security: Ensure proper record rules are defined so users in multi-company environments don't face access errors or leakages.
Add search view in module
Describe alternatives you've considered
Keep this behavior in downstream custom modules only.
Override invoice creation in each deployment that needs strict multi-company/multi-currency behavior.
These alternatives duplicate logic across projects and increase maintenance cost compared to handling it upstream.
Additional context
I can submit a PR for 19.0 including implementation and tests.