Value scheduler¶
The eYssen Value Scheduler application (value_scheduler) changes the value of one field on many
records at once, from a two-column CSV or Excel file, either immediately or at a date and time
chosen in advance. Typical examples are price list tags that must be switched at the start of a
promotion, or product attributes to be updated for a whole supplier catalog during the night.
Every operation relies on a preset, prepared once by an administrator, which defines the model and the field to update and how the records are found. The users then only have to upload a file.
Note
The application requires the Price List Validation by Tags module
(eyssen_product_pricelist_tag), which is installed along with it.
Access rights¶
In the access rights of a user, the Value Scheduler category has two levels:
Scheduler: can open the application, and create, process, schedule, and cancel imports with the existing presets;
Administrator: in addition, has access to the Developer menu: the Preset Editor and the list of All Scheduled Changes.
Import a file¶
Open the Value Scheduler app, and, in the Operations menu, click the operation to perform (e.g., Pricelist Tag Update). The list of the previous imports of that operation is displayed.
Click New, and upload the file in the File field.
Select the Run Mode:
Timed: the changes are applied at the Scheduled Date, which becomes mandatory;
Instant: the changes are applied as soon as the file is processed. This mode is limited to 25 changes per import.
Select the Write Mode:
Overwrite: the value of the file replaces the current value of the field. For a tags field, an empty second column empties the field;
Extend: for a tags field, the values of the file are added to the existing ones;
Remove: for a tags field, the values of the file are removed from the existing ones. Tick Clear All to empty the field instead, whatever the second column contains. For any other field, the field is emptied.
Click Process. The file is read, one scheduled change is created per row, and the file is attached to the chatter of the import. If a row cannot be interpreted (e.g., an unknown tag name), the whole file is refused, and the message lists the rows to correct.
In Timed mode, the import and its changes move to the Scheduled status. In Instant mode, the changes are executed right away, and the import moves to Done.
- menu
- Value Scheduler ‣ Operations ‣ Pricelist Tag Update ‣ New
- shows
- A draft import form with the Process button, the uploaded file, Run Mode "Timed" with a scheduled date, and Write Mode "Extend".
- highlight
- The "Run Mode" and "Write Mode" radio buttons (red frame).
- data
- File "promo_tags_week40.csv"; scheduled date next Monday 00:00.
- module
- value_scheduler
- notes
- English UI, light theme, 1440px width.
File format¶
The file is either a CSV file (; separator, UTF-8 or Latin-1 encoding) or an Excel workbook
(.xlsx), of which only the first sheet is read. The first row is a header and is ignored. Each
following row has two columns:
the lookup value, used to find the record(s) to update. The field it is compared with is defined by the preset (e.g., the internal reference of the product). Rows with an empty first column are skipped;
the new value. How it is interpreted depends on the preset; for the Pricelist Tag Update preset, it is a comma-separated list of price list tag names (not case-sensitive).
reference;tags
FURN_0096;Promo week 40, Wholesale
FURN_1118;Promo week 40
Warning
Do not use apostrophes (') in the lookup values: such rows cannot be matched.
Follow up and cancel an import¶
Scheduled changes are applied by the Value Scheduler: Process Timed Changes scheduled action, which runs every five minutes and processes the due changes in batches of 25, until none is left. A change is therefore applied within a few minutes after its Scheduled Date.
On the import, the Changes smart button and the Scheduled Changes tab show the changes with their Lookup value, the Modifier (the value of the file), and, once executed, the Old Value and the Result. Click the icon of a line to open the matching records. The status of a change is one of the following:
Draft: created, not queued yet;
Scheduled: waiting for its date;
Done: the value was changed;
Unchanged: the records already had the requested value;
Failed: the change could not be applied; the reason is given in the Notes tab of the change (e.g., no record found for the lookup value).
An import is Done when all its changes have been processed without failure, and Failed if at least one of them failed.
The following buttons are available on the import:
Cancel: on a Scheduled import of which no change has been executed yet, moves the import to Cancelled; its changes go back to Draft and are not applied;
Reset to Draft: brings the import back to Draft, together with its scheduled and failed changes, e.g., to modify the scheduled date;
Schedule: on a draft import that already has changes, queues them again without reading the file a second time.
Only draft imports can be deleted.
Note
In Instant mode, a Value Scheduler note is posted in the chatter of each updated record, with the old value, the value of the file, and the resulting value. Changes applied by the scheduled action do not post such a note, and the usual field tracking is disabled in both modes: use the Old Value and Result columns of the import as the audit trail.
Presets¶
Presets are managed by the administrators of the application in . A preset is defined by:
Name and Menu Name, the label of its entry in the Operations menu;
Target Model and Target Field: the model and the field to update;
Domain Lookup Field: the technical name of the field of the target model that is compared with the first column of the file;
Code: optionally, Python code that converts the rows of the file into changes, e.g., to turn tag names into records and to report unknown names. Without code, the second column is written as is, which suits text and number fields.
Click Install to create the entry of the preset in the Operations menu, and Uninstall to remove it. The Imports smart button lists the imports made with the preset.
The application is delivered with one preset, Pricelist Tag Update, which updates the Pricelist Tags of the products.
Important
The Pricelist Tag Update preset is delivered with
master_article_numberas Domain Lookup Field. This field is not part of the standard product form: before installing the preset, replace it with the field that identifies your products in the file, e.g.,default_code(internal reference) orbarcode.The code of a preset is executed on the server. Only trusted administrators should be granted the Administrator level.
lists the changes of all imports, with filters by status and grouping by import, model, and scheduled date.
- menu
- Value Scheduler ‣ Developer ‣ Preset Editor ‣ Pricelist Tag Update
- shows
- The preset form with the Install button, the Configuration group (name, menu name, sequence), the Target group (Target Model "Product", Target Field "Pricelist Tags", Domain Lookup Field) and the Row Processing Code editor.
- highlight
- The "Domain Lookup Field" (red frame).
- data
- Domain Lookup Field set to "default_code".
- module
- value_scheduler
- notes
- English UI, light theme, 1440px width.
See also