- 12 Jul, 2017 19 commits
-
-
Ayush Tiwari authored
Create FilterDict and Filter class which would be used to imitate the behaviour of filter_dict for Catalog.
-
Ayush Tiwari authored
And, Patch changeObjectClass extension to remove useless attributes Copying __dict__ from one object to another brings us to situation where we don have many objects which we don't need at all, for example, migrating objects with subclasses who were initially OFS objects and later an ERP5 object can lead to adding subobjects as attributes of the new object, which is completely undesirable. To handle this, it is important to delete the sub-objects as the attributes for those migrated classes. erp5_catalog: Refactor _bootstrap for Catalog Tool Old Catalog Tool didn't have portal_type attribute, so while migrating via synchronizeDynamicModule, after _bootstrap, we expect the tool to have a portal_type to finalize migration. This step is now being done only at the end of _bootstrap after we change the classes for portal_catalog and its sub-objects. And, changes to improve performance while dynamic migration. XXX: Still at this point we are not doing the same thing with sub-objects of catalog tool and wait till business template installation. erp5_catalog: Update attributes of the portal_catalog object after migration
-
Ayush Tiwari authored
-
Ayush Tiwari authored
One of the difference between SQL and ERP5 Catalog is how they handle their properties. For ERP5Catalog, we use property_sheets which generate setters and getters, for SQLCatalog, properties just act as attributes(as one can expect from a property set on a class). This creates a difference on how we use them, especially for list_type properties, which have accessors like get<PropertyName>List to get the list of objects. For SQLCatalog, there is no such thing. This creates problem whereever 'get<PropertyName>' or getProperty(<name>) was being used to get multiple property types. So, we changed this to rely on getattr for the Python Scripts in this commit. Note that, getattr isn't good if we care about performance, but given that its used only twice, this can be better than adding extra function overhead.
-
Ayush Tiwari authored
-
Ayush Tiwari authored
-
Ayush Tiwari authored
-
Ayush Tiwari authored
-
Ayush Tiwari authored
Also, add test for migration in testERP5Catalog(as the first test to be run) and migrate Catalog in afterSetup in testERP5CatalogSecurityUidOptimization.
-
Ayush Tiwari authored
-
Ayush Tiwari authored
-
Ayush Tiwari authored
-
Ayush Tiwari authored
Also, Update BusinessTemplate installation with updated filter_dict This removes the need to copy-patch or if-else on meta_type of catalog. Use dynamic migration while installing the catalog method objects for bt5. Note : here we use conversion method for python script but dynamic migration for ZSQL Methods. This is necessary because after the conversion to erp5 object, we need to compile the body to generate code object for python script. By just changing the class, this was not possible. erp5_catalog: Simplify bt5 installation
-
Ayush Tiwari authored
Contains views, property sheets, portal types concerning migration of portal_catalog, sql catalog and their subobjects to erp5 object. Portal Types: 1. Catalog : ERP5 Catalog object (an ERP5 Folder), which earlier used to be OFS Folder. Actions: Update Catalog Clear Catalog Clear Reserved Export Properties 2. Catalog Tool: Portal Catalog where we can add and use multiple ERP5 catalogs. Actions: Hot ReindexAll 3. SQL Method: SQL methods with their views inside erp5. Actions: Run Method Property Sheet: 1. Catalog 2. CatalogTool 3. SQLMethod Containing properties for the various portal_types/classes respectively. 4. CatalogFilter Also, filter_dict for erp5_catalog would now not be a Persistent Mapping object. The info inside filter_dict is being saved inside the SQL Method objects as their properties. Views: 1. Catalog (View) 2. CatalogTool(View, Properties, Filtered Items), Object Actions 3. SQLMethod (View, Filter) 4. Python Script (Filter) Extras: - Dialog view for catalog before clear_catalog - Add typeBaseMethod(s) for PythonScript and SQLMethod portal types: The methods <portal_type>_getRedirectParameterDictAfterAdd are required for these portal_types, cause their __call__ methods are overridden, so after addition of new objects for them, it was taking to the url concerning wherever __call__ methods directed them. Now, we change them to redirect to 'abosulte_url+'/view'' which is basically the homepage for these catalog methods. - Do not use default ERP5 Catalog to show properties: Earlier, in tales for properties for any erp5 catalog, we showed the values for the default_erp5_catalog. But keeping in mind that we can have multiple catalogs at same time, the old approach was wrong. Hence, we now display properties for the current catalog - Search fo Catalog_viewContentList and Catalog_viewFilterList
-
Ayush Tiwari authored
Its better to change the tests where they need to call getpath function of portal_catalog to use portal_catalog.getpath instead of portal_catalog.getPath, as we have overridden the 'getPath' function for CatalogTool class due to change in inherited class.
-
Ayush Tiwari authored
- This step is needed due to the use of BaseTool as Base class for CatalogTool due to which there were conflict between reindexObject from the Base and the one from the BaseTool.
-
Ayush Tiwari authored
- Remove copy-pasting all code from CatalogTool, better to rely on inheritence - Remove unnecessary imports - Add argument id in __init__ class - Add functions _isBootstrapRequired and _bootstrap - Update BusinessTemplate installation according to changes made in ERP5Catalog and Tool
-
Ayush Tiwari authored
We try to move from using SQLCatalog to ERP5Catalog as the default Catalog inside ERP5. The major difference is use of Folder class as the base for Catalog from Products.ERP5Type.Core Significant changes: -Add dtml form for creating ERP5Catalog object -Inherit from Catalog class from Products.ZSQLCatalog.SQLCatalog instead of copy-pasting the whole code again. -Add allowed_types for ERP5Catalog tool -Monkey patch some property setters and getters to maintain consistency -Update id and title for ERP5Catlog while class initialization -Set declarative securities and solve some inheritance conflicts -Add isRADContent for ERP5Catalog Class -Solve inheritence conflict for _setPropValue function in ERP5Catalog class -Add SQL Method portal_type in allowed_types for ERP5Catalog class -Override getCatalogMethodIds cause it uses global variable in SQLCatalog.Catalog -Redefine security declarations -Add functions for object_actions of Catalog portal_type in ERP5Catalog object -Add filter_dict and _properties attributes for compatibilty -isIndexable should be function instead of Accessor property for Catalog object
-
Ayush Tiwari authored
Here, we are creating the SQLMethod class based on ZSQLMethods.SQL class and XMLObject. Also, we are moving important attributes to property in 'SQL Method' property sheets.
-
- 11 Jul, 2017 2 commits
-
-
Klaus Wölfel authored
-
Aurel authored
-
- 10 Jul, 2017 1 commit
-
-
Jérome Perrin authored
Since !306 we have configured system preference to use cloudoo from the Slapos SR, but this configuration was still old style configuration setting host / port. It caused a test to fail ``` ====================================================================== FAIL: test_01_PreferenceSetup (testIngestion.TestIngestion) ---------------------------------------------------------------------- Traceback (most recent call last): File "/srv/slapgrid/slappart7/srv/testnode/aai/soft/f030becfa6e3878c62ccb9bccc43a291/parts/erp5/Products/ERP5OOo/tests/testIngestion.py", line 1048, in test_01_PreferenceSetup self.assertEqual(preference_tool.getPreferredOoodocServerAddress(), conversion_dict['hostname']) AssertionError: 'erp5-cloudooo' != 'localhost' ``` and that was a problem with the test, we don't have to care about `getPreferredOoodocServerAddress`, as only URL matters now (it was just working because both were set to localhost). /reviewed-on nexedi/erp5!315
-
- 07 Jul, 2017 11 commits
-
-
Julien Muchembled authored
- The conversion server is supposed to be configured in a system preference, so do this instead of using a normal preference. - _getConversionServerDict -> _getConversionServerUrl, to make clear that cloudooo is now configured by a url, instead of a host/port couple. - Refactoring: From the moment where setUpERP5Site() sets up things automatically, we don't the "same" duplicated code throughout many test to redo cloudooo configuration. - In the promise file, the volatile/persistent memcached url were swapped.
-
Jérome Perrin authored
configuring host / port was still compatibility
-
Jérome Perrin authored
-
Julien Muchembled authored
-
Tristan Cavelier authored
-
Tomáš Peterka authored
-
Tomáš Peterka authored
-
francois authored
-
francois authored
This commit contain a testing business template for the receipt recognition module test the "Receipt" type update as well as the OCR success and fail on a set of poor This commit contain binary files that are test images..
-
francois authored
This commit contain the business template that take a receipt image as a source, binarize then segmentize it, and apply OCR on it. It then extract the meaning with regular expressions. The image should already be loaded inside the image module before it can be read. The business template contain: * The receipt recognition module * An extension containing the code that binarize, crop and segmentize the image then analize it. * A new type "Receipt" that contain a source image and the field that contain the "total" value * A portal skin folder containing the extension externalMethods aswell as the conversion script that call the recognition and update the Receipt "total" field Improvements (not limited to this list): - Easier loading of picture: directly from the receipt page. - Easier loading of picture 2: from phone with OfficeJS (or any renderJS) application? - Detect when images are sideway and rotate them straight - Better "boxing" and segmentation: some lines are deleted from the original image during the segmentation when they are too close from other - Modify the neural network (lstm) to increase weight of signs like $, euro, / and numbers - Use of a faster/smaller neural network: Most of the time is lost with the loading of the neural network - Caching the neural network: See previous statement. - Extract currency, date and receipt emettor. - Use a neural network for the meaning extraction?
-
Vincent Pelletier authored
Avoid iterating over all columns known to catalog to then restrict to a single table by using SQLCatalog API. Only check for one range column suffix as code anyway relies on the triplet of columns to be consistently present. Document this in the code and get rid of now-unneeded range_column_set mechanism.
-
- 06 Jul, 2017 7 commits
-
-
Julien Muchembled authored
-
Julien Muchembled authored
str.encode() first performs an implicit conversion to unicode using sys.getdefaultencoding(), which is usually 'ascii'. The 'isort' module changes the default encoding to utf-8, leading to UnicodeEncodeError instead of UnicodeDecodeError. Let's simplify all this.
-
Julien Muchembled authored
-
Julien Muchembled authored
-
Vincent Bechu authored
-
Vincent Bechu authored
-
Ayush Tiwari authored
-