Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][FIX] account_invoice_section_sale_order: FWD port and fix test-case #1871

Open
wants to merge 4 commits into
base: 17.0
Choose a base branch
from

Conversation

LucasTran380381
Copy link

@LucasTran380381 LucasTran380381 commented Dec 31, 2024

FWD ports

#1774
#1862
#1770

Fix test-case

test_create_invoice_with_currency change compare

self.assertEqual(invoices.amount_total, 80) => self.assertEqual(invoices.amount_untaxed, 80)

@miguel-S73
Copy link
Contributor

@sergiocorato @simahawk Could any of you kindly review this PR? Thank you!

@pilarvargas-tecnativa
Copy link

@TDu Can you take a look at this fix please?

Copy link
Member

@StefanRijnhart StefanRijnhart left a comment

Choose a reason for hiding this comment

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

Thanks for fixing the tests! I see they were caused by Odoo adding taxes to demo products in odoo/odoo@1443e5503c7396512a. Hope we can merge this one fast. Just a small question.

mmequignon and others added 4 commits February 4, 2025 09:44
the `sale.order._create_invoices() method does not only requires
`create` access to the `account.move` and `account.move.line` models.

Because we're actually sorting lines after the creating, it requires
`read` access to sort, and `write` access to modify their sequence.

This is problematic when interracting with other modules like
`invoice_mode_at_shipping` where stock users are the ones to create
invoices.

This commit adds a few `sudo()` in the code, in order to avoid granting
`read` and `write` access to users that shouldn't be allowed to read and write invoices.
@LucasTran380381 LucasTran380381 force-pushed the 17.0-fix-account_invoice_section_sale_order branch from 17292ca to c62dfd9 Compare February 4, 2025 02:47
@simahawk
Copy link
Contributor

@StefanRijnhart fine for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants