pos_payment_method_views.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record id="pos_payment_method_view_form" model="ir.ui.view">
  4. <field name="name">pos.payment.method.form</field>
  5. <field name="model">pos.payment.method</field>
  6. <field name="arch" type="xml">
  7. <form string="Payment Methods">
  8. <sheet>
  9. <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
  10. <field name="active" invisible="1"/>
  11. <field name="type" invisible="1" />
  12. <div class="oe_title">
  13. <label for="name"/>
  14. <h1><field name="name" placeholder="e.g. Cash" class="oe_inline"/></h1>
  15. </div>
  16. <group name="Payment methods">
  17. <field name="hide_use_payment_terminal" invisible="1"/>
  18. <group>
  19. <field name="split_transactions"/>
  20. <field name="journal_id" attrs="{'required': [('split_transactions', '=', False)]}" placeholder="Leave empty to use the receivable account of customer" />
  21. <field name="outstanding_account_id" groups="account.group_account_readonly" attrs="{'invisible': [('type', '!=', 'bank')]}" placeholder="Leave empty to use the default account from the company setting" />
  22. <field name="receivable_account_id" groups="account.group_account_readonly" attrs="{'invisible': [('split_transactions', '=', True)]}" placeholder="Leave empty to use the default account from the company setting" />
  23. <field name="company_id" readonly="1" groups="base.group_multi_company" />
  24. </group>
  25. <group attrs="{'invisible': ['|', ('hide_use_payment_terminal', '=', False), ('type', 'in', ['cash', 'pay_later'])]}">
  26. <div colspan="2">
  27. <h2>Tips:</h2>
  28. <p>
  29. Go to <a href="#" name="%(action_pos_configuration)d" type="action" class="btn-link o_form_uri" role="button">Configurations > Settings</a>
  30. <strong> > Payment Terminals</strong>
  31. in order to install a Payment Terminal and make a fully integrated payment method.
  32. </p>
  33. </div>
  34. </group>
  35. <group attrs="{'invisible': [('hide_use_payment_terminal', '=', True)]}">
  36. <field name="use_payment_terminal" />
  37. </group>
  38. </group>
  39. </sheet>
  40. </form>
  41. </field>
  42. </record>
  43. <record id="pos_payment_method_view_tree" model="ir.ui.view">
  44. <field name="name">pos.payment.method.tree</field>
  45. <field name="model">pos.payment.method</field>
  46. <field name="arch" type="xml">
  47. <tree string="Payment Methods" create="1" delete="1">
  48. <field name="type" invisible="1"/>
  49. <field name="name" />
  50. <field name="split_transactions" optional="hide" />
  51. <field name="journal_id" attrs="{'required': [('split_transactions', '=', False)]}" />
  52. <field name="outstanding_account_id" groups="account.group_account_readonly" optional="hide" attrs="{'invisible': [('type', '!=', 'bank')]}" />
  53. <field name="receivable_account_id" groups="account.group_account_readonly" optional="hide" attrs="{'invisible': [('split_transactions', '=', True)]}" />
  54. <field name="company_id" groups="base.group_multi_company" />
  55. </tree>
  56. </field>
  57. </record>
  58. <record id="pos_payment_method_view_search" model="ir.ui.view">
  59. <field name="name">pos.payment.search.view</field>
  60. <field name="model">pos.payment.method</field>
  61. <field name="arch" type="xml">
  62. <search string="Payment Methods">
  63. <field name="name"/>
  64. <field name="receivable_account_id" groups="account.group_account_readonly" />
  65. <group expand="1" string="Group By">
  66. <filter name="group_by_receivable_account" string="Account" domain="[]" context="{'group_by':'receivable_account_id'}"/>
  67. </group>
  68. <filter string="Archived" name="active" domain="[('active', '=', False)]"/>
  69. </search>
  70. </field>
  71. </record>
  72. <record id="action_pos_payment_method_form" model="ir.actions.act_window">
  73. <field name="name">Payment Methods</field>
  74. <field name="type">ir.actions.act_window</field>
  75. <field name="res_model">pos.payment.method</field>
  76. <field name="view_mode">tree,kanban,form</field>
  77. <field name="view_id" eval="False"/>
  78. <field name="domain">[]</field>
  79. <field name="context">{'search_default_group_by_account': 1}</field>
  80. <field name="help" type="html">
  81. <p class="o_view_nocontent_smiling_face">
  82. Add a new payment method
  83. </p>
  84. <p>
  85. Installing chart of accounts from the General Settings of
  86. Invocing/Accounting app will create Bank and Cash payment
  87. methods automatically.
  88. </p>
  89. </field>
  90. </record>
  91. <menuitem id="menu_pos_payment_method" parent="menu_point_config_product" action="action_pos_payment_method_form" sequence="3" groups="group_pos_manager,group_pos_user"/>
  92. <record id="action_payment_methods_tree" model="ir.actions.act_window">
  93. <field name="context">{}</field>
  94. <field name="name">Payments Methods</field>
  95. <field name="res_model">pos.payment.method</field>
  96. <field name="view_id" ref="pos_payment_method_view_tree"/>
  97. <field name="view_mode">tree,form,kanban</field>
  98. </record>
  99. </odoo>