res_country_views.xml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <data>
  4. <!--
  5. Country
  6. -->
  7. <record id="view_country_tree" model="ir.ui.view">
  8. <field name="name">res.country.tree</field>
  9. <field name="model">res.country</field>
  10. <field name="arch" type="xml">
  11. <tree string="Country" create="0" delete="0">
  12. <field name="name"/>
  13. <field name="code"/>
  14. </tree>
  15. </field>
  16. </record>
  17. <record id="view_country_form" model="ir.ui.view">
  18. <field name="name">res.country.form</field>
  19. <field name="model">res.country</field>
  20. <field name="arch" type="xml">
  21. <form create="0" delete="0">
  22. <sheet>
  23. <div class="oe_button_box" name="button_box">
  24. </div>
  25. <field name="image_url" widget="image_url" class="oe_avatar" options="{'size': [128,128]}"/>
  26. <group name="main_group">
  27. <group name="country_details">
  28. <field name="name"/>
  29. <field name="currency_id"/>
  30. <field name="code" required="1"/>
  31. </group>
  32. <group name="phone_vat_settings">
  33. <field name="phone_code" options="{'format': false}"/>
  34. <field name="vat_label"/>
  35. <field name="zip_required"/>
  36. <field name="state_required"/>
  37. </group>
  38. </group>
  39. <group name="advanced_address_formatting" string="Advanced Address Formatting" groups="base.group_no_one">
  40. <label for="address_view_id"/>
  41. <div class="o_row">
  42. <field name="address_view_id"/>
  43. <div class="text-muted ms-2">Choose a subview of partners that includes only address fields, to change the way users can input addresses.</div>
  44. </div>
  45. <label for="address_format"/>
  46. <div class="o_row">
  47. <field name="address_format" placeholder="Address format..."/>
  48. <div name="div_address_format ms-2" class="text-muted">Change the way addresses are displayed in reports</div>
  49. </div>
  50. <field name="name_position" class="oe_inline"/>
  51. </group>
  52. <label for="state_ids"/>
  53. <field name="state_ids">
  54. <tree editable="bottom">
  55. <field name="name"/>
  56. <field name="code"/>
  57. </tree>
  58. </field>
  59. </sheet>
  60. </form>
  61. </field>
  62. </record>
  63. <record id="action_country" model="ir.actions.act_window">
  64. <field name="name">Countries</field>
  65. <field name="type">ir.actions.act_window</field>
  66. <field name="res_model">res.country</field>
  67. <field name="help" type="html">
  68. <p class="o_view_nocontent_smiling_face">
  69. No Country Found!
  70. </p><p>
  71. Manage the list of countries that can be set on your contacts.
  72. </p>
  73. </field>
  74. </record>
  75. <record id="view_country_group_tree" model="ir.ui.view">
  76. <field name="name">res.country.group.tree</field>
  77. <field name="model">res.country.group</field>
  78. <field name="arch" type="xml">
  79. <tree string="Country Group">
  80. <field name="name"/>
  81. </tree>
  82. </field>
  83. </record>
  84. <record id="view_country_group_form" model="ir.ui.view">
  85. <field name="name">res.country.group.form</field>
  86. <field name="model">res.country.group</field>
  87. <field name="arch" type="xml">
  88. <form string="Country Group">
  89. <sheet>
  90. <div class="oe_title">
  91. <label for="name" string="Group Name"/>
  92. <h1><field name="name" placeholder="e.g. Europe"/></h1>
  93. </div>
  94. <group name="country_group">
  95. <field name="country_ids" widget="many2many_tags" options="{'no_open': True, 'no_create': True}"/>
  96. </group>
  97. </sheet>
  98. </form>
  99. </field>
  100. </record>
  101. <record id="action_country_group" model="ir.actions.act_window">
  102. <field name="name">Country Group</field>
  103. <field name="type">ir.actions.act_window</field>
  104. <field name="res_model">res.country.group</field>
  105. <field name="help" type="html">
  106. <p class="o_view_nocontent_smiling_face">
  107. Create a Country Group
  108. </p><p>
  109. Use groups to organize countries that are frequently selected together (e.g. "LATAM", "BeNeLux", "ASEAN").
  110. </p>
  111. </field>
  112. </record>
  113. <!-- State -->
  114. <record id="view_country_state_tree" model="ir.ui.view">
  115. <field name="name">res.country.state.tree</field>
  116. <field name="model">res.country.state</field>
  117. <field name="arch" type="xml">
  118. <tree string="State" editable="bottom">
  119. <field name="name"/>
  120. <field name="code"/>
  121. <field name="country_id" options="{'no_create': True, 'no_open': True}"/>
  122. </tree>
  123. </field>
  124. </record>
  125. <record id="view_country_state_form" model="ir.ui.view">
  126. <field name="name">res.country.state.form</field>
  127. <field name="model">res.country.state</field>
  128. <field name="arch" type="xml">
  129. <form string="State">
  130. <sheet>
  131. <group>
  132. <field name="name"/>
  133. <field name="code"/>
  134. <field name="country_id" options='{"no_open": True, "no_create": True}'/>
  135. </group>
  136. </sheet>
  137. </form>
  138. </field>
  139. </record>
  140. <record id="view_country_state_search" model="ir.ui.view">
  141. <field name="name">res.country.state.search</field>
  142. <field name="model">res.country.state</field>
  143. <field name="arch" type="xml">
  144. <search string="Country">
  145. <field name="name"/>
  146. <field name="country_id"/>
  147. <group string="Group By">
  148. <filter name="groupby_country" string="Country" context="{'group_by': 'country_id'}"/>
  149. </group>
  150. </search>
  151. </field>
  152. </record>
  153. <record id="action_country_state" model="ir.actions.act_window">
  154. <field name="name">Fed. States</field>
  155. <field name="type">ir.actions.act_window</field>
  156. <field name="res_model">res.country.state</field>
  157. <field name="view_id" ref="view_country_state_tree"/>
  158. <field name="help" type="html">
  159. <p class="o_view_nocontent_smiling_face">
  160. Create a State
  161. </p><p>
  162. Federal States belong to countries and are part of your contacts' addresses.
  163. </p>
  164. </field>
  165. </record>
  166. </data>
  167. </odoo>