From 5e9a7fad3d0170330033f1e0cf6acd3699131cb0 Mon Sep 17 00:00:00 2001 From: Eric Antones Date: Thu, 15 Jul 2021 21:08:21 +0200 Subject: [PATCH] [FIX] connector_pms_wubook: virtual Pricelist error skiping items because of date_consumption not applicable --- .../models/product_pricelist/mapper_export.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/connector_pms_wubook/models/product_pricelist/mapper_export.py b/connector_pms_wubook/models/product_pricelist/mapper_export.py index f757b04456e..86aac5e5efa 100644 --- a/connector_pms_wubook/models/product_pricelist/mapper_export.py +++ b/connector_pms_wubook/models/product_pricelist/mapper_export.py @@ -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( [ @@ -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, ] )