project_sharing_views.xml 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record id="project_sharing_inherit_project_task_view_form" model="ir.ui.view">
  4. <field name="name">project.task.form.inherit.timesheet</field>
  5. <field name="model">project.task</field>
  6. <field name="inherit_id" ref="project.project_sharing_project_task_view_form"/>
  7. <field name="arch" type="xml">
  8. <xpath expr="//field[@name='timesheet_ids']/tree" position="attributes">
  9. <attribute name="decoration-muted">timesheet_invoice_id != False</attribute>
  10. </xpath>
  11. <xpath expr="//field[@name='timesheet_ids']/tree/field[@name='unit_amount']" position="before">
  12. <field name="timesheet_invoice_id" invisible="1"/>
  13. <field name="so_line"
  14. attrs="{'column_invisible': [('parent.allow_billable', '=', False)]}"
  15. context="{'with_remaining_hours': True, 'with_price_unit': True}" options="{'no_create': True, 'no_open': True}"
  16. optional="hide"/>
  17. </xpath>
  18. <xpath expr="//field[@name='child_ids']/tree/field[@name='remaining_hours']" position="after">
  19. <field name="remaining_hours_so" optional="hide" widget="timesheet_uom"/>
  20. </xpath>
  21. <xpath expr="//field[@name='remaining_hours']" position="after">
  22. <field name="allow_billable" invisible="1" />
  23. <field name="remaining_hours_available" invisible="1"/>
  24. <field name="sale_order_id" invisible="1"/>
  25. <span id="remaining_hours_so_label" attrs="{'invisible': ['|', '|', '|', '|', ('allow_billable', '=', False), ('sale_order_id', '=', False), ('partner_id', '=', False), ('sale_line_id', '=', False), ('remaining_hours_available', '=', False)]}" class="o_td_label float-start">
  26. <label class="fw-bold" for="remaining_hours_so" string="Remaining Hours on SO"
  27. attrs="{'invisible': ['|', ('encode_uom_in_days', '=', True), ('remaining_hours_so', '&lt;', 0)]}"/>
  28. <label class="fw-bold" for="remaining_hours_so" string="Remaining Days on SO"
  29. attrs="{'invisible': ['|', ('encode_uom_in_days', '=', False), ('remaining_hours_so', '&lt;', 0)]}"/>
  30. <label class="fw-bold text-danger" for="remaining_hours_so" string="Remaining Hours on SO"
  31. attrs="{'invisible': ['|', ('encode_uom_in_days', '=', True), ('remaining_hours_so', '&gt;=', 0)]}"/>
  32. <label class="fw-bold text-danger" for="remaining_hours_so" string="Remaining Days on SO"
  33. attrs="{'invisible': ['|', ('encode_uom_in_days', '=', False), ('remaining_hours_so', '&gt;=', 0)]}"/>
  34. </span>
  35. <field name="remaining_hours_so" nolabel="1" widget="timesheet_uom" attrs="{'invisible': ['|', '|', '|', '|', ('allow_billable', '=', False), ('sale_order_id', '=', False), ('partner_id', '=', False), ('sale_line_id', '=', False), ('remaining_hours_available', '=', False)]}"></field>
  36. </xpath>
  37. </field>
  38. </record>
  39. <record id="project_sharing_inherit_project_task_view_tree_sale_timesheet" model="ir.ui.view">
  40. <field name="name">project.task.tree.inherit.sale.timesheet</field>
  41. <field name="model">project.task</field>
  42. <field name="inherit_id" ref="hr_timesheet.project_sharing_inherit_project_task_view_tree"/>
  43. <field name="arch" type="xml">
  44. <xpath expr="//field[@name='remaining_hours']" position="after">
  45. <field name="remaining_hours_so" optional="hide" widget="timesheet_uom"/>
  46. </xpath>
  47. </field>
  48. </record>
  49. </odoo>