Skip to content

Commit

Permalink
[FIX] sale_gathering: fix invoice in 0 discounting gathering
Browse files Browse the repository at this point in the history
closes #935

X-original-commit: 65eed03
Signed-off-by: Juan Ignacio Rivero <[email protected]>
Signed-off-by: Franco Leyes <[email protected]>
  • Loading branch information
lef-adhoc committed Sep 23, 2024
1 parent 8312c04 commit dadc156
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sale_gathering/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,12 @@ def _compute_gathering_balance(self):
def _get_invoiceable_lines(self, final=False):
"""Return the invoiceable lines for order `self`."""
invoiceable_lines = super()._get_invoiceable_lines(final=final)
for rec in self.filtered(lambda x: x.is_gathering and x.gathering_balance > 0.0):
product_precision_digits = self.env['decimal.precision'].precision_get('Product Price')
for rec in self.filtered(lambda x: x.is_gathering and float_compare(x.gathering_balance, 0.0, precision_digits=product_precision_digits) >= 0):
for line in rec.order_line.filtered('is_downpayment'):
if final:
invoiceable_lines |= line
invoiceable_lines = invoiceable_lines.filtered(
lambda line: line.display_type not in ['line_section', 'line_note']
)
invoiceable_lines = invoiceable_lines.filtered(lambda line: line.display_type not in ['line_section', 'line_note'])
return invoiceable_lines

@api.constrains('is_gathering', 'amount_total')
Expand Down

0 comments on commit dadc156

Please sign in to comment.