Main idea of this commit is to simplify the various options of ir.actions.server model. Purpose is to make it a simple tool to execute some actions or python code. This has two main consequences * create and update server actions are simplified to update only the current record. Complex options can always be achieved by python code instead of error-prone option building mechanism; * condition of server actions is removed. If a condition is necessary it can either be included in a code server action, or integrated in an automated action; This commit features : * remove 'client_action' server action type. Indeed this can be achieved with a code server action returning an action; * remove 'condition' on ir_actions_server model. From now on conditions and triggers are managed in server action code or using automated or scheduled action; * clean 'create and copy a record'. Create and link are the proposed options. Copy of the record or of a selected record is removed. Link is simplified by removing the parsed expression that allowed complex path update. It is simpler to write code than write python-like expression in char fields; * remove 'use_write' options. It now simply updates a record; * remove 'write_expression' as it is replaced by code actions; * remove 'ref_object' not used anymore with the removal of "choose a record"; * remove helper to build an expression not used anymore with the removal of "write expression"; * remove object ID finder; * removed template display when choosing an email template; just go on the template if you want more details; * refactor server action form view to reflect changes. It will be used in future commits as base view for automated and scheduled actions; * add 'sequence' in list view; * add new 'usage' selection field allowing to distinguish which model uses the server action. Indeed as server action will soon be used in scheduled or automated actions having a clue about the usage is always helpful; Thanks to @fpodoo for the original idea and preliminary work. Thanks to @jpr-odoo for first developments. Thanks to @jem-odoo and @rco-odoo for reviewing.
49 lines
2.2 KiB
XML
49 lines
2.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<data>
|
|
|
|
<record model="ir.ui.view" id="view_server_action_form_website">
|
|
<field name="name">ir.actions.server.form.website</field>
|
|
<field name="model">ir.actions.server</field>
|
|
<field name="inherit_id" ref="base.view_server_action_form"/>
|
|
<field name="arch" type="xml">
|
|
<data>
|
|
<xpath expr="//field[@name='state']" position="after">
|
|
<field name="website_published"
|
|
attrs="{'invisible': [('state', '!=', 'code')]}"/>
|
|
<field name="xml_id" invisible="1"/>
|
|
<field name="website_path"
|
|
attrs="{'invisible': ['|', ('website_published', '!=', True), ('state', '!=', 'code')]}"/>
|
|
<field name="website_url" readonly="1" widget="url"
|
|
attrs="{'invisible': ['|', ('website_published', '!=', True), ('state', '!=', 'code')]}"/>
|
|
</xpath>
|
|
</data>
|
|
</field>
|
|
</record>
|
|
|
|
<record model="ir.ui.view" id="view_server_action_tree_website">
|
|
<field name="name">ir.actions.server.tree.website</field>
|
|
<field name="model">ir.actions.server</field>
|
|
<field name="inherit_id" ref="base.view_server_action_tree"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='model_id']" position="after">
|
|
<field name="website_url"/>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record model="ir.ui.view" id="view_server_action_search_website">
|
|
<field name="name">ir.actions.server.search.website</field>
|
|
<field name="model">ir.actions.server</field>
|
|
<field name="inherit_id" ref="base.view_server_action_search"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='state']" position="after">
|
|
<filter string="Website" name="website"
|
|
domain="[('website_published', '=', True), ('state', '=', 'code')]"/>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
</data>
|
|
</odoo>
|