Skip to content

Commit

Permalink
[IMP]change method parameter for better control
Browse files Browse the repository at this point in the history
  • Loading branch information
matteonext committed Aug 25, 2023
1 parent 6c1c57b commit 9b74b95
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ def _get_agent_lines(self, agent, date_to_agent):
lambda r: r.commission_id.invoice_state == "paid"
and self.date_payment_to != "false"
):
if not self.check_payment_date(line.invoice_id.invoice_payments_widget):
if not self.check_payment_date(line):
agent_lines -= line
return agent_lines

Check warning on line 25 in sale_commission_settlement_payment_date/wizard/wizard_settle.py

View check run for this annotation

Codecov / codecov/patch

sale_commission_settlement_payment_date/wizard/wizard_settle.py#L24-L25

Added lines #L24 - L25 were not covered by tests

def check_payment_date(self, payments_widget):
move_dict_content = json.loads(payments_widget)["content"]
def check_payment_date(self, agent_line):
move_dict_content = json.loads(agent_line.invoice_id.invoice_payments_widget)[

Check warning on line 28 in sale_commission_settlement_payment_date/wizard/wizard_settle.py

View check run for this annotation

Codecov / codecov/patch

sale_commission_settlement_payment_date/wizard/wizard_settle.py#L28

Added line #L28 was not covered by tests
"content"
]
return all(
[
self.date_payment_to > datetime.strptime(x["date"], "%Y-%m-%d").date()
Expand Down

0 comments on commit 9b74b95

Please sign in to comment.