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.

85 lines
3.1 KiB

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <odoo>
  3. <record model="ir.ui.view" id="better_zip_form">
  4. <field name="name">res.better.zip.form</field>
  5. <field name="model">res.better.zip</field>
  6. <field name="arch" type="xml">
  7. <form string="City">
  8. <group col="4">
  9. <group>
  10. <field name="name"/>
  11. <field name="city_id"
  12. attrs="{'invisible': [('enforce_cities', '=', False)],'required': [('enforce_cities', '=', True)]}"/>
  13. <field name="city"
  14. attrs="{'invisible': [('enforce_cities', '=', True)]}"/>
  15. <field name="country_id"/>
  16. <field name="enforce_cities" invisible="1"/>
  17. </group>
  18. <group>
  19. <field name="code"/>
  20. <field name="state_id"
  21. attrs="{'invisible': [('enforce_cities', '=', True)]}"/>
  22. </group>
  23. </group>
  24. </form>
  25. </field>
  26. </record>
  27. <record model="ir.ui.view" id="better_zip_tree">
  28. <field name="name">res.better.zip.tree</field>
  29. <field name="model">res.better.zip</field>
  30. <field name="arch" type="xml">
  31. <tree string="Cities">
  32. <field name="name"/>
  33. <field name="code"/>
  34. <field name="city"/>
  35. <field name="state_id"/>
  36. <field name="country_id"/>
  37. </tree>
  38. </field>
  39. </record>
  40. <record id="view_better_zip_filter" model="ir.ui.view">
  41. <field name="name">res.better.zip.select</field>
  42. <field name="model">res.better.zip</field>
  43. <field name="arch" type="xml">
  44. <search string="Search city">
  45. <field name="name"/>
  46. <field name="code"/>
  47. <field name="city"/>
  48. <field name="state_id"/>
  49. <field name="country_id"/>
  50. <group expand="0" string="Group By">
  51. <filter string="State" domain="[]"
  52. context="{'group_by':'state_id'}"/>
  53. <filter string="Country" domain="[]"
  54. context="{'group_by':'country_id'}"/>
  55. </group>
  56. </search>
  57. </field>
  58. </record>
  59. <record id="action_zip_tree" model="ir.actions.act_window">
  60. <field name="name">Locations</field>
  61. <field name="res_model">res.better.zip</field>
  62. <field name="view_type">form</field>
  63. <field name="view_mode">tree,form</field>
  64. <field ref="better_zip_tree" name="view_id"/>
  65. <field name="search_view_id" ref="view_better_zip_filter"/>
  66. </record>
  67. <menuitem
  68. name="Locations Management"
  69. id="locations_root_menu"
  70. parent="base.menu_custom"
  71. />
  72. <menuitem
  73. name="Locations"
  74. id="locations_menu"
  75. parent="locations_root_menu"
  76. action="action_zip_tree"
  77. />
  78. </odoo>