account_journal_dashboard_view.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <openerp>
  3. <data>
  4. <record id="view_filter_inherited" model="ir.ui.view">
  5. <field name="name">view_filter_inherited</field>
  6. <field name="model">account.invoice</field>
  7. <field name="inherit_id" ref="account.view_account_invoice_filter"/>
  8. <field name="arch" type="xml">
  9. <field name="number" position="after">
  10. <filter name="sale_draft" string="Sale Draft" domain="['&amp;',('state','=','draft'),('type','=','out_invoice')]" invisible="1"/>
  11. <filter name="purchase_draft" string="Purchase Draft" domain="['&amp;',('state','=','draft'),('type','=','in_invoice')]" invisible="1" />
  12. <filter name="sale_open" string="Sale Open" domain="['&amp;',('state','=','open'),('type','=','out_invoice')]" invisible="1"/>
  13. <filter name="purchase_open" string="Purchase Open" domain="['&amp;',('state','=','open'),('type','=','in_invoice')]" invisible="1"/>
  14. </field>
  15. <filter name="draft" position="attributes">
  16. <attribute name="invisible">True</attribute>
  17. </filter>
  18. <filter name="proforma" position="attributes">
  19. <attribute name="invisible">True</attribute>
  20. </filter>
  21. <filter name="invoices" position="attributes">
  22. <attribute name="invisible">True</attribute>
  23. </filter>
  24. <filter name="unpaid" position="attributes">
  25. <attribute name="invisible">True</attribute>
  26. </filter>
  27. </field>
  28. </record>
  29. <!-- -->
  30. <record id="account_journal_dashboard_kanban_view" model="ir.ui.view">
  31. <field name="name">account.journal.dashboard.kanban</field>
  32. <field name="model">account.journal</field>
  33. <field name="arch" type="xml">
  34. <kanban class="oe_background_grey" create="0">
  35. <field name="id"/>
  36. <field name="name"/>
  37. <field name="type"/>
  38. <field name="show_on_dashboard"/>
  39. <field name="kanban_dashboard"/>
  40. <templates>
  41. <t t-name="kanban-box">
  42. <div t-attf-class="oe_kanban_color_#{kanban_getcolor(3)} oe_kanban_card oe_kanban_invoice">
  43. <t t-value="JSON.parse(record.kanban_dashboard.raw_value)" t-set="dashboard"/>
  44. <t t-value="record.type.raw_value" t-set="journal_type"/>
  45. <t t-value="record.id" t-set="id_graph"/>
  46. <t t-call="JournalTop"/>
  47. <div class="o_kanban_card_content o_visible">
  48. <div class="row">
  49. <t t-if="(journal_type == 'bank' || journal_type == 'cash')" t-call="JournalBodyBankCash"/>
  50. <t t-if="journal_type == 'sale' || journal_type == 'purchase'" t-call="JournalBodySalePurchase"/>
  51. <div t-if="journal_type == 'general' || journal_type == 'situation'" class="row">
  52. </div>
  53. </div>
  54. <t t-if="journal_type == 'bank' || journal_type == 'cash' || journal_type == 'sale' || journal_type == 'purchase'" t-call="JournalBodyGraph"/>
  55. </div>
  56. </div>
  57. </t>
  58. <t t-name="JournalTop">
  59. <div class="o_kanban_card_header">
  60. <div class="o_kanban_card_header_title">
  61. <h4 class="text-center">
  62. <strong><field name="name"/></strong>
  63. </h4>
  64. </div>
  65. </div>
  66. </t>
  67. <t t-name="JournalBodyBankCash">
  68. <!-- On the left, display :
  69. - A button corresponding to the bank_statements_source, if it wasn't configured, a button for each of them
  70. - If there are statements to reconcile, a link to reconcile them -->
  71. <div class="col-xs-6 o_kanban_primary_left">
  72. <t t-if="dashboard.number_to_reconcile > 0">
  73. <button type="object" name="action_open_reconcile" class="btn btn-primary btn-sm"> Reconcile <t t-esc="dashboard.number_to_reconcile"/> Items</button>
  74. </t>
  75. <t t-if="journal_type == 'bank'">
  76. <div name="bank_journal_default_cta" t-if="! dashboard.bank_statements_source">
  77. <button t-if="dashboard.number_to_reconcile == 0" type="object" name="create_bank_statement" class="btn btn-primary btn-sm">New Statement</button>
  78. <a t-if="dashboard.number_to_reconcile > 0" type="object" name="create_bank_statement" class="oe_inline">New Statement</a>
  79. </div>
  80. <div name="bank_journal_cta" t-if="dashboard.bank_statements_source">
  81. <button t-if="dashboard.bank_statements_source == 'manual' &amp;&amp; dashboard.number_to_reconcile == 0" type="object" name="create_bank_statement" class="btn btn-primary btn-sm">New Statement</button>
  82. <a t-if="dashboard.bank_statements_source == 'manual' &amp;&amp; dashboard.number_to_reconcile > 0" type="object" name="create_bank_statement" class="oe_inline">New Statement</a>
  83. </div>
  84. </t>
  85. <t t-if="dashboard.number_to_reconcile > 0">
  86. <a t-if="journal_type == 'cash'" type="object" name="create_cash_statement" class="oe_inline">New Transactions</a>
  87. </t>
  88. <t t-if="dashboard.number_to_reconcile == 0">
  89. <button t-if="journal_type == 'cash'" type="object" name="create_cash_statement" class="btn btn-primary btn-sm">New Transactions</button>
  90. </t>
  91. </div>
  92. <!-- On the right, show other common informations/actions -->
  93. <div class="col-xs-6 o_kanban_primary_right">
  94. <div class="row">
  95. <div class="col-xs-6">
  96. <span title="Balance in Odoo">Balance in Odoo</span>
  97. </div>
  98. <div class="col-xs-6 text-right">
  99. <span><t t-esc="dashboard.account_balance"/></span>
  100. </div>
  101. </div>
  102. <div class="row" name="latest_statement" t-if="dashboard.last_balance != dashboard.account_balance">
  103. <div class="col-xs-6">
  104. <span title="Latest Statement">Latest Statement</span>
  105. </div>
  106. <div class="col-xs-6 text-right">
  107. <span><t t-esc="dashboard.last_balance"/></span>
  108. </div>
  109. </div>
  110. </div>
  111. </t>
  112. <t t-name="JournalBodySalePurchase">
  113. <div class="col-xs-5 o_kanban_primary_left">
  114. <button type="object" name="action_create_new" class="btn btn-sm">
  115. <t t-if="journal_type == 'sale'"><span>Nueva Venta</span></t>
  116. <t t-if="journal_type == 'purchase'"><span>Nueva Compra</span></t>
  117. </button>
  118. </div>
  119. <div class="col-xs-7 o_kanban_primary_right">
  120. <div class="row">
  121. <div class="col-xs-6">
  122. <a type="object" name="open_action" context="{'search_default_sale_draft': '1'}">
  123. <span t-if="journal_type == 'sale'" title="Facturas por validar"><t t-esc="dashboard.number_draft"/> Facturas por validar</span>
  124. </a>
  125. <a type="object" name="open_action" context="{'search_default_purchase_draft': '1'}">
  126. <span t-if="journal_type == 'purchase'" title="Facturas en borrador"><t t-esc="dashboard.number_draft"/> Facturas en borrador</span>
  127. </a>
  128. </div>
  129. <div class="col-xs-6 text-right">
  130. <span><t t-esc="dashboard.currency_id"/></span>
  131. <span><t t-esc="dashboard.sum_draft"/></span>
  132. </div>
  133. </div>
  134. <div class="row">
  135. <div class="col-xs-6">
  136. <a type="object" name="open_action" context="{'search_default_sale_open':'1'}">
  137. <span t-if="journal_type == 'sale'" title="Esperando pagos"><t t-esc="dashboard.number_waiting"/> Esperando pagos</span>
  138. </a>
  139. <a type="object" name="open_action" context="{'search_default_purchase_open': '1'}">
  140. <span t-if="journal_type == 'purchase'" title="Pagos a realizar"><t t-esc="dashboard.number_waiting"/> Pagos a realizar</span>
  141. </a>
  142. </div>
  143. <div class="col-xs-6 text-right">
  144. <span><t t-esc="dashboard.currency_id"/></span>
  145. <span> <t t-esc="dashboard.sum_waiting"/></span>
  146. </div>
  147. </div>
  148. </div>
  149. </t>
  150. <t t-name="JournalBodyGraph">
  151. <div class="o_kanban_graph_section">
  152. <field name="kanban_dashboard_graph" t-att-graph_type="_.contains(['cash','bank'],journal_type) ? 'line' : 'bar'" widget="kanban_graph"/>
  153. </div>
  154. </t>
  155. </templates>
  156. </kanban>
  157. </field>
  158. </record>
  159. <record id="open_account_journal_dashboard_kanban" model="ir.actions.act_window">
  160. <field name="name">Control de Mando</field>
  161. <field name="res_model">account.journal</field>
  162. <field name="view_type">form</field>
  163. <field name="view_mode">kanban,form</field>
  164. <field name="usage">menu</field>
  165. <field name="context">{}</field>
  166. <field name="domain">['|',('type', '=', 'sale'),('type', '=', 'purchase')]</field>
  167. </record>
  168. <menuitem id="menu_board_journal_1" name="Control de Mando" parent="account.menu_finance" sequence="1"/>
  169. <menuitem id="submenu_board_journal_1" name="Resumen" action="open_account_journal_dashboard_kanban"
  170. parent="menu_board_journal_1" sequence="1"/>
  171. <!-- -->
  172. </data>
  173. </openerp>