You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

153 lines
8.1 KiB

  1. <?xml version="1.0" ?>
  2. <openerp>
  3. <data>
  4. #---------------------------------------------------------------------
  5. # Hours block search form
  6. #---------------------------------------------------------------------
  7. <record id="view_account_invoice_filter" model="ir.ui.view">
  8. <field name="name">account.hours.block.select</field>
  9. <field name="model">account.hours.block</field>
  10. <field name="type">search</field>
  11. <field name="arch" type="xml">
  12. <search string="Search Invoice">
  13. <group col="7" colspan="4">
  14. <filter name="draft" icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Hours Blocks"/>
  15. <filter name="running" icon="terp-dolar" string="Running" domain="[('close_date','=',False),('state','&lt;&gt;','draft')]" help="All Running Hours Block"/>
  16. <separator orientation="vertical"/>
  17. <filter name="overdue" icon="terp-dolar_ok!" string="Overdue" domain="[('amount_hours_block_delta','&lt;','0.0')]" help="Overdue Hours Block"/>
  18. <separator orientation="vertical"/>
  19. <field name="number"/>
  20. <field name="partner_id"/>
  21. <field name="user_id" select="1" widget="selection" string="Salesman">
  22. <filter domain="[('user_id','=',uid)]" help="My invoices" icon="terp-personal" separator="1"/>
  23. </field>
  24. <field name="company_id" widget="selection"/>
  25. </group>
  26. <newline/>
  27. <group expand="0" string="Group By...">
  28. <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
  29. <filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
  30. <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
  31. </group>
  32. </search>
  33. </field>
  34. </record>
  35. #------------------------------------------------------------------------
  36. # Hours Block View
  37. #------------------------------------------------------------------------
  38. <record id="hours_block_invoice_form" model="ir.ui.view">
  39. <field name="name">account.hours.block.form</field>
  40. <field name="model">account.hours.block</field>
  41. <field name="type">form</field>
  42. <field name="arch" type="xml">
  43. <form string="Invoice">
  44. <field name="type" />
  45. <field name="invoice_id" />
  46. <field name="last_action_date" />
  47. <field name="close_date" />
  48. <group col="6" colspan="4">
  49. <separator colspan="6" string="Hours Quantity / Amount"/>
  50. <field name="amount_hours_block" string="Bought"/>
  51. <field name="amount_hours_block_done" string="Used"/>
  52. <field name="amount_hours_block_delta" string="Difference"/>
  53. </group>
  54. <separator colspan="4" string="Invoice's related information"/>
  55. <field name="date_invoice"/>
  56. <field name="name"/>
  57. <field name="number"/>
  58. <field name="partner_id" groups="base.group_user"/>
  59. <field name="user_id"/>
  60. <field name="company_id" groups="base.group_multi_company" widget="selection"/>
  61. <field name="journal_id" invisible="1"/>
  62. <field name="period_id" invisible="1" groups="account.group_account_user"/>
  63. <field name="currency_id"/>
  64. <newline/>
  65. <field name="residual" sum="Residual Amount"/>
  66. <field name="amount_total" sum="Total Amount"/>
  67. <field name="state"/>
  68. </form>
  69. </field>
  70. </record>
  71. <record model="ir.ui.view" id="invoice_tree_hour_block">
  72. <field name="name">account.hours.block.tree</field>
  73. <field name="model">account.hours.block</field>
  74. <field name="type">tree</field>
  75. <field name="arch" type="xml">
  76. <tree colors="blue:state in ('draft');black:state in ('proforma','proforma2','open');gray:state in ('cancel')" string="Invoice">
  77. <field name="date_invoice"/>
  78. <field name="partner_id" groups="base.group_user"/>
  79. <field name="name"/>
  80. <field name="amount_hours_block" sum="Quantity of hours bought"/>
  81. <field name="amount_hours_block_done" sum="Quantity of hours used" />
  82. <field name="amount_hours_block_delta" sum="Quantity of hours difference"/>
  83. <field name="last_action_date" />
  84. <field name="close_date" />
  85. <field name="journal_id" invisible="1"/>
  86. <field name="period_id" invisible="1" groups="account.group_account_user"/>
  87. <field name="company_id" groups="base.group_multi_company" widget="selection"/>
  88. <field name="user_id"/>
  89. <field name="currency_id"/>
  90. <field name="residual" sum="Residual Amount"/>
  91. <field name="amount_total" sum="Total Amount"/>
  92. <field name="state"/>
  93. </tree>
  94. </field>
  95. </record>
  96. #---------------------------------------------------------------------------------------------------------
  97. # Add related act_window from partner and Hours Block
  98. #---------------------------------------------------------------------------------------------------------
  99. <act_window name="All blocks hours"
  100. domain="[('partner_id', '=', active_id)]"
  101. res_model="account.hours.block"
  102. src_model="res.partner"
  103. id="act_block_hour_from_partner"/>
  104. #---------------------------------------------------------------------------------------------------------
  105. # Link to invoice on hours block view
  106. #---------------------------------------------------------------------------------------------------------
  107. <act_window
  108. domain="[('account_hours_block_ids', '=', active_id)]"
  109. id="act_invoice_from_hours_block"
  110. name="Invoice"
  111. res_model="account.invoice"
  112. src_model="account.hours.block"
  113. view_mode="tree,form"
  114. view_type="form"/>
  115. #---------------------------------------------------------------------------------------------------------
  116. # Link to analytic lines on hours block view
  117. #---------------------------------------------------------------------------------------------------------
  118. <act_window
  119. domain="[('invoice_id.account_hours_block_ids', '=', active_id)]"
  120. id="act_analytic_lines_from_hours_block"
  121. name="Analytic Lines"
  122. res_model="account.analytic.line"
  123. src_model="account.hours.block"
  124. view_mode="tree,form"
  125. view_type="form"/>
  126. #---------------------------------------------------------------------------------------------------------
  127. # Link to hours block on invoice view
  128. #---------------------------------------------------------------------------------------------------------
  129. <act_window
  130. domain="[('invoice_id', '=', active_id)]"
  131. id="act_hours_block_from_invoice"
  132. name="Hours Block"
  133. res_model="account.hours.block"
  134. src_model="account.invoice"
  135. view_mode="tree,form,calendar,graph"
  136. view_type="form"/>
  137. </data>
  138. </openerp>