|
- <?xml version="1.0"?>
- <odoo>
- <data>
-
- <record model="ir.ui.view" id="wecom_material_form">
- <field name="name">wecom.material.form</field>
- <field name="model">wecom.material</field>
- <field name="arch" type="xml">
- <form>
- <sheet>
- <div class="oe_button_box" name="button_box">
- <button class="oe_stat_button" name="upload_media" string="Upload media files" type="object" icon="fa-upload" attrs="{'invisible': ['|',('id','=',False),('company_id', '=', False)]}"/>
- </div>
- <group col="4">
- <field name="company_id" widget="selection" />
- </group>
- <group>
- <group>
- <field name="name" />
- <field name="media_type" attrs="{'readonly': ['|',('media_id', '!=', False),('img_url', '!=', False)]}"/>
- <field name="temporary" force_save="1" attrs="{'readonly': [('media_type', '!=', 'image')],'invisible': ['|',('media_id','!=',False),('img_url','!=',False)]}"/>
- <field name="media_file" filename="media_filename" widget="binary" attrs="{'invisible': [('media_type','=','image')],'readonly': ['|',('media_id', '!=', False),('img_url', '!=', False)]}"/>
- <field name="media_file" filename="media_filename" widget="image" attrs="{'invisible': [('media_type','!=','image')]}"/>
- <field name="media_filename" invisible="1"/>
- </group>
- <group>
- <field name="media_id" widget="CopyClipboardChar"/>
- <field name="img_url" widget="CopyClipboardChar" attrs="{'invisible': [('media_type','!=','image')]}"/>
- <field name="created_at"/>
- </group>
- </group>
- </sheet>
- </form>
- </field>
- </record>
-
- <record id="wecom_material_filter" model="ir.ui.view">
- <field name="name">wecom.material.search</field>
- <field name="model">wecom.material</field>
- <field name="arch" type="xml">
- <search>
- <field name="company_id" />
- <group expand="0" string="Group By">
- <filter string="Companies" name="Companies" domain="" context="{'group_by':'company_id'}"/>
- </group>
- </search>
- </field>
- </record>
-
-
- <record model="ir.ui.view" id="wecom_material_tree">
- <field name="name">wecom.material.tree</field>
- <field name="model">wecom.material</field>
- <field name="arch" type="xml">
- <tree expand="1">
- <field name="company_id"/>
- <field name="name"/>
- <field name="media_type"/>
- <field name="temporary"/>
- <field name="media_id"/>
- <field name="img_url"/>
- <field name="created_at"/>
- </tree>
- </field>
- </record>
-
- <record id="action_view_wecom_material" model="ir.actions.act_window">
- <field name="name">Wecom Material</field>
- <field name="res_model">wecom.material</field>
- <field name="view_mode">tree,form</field>
- <field name="context">{'group_by':['company_id']}</field>
- </record>
- </data>
-
- </odoo>
|