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: Extra downpayment line #164038

Conversation

ramaniraj11
Copy link
Contributor

Issue:
======
Extra down-payment line is creating

Steps to reproduce the issue:
=============================
- create an SO, then create downpayment with 30% percent, remove the tax in generated INV and post the invoice.
- go back to SO create another downpayment with 30%

Solution:
=========
Typically, when calculating the value of down-payment lines,
we only consider sales order lines for products, not down-payment lines.
This is because, according to the Odoo workflow,
down-payment lines are created based on product lines in the sales order,
not on down-payment lines themselves. Therefore, I am filtering out those lines here.

closes odoo/odoo#163699

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

    Issue:
    ======
   	Extra down-payment line is creating

    Steps to reproduce the issue:
    =============================
    - create an SO, then create downpayment with 30% percent, remove the tax in generated INV and post the invoice.
    - go back to SO create another downpayment with 30%

    Solution:
    =========
	Typically, when calculating the value of down-payment lines,
	we only consider sales order lines for products, not down-payment lines.
	This is because, according to the Odoo workflow,
	down-payment lines are created based on product lines in the sales order,
	not on down-payment lines themselves. Therefore, I am filtering out those lines here.

    closes odoo#163699
@robodoo
Copy link
Contributor

robodoo commented Apr 30, 2024

@C3POdoo C3POdoo requested review from a team April 30, 2024 15:05
@Feyensv Feyensv requested review from jbw-odoo and removed request for a team April 30, 2024 15:20
@C3POdoo C3POdoo added CLA Contributor License Agreement Sales Sales labels Apr 30, 2024
@MiquelRForgeFlow
Copy link
Contributor

Remove [FW] from PR title.

@ramaniraj11 ramaniraj11 changed the title [FW][FIX] sale: Extra downpayment line [FIX] sale: Extra downpayment line May 3, 2024
@ramaniraj11
Copy link
Contributor Author

Remove [FW] from PR title.

Done

@jbw-odoo
Copy link
Contributor

jbw-odoo commented May 3, 2024

Hi @ramaniraj11 👋
First of all, thanks for this fix, it looks great. Not a use case i had i mind, so thx for that.
2 things :

  • This should target saas-16.3
  • A test would be fine.

Let me know if you need help in any of this.

@ramaniraj11
Copy link
Contributor Author

Hi @ramaniraj11 👋 First of all, thanks for this fix, it looks great. Not a use case i had i mind, so thx for that. 2 things :

  • This should target saas-16.3
  • A test would be fine.

Let me know if you need help in any of this.

Sorry Can you expain what are you try to say in above two point i don't understand

@jbw-odoo
Copy link
Contributor

jbw-odoo commented May 3, 2024

Hi @ramaniraj11 👋 First of all, thanks for this fix, it looks great. Not a use case i had i mind, so thx for that. 2 things :

  • This should target saas-16.3
  • A test would be fine.

Let me know if you need help in any of this.

Sorry Can you expain what are you try to say in above two point i don't understand

Yes, no worries :

Retargetting :

So this PR targets odoo 17.0 at the moment. But this fix should target odoo version saas-16.3 as this is the oldest supported version where this fix is useful. Once the fix is added to the 16.3 version of odoo, it will be forward ported to the more recent odoo versions.
To retarget you should change the base of your branch :

git fetch origin saas-16.3
git rebase --onto origin/saas-16.3 origin/17.0 17.0-fix-extra_downpayment_line_generated
git push -f

You then can change the target of this PR by clicking "Edit" and changing the "commit into" value

Test

When fixing a bug we often add a test covering the use case that is concerned.

If it's too much of a hassel, i can merge this PR and backport it to saas-16.3 + add a test myself afterwards. Let me know.

@ramaniraj11
Copy link
Contributor Author

Hello can you please write test case and back port this code please

@jbw-odoo
Copy link
Contributor

@robodoo r+

@robodoo robodoo closed this in 225d525 May 23, 2024
lohwswilson pushed a commit to lohwswilson/odoo that referenced this pull request Jun 5, 2024
    Issue:
    ======
   	Extra down-payment line is creating

    Steps to reproduce the issue:
    =============================
    - create an SO, then create downpayment with 30% percent, remove the tax in generated INV and post the invoice.
    - go back to SO create another downpayment with 30%

    Solution:
    =========
	Typically, when calculating the value of down-payment lines,
	we only consider sales order lines for products, not down-payment lines.
	This is because, according to the Odoo workflow,
	down-payment lines are created based on product lines in the sales order,
	not on down-payment lines themselves. Therefore, I am filtering out those lines here.

    closes odoo#163699

closes odoo#164038

Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Contributor License Agreement Sales Sales
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants