[FIX] calendar: restore schedule call activity without event

Since PR #137969, the `save` button is no longer available in schedule activity
 wizard.
This PR makes `schedule` button available for call activities like other
activities (except meeting), so user can create a call activity without going to
 calendar view.
Also, we have to consider `has_error` in creating activity so if there is an
error, user couldn't access to `schedule` button. This field is correctly placed
in `mail.mail_activity_schedule_view_form` view but not in the inherited view
in `calendar`.

task-3668732

closes odoo/odoo#152893

Signed-off-by: Maryam Kia (maki) <maki@odoo.com>
This commit is contained in:
Maryam Kia
2024-02-14 18:32:04 +00:00
parent d8ca1f3412
commit e6097043b9
2 changed files with 18 additions and 1 deletions
@@ -13,7 +13,7 @@
<attribute name="invisible">activity_category == 'meeting'</attribute>
</xpath>
<xpath expr="//button[@name='action_schedule_activities']" position="attributes">
<attribute name="invisible">activity_category in ('meeting', 'phonecall') or id</attribute>
<attribute name="invisible">has_error or activity_category == 'meeting' or id</attribute>
</xpath>
<xpath expr="//field[@name='note']" position="attributes">
<attribute name="invisible">activity_category == 'meeting'</attribute>
@@ -8,6 +8,23 @@ registry.category("web_tour.tours").add("mail_activity_schedule_from_chatter", {
{
trigger: "button:contains('Activities')",
},
{
trigger: "input[id*='activity_type_id']",
run: "click",
},
{
trigger: ".dropdown-item:contains('Call')",
},
{
extra_trigger: "button:contains('Schedule')",
trigger: "input[id*='activity_type_id']",
run: function (action_helper) {
setTimeout(() => action_helper.click(), 100);
},
},
{
trigger: ".dropdown-item:contains('To-Do')",
},
{
trigger: "div[name='summary'] input",
run: "text Play Mario Party",