- 26 Mar, 2024 2 commits
-
-
Rafael Monnerat authored
The script is supposed to be called on portal context (or any context) and not on MailevaSOAPConnector, and it should return a MailevaSOAPConnector for a given reference.
-
Romain Courteaud authored
XXX use category instead
-
- 22 Mar, 2024 3 commits
-
-
Rafael Monnerat authored
This reverts commit cff9daa3.
-
Rafael Monnerat authored
-
Rafael Monnerat authored
-
- 21 Mar, 2024 4 commits
-
-
Rafael Monnerat authored
Otherwise, erp5_payroll_l10n_fr would be a direct dependent of this service, which is not what we want. It also allows implement other kind of document sending w/o hardcode the core or overwriting too much.
-
Rafael Monnerat authored
In the implementation where the user cannot directly insert holidays (by an specialised role/implementation) it allow the accountant insert the values more easily. Using a simple action. Add simple jump for navigate to the holidays/leave This helps to review value on the print out
-
Rafael Monnerat authored
Workflows now are viable from ERP5 UI, so redirect to /view instead
-
Jérome Perrin authored
With python2, iterating on a dictionary or a set always produces the same result, although this is not a documented behavior. On python3 this is not the case, because the hashing algorithm is random by default, which can also be set using [`PYTHONHASHSEED`](https://docs.python.org/3/using/cmdline.html#envvar-PYTHONHASHSEED). On SlapOS, this is done with nexedi/slapos!1535 This fixes the parts where ERP5 code depends on python2 order, mostly tests, but also places where we iterate on a dictionary or set. Most of the time, the fix has been to sort so that the order is deterministic regardless of the hash algorithm randomization, but sometimes we had to extend a bit the configuration where the order was really important. We did this after discovering the problematic areas by running tests multiple times with different hash randomization seeds. It's not impossible that changing from "default python2 order" to "sorted" reveals some more problems in custom configurations, but this would mean that the configuration must be adjusted to use explicit order instead of being lucky with the default python2 order. The main pattern was the use of `edit` method which edits properties in an order that is a bit constrained with the `edit_order` mechanism, because some properties depend on other properties, so it's important to set them in order. This extends a bit the `edit_order` mechanism to specify more properties that were edited in the right order with `PYTHONHASHSEED=0` by chance. This also extends delivery builders to edit properties in order defined in the equivalence tester, most equivalence tester were already properly configured, except the `start_date` and `stop_date` from delivery level movement groups. That probably only matters for some specific test assertions, but in practice this was visible in a lot of failing tests. Some visible changes are that: - workflows are now sorted alphabetically on history tab - properties are now sorted alphabetically on the diff view of history tab - business templates are installed in the order of dependencies and in alphabetic order when they are not constrained. See merge request nexedi/erp5!1882
-
- 19 Mar, 2024 15 commits
-
-
Rafael Monnerat authored
Remove forbidden properties when retrieve the properties from the schema. - template and options isn't part of json schema spec, so it isn't possible to use this feature globally. - template also could be used to call callbacks, so despite we block unsafe-eval, it still better remove it. - both were removed because it can lead to parameter injection, where by saving the form w/o editing anything, it changes the parameters, it adds non-visible values, which can up to some extend be a security risk. Update the description to display the "default" value as a hint, if it was provided into the schema.
-
Rafael Monnerat authored
Remove forbidden properties when retrieve the properties from the schema. - template and options isn't part of json schema spec, so it isn't possible to use this feature globally. - template also could be used to call callbacks, so despite we block unsafe-eval, it still better remove it. - both were removed because it can lead to parameter injection, where by saving the form w/o editing anything, it changes the parameters, it adds non-visible values, which can up to some extend be a security risk. Update the description to display the "default" value as a hint, if it was provided into the schema.
-
Jérome Perrin authored
constructs like `portal_catalog(title=d.keys())` were allowed on python2, we can allow them on python3 as well.
-
Jérome Perrin authored
See discussion in https://www.erp5.com/group_section/forum/Worklists-with-security-uid-columns-wa7gzLN6NG See merge request nexedi/erp5!1712
-
Georgios Dagkakis authored
-
Georgios Dagkakis authored
-
Georgios Dagkakis authored
-
Georgios Dagkakis authored
-
Georgios Dagkakis authored
-
Klaus Wölfel authored
With some combinations of worklists using two additional security_uid columns coming from local role groups, some documents might be excluded from worklists, without the fix, when running with a random PYTHONHASHSEED, the test can fail with: FAIL: test_worklist_exclusionlist_collision (erp5.component.test.erp5_version.testERP5CatalogSecurityUidOptimization.TestSecurityUidOptimizationWorklist) ---------------------------------------------------------------------- Traceback (most recent call last): File "<portal_components/test.erp5.testERP5CatalogSecurityUidOptimization>", line 370, in test_worklist_exclusionlist_collision 'security_uid_or_alternate_security_uid_draft': 1, File "<portal_components/test.erp5.testERP5CatalogSecurityUidOptimization>", line 213, in assertWorklistCount expected_count_by_worklist_id, AssertionError: {'security_uid_or_alternate_security_uid_draft': 1} != {'collision_worklist': 1, 'security_uid_or_alternate_security_uid_draft': 1} - {'security_uid_or_alternate_security_uid_draft': 1} + {'collision_worklist': 1, 'security_uid_or_alternate_security_uid_draft': 1} ? +++++++++++++++++++++++++ What happens in sumCatalogResultByWorklist is something like this: (Pdb) pp criterion_dict {'alternate_security_uid': <ExclusionList [11, 14]>, 'other_security_uid': frozenset([13L]), 'portal_type': frozenset(['Person']), 'validation_state': frozenset(['draft'])} (Pdb) pp catalog_result.dictionaries() [{'alternate_security_uid': 12, 'count': Decimal('1'), 'other_security_uid': 13, 'portal_type': 'Person', 'validation_state': 'draft'}] Depending on the worklists grouped together in grouped_worklist_dict and the order this dict is iterated, we may reach a situation where criterion_id_list contains 'alternate_security_uid', because for another worklist it was not an ExclusionList but a list to be applied, in this case, this if condition is false: for criterion_id in criterion_id_list: criterion_value_set = criterion_dict[criterion_id] if result_line[criterion_id] not in criterion_value_set: is_candidate = False and the row is not counted in collision_worklist worklist. Co-authored-by: Jérome Perrin <jerome@nexedi.com>
-
Jérome Perrin authored
These are printed like a normal list, so it's a bit hard to figure out if they are supposed to be excluded when debugging
-
Jérome Perrin authored
This refactors security_uid_innodb_catalog test to have the config in a test business template and include a workflow with some worklists. This also depends on erp5_worklist_sql, to test worklists when a combination of erp5_security_uid_innodb_catalog and erp5_worklist_sql are enabled, which a common situation.
-
Jérome Perrin authored
Otherwise we get an error when just adding a worklist
-
Rafael Monnerat authored
-
Rafael Monnerat authored
See merge request nexedi/erp5!1900
-
- 18 Mar, 2024 7 commits
-
-
Rafael Monnerat authored
This business template introduces a way to adjust mariadb and data.fs after restore from backup. In the occasion that the backups are unsync (which is normal) it helps to push both on sync instead of fully reindex the site.
-
Rafael Monnerat authored
See merge request nexedi/erp5!1904
-
Rafael Monnerat authored
-
Rafael Monnerat authored
-
Rafael Monnerat authored
Select sets "1" and "" as values
-
Rafael Monnerat authored
The select must display the value regardless if it is the proper type or not, so we patch setValue to include the value even it is not present on enum (instead drop the value). Typecast patch was extended to not modify the data only convert to proper type if possible, otherwise, keep the wrong value. The goal is allow the user see the wrong value with the error message.
-
Rafael Monnerat authored
-
- 13 Mar, 2024 5 commits
-
-
Rafael Monnerat authored
See merge request nexedi/erp5!1902
-
Rafael Monnerat authored
-
Rafael Monnerat authored
-
Jérome Perrin authored
by using str on a dict we don't produce consistent results depending on hash randomization. This was visible with erp5_core_test:testCacheTool and PYTHONHASHSEED 12 , the cache id generated in https://lab.nexedi.com/nexedi/erp5/-/blob/a0aa9184d/bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testCacheTool.py#L216-218 was "('py_script_obj', (60000,), {'result': 'a short value', 'portal_path': ('', 'erp5')})" and the cache id generated in https://lab.nexedi.com/nexedi/erp5/-/blob/a0aa9184d/bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testCacheTool.py#L239-241 with same arguments for delete was "('py_script_obj', (60000,), {'portal_path': ('', 'erp5'), 'result': 'a short value'})")
-
Jérome Perrin authored
nowadays we can use time.sleep in restricted python
-
- 11 Mar, 2024 4 commits
-
-
Georgios Dagkakis authored
-
Georgios Dagkakis authored
-
Georgios Dagkakis authored
-
Georgios Dagkakis authored
anyway, what happened is stored in the HTTP Exchange
-