mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG] web_timeline: Migration to 17.0
- Convert Moment.js to Luxon. - Replace Underscore.js with native JavaScript code. - Migrate legacy views to the new system and add an architecture parser to separate logic. - added basic test
This commit is contained in:
@@ -20,10 +20,9 @@ render the timeline items. You have to name the template
|
||||
'timeline-item'. These are the variables available in template
|
||||
rendering:
|
||||
|
||||
- `record`: to access the fields values selected in the timeline
|
||||
definition.
|
||||
- `field_utils`: used to format and parse values (see available
|
||||
functions in `web.field_utils`).
|
||||
- `record`: to access the fields values selected in the timeline definition.
|
||||
- `formatters`: used to format values (see available functions in `@web/views/fields/formatters`).
|
||||
- `parsers`: used to parse values (see available functions in `@web/views/fields/parsers`).
|
||||
|
||||
You also need to declare the view in an action window of the involved
|
||||
model.
|
||||
@@ -45,15 +44,15 @@ More evolved example, from `project_timeline`:
|
||||
string="Tasks"
|
||||
default_group_by="project_id"
|
||||
event_open_popup="true"
|
||||
colors="white: user_ids == []; #2ecb71: kanban_state == 'done'; #ec7063: kanban_state == 'blocked'"
|
||||
colors="white: user_ids == []; #2ecb71: state == '1_done'; #ec7063: state == '1_canceled'"
|
||||
dependency_arrow="depend_on_ids"
|
||||
>
|
||||
<field name="user_ids" />
|
||||
<field name="planned_hours" />
|
||||
<field name="allocated_hours" />
|
||||
<templates>
|
||||
<t t-name="timeline-item">
|
||||
<div class="o_project_timeline_item">
|
||||
<t t-foreach="record.user_ids" t-as="user">
|
||||
<t t-foreach="record.user_ids" t-as="user" t-key="user.id">
|
||||
<img
|
||||
t-if="record.user_ids"
|
||||
t-attf-src="/web/image/res.users/#{user}/image_128/16x16"
|
||||
@@ -68,12 +67,12 @@ More evolved example, from `project_timeline`:
|
||||
<t t-esc="record.display_name" />
|
||||
</span>
|
||||
<small
|
||||
name="planned_hours"
|
||||
name="allocated_hours"
|
||||
class="text-info ml4"
|
||||
t-if="record.planned_hours"
|
||||
t-if="record.allocated_hours"
|
||||
>
|
||||
<t
|
||||
t-esc="field_utils.format.float_time(record.planned_hours)"
|
||||
t-out="formatters.get('float_time')(record.allocated_hours)"
|
||||
/>
|
||||
</small>
|
||||
</div>
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
- Pedro M. Baeza
|
||||
- Alexandre Díaz
|
||||
- César A. Sánchez
|
||||
- Carlos López
|
||||
- [Onestein](https://www.onestein.nl):
|
||||
- Dennis Sluijk \<<d.sluijk@onestein.nl>\>
|
||||
- Anjeel Haria
|
||||
|
||||
Reference in New Issue
Block a user