Commit Graph
112 Commits
Author SHA1 Message Date
Cédric Krier a34a59d35d Remove same types restriction on PYSON If
issue11644
review419661003
2022-09-08 13:17:54 +02:00
Cédric Krier 2ecc2f35be Keep text of unsupported HTML tag except for script
issue11476
review417311003
2022-06-08 09:13:24 +02:00
Cédric Krier 0322a9d2c2 Correctly complete after opening OR-ed parenthesis
The nested call to replace_ending_clause must be pushed in the result instead
of concatenated because the clause can be OR-ed.
And pslice must remove depth from the length of the sting.

issue11477
review421151003
2022-05-19 21:58:31 +02:00
Cédric Krier e1528808ab Test for sub-domain instead of not leaf in domain parser
issue11472
review411171004
2022-05-19 21:54:36 +02:00
Nicolas Évrard 600f22f43a Remove extra operator when simplifying nested domains
issue11406
review390621002
2022-04-14 10:21:53 +02:00
Nicolas Évrard 030772688b Deduplicate entries in domain inversion's simplify
issue11248
review397301002
2022-03-30 19:20:31 +02:00
Cédric Krier 6c4998db2d Manage None as value of PYSON In
issue11280
review393771002
2022-03-06 18:02:00 +01:00
Cédric Krier e87aa696eb Use first the dotted name variable in the PYSON context
issue11109
review383991002
2022-01-11 23:03:06 +01:00
Cédric Krier f965fa66fb Return default value when evaluating undefined value
issue11089
review374511002
2022-01-03 22:49:47 +01:00
Cédric Krier f150cf50fe Run tests in UTC and use millisecond precision for moment comparison
Backout of changeset d5742068fd8d

issue10846
review389071002
2021-10-19 00:20:37 +02:00
Cédric Krier b23cbe25ee Use '\' as escape char for wildcard
issue10626
review349031002
2021-08-12 18:39:50 +02:00
Maxime Richez 3e758d18aa Allow PYSON Expression as key for PYSON In with dict object
issue10542
2021-07-11 11:25:30 +02:00
Cédric Krier 0760b01b65 Pass all arguments when evaluate And/Or PYSON
issue10327
review338201002
2021-04-23 20:34:44 +02:00
Nicolas Évrard 4aec8c2819 Use specific search domain for reference field searches
issue9997
review324781002
2021-04-12 20:54:03 +02:00
Cédric Krier 8a218aa66f Do not return None when evaluating domain with in operator
When the operator is 'in' and the value contains None, Field._domain_add_null
adds an equal operator against NULL. So this must be managed like the '='
operator.

issue9906
review332201005
2021-03-20 12:33:09 +01:00
Cédric Krier 0921f01ba3 Detect all wild cards and escaped wild cards in likify
issue10020
review320611002
2021-02-03 19:30:13 +01:00
Cédric Krier 41513b2718 Support float represented by exponential
The domain parser need to find the number of digit to display by analysing the
string format of the value. Some small values may be formatted as exponential.

issue9955
review347261002
2021-01-18 23:29:44 +01:00
Cédric Krier b291df2381 Encode Decimal with it primitive value for PYSON
Otherwise the Decimal is duplicated as a generic Object by the preparation.

issue9852
review330001002
2021-01-11 00:11:25 +01:00
Cédric Krier 57c4962bd7 Support empty value for timedelta converter
issue5092
review316481002
2020-12-18 00:21:38 +01:00
Cédric Krier 74d895533d Unify PYSON string format between all clients
issue9723
review328481002
2020-11-15 18:50:47 +01:00
Cédric Krier 45ac695132 Returns an Array with the statements for PYSON string of And/Or
issue9722
review300711002
2020-10-21 23:15:18 +02:00
Cédric Krier 056e43717e Use ISO string format for timeseries graph
c3 does not support moment but only string with a specific format.
We implement .toString on the moment prototype because form widgets does not
use Sao.Date nor Sao.DateTime. This ensures that calling .toString will always
return the ISO format.
And finally the x field type is retrieved from the model instead of the
attribute which is no more filled since changeset 2fc36d9e359b

issue9539
review296221002
2020-09-27 12:29:38 +02:00
Cédric Krier f7d2c114dc Add support for UTC Date for testing purpose
The tests may depend on the timezone of the browser so we need a way to write
tests as UTC only.

issue9577
review298511002
2020-09-09 23:25:24 +02:00
Cédric Krier 523fdbca0d Support PYSON comparison of date and datetime
issue4879
review270061002
2020-09-05 22:59:38 +02:00
Nicolas Évrard 7cb4222199 Sanitize RichtText fields content
issue9405
review327451002
2020-06-29 17:33:06 +02:00
Cédric Krier eda93a21ed Returns None when evaluating domain with None
We implement the same behavior as SQL with NULL which always returns NULL
except for IS operator. So the evaluation has the same result as the search.

issue8615
review290281002
2020-06-19 00:18:04 +02:00
Cédric Krier c20ef88a21 Prepare pyson result when encoding PYSON statement
The object returned by the pyson method must also be prepared before being
jsonified.

issue9234
review327191003
2020-05-19 18:47:53 +02:00
Cédric Krier b1d501ee66 Skip invalid branch of domain without the inverted field
Those branches of the domain should not prevent to compute a proper inverted
domain for the field as the other fields will be fixed later.

issue9200
review311191002
2020-04-12 23:21:08 +02:00
Cédric Krier 3a079ab1d6 Do not force value in OR-ed clause
When any other variable in Or-ed clause is not known, we can not force the
value of the variable.

issue9092
review272941002
2020-03-06 23:14:24 +01:00
Sergi Almacellas Abellana db5c5c11b7 Add tests for time only timedelta conversion
issue9016
review258701002
2020-02-06 20:48:48 +01:00
Cédric Krier fb9876d0f4 Add tests for types checking in PYSON Greater
issue9002
review276711002
2020-02-04 18:32:10 +01:00
Cédric Krier c0a592ec1f Test only instance of PYSON DateTime with invalid start
Both instances tested can have different values as they are instantiate at
different time.

issue8829
2019-11-16 15:57:56 +01:00
Cédric Krier 0fefec033f Convert to float when parsing timedelta
The user can enter a float value for the converter parts.

issue8816
review256231002
2019-11-16 12:51:50 +01:00
Cédric Krier 3c7d6214a4 Add domain parser tests to parse operator as value
issue8711
review268071002
2019-10-11 11:48:24 +02:00
Cédric Krier 397cd88db9 Add start value to PYSON Date and DateTime
This enable the customization of the starting point for delta operations.

issue8561
review264041002
2019-09-20 11:36:05 +02:00
Cédric Krier 1de6685654 Add MultiSelection field
issue7851
review249911002
2019-09-20 11:32:55 +02:00
Sergi Almacellas Abellana e0d7f0e933 Support dot notation on PYSON Eval
issue8528
review287841003
2019-09-19 14:11:30 +02:00
Cédric Krier e9f6976eae Improve completion on boolean
- Do not convert None to False
- Complete with the opposite or both values

issue8620
review254181002
2019-09-16 23:59:43 +02:00
Cédric Krier 5f91e10c06 Ensure DomainParse.group returns a list of clause
issue8520
review255681002
2019-08-07 19:22:59 +02:00
Cédric Krier f841fd1bc7 Allow to search on related field in search box
The server adds to the definition of the fields, the definition of relation
fields up to specific deep level.
The clients use this relation fields definition to extend the domain parser
with those fields using a dot notation. But those "dotted fields" are not
shown in the search filter to not bloat the popup as it is dedicated to
learning.
In addition, Dict fields are also filled with relation fields coming from the
keys defined in the schema model. As the size can very large, it is possible
to deactivate this feature from the configuration.

issue8293
review259391005
2019-06-16 15:44:14 +02:00
Cédric Krier 87d14df402 Add boostrap JS to test index page
The method get_credentials needs modal.

issue8315
review287361002
2019-05-02 12:58:12 +02:00
Cédric Krier 9c63f7a444 domain_parser should use rec_name for relation field and list
in operator on relation field must use list of ids. So the related rec_name
should be used instead because domain_parser always uses string as value.

issue3540
review271321002
2019-04-24 23:45:06 +02:00
Sergi Almacellas Abellana 247a32f74c Add domain inversion for reference fields
issue7877
review45831002
2019-04-14 14:17:39 +02:00
Cédric Krier 35e082d2a5 Evaluate DateTime PYSON in UTC
issue8165
review70591002
2019-03-08 18:38:16 +01:00
Nicolas Évrard 33ac9a0e46 Fix wrong function name in sao's test introduced in 95501e406c46 2018-12-21 10:40:48 +01:00
Nicolas Évrard 5798cf5cbc Fix domain inversion of child_of mixing M2O and Reference fields
Domain inversion on Reference field does not work when using the dotted
notation with a M2O field using child_of or parent_of.

To solve this we correctly compute the localization of child_of leaves when
using the dotted notation (which renders the inverse_leaf function useless).
But we must also ensure that the selection used by reference fields restrict
the choice to the right models.

issue7869
review60441002
2018-12-20 18:44:31 +01:00
Cédric Krier 118837f6a3 Domain with ids are not stringable
issue7788
review53441002
2018-10-21 21:32:38 +02:00
Cédric Krier 0f2ecee3c4 Apply factor on domain parser
issue7642
review68301002
2018-08-30 16:05:38 +02:00
Cédric Krier 230377544d Fix domain inversion evaluation of constrained field
The evaluation to True of constrained clause should only be done for inversion.
Also it should be valid even if a wrong value is defined in the context.

issue7603
review56331002
2018-08-18 22:50:51 +02:00
Cédric Krier b64ba85821 Add pyson TimeDelta
issue7351
review47651002
2018-08-18 17:19:33 +02:00