Skip to content

Commit

Permalink
[FIX] connector_pms_wubook: wrong rule conflict count between rules o…
Browse files Browse the repository at this point in the history
…f different Availabily Plans with the same Backend
  • Loading branch information
eantones committed Jul 25, 2021
1 parent 5e9a7fa commit f664c49
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def _compute_inconsistent_rules(self):
if rec.channel_wubook_bind_ids:
inconsistent_rules = self.search(
[
("id", "not in", rec.ids),
("room_type_id", "=", rec.room_type_id.id),
("date", "=", rec.date),
(
Expand All @@ -52,8 +51,14 @@ def _compute_inconsistent_rules(self):
lambda x: x.max_avail != rec.max_avail
).max_avail = rec.max_avail
rec.inconsistent_rules = inconsistent_rules
rec.inconsistent_rule_count = len(inconsistent_rules) + len(
rec.channel_wubook_bind_ids.mapped("inconsistent_binding_rules")
other_inconsistent_rules = inconsistent_rules.filtered(
lambda x: x.id not in rec.ids
)
inconsistent_binding_rules = rec.channel_wubook_bind_ids.mapped(
"inconsistent_binding_rules"
)
rec.inconsistent_rule_count = len(other_inconsistent_rules) + len(
inconsistent_binding_rules
)
else:
rec.inconsistent_rules = False
Expand Down

0 comments on commit f664c49

Please sign in to comment.