Skip to content
Permalink
Browse files

[FIX] calendar: Add force_save to send values to server

- Create Event (Where All Day is Set to False)
- Edit Event > Check 'All Day', make it 'Recurrent'

An error occurs because a mandatory field is not set (`stop_date`).

It is possible to work around the issue by doing:
- Check 'All Day'
- Save
- Make it 'Recurrent'

However, the result should not depend on the order we perform the
action. To solve this we send data to server with `force_save`.

Fixes #27269
Closes #33068

closes #35758

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
  • Loading branch information...
sswapnesh authored and nim-odoo committed Apr 30, 2019
1 parent ab38242 commit d5072c2ec6d90c5760ab9ef44bee265b96970523
Showing with 3 additions and 3 deletions.
  1. +3 −3 addons/calendar/views/calendar_views.xml
@@ -122,8 +122,8 @@
<field name="stop" attrs="{'invisible': True}"/>
<field name="id" attrs="{'invisible': True}"/>

<field name="start_date" string="Starting at" attrs="{'required': [('allday','=',True)], 'invisible': [('allday','=',False)], 'readonly': [('id', '!=', False), ('recurrency','=',True)]}"/>
<field name="stop_date" string="Ending at" attrs="{'required': [('allday','=',True)],'invisible': [('allday','=',False)], 'readonly': [('id', '!=', False), ('recurrency','=',True)]}"/>
<field name="start_date" string="Starting at" attrs="{'required': [('allday','=',True)], 'invisible': [('allday','=',False)], 'readonly': [('id', '!=', False), ('recurrency','=',True)]}" force_save="1"/>
<field name="stop_date" string="Ending at" attrs="{'required': [('allday','=',True)],'invisible': [('allday','=',False)], 'readonly': [('id', '!=', False), ('recurrency','=',True)]}" force_save="1"/>

<field name="start_datetime" string="Starting at" attrs="{'required': [('allday','=',False)], 'invisible': [('allday','=',True)], 'readonly': [('id', '!=', False), ('recurrency','=',True)]}"/>
<field name="stop_datetime" invisible="1"/>
@@ -132,7 +132,7 @@
<field name="duration" widget="float_time" string="Duration" class="oe_inline" attrs="{'readonly': [('id', '!=', False), ('recurrency','=',True)]}"/>
<span> hours</span>
</div>
<field name="allday" attrs="{'readonly': [('id', '!=', False), ('recurrency','=',True)]}"/>
<field name="allday" attrs="{'readonly': [('id', '!=', False), ('recurrency','=',True)]}" force_save="1"/>
</group>
<group>
<field name="categ_ids" widget="many2many_tags" options="

0 comments on commit d5072c2

Please sign in to comment.
You can’t perform that action at this time.