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

[FIX] website_sale: no automatic invoice when the full amount is discounted #162354

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dere-odoo
Copy link

Prior to this commit:

  • When the "Automatic Invoice" setting was enabled and the total amount of the cart was zero due to a discount, no invoice was automatically created in the backend. This required manual intervention to create an invoice and confirm the sale order.

Post this commit:

  • When the "Automatic Invoice" setting is activated and the total amount of the cart is zero thanks to a discount, the invoice is automatically created in the backend without the need for manual operation.

Task: 3786812

I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@robodoo
Copy link
Contributor

robodoo commented Apr 18, 2024

@C3POdoo C3POdoo added the RD research & development, internal work label Apr 18, 2024
@dere-odoo dere-odoo force-pushed the master-website_sale-fix-no-automatic-invoice-when-the-full-amount-is-discounted-dere branch 3 times, most recently from 1dc1c57 to d609610 Compare April 25, 2024 09:43
Copy link
Contributor

@kcv-odoo kcv-odoo 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 your work 💯

About your solution we still need to explore more about auto invoice flow 😮‍💨 : before finalizing solution

@@ -1768,6 +1768,7 @@ def shop_payment_validate(self, sale_order_id=None, **post):
order = request.env['sale.order'].sudo().browse(sale_order_id)
assert order.id == request.session.get('sale_last_order_id')


Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

Unnecessary change

auto_invoice = str2bool(
request.env['ir.config_parameter'].sudo().get_param('sale.automatic_invoice')
)
if auto_invoice:
Copy link
Contributor

@kcv-odoo kcv-odoo Apr 26, 2024

Choose a reason for hiding this comment

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

I am not sure but this feels wrong 😕
I think what you need to do is change something in actual auto_invoice flow and take this into account but as you try to do it was creating payment entry and here we don't want to create payment entries 😐
Still need to dive in deeper 🦀

…ounted

Prior to this commit:
- When the "Automatic Invoice" setting was enabled and the total amount of the
cart was zero due to a discount, no invoice was automatically created in the
backend. This required manual intervention to create an invoice and confirm the
sale order.

Post this commit:
- When the "Automatic Invoice" setting is activated and the total amount of the
cart is zero thanks to a discount, the invoice is automatically created in the
backend without the need for manual operation.

Task: 3786812
@dere-odoo dere-odoo force-pushed the master-website_sale-fix-no-automatic-invoice-when-the-full-amount-is-discounted-dere branch from d609610 to 978b0f4 Compare May 1, 2024 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants