odoo_dev 开发培训作业:图书管理系统
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.

59 lines
2.6KB

  1. <?xml version="1.0"?>
  2. <odoo>
  3. <record id="view_form_book" model="ir.ui.view">
  4. <field name="name">Book Form</field>
  5. <field name="model">library.book</field>
  6. <field name="arch" type="xml">
  7. <form string="Book">
  8. <!--add button(check isbn) in header element. status bar could be put here if the model has a state field-->
  9. <header>
  10. <!-- button_check_isbn 是py文件里的方法名。可以通过context传参(新一个action可以清空context)-->
  11. <button name="button_check_isbn" type="object"
  12. string="Check ISBN" />
  13. </header>
  14. <sheet> <!--sheet 像是一张纸张的界面-->
  15. <group name="group_top">
  16. <group name="group_left">
  17. <field name="name" />
  18. <field name="author_ids" widget="many2many_tags" /> <!--widget defines how the data is supposed to be presented.-->
  19. <field name="publisher_id" domain="[('is_company','=',True)]" /> <!--set a filter-->
  20. <field name="date_published" />
  21. </group>
  22. <group name="group_right">
  23. <field name="isbn" />
  24. <field name="active" />
  25. <field name="image" widget="image" />
  26. </group>
  27. </group>
  28. </sheet>
  29. </form>
  30. </field>
  31. </record>
  32. <record id="view_tree_book" model="ir.ui.view">
  33. <field name="name">Book List</field>
  34. <field name="model">library.book</field>
  35. <field name="arch" type="xml">
  36. <tree>
  37. <field name="name" />
  38. <field name="author_ids" widget="many2many_tags" />
  39. <field name="publisher_id" />
  40. <field name="date_published" />
  41. </tree>
  42. </field>
  43. </record>
  44. <record id="view_search_book" model="ir.ui.view"> <!-- search view 搜索视图-->
  45. <field name="name">Book Filters</field>
  46. <field name="model">library.book</field>
  47. <field name="arch" type="xml">
  48. <search>
  49. <field name="publisher_id" />
  50. <filter name="filter_active"
  51. string="Active"
  52. domain="[('active','=',True)]" />
  53. <filter name="filter_inactive"
  54. string="Inactive"
  55. domain="[('active','=',False)]" />
  56. </search>
  57. </field>
  58. </record>
  59. </odoo>
上海开阖软件有限公司 沪ICP备12045867号-1