account_invoice_view.xml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <data>
  4. <record id="isr_invoice_form" model="ir.ui.view">
  5. <field name="name">l10n_ch.account.invoice.form</field>
  6. <field name="model">account.move</field>
  7. <field name="inherit_id" ref="account.view_move_form"/>
  8. <field name="arch" type="xml">
  9. <xpath expr="//field[@name='is_move_sent']" position="after">
  10. <field name="l10n_ch_isr_sent" invisible="1"/>
  11. <field name="l10n_ch_currency_name" invisible="1" readonly="1"/>
  12. <field name="l10n_ch_is_qr_valid" invisible="1"/>
  13. </xpath>
  14. <header position="after">
  15. <field name="l10n_ch_isr_needs_fixing" invisible="1"/>
  16. <div groups="account.group_account_invoice" class="alert alert-warning" role="alert" style="margin-bottom:0px;" attrs="{'invisible': [('l10n_ch_isr_needs_fixing', '=', False)]}">
  17. Please fill in a correct ISR reference in the payment reference. The banks will refuse your payment file otherwise.
  18. </div>
  19. </header>
  20. </field>
  21. </record>
  22. <record id="isr_invoice_search_view" model="ir.ui.view">
  23. <field name="name">l10n_ch.invoice.select</field>
  24. <field name="model">account.move</field>
  25. <field name="inherit_id" ref="account.view_account_invoice_filter"/>
  26. <field name="mode">primary</field>
  27. <field name="arch" type="xml">
  28. <xpath expr="//search" position="inside">
  29. <field name="l10n_ch_isr_number" string="ISR reference number"/>
  30. </xpath>
  31. </field>
  32. </record>
  33. <!--Overridden action (and primary child view), so the filter are only
  34. available for customer invoices-->
  35. <record id="account.action_move_out_invoice_type" model="ir.actions.act_window">
  36. <field name="name">Customer Invoices</field>
  37. <field name="res_model">account.move</field>
  38. <field name="search_view_id" ref="isr_invoice_search_view"/>
  39. </record>
  40. <record id="l10n_ch_qr_server_action" model="ir.actions.server">
  41. <field name="name">Print QR Invoices</field>
  42. <field name="model_id" ref="account.model_account_move"/>
  43. <field name="binding_model_id" ref="account.model_account_move"/>
  44. <field name="binding_view_types">list</field>
  45. <field name="state">code</field>
  46. <field name="code">
  47. if records:
  48. action = records.l10n_ch_action_print_qr()
  49. </field>
  50. </record>
  51. </data>
  52. </odoo>