-
-
Notifications
You must be signed in to change notification settings - Fork 699
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
base: 17.0
Are you sure you want to change the base?
[17.0][FIX] account_invoice_section_sale_order: FWD port and fix test-case #1871
Conversation
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.
…nvoice_with_currency
@sergiocorato @simahawk Could any of you kindly review this PR? Thank you! |
@TDu Can you take a look at this fix please? |
There was a problem hiding this 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.
for move_line in self.env["account.move.line"].browse(move_line_ids): | ||
if move_line.display_type == "line_section": | ||
# add extra indent for existing SO Sections | ||
move_line.name = f"- {move_line.name}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you removing this extra indent bit on purpose? I don't see it in the original fixes that you are porting here, but then again it was introduced in the migration of v15 (439ff49) and the fixes ported here are from 14.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It ported from commit https://github.com/OCA/account-invoicing/pull/1774
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see where in #1774 the extra indent is removed. Again, that patch is on 14.0 whereas the extra indent was only introduced in 15 if I understand correctly.
FWD ports
#1774
#1862
#1770
Fix test-case
test_create_invoice_with_currency
change compare