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

[8.0] skip invoice lines with value 0 #24

Merged
merged 3 commits into from
Nov 25, 2018
Merged

Conversation

luc-demeyer
Copy link
Contributor

No description provided.

Copy link
Member

@cubells cubells left a comment

Choose a reason for hiding this comment

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

👍

LGTM

Code review and test.

@cubells
I changed the check on 'price_unit' with value into price_subtotal.
By doing so we also cover the case of invoice lines with 100% discount.
Let me know if it's ok so that we can merge (and forward port to v10)
@luc-demeyer
Copy link
Contributor Author

@cubells
I changed the check on 'price_unit' with value 0.0 into 'price_subtotal'.
By doing so we also cover the case of invoice lines with 100% discount.
Let me know if it's ok so that we can merge (and forward port to v10)

Copy link
Member

@cubells cubells left a comment

Choose a reason for hiding this comment

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

@luc-demeyer

If you remove white spaces all is ok for me.

@@ -501,6 +501,9 @@ def _gather_invoices(self):
total_inv_weight = 0.0
for inv_line in invoice.invoice_line:

if not inv_line.price_subtotal:
continue

Copy link
Member

Choose a reason for hiding this comment

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

Remove all the white spaces of this line to avoid lint errors.

Copy link
Member

@pedrobaeza pedrobaeza Oct 29, 2017

Choose a reason for hiding this comment

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

A better expression is:

for inv_line in invoice.invoice_line.filtered('price_subtotal'):
    ...

@pedrobaeza
Copy link
Member

Travis is red

@luc-demeyer luc-demeyer merged commit c282362 into OCA:8.0 Nov 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants