Skip to content

Commit

Permalink
[MIG] sale_timesheet_timeline: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-lopez-tecnativa committed Nov 16, 2024
1 parent f7b02fd commit b4a9524
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion sale_timesheet_timeline/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Dates planning in sales order lines",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"category": "Services/Project",
"website": "https://github.com/OCA/timesheet",
"author": "Tecnativa, Odoo Community Association (OCA)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,7 @@ def test_task_creation(self):
self.assertEqual(
task.planned_date_end, fields.Datetime.from_string("2024-08-05 12:00:00")
)
self.assertEqual(task.date_deadline, fields.Date.from_string("2024-08-05"))
self.assertEqual(
task.date_deadline, fields.Datetime.from_string("2024-08-05 12:00:00")
)
self.assertEqual(task.user_ids, self.user)
19 changes: 13 additions & 6 deletions sale_timesheet_timeline/views/sale_order_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
<templates>
<t t-name="timeline-item">
<div class="o_project_timeline_item">
<t t-foreach="record.task_user_ids" t-as="user">
<t
t-foreach="record.task_user_ids"
t-as="user"
t-key="user.id"
>
<img
t-if="record.task_user_ids"
t-attf-src="/web/image/res.users/#{user}/avatar_128/16x16"
Expand All @@ -39,7 +43,7 @@
t-if="record.product_uom_qty"
>
<t
t-esc="field_utils.format.float_time(record.product_uom_qty)"
t-out="formatters.get('float_time')(record.product_uom_qty)"
/>
</small>
</div>
Expand All @@ -65,18 +69,21 @@
<field
name="task_date_start"
optional="hide"
attrs="{'invisible': [('product_type', '!=', 'service')], 'readonly': [('state', 'not in', ('draft', 'sent'))]}"
invisible="product_type != 'service'"
readonly="state not in ('draft', 'sent')"
/>
<field
name="task_date_end"
optional="hide"
attrs="{'invisible': [('product_type', '!=', 'service')], 'readonly': [('state', 'not in', ('draft', 'sent'))]}"
invisible="product_type != 'service'"
readonly="state not in ('draft', 'sent')"
/>
<field
name="task_user_ids"
optional="hide"
widget="many2many_avatar_user"
attrs="{'invisible': [('product_type', '!=', 'service')], 'readonly': [('state', 'not in', ('draft', 'sent'))]}"
invisible="product_type != 'service'"
readonly="state not in ('draft', 'sent')"
/>
</xpath>
<xpath expr="//div[@name='button_box']" position="inside">
Expand All @@ -86,7 +93,7 @@
type="action"
class="oe_stat_button"
icon="fa-tasks"
attrs="{'invisible': [('any_service_line', '=', False)]}"
invisible="not any_service_line"
>
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">Planning</span>
Expand Down

0 comments on commit b4a9524

Please sign in to comment.