Files
odoo_source/addons/product/views/product_template_views.xml
T
Alexandre Kühn a87d761fdb [IMP] core: menu tip ux/ui improvement
We would like to make the "no item found" screens more appealing.

Before this commit, it shows a small help tip in the top-left
corner of the screen, just below the "Create" button.

With this commit, these help tips have been replaced by onboarding
screens, which consist of a picture and some text below, both of which
are horizontally centered.

The texts have been slightly changed, so that they are shorter and clearer.

Considered modules:

(A)
    account,
    account_asset,
    account_budget,
    account_test,
    account_voucher,
    analytic
(B)
    barcodes,
    base,
    base_automation,
    board
(C)
    calendar,
    contacts,
    crm
(D)
    delivery
(E)
    event
(F)
    fleet
(G)
    gamification,
    google_drive
(H)
    hr,
    hr_attendance,
    hr_contract,
    hr_expense,
    hr_gamification,
    hr_holidays,
    hr_payroll,
    hr_recruitment,
    hr_timesheet
(I)
    im_livechat
(L)
    l10n_fr_sale_closing,
    link_tracker,
    lunch
(M)
    mail,
    maintenance,
    mass_mailing,
    membership,
    mrp
(N)
    note
(P)
    payment,
    point_of_sale,
    post_mercury,
    pos_restaurant,
    product,
    project,
    purchase,
    purchase_requisition
(R)
    rating,
    repair,
    resource
(S)
    sale,
    sale_timesheet,
    sales_team,
    stock,
    stock_account,
    stock_landed_costs,
    stock_picking_batch,
    survey
(U)
    utm
(W)
    web,
    website,
    website_blog,
    website_customer,
    website_event_track,
    website_forum,
    website_quote,
    website_sale,
    website_sale_digital,
    website_slides
2018-01-18 21:43:29 +01:00

121 lines
6.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="product_template_tree_view" model="ir.ui.view">
<field name="name">product.template.product.tree</field>
<field name="model">product.template</field>
<field name="arch" type="xml">
<tree string="Product">
<field name="sequence" widget="handle"/>
<field name="default_code"/>
<field name="name"/>
<field name="list_price" string="Sales Price"/>
<field name="standard_price"/>
<field name="categ_id"/>
<field name="type"/>
<field name="uom_id" options="{'no_open': True, 'no_create': True}" groups="product.group_uom"/>
<field name="active" invisible="1"/>
</tree>
</field>
</record>
<record id="product_template_only_form_view" model="ir.ui.view">
<field name="name">product.template.product.form</field>
<field name="model">product.template</field>
<field name="mode">primary</field>
<field name="priority" eval="8" />
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//form" position="attributes">
<attribute name="name">Product Template</attribute>
</xpath>
<field name="categ_id" position="after">
<field name="default_code" attrs="{'invisible': [('product_variant_count', '>', 1)]}"/>
<field name="barcode" attrs="{'invisible': [('product_variant_count', '>', 1)]}"/>
</field>
<button name="toggle_active" position="before">
<button name="%(product.product_variant_action)d" type="action"
icon="fa-sitemap" class="oe_stat_button"
attrs="{'invisible': [('product_variant_count', '&lt;=', 1)]}"
groups="product.group_product_variant">
<field string="Variants" name="product_variant_count" widget="statinfo" />
</button>
</button>
<xpath expr="//page[@name='general_information']" position="after">
<page name="variants" string="Variants" groups="product.group_product_variant">
<field name="attribute_line_ids" widget="one2many_list" context="{'show_attribute': False}">
<tree string="Variants" editable="bottom">
<field name="attribute_id"/>
<field name="value_ids" widget="many2many_tags" options="{'no_create_edit': True}" domain="[('attribute_id', '=', attribute_id)]" context="{'default_attribute_id': attribute_id}"/>
</tree>
</field>
<p class="oe_grey">
<strong>Warning</strong>: adding or deleting attributes
will delete and recreate existing variants and lead
to the loss of their possible customizations.
</p>
</page>
</xpath>
</field>
</record>
<record id="product_template_kanban_view" model="ir.ui.view">
<field name="name">Product.template.product.kanban</field>
<field name="model">product.template</field>
<field name="arch" type="xml">
<kanban>
<field name="id"/>
<field name="image_small"/>
<field name="lst_price"/>
<field name="product_variant_count"/>
<field name="product_variant_ids"/>
<field name="currency_id"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div class="o_kanban_image">
<img t-att-src="kanban_image('product.template', 'image_small', record.id.raw_value)"/>
</div>
<div class="oe_kanban_details">
<strong class="o_kanban_record_title">
<field name="name"/>
<small t-if="record.default_code.value">[<field name="default_code"/>]</small>
</strong>
<div t-if="record.product_variant_count.value &gt; 1" groups="product.group_product_variant">
<strong>
<t t-esc="record.product_variant_count.value"/> Variants
</strong>
</div>
<div name="tags"/>
<ul>
<li>Price: <field name="lst_price" widget="monetary" options="{'currency_field': 'currency_id', 'field_digits': True}"></field></li>
</ul>
<div name="tags"/>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="product_template_action" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.template</field>
<field name="view_mode">kanban,tree,form</field>
<field name="view_type">form</field>
<field name="view_id" ref="product_template_kanban_view"/>
<field name="context">{"search_default_filter_to_sell":1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new product
</p><p>
You must define a product for everything you purchase,
whether it's a physical product, a consumable or services.
</p>
</field>
</record>
</odoo>