官网上架 app_template

This commit is contained in:
Ivan Office
2023-10-08 23:54:37 +08:00
parent da6a8dc2be
commit 4e9ffaa9fb
35 changed files with 1258 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Sample样例-->
<!-- Root根菜单This Menu Item will appear in the Upper bar, That's why It needs NO parent or action -->
<menuitem id="module_new_root" name="Module New Root"
web_icon="app_template,static/description/icon.png"
groups="group_app_user"
sequence="90"/>
<!-- Category,菜单分组This Menu Item Must have a parent -->
<menuitem id="module_new_cat" name="Module New Category"
parent="module_new_root"
sequence="91"/>
<!-- Action操作菜单This Menu Item must have a parent and an action -->
<!-- model.new Menu -->
<menuitem id="menu_model_new" name="Model New"
parent="module_new_cat"
sequence="92"
action="action_model_new"/>
<menuitem id="menu_model_new_report" name="Model New Report"
parent="module_new_cat"
sequence="93"
action="action_model_new_report"/>
<!-- Exist Menu改当前存在菜单Change exist menu, use context if you are using multi language-->
<!-- <record id="Exist_ID_menu" model="ir.ui.menu" context="{'lang': 'zh_CN}">-->
<!-- <field name="groups_id"-->
<!-- eval="[(6,0,[ref('Exist_ID')])]"/>-->
<!-- </record>-->
</data>
</odoo>

View File

@@ -0,0 +1,267 @@
<?xml version="1.0"?>
<odoo>
<!-- Template for model new view新建模型视图 -->
<!-- model.new Tree View -->
<record id="app_view_model_new_tree" model='ir.ui.view'>
<field name="name">app.view.model.new.tree</field>
<field name="model">model.new</field>
<field name="priority">16</field>
<field name="arch" type="xml">
<tree string="Model New" editable="bottom">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="ref" optional="show"/>
<field name="date" widget="date" optional="show"/>
<field name="amount" optional="show" sum="Total"/>
<field name="note" optional="hide"/>
<field name="state"
decoration-warning="state == 'draft'"
decoration-muted="state == 'cancel'"
decoration-success="state == 'done'"
widget="badge" optional="show"/>
<field name="active" optional="show" widget="boolean_toggle"/>
<field name="user_id" optional="show" widget="many2one_avatar_user"/>
</tree>
</field>
</record>
<!-- model.new Form View -->
<record id="app_view_model_new_form" model="ir.ui.view">
<field name="name">app.view.model.new.form</field>
<field name="model">model.new</field>
<field name="priority">16</field>
<field name="arch" type="xml">
<form string="Model New">
<header>
<field name="state" widget="statusbar" statusbar_visible="draft,done"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="%(account.res_partner_action_customer)d"
type="action"
class="oe_stat_button"
icon="fa-pencil-square-o">
<field name="partner_count" widget="statinfo" />
</button>
</div>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<field name="image" widget='image' class="oe_avatar" options='{"preview_image": "image"}'/>
<div class="oe_title">
<label class="oe_edit_only" for="name"/>
<h1>
<field name="name"/>
</h1>
</div>
<group>
<group name="g1">
<field name="ref"/>
<field name="sequence"/>
</group>
<group name="g2">
<field name="active" widget="boolean_toggle"/>
<label class="o_form_label" for="note"/>
<div>
<field name="note" class="oe_inline" placeholder="Special field view for more contend"/>
<a href="https://apps.odoo.com/apps/modules/16.0/app_module_creator" title="Odoo Module Creator" class="o_doc_link"
target="_blank"></a>
</div>
</group>
</group>
<notebook>
<page string="Widget Frequently Used">
<div class="row">
<div class="col-5 alert alert-success mb-2 ml4" role="alert">
<a href="https://www.odooai.cn/documentation/16.0/zh_CN/developer.html" title="Odoo Developer Tutorials" class="o_doc_link"
target="_blank">
Alert success: Odoo Developer reference Guides
</a>
</div>
<div class="col-5 alert alert-danger mb-2 ml4" role="alert">
<a href="https://www.odooai.cn/blog/odoo-develope-implement-8/odoo16-owl-widget-list-110" title="Odoo Module Creator" class="o_doc_link"
target="_blank">
Alert danger: Get All 174+ odoo widget list
</a>
</div>
<div class="col-5 alert alert-info mb-2 ml4" role="alert">
<a href="https://apps.odoo.com/apps/modules/16.0/app_module_creator" title="Odoo Module Creator" class="o_doc_link"
target="_blank">
Alert info: Get odoo module auto creator, Quick create module with view and widget.
</a>
</div>
<div class="col-5 alert alert-warning mb-2 ml4" role="alert">
<a href="https://www.odooai.cn" title="Odoo Module Creator" class="o_doc_link"
target="_blank">
Alert warning: Get More support in odooai.cn
</a>
</div>
</div>
<group>
<group string="char">
<field name="w_phone" widget="phone"/>
<field name="w_email" widget="email"/>
<field name="w_image_url" widget="image_url" options="{'size': [60, 60]}"/>
<field name="w_url" widget="url"/>
<field name="w_CopyClipboardURL" widget="CopyClipboardURL"/>
<field name="w_CopyClipboardChar" widget="CopyClipboardChar"/>
<field name="w_CopyClipboardText" widget="CopyClipboardText"/>
</group>
<group string="int,float,date,datetime">
<label for="date" string="daterange"/>
<div class="o_row">
<field name="date" widget="daterange" options='{"related_end_date": "date_end"}'/>
<i class="fa fa-long-arrow-right mx-2 oe_edit_only" aria-label="Arrow icon" title="Arrow"/>
<field name="date_end" widget="daterange" options='{"related_start_date": "date"}'/>
</div>
<field name="w_gauge" widget="gauge" options="{'max_field': 'day_max'}"/>
<field name="w_progressbar" widget="progressbar" options="{'editable': true}" title="Integer"/>
<field name="w_progressbar" widget="progressbar" options="{'editable': true}" title="Integer"/>
<field name="w_percentpie" widget="percentpie" title="float"/>
<field name="w_percentage" widget="percentage" title="float"/>
</group>
<group string="selection">
<!-- status_with_color 是在 kanban中使用-->
<!-- <field name="w_color_s"/>-->
<!-- <field name="w_status_with_color" widget="status_with_color" options="{'color_field': 'w_color_s'}"/>-->
<field name="state"
decoration-warning="state == 'draft'"
decoration-muted="state == 'cancel'"
decoration-success="state == 'done'"
widget="badge" optional="show"/>
</group>
<group string="many2many">
<!-- <field name="partner_ids" widget="many2many_tags"/>-->
<field name="partner_ids" widget="many2many_tags_avatar" string="many2many_tags_avatar"/>
<!-- <field name="w_autosave_many2many_tags" widget="autosave_many2many_tags"-->
<!-- options="{'no_create': True}"-->
<!-- force_save="1"/>-->
</group>
<group string="many2one">
<field name="user_id" widget="many2one_avatar_user" string="many2one_avatar_user"/>
<field name="w_selection_badge" widget="selection_badge"/>
</group>
</group>
</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>
<!-- model.new Kanban View -->
<record id="app_view_model_new_kanban" model="ir.ui.view">
<field name="name">app.model.new.kanban</field>
<field name="model">model.new</field>
<field name="arch" type="xml">
<kanban>
<field name="id"/>
<field name="name"/>
<field name="amount"/>
<field name="date"/>
<field name="state"/>
<field name="user_id"/>
<field name="image"/>
<field name="partner_count"/>
<field name="company_id"/>
<field name="color"/>
<field name="w_color_s"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="#{!selection_mode ? kanban_color(record.color.raw_value) : ''} oe_kanban_global_click o_has_icon oe_kanban_content oe_kanban_card">
<div t-attf-class="o_kanban_card_header">
<div class="o_kanban_card_header_title">
<h3 class="o_primary"><field name="name"/></h3>
</div>
<div class="o_kanban_manage_button_section">
<a class="o_kanban_manage_toggle_button" href="#"><i class="fa fa-ellipsis-v" role="img" aria-label="Manage" title="Manage"/></a>
</div>
</div>
<div class="o_kanban_card_content mt4">
<div class="o_kanban_image mr4">
<img t-att-src="kanban_image('model.new', 'image', record.id.raw_value)" alt="Image"/>
</div>
<h4 class="o_kanban_record_title mb4">
Ref: <field name="ref"/>
</h4>
<div class="oe_kanban_details">
<ul>
<li>
<a name="%(account.res_partner_action_customer)d" type="action">
<t t-esc="record.partner_count.value"/>
Partner
</a>
</li>
<li>
<field name="w_progressbar" widget="progressbar"/>
</li>
<li>
<field name="w_url" widget="url"/>
</li>
</ul>
</div>
<div class="o_kanban_record_bottom mt-3">
<div class="oe_kanban_bottom_left">
<div class="o_project_kanban_boxes d-flex align-items-baseline">
<field name="date"/>
</div>
<field name="activity_ids" widget="kanban_activity"/>
</div>
<div class="oe_kanban_bottom_right">
<field name="user_id" widget="many2one_avatar_user" t-if="record.user_id.raw_value"/>
</div>
</div>
</div>
<div class="o_kanban_card_manage_pane dropdown-menu text-right" role="menu">
<div class="o_kanban_card_manage_section">
<div class="dropdown-divider mt-0"/>
<!-- 下拉操作-->
<div role="menuitem" class="text-end mr32">
<a type="edit">Edit</a>
</div>
</div>
<div t-if="widget.editable" role="menuitem" aria-haspopup="true" class="o_no_padding_kanban_colorpicker">
<ul class="oe_kanban_colorpicker" data-field="color" role="popup"/>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- model.new Search View -->
<record id="app_view_model_new_search" model="ir.ui.view">
<field name="name">app.view.model.new.search</field>
<field name="model">model.new</field>
<field name="priority">16</field>
<field name="arch" type="xml">
<search string="Model New">
<field name="name"/>
<field name="ref"/>
<field name="note"/>
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
<group expand="0" string="Group By">
<filter string="State" name="groupby_state" context="{'group_by': 'state'}"/>
<filter string="User" name="groupby_user_id" context="{'group_by': 'user_id'}"/>
</group>
<searchpanel>
</searchpanel>
</search>
</field>
</record>
<!-- model.new Action -->
<record id="action_model_new" model="ir.actions.act_window">
<field name="name">Model New</field>
<field name="res_model">model.new</field>
<field name="view_mode">kanban,tree,form</field>
<field name="context">{'search_default_groupby_state': 1}</field>
</record>
</odoo>

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Template for model view inherit继承模型视图 -->
<!-- List -->
<record id="app_view_product_template_tree" model="ir.ui.view">
<field name="name">app.view.product.template.tree</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_tree_view"/>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="short_name"/>
</field>
</field>
</record>
<!-- Kanban-->
<record id="app_view_product_template_kanban" model="ir.ui.view">
<field name="name">app.view.product.template.kanban</field>
<field name="model">product.template</field>
<field name="name">product.template.search.brand</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_kanban_view"/>
<field name="arch" type="xml">
<xpath expr="//div[hasclass('oe_kanban_details')]/strong[1]" position="after">
<div>
<a t-if="record.product_brand_id" type="action"
name="%(action_open_single_product_brand)d">
<field name="product_brand_id"/>
</a>
</div>
</xpath>
</field>
</record>
<!-- Form -->
<record id="app_view_product_template_form" model="ir.ui.view">
<field name="name">app.product.template.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<field name="product_tooltip" position="after">
<field name="short_name" placeholder="Brief Name"/>
</field>
</field>
</record>
<!-- Search -->
<record id="app_view_product_template_search" model="ir.ui.view">
<field name="name">app.product.template.search</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_search_view"/>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="short_name"/>
</field>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="assets_backend" name="app_web_supero2m assets" inherit_id="web.assets_backend">
<xpath expr="//link[last()]" position="after">
<link rel="stylesheet" type="text/scss" href="/app_web_supero2m/static/src/scss/app.scss"/>
</xpath>
<xpath expr="script[last()]" position="after">
<script type="text/javascript" src="/app_web_supero2m/static/src/js/list_renderer.js"/>
</xpath>
</template>
</data>
</odoo>