|
- <?xml version="1.0" ?>
- <odoo>
- <act_window id="action_other_checkouts_button"
- name="Open Other Checkouts"
- res_model="library.checkout"
- view_mode="tree,form"
- domain="[('member_id', '=', default_member_id),
- ('state', 'in', ['open']),
- ('id', '!=', active_id)]"/>
- <!-- Tree视图 -->
- <record id="view_tree_checkout" model="ir.ui.view">
- <field name="name">Checkout Tree</field>
- <field name="model">library.checkout</field>
- <field name="arch" type="xml">
- <tree decoration-muted="state in ['done', 'cancel']" decoration-bf="state=='open'">
- <field name="state" invisible="True"/>
- <field name="request_date"/>
- <field name="member_id"/>
- <field name="checkout_date"/>
- <field name="stage_id"/>
- <!--<field name="num_books" sum="# Books" />-->
- <!--<field name="num_books" sum="number of Books" />-->
- </tree>
- </field>
- </record>
- <!-- Form视图 -->
- <record id="view_form_checkout" model="ir.ui.view">
- <field name="name">Checkout Form</field>
- <field name="model">library.checkout</field>
- <field name="arch" type="xml">
- <form>
- <header>
- <field name="state" invisible="True"/>
- <button name="button_done" type="object" string="Return Books"
- attrs="{'invisible':[('state', 'in', ['new', 'done'])]}" class="oe_highlight"/>
- <!--另外一种方法
- <button name="button_done" type="object" string="Returned" states="open,cancel" class="oe_highlight" />-->
-
- <field name="stage_id" widget="statusbar" clickable="True" options="{'fold_field': 'fold'}"/>
- <!--另一种方法状态代替管道
- <field name="state" widget="statusbar" clickable="True" statusbar_visible="draft,open,done" />-->
-
- <!--下仅供查看效果使用-->
- <!--<field name="state" widget="statusbar" clickable="True"/>-->
-
- </header>
-
- <sheet>
- <div name="button_box" class="oe_button_box">
- <button class="oe_stat_button"
- icon="fa-tasks"
- help="Other checkouts pending return."
- type="action"
- name="%(action_other_checkouts_button)d"
- context="{'default_member_id': member_id}">
- <field string="To Return" name="num_other_checkouts" widget="statinfo"/>
- </button>
- </div>
-
- <field name="member_image" widget="image" class="oe_avatar"/>
- <div class="oe_title">
-
- <label for="member_id" class="oe_edit_only"/>
- <h1>
- <field name="member_id"/>
- </h1>
- <h3>
- <span class="oe_read_only">By</span>
- <label for="user_id" class="oe_edit_only"/>
- <field name="user_id" class="oe_inline"/>
- </h3>
-
- <label for="login" class="oe_edit_only"/>
- <field name="login" class="oe_inline"/>
- </div>
-
- <group name="group_top"> <!-- col=4个字段,solspan=2列显示 -->
- <group name="group_col1"
- col="4"
- colspan="2"
- string="Group 1">
- <field name="user_id"/>
- <field name="checkout_date"/>
- <field name="state"/>
- <field name="closed_date"/>
- </group>
- <group name="group_col2" string="Hello World!">
- <field name="state"/>
- <field name="closed_date"/>
- <field name="num_books"/>
- </group>
- </group>
- <group>
- <field name="member_id"/>
- <field name="request_date"/>
- <field name="user_id"/>
- <field name="line_ids"/>
-
- </group>
- <notebook>
- <page string="Borrowed Books" name="page_lines">
- <field name="note" accesskey="a"/>
- </page>
- <page string="管理">
- <group>
- <field name="login"/>
- <field name="pwd" password="True"/>
- </group>
- </page>
- <page string="Borrowed Books" name="page_lines">
- <field name="line_ids">
- <tree>
- <field name="book_id"/>
- </tree>
- <!--form>
- <field name="book_id" />
- </form-->
- </field>
- </page>
- </notebook>
-
- </sheet>
- <div class="oe_chatter">
- <field name="message_follower_ids" widget="mail_followers"/>
- <field name="activity_ids" widget="mail_activity"/>
- <field name="message_ids" widget="mail_thread"/>
- </div>
- </form>
- </field>
- </record>
- <!-- 搜索视图 -->
- <record id="view_filter_checkout" model="ir.ui.view">
- <field name="model">library.checkout</field>
- <field name="arch" type="xml">
- <search>
- <field name="member_id"/>
- <field name="user_id"/>
- <filter name="filter_not_done" string="To Return" domain="[('state','=','open')]"/>
- <filter name="filter_my_checkouts" string="My Checkouts" domain="['user_id', '=', uid]"/>
- <filter name="group_user" string="By Member" context="{'group_by': 'member_id'}"/>
- </search>
- </field>
- </record>
- <!-- 日历视图 date_start是开始日期字段(必填) -->
- <record id="view_calendar_checkout" model="ir.ui.view">
- <field name="model">library.checkout</field>
- <field name="arch" type="xml">
- <calendar date_start="request_date"
- color="user_id">
- <field name="member_id"/>
- <field name="stage_id"/>
- </calendar>
- </field>
- </record>
- <!-- 透视表视图 -->
- <record id="view_pivot_checkout" model="ir.ui.view">
- <field name="name">view_pivot_checkout</field>
- <field name="model">library.checkout</field>
- <field name="arch" type="xml">
- <pivot>
- <field name="stage_id" type="col"/>
- <field name="member_id"/>
- <field name="request_date" interval="week"/>
- <!--<field name="num_books" type="measure"/>-->
- </pivot>
- </field>
- </record>
- <!-- 图表视图 -->
- <record id="view_graph_checkout" model="ir.ui.view">
- <field name="name">view_graph_checkout</field>
- <field name="model">library.checkout</field>
- <field name="arch" type="xml">
- <graph type="bar">
- <field name="stage_id"/>
- <!--<field name="num_books" type="measure"/>-->
- </graph>
- </field>
- </record>
- </odoo>
|