Skip to content

[18.0] [MIG] pos_session_pay_invoice#1472

Merged
OCA-git-bot merged 40 commits intoOCA:18.0from
sygel-technology:18.0-mig-pos_session_pay_invoice
Mar 25, 2026
Merged

[18.0] [MIG] pos_session_pay_invoice#1472
OCA-git-bot merged 40 commits intoOCA:18.0from
sygel-technology:18.0-mig-pos_session_pay_invoice

Conversation

@Tisho99
Copy link
Copy Markdown
Contributor

@Tisho99 Tisho99 commented Jan 12, 2026

Standard migration

  • The pos order is now created in draft state because we can no longer create pos payments in posted pos orders. The 'invoiced' state is assigned after that
  • The refund of the setUpClass is now generated from a new invoice because in v18 the original and refund moves were being automatically conciliated

Depends of OCA/account-payment#820

T-9200

@Tisho99 Tisho99 force-pushed the 18.0-mig-pos_session_pay_invoice branch 3 times, most recently from 642bbe1 to 6bfe20c Compare January 16, 2026 14:18
@Tisho99 Tisho99 marked this pull request as ready for review January 16, 2026 14:20
@Tisho99 Tisho99 force-pushed the 18.0-mig-pos_session_pay_invoice branch 2 times, most recently from dd612a9 to 868f215 Compare January 19, 2026 14:48
Copy link
Copy Markdown

@javierizaca javierizaca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functional review completed. The module works as expected, allowing payments to be made from the backend of an active session. LGTM.

Comment thread pos_session_pay_invoice/__manifest__.py Outdated
"partner_id": self.invoice_id.partner_id.id,
"account_move": self.invoice_id.id,
"state": "invoiced",
"state": "draft",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it validated at some point?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is validated (or set as 'invoiced') here: https://github.com/OCA/pos/pull/1472/files#diff-f228ebf7313229f41451c1c8f72b80d566b40b9075e7fefd8dfac7313711e159R92

I searched for highet level function in pos.order to assign the state, but found anything useful for this case

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried the following function 'action_pos_order_invoice' which calls '_generate_pos_order_invoice' which generates an invoice and marks the 'pos order' as invoiced?

https://github.com/odoo/odoo/blob/bcc1397c7d694dbe61ecbd44d0320b9518df84cb/addons/point_of_sale/models/pos_order.py#L984C9-L984C33

https://github.com/odoo/odoo/blob/bcc1397c7d694dbe61ecbd44d0320b9518df84cb/addons/point_of_sale/models/pos_order.py#L1010

Copy link
Copy Markdown
Contributor Author

@Tisho99 Tisho99 Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have to generate a new invoice, the invoice is already generated. We are associating a new pos order with an already created invoice. So using that function does not make sense for me

Comment thread pos_session_pay_invoice/tests/test_pay_invoice.py
@Tisho99 Tisho99 force-pushed the 18.0-mig-pos_session_pay_invoice branch from 868f215 to 9d88a07 Compare January 21, 2026 16:18
Copy link
Copy Markdown

@ValentinVinagre ValentinVinagre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏻

@Tisho99 Tisho99 force-pushed the 18.0-mig-pos_session_pay_invoice branch from 9d88a07 to 6dabf01 Compare February 10, 2026 08:20
@pedrobaeza
Copy link
Copy Markdown
Member

/ocabot migration pos_session_pay_invoice

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Mar 19, 2026
@OCA-git-bot OCA-git-bot mentioned this pull request Mar 19, 2026
33 tasks
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this locally, both at code level and functionally.

Regarding the CI/CD failures, they don't seem related to this module at all — for example, the IrModuleModule._load_pos_data_fields() error (tracked in odoo/odoo#241122) was already fixed in the OCB via commit OCA/OCB@692620ab6.

Also, the module's own tests pass cleanly on my end, so LGTM.

OCA-git-bot and others added 17 commits March 24, 2026 09:21
Currently translated at 100.0% (30 of 30 strings)

Translation: pos-16.0/pos-16.0-pos_session_pay_invoice
Translate-URL: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_session_pay_invoice/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: pos-16.0/pos-16.0-pos_session_pay_invoice
Translate-URL: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_session_pay_invoice/
Currently translated at 100.0% (8 of 8 strings)

Translation: pos-16.0/pos-16.0-pos_session_pay_invoice
Translate-URL: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_session_pay_invoice/it/
…S session

To prevent mistakes, users must select only the journals available in the pos.payment.method of the POS session.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: pos-16.0/pos-16.0-pos_session_pay_invoice
Translate-URL: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_session_pay_invoice/
… customer transactions

Before this commit, the wizard generated an account.bank.statement.line, but the problem was that when the POS had cash control enabled, all transactions generated by this wizard were displayed under Cash, because Odoo considered such statements as Cash In/Out operations, see https://github.com/odoo/odoo/blob/c1d3153ed564c0f47a201e5751740857a15d7db2/addons/point_of_sale/models/pos_session.py#L557-L567.

Now, the transactions are shown under Cash or Bank depending on the payment method and journal type.

For payments of vendor bills, a statement line will still be created, because the POS only works with receivable accounts and cannot reconcile with payable accounts.
See https://github.com/odoo/odoo/blob/c1d3153ed564c0f47a201e5751740857a15d7db2/addons/point_of_sale/models/pos_order.py#L890-L898
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: pos-16.0/pos-16.0-pos_session_pay_invoice
Translate-URL: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_session_pay_invoice/
Currently translated at 100.0% (12 of 12 strings)

Translation: pos-16.0/pos-16.0-pos_session_pay_invoice
Translate-URL: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_session_pay_invoice/it/
@Tisho99 Tisho99 force-pushed the 18.0-mig-pos_session_pay_invoice branch from 6dabf01 to 64477f2 Compare March 24, 2026 08:22
@Tisho99
Copy link
Copy Markdown
Contributor Author

Tisho99 commented Mar 24, 2026

Rebased to see if the tests pass now

@pedrobaeza
Copy link
Copy Markdown
Member

Waiting OCA/oca-ci#123 for the CI to greenify.

@Tisho99 Tisho99 force-pushed the 18.0-mig-pos_session_pay_invoice branch from 64477f2 to fd65042 Compare March 25, 2026 14:15
@Tisho99
Copy link
Copy Markdown
Contributor Author

Tisho99 commented Mar 25, 2026

Hello @pedrobaeza

This pull request is ready, in case you want to review it or merge it.

Thanks!

@pedrobaeza
Copy link
Copy Markdown
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 18.0-ocabot-merge-pr-1472-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 60ac10c into OCA:18.0 Mar 25, 2026
7 checks passed
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at e826150. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.