summaryrefslogtreecommitdiff
path: root/addons/base_automation/views
diff options
context:
space:
mode:
authorNans Lefebvre <len@odoo.com>2019-01-11 13:20:41 +0000
committerRaphael Collet <rco@odoo.com>2019-02-15 12:37:25 +0000
commitee775c7548f6b428a1ef4f2ef40222ad4a8746c5 (patch)
treefeddd7cfbc8bdb6f74cf65f045b26648c23c09c5 /addons/base_automation/views
parentb3b29f3b86f22b3157aba35e66e8ec3c16ee47bc (diff)
[IMP] base: add to automated actions the fields to watch during update
When users create an automated action to trigger when a record is updated, they assume each update is 'atomic' in some sense. It is not the case, as one write may trigger many write, some in recompute. As a result, any update may trigger a dozen actions (or more). We add a field wich allows us to specify which field we want to watch. For instance, you could select the field 'state on quotation', and thus only action would be triggered on confirming the quotation. The link_field_id is a field that allows to link a record of the source model to a new record of the target model, through a many2one. However many target records can be created, so every one of them (except the last) ends up orphan. We allow for one2many and many2many fields to be used, and in these cases we add the newly created record to the list. opw 1910671
Diffstat (limited to 'addons/base_automation/views')
-rw-r--r--addons/base_automation/views/base_automation_view.xml2
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/base_automation/views/base_automation_view.xml b/addons/base_automation/views/base_automation_view.xml
index 206f7897c75..ae56d4ea8a2 100644
--- a/addons/base_automation/views/base_automation_view.xml
+++ b/addons/base_automation/views/base_automation_view.xml
@@ -24,6 +24,8 @@
</div>
<xpath expr="//group[@name='action_content']" position="inside">
<field name="trigger"/>
+ <field name="trigger_field_ids" domain="[('model_id', '=', model_id)]"
+ attrs="{'invisible': [('trigger', 'not in', ['on_write', 'on_create_or_write'])]}"/>
<field name="filter_pre_domain" widget="domain" options="{'model': 'model_name', 'in_dialog': True}" attrs="{'invisible': [('trigger', 'not in', ['on_write','on_create_or_write'])]}"/>
<field name="filter_domain" widget="domain" options="{'model': 'model_name', 'in_dialog': True}"/>