[IMP] event_track_calendar_event:

* change widget to display dates
* limit locations to company (not contacts)
This commit is contained in:
clementthomas
2024-03-22 12:27:56 +01:00
parent f524724a0f
commit 0aab44b770
2 changed files with 7 additions and 3 deletions

View File

@@ -21,8 +21,12 @@
<form>
<group>
<field name="name" string="Name" invisible="True" />
<field name="start" string="From" />
<field name="stop" string="To" />
<label for="start" string="Date"/>
<div class="o_row">
<field name="start" widget="daterange" nolabel="1" class="oe_inline" options="{'related_end_date': 'stop'}"/>
<i class="fa fa-long-arrow-right mx-2" aria-label="Arrow icon" title="Arrow"/>
<field name="stop" widget="daterange" nolabel="1" class="oe_inline" options="{'related_start_date': 'start'}"/>
</div>
<field name="description" />
</group>
</form>

View File

@@ -5,7 +5,7 @@ from odoo import fields, models, api
class EventTrackLocation(models.Model):
_inherit = 'event.track.location'
partner_id = fields.Many2one('res.partner', 'Address')
partner_id = fields.Many2one('res.partner', 'Address', domain="[('is_company','=',True)]")
def write(self, vals):
"""update calendar events related to event tracks if partner change