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] sale: correctly get AML lines with downpayment #77195

Closed
wants to merge 1 commit into from

Conversation

sswapnesh
Copy link
Contributor

Steps:

  • Create AML which is linked to multiple Down payment SO lines
  • Post Invoice

Issue:

  • Traeback due to accessing field on m2m sale_line_ids field

Fix:

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

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

@robodoo
Copy link
Contributor

robodoo commented Sep 24, 2021

@C3POdoo C3POdoo requested a review from a team September 24, 2021 17:39
@C3POdoo C3POdoo added the Sales Sales label Sep 24, 2021
Copy link
Contributor

@Feyensv Feyensv left a comment

Choose a reason for hiding this comment

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

Seems correct, even if I don't really see the flow to reproduce the bug in standard 🤔

addons/sale/models/account_move.py Outdated Show resolved Hide resolved
Steps:
 - Create AML which is linked to multiple Down payment SO lines
 - Post Invoice

Issue:

 - Traeback due to accessing field on m2m `sale_line_ids` field

Fix:
- Filter the SO lines based on `is_downpayment` field.
Fixes: odoo#77028
Copy link

@mbcosta mbcosta left a comment

Choose a reason for hiding this comment

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

Thanks @sswapnesh for solving,

There is another problem related to reference multiple sale lines to one invoice line, maybe should be solve in another PR, the field qty_invoiced in sale.order.line show the quantity of invoice line without consider, in this case, that the value is the sum of others sale lines https://github.com/odoo/odoo/blob/14.0/addons/sale/models/sale.py#L1230, what can make confuse the user about the real Invoiced Quantity:

image

@sswapnesh
Copy link
Contributor Author

@Feyensv Can this be merged ?

@Feyensv
Copy link
Contributor

Feyensv commented Apr 22, 2022

After more thoughts, I prefer to avoid merging stable changes unless you can really reproduce this traceback with a standard flow (AFAIK, we never link one AML with multiple SOL in standard flows 🤔)

@sswapnesh
Copy link
Contributor Author

@Feyensv What do you think to correct this on new versions to make this one to one ?
May be an internal Task ?

@Feyensv
Copy link
Contributor

Feyensv commented Apr 25, 2022

There is no such thing as a Onetoone field :D.

@sswapnesh
Copy link
Contributor Author

There is no such thing as a Onetoone field :D.

😄 It was there in Past 😉
What I mean is to make it m2o

@Feyensv
Copy link
Contributor

Feyensv commented Apr 28, 2022

Oh indeed, I thought it was already a m2o/o2m pair, but those are two m2m surprisingly.
Well, this would require a migration script and more job for us & OpenUpgrade, so I believe we could leave it like that, even if I recognize it's a bit confusing ^^.

@C3POdoo
Copy link
Contributor

C3POdoo commented Apr 16, 2024

Dear @sswapnesh,

Thank you for your contribution but the version 14.0 is no longer supported.
We only support the last 3 stable versions so no longer accepts patches into this branch.

We apology if we could not look at your request in time.
If the contribution still makes sense for the upper version, please let us know and do not hesitate to recreate one for the recent versions. We will try to check it as soon as possible.

This is an automated message.

@C3POdoo C3POdoo closed this Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sales Sales
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Post Invoice with lines with mulltiple Sale lines
5 participants