Skip to content

Commit

Permalink
[FIX] connector_pms_wubook: virtual Pricelist error skiping items bec…
Browse files Browse the repository at this point in the history
…ause of date_consumption not applicable
  • Loading branch information
eantones committed Jul 20, 2021
1 parent 9ba9a1e commit 809cb50
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions connector_pms_wubook/models/product_pricelist/mapper_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ class ChannelWubookProductPricelistChildBinderMapperExport(Component):

def skip_item(self, map_record):
if (
map_record.source.date_start_consumption
map_record.source.wubook_item_type == "standard"
and map_record.source.date_start_consumption
!= map_record.source.date_end_consumption
):
raise ValidationError(
_("Consumption dates must be the same on daily pricelists")
_("Consumption dates must be the same on daily standard pricelists")
)
return any(
[
Expand All @@ -57,7 +58,10 @@ def skip_item(self, map_record):
and self.backend_record.pms_property_id
not in map_record.source.pms_property_ids,
map_record.source.synced_export,
(fields.Date.today() - map_record.source.date_start_consumption).days
map_record.source.wubook_item_type == "standard"
and (
fields.Date.today() - map_record.source.date_start_consumption
).days
> 2,
]
)
Expand Down

0 comments on commit 809cb50

Please sign in to comment.