Files
odoo_source/addons/mail/views/ir_actions_views.xml
T
jerome hanke (jhk) a45c1b53cc [FIX] mail: next activity due date type is required
Steps to reproduce:
-install base_automation and contacts
-go to settings > technical > automated actions
-create an automated action on new contact creation
-set your action to "create next activity"
-leave the activity due type to blank
-trigger the automated action by creating a new contact

Previous behavior:
you get a traceback error
"TypeError: __init__() keywords must be strings"

Current behavior:
the field is required when activity_date_deadline_range is not 0
and does not allow a blank type

opw-2159755

closes odoo/odoo#42503

X-original-commit: 04dff5ad6c5935f899c7946cb1924afaea9e547c
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-12-30 15:16:34 +00:00

53 lines
3.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record model="ir.ui.view" id="view_server_action_form_template">
<field name="name">ir.actions.server.form</field>
<field name="model">ir.actions.server</field>
<field name="inherit_id" ref="base.view_server_action_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='page_object']" position="after">
<page string="Activity" name="next_activity" autofocus="autofocus" attrs="{'invisible': [('state', '!=', 'next_activity')]}">
<group>
<group>
<field name="activity_type_id" options="{'no_create': True, 'no_open': True}" attrs="{'required': [('state', '=', 'next_activity')]}"/>
<field name="activity_summary" placeholder="e.g. Discuss proposal"/>
</group>
<group>
<label for="activity_date_deadline_range"/>
<div class="o_row">
<field name="activity_date_deadline_range"/>
<field name="activity_date_deadline_range_type" attrs="{
'required': [('state', '=', 'next_activity'), ('activity_date_deadline_range', '>', 0)]
}"/>
</div>
<field name="activity_user_type"/>
<field name="activity_user_field_name" attrs="{
'invisible': [('activity_user_type', '=', 'specific')],
'required': [('state', '=', 'next_activity'), ('activity_user_type', '=', 'generic')]
}"/>
<field name="activity_user_id" attrs="{
'invisible': [('activity_user_type', '=', 'generic')],
'required': [('state', '=', 'next_activity'), ('activity_user_type', '=', 'specific')]
}"/>
</group>
</group>
<field name="activity_note" placeholder="Log a note..."/>
</page>
</xpath>
<xpath expr="//field[@name='link_field_id']" position="after">
<field name="partner_ids" widget="many2many_tags"
attrs="{'invisible': [('state', '!=', 'followers')]}"/>
<field name="channel_ids" widget="many2many_tags"
attrs="{'invisible': [('state', '!=', 'followers')]}"/>
<field name="template_id"
attrs="{'invisible': [('state', '!=', 'email')],
'required': [('state', '=', 'email')]}"/>
</xpath>
</field>
</record>
</data>
</odoo>