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

[15.0][FIX] agreement_rebate: Settlement lines already invoiced are invoiced twice when process the settlement in tow steps #55

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion agreement_rebate/models/agreement_rebate_settlement.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ def _reverse_type_map(self, inv_type):

def create_invoice(self):
invoice_dic = {}
for line in self.mapped("line_ids"):
for line in self.mapped("line_ids").filtered(
lambda ln: ln.invoice_status == "to_invoice"
):
key = line._get_invoice_key()
if key not in invoice_dic:
invoice_dic[key] = line._prepare_invoice()
Expand Down
Loading