Openbravo Issue Tracking System - POS2
View Issue Details
0050626POS2Corepublic2022-10-25 11:392022-10-26 19:17
cberner 
yogaskarnik 
normalcriticalhave not tried
closedfixed 
5
 
23Q1 
cberner
No
0050626: Autocomplete CRM reference properties are not supported for discounts & promotions property/condition
Autocomplete is a new CRM reference type that was added in core2, but it is not supported to be used as a CRM Property Condition in the Discounts & Promotions window.

Related issue, where Autocomplete CRM type reference is introduced: https://issues.openbravo.com/view.php?id=49834 [^]
This should be reproducible in an environment with pos2-modules
1. Login Backoffice and configure a CRM property as Autocomplete reference
2. Go to Discounts&Promotions and add that crm property on one discount in the subtab CRM Property Condition
3. Login WebPOS and refresh masterdata
4. Try to add a product with that particular discount
5. Change Business Partner to some business partner from the CRM
As system admin, in Comparators window, add Autocomplete reference type as a Supported reference to the same comparators that have String reference as supported.

Create a new file, following the logic of StringComparatorType.js: https://gitlab.com/openbravo/product/pmods/org.openbravo.discounts.propertycondition/-/blob/master/web/org.openbravo.discounts.propertycondition/js/engine/comparators/StringComparatorType.js [^]
This should contain the functions for each of the supported comparisons of the Autocomplete reference type.

Make sure this is executed as part of the ob-init.js or before.
FASH
related to defect 0049834 closed Retail DQM Support for React 
related to defect 0050629 new Triage Platform Base You may not call store.getState() error when calling OB.error from discount comparator engine 
Issue History
2022-10-25 11:39cbernerNew Issue
2022-10-25 11:39cbernerAssigned To => Triage Platform Base
2022-10-25 11:39cbernerTriggers an Emergency Pack => No
2022-10-25 11:51rafarodaTag Attached: FASH
2022-10-25 11:52rafarodaSeveritymajor => critical
2022-10-25 14:20alostaleRelationship addedrelated to 0049834
2022-10-25 14:25alostaleAssigned ToTriage Platform Base => yogaskarnik
2022-10-25 15:49rafarodaRelationship addedrelated to 0050629
2022-10-26 17:18hgbotNote Added: 0142606
2022-10-26 19:16hgbotNote Added: 0142624
2022-10-26 19:16hgbotResolutionopen => fixed
2022-10-26 19:16hgbotStatusnew => resolved
2022-10-26 19:16hgbotNote Added: 0142625
2022-10-26 19:17cbernerReview Assigned To => cberner
2022-10-26 19:17cbernerStatusresolved => closed
2022-10-26 19:17cbernerFixed in Version => 23Q1

Notes
(0142606)
hgbot   
2022-10-26 17:18   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.discounts.propertycondition/-/merge_requests/17 [^]
(0142624)
hgbot   
2022-10-26 19:16   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.discounts.propertycondition/-/merge_requests/17 [^]
(0142625)
hgbot   
2022-10-26 19:16   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.discounts.propertycondition [^]
Changeset: a3a3ac4dba6b9ba326105c6cae003ba825354aa1
Author: Yogas Karnik <yogas.karnik@openbravo.com>
Date: 26-10-2022 17:16:44
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.discounts.propertycondition/-/commit/a3a3ac4dba6b9ba326105c6cae003ba825354aa1 [^]

Fixes FR-50626: Autocomplete CRM reference properties are not supported for autocomplete

Adds support for Autocomplete core2 CRM reference property, by adding the necessary comparators.
It also adds a test for it, and the necessary Supported References for this new comparator.

---
A src-test/org/openbravo/discounts/propertycondition/comparators/AutocompleteComparatorTypeTest.java
A web/org.openbravo.discounts.propertycondition/js/engine/comparators/AutocompleteComparatorType.js
M src-db/database/sourcedata/OBPRDIS_REF_COMPARATOR.xml
M src-test/org/openbravo/discounts/propertycondition/DiscountsPropertyConditionTestSuite.java
M src/org/openbravo/discounts/propertycondition/DiscountsPropertyConditionComponentProvider.java
---