flectra/addons/product/views/product_views.xml
2018-07-10 19:03:09 +05:30

599 lines
33 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<flectra>
<data>
<!-- base structure of product.template, common with product.product -->
<record id="product_template_form_view" model="ir.ui.view">
<field name="name">product.template.common.form</field>
<field name="model">product.template</field>
<field name="mode">primary</field>
<field name="arch" type="xml">
<form string="Product">
<header>
<button string="Variant Prices" type="action"
name="%(product_attribute_value_action)d"
attrs="{'invisible': [('product_variant_count', '&lt;=', 1)]}"
groups="product.group_product_variant"/>
</header>
<sheet>
<field name='product_variant_count' invisible='1'/>
<field name='is_product_variant' invisible='1'/>
<field name="id" invisible="True"/>
<div class="oe_button_box" name="button_box">
<button name="toggle_active" type="object"
class="oe_stat_button" icon="fa-archive">
<field name="active" widget="boolean_button"
options='{"terminology": "archive"}'/>
</button>
</div>
<field name="image_medium" widget="image" class="oe_avatar"/>
<div class="oe_title">
<label class="oe_edit_only" for="name" string="Product Name"/>
<h1><field name="name" placeholder="Product Name"/></h1>
<div name="options" groups="base.group_user">
<div>
<field name="sale_ok"/>
<label for="sale_ok"/>
</div>
<div>
<field name="purchase_ok"/>
<label for="purchase_ok"/>
</div>
</div>
</div>
<notebook>
<page string="General Information" name="general_information">
<group>
<group name="group_general">
<field name="type"/>
<field name="categ_id" string="Category"/>
</group>
<group name="group_standard_price">
<field name="list_price" widget='monetary' options="{'currency_field': 'currency_id', 'field_digits': True}"/>
<label for="standard_price" groups="base.group_user" attrs="{'invisible': [('product_variant_count', '&gt;', 1), ('is_product_variant', '=', False)]}"/>
<div name="standard_price_uom" groups="base.group_user" attrs="{'invisible': [('product_variant_count', '&gt;', 1), ('is_product_variant', '=', False)]}">
<field name="standard_price" widget='monetary' options="{'currency_field': 'currency_id', 'field_digits': True}"/>
</div>
<field name="company_id" groups="base.group_multi_company"
options="{'no_create': True}"/>
<field name="uom_id" groups="product.group_uom" options="{'no_create': True}"/>
<field name="uom_po_id" groups="product.group_uom" options="{'no_create': True}"/>
<field name="currency_id" invisible="1"/>
<field name="product_variant_id" invisible="1"/>
</group>
</group>
</page>
<page string="Sales" attrs="{'invisible':[('sale_ok','=',False)]}" name="sales">
<div name="pricelist_item" groups="product.group_product_pricelist">
<separator string="Pricing"/>
<field name="item_ids" nolabel="1" context="{'default_base':'list_price', 'default_applied_on' :'1_product'}">
<tree string="Pricelist Items" editable="bottom">
<field name="pricelist_id" string="Pricelist" required='1'/>
<field name="fixed_price" string="Price" required='1'/>
<field name="min_quantity"/>
<field name="date_start"/>
<field name="date_end"/>
<field name="applied_on" invisible="1"/>
</tree>
</field>
</div>
<group name="sale">
<group name="email_template_and_project"
attrs="{'invisible':[('type', '!=', 'service')]}"/>
</group>
</page>
<page string="Inventory" name="inventory" groups="stock.group_stock_user,product.group_stock_packaging" attrs="{'invisible':[('type', '=', 'service')]}">
<group name="packaging" string="Packaging"
colspan="4"
attrs="{'invisible':['|', ('type', 'not in', ['product', 'consu']), ('product_variant_count', '>', 1)]}"
groups="product.group_stock_packaging">
<field name="packaging_ids" nolabel="1" context="{'default_product_id': product_variant_id,'tree_view_ref':'product.product_packaging_tree_view', 'form_view_ref':'product.product_packaging_form_view'}"/>
</group>
</page>
<page string="Notes" name="notes">
<group name="description_internal">
<group string="Description for Internal">
<field name="description" nolabel="1" placeholder="This note is only for internal purposes."/>
</group>
</group>
<group name="description">
<group string="Description for Customers" attrs="{'invisible': [('sale_ok','=',False)]}">
<field name="description_sale" nolabel="1" placeholder="This note will show up on sales orders."/>
</group>
</group>
<group name="warning">
<group name="sale_warning"/>
<group name="purchase_warning"/>
</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>
<record id="product_template_search_view" model="ir.ui.view">
<field name="name">product.template.search</field>
<field name="model">product.template</field>
<field name="arch" type="xml">
<search string="Product">
<field name="name" string="Product" filter_domain="['|','|',('default_code','ilike',self),('name','ilike',self),('barcode','ilike',self)]"/>
<field name="categ_id" filter_domain="[('categ_id', 'child_of', raw_value)]"/>
<separator/>
<filter string="Services" name="services" domain="[('type','=','service')]"/>
<filter string="Products" name="consumable" domain="[('type', 'in', ['consu', 'product'])]"/>
<separator/>
<filter string="Can be Sold" name="filter_to_sell" domain="[('sale_ok','=',1)]"/>
<filter string="Can be Purchased" name="filter_to_purchase" domain="[('purchase_ok', '=', 1)]"/>
<separator/>
<filter string="Archived" name="inactive" domain="[('active','=',False)]"/>
<field string="Attributes" name="attribute_line_ids" groups="product.group_product_variant"/>
<field name="pricelist_id" widget="selection" context="{'pricelist': self}" filter_domain="[]" groups="product.group_sale_pricelist"/> <!-- Keep widget=selection on this field to pass numeric `self` value, which is not the case for regular m2o widgets! -->
<separator/>
<filter string="Late Activities" name="activities_overdue"
domain="[('activity_ids.date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
help="Show all records which has next action date is before today"/>
<filter string="Today Activities" name="activities_today"
domain="[('activity_ids.date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
<filter string="Future Activities" name="activities_upcoming_all"
domain="[('activity_ids.date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))
]"/>
</search>
</field>
</record>
<record id="product_template_action_all" 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="context">{}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to define a new product.
</p>
</field>
</record>
<record id="product_search_form_view" model="ir.ui.view">
<field name="name">product.product.search</field>
<field name="model">product.product</field>
<field name="mode">primary</field>
<field name="inherit_id" ref="product.product_template_search_view"/>
<field name="arch" type="xml">
<field name="attribute_line_ids" position="replace">
<field name="attribute_value_ids" groups="product.group_product_variant"/>
<field name="product_tmpl_id" string="Product Template"/>
</field>
</field>
</record>
<record id="product_normal_action" model="ir.actions.act_window">
<field name="name">Product Variants</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.product</field>
<field name="view_mode">tree,form,kanban</field>
<field name="view_type">form</field>
<field name="search_view_id" ref="product_search_form_view"/>
<field name="view_id" eval="False"/> <!-- Force empty -->
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to define a new product.
</p><p>
You must define a product for everything you sell, whether it's
a physical product, a consumable or a service you offer to
customers.
</p><p>
The product form contains information to simplify the sale
process: price, notes in the quotation, accounting data,
procurement methods, etc.
</p>
</field>
</record>
<record id="product_variant_easy_edit_view" model="ir.ui.view">
<field name="name">product.product.view.form.easy</field>
<field name="model">product.product</field>
<field name="mode">primary</field>
<field name="arch" type="xml">
<form string="Variant Information">
<sheet>
<field name="id" invisible="1"/>
<field name="image_medium" widget="image" class="oe_avatar"/>
<div class="oe_title">
<label class="oe_edit_only" for="name" string="Product Name"/>
<h1><field name="name" placeholder="e.g. Flectra Subscription"/></h1>
</div>
<group>
<p>All general settings about this product are managed on <button name="open_product_template" type="object" string="the product template" class="oe_link"/></p>
</group>
<group string="Attributes">
<field name="attribute_value_ids" widget="many2many_tags" readonly="1"/>
</group>
<group>
<group name="codes" string="Codes">
<field name="barcode"/>
<field name="default_code"/>
</group>
<group>
<field name="active"/>
<field name="type" invisible="1"/>
</group>
</group>
<group>
<group name="pricing" string="Pricing">
<field name="product_variant_count" invisible="1"/>
<field name="lst_price" widget='monetary' options="{'currency_field': 'currency_id', 'field_digits': True}" attrs="{'readonly': [('product_variant_count', '&gt;', 1)]}"/>
<field name="standard_price" widget='monetary' options="{'currency_field': 'currency_id', 'field_digits': True}"/>
<field name="currency_id" invisible='1'/>
</group>
<group name="weight">
<group name="weight" string="Weights" attrs="{'invisible':[('type', 'not in', ['product', 'consu'])]}">
<label for="volume"/>
<div class="o_row">
<field name="volume"/>
<span></span>
</div>
<label for="weight"/>
<div class="o_row">
<field name="weight"/>
<span>kg</span>
</div>
</group>
</group>
</group>
<group name="packaging" string="Packaging"
colspan="4"
groups="product.group_stock_packaging">
<field name="packaging_ids" nolabel="1" context="{'default_product_id': id, 'tree_view_ref':'product.product_packaging_tree_view', 'form_view_ref':'product.product_packaging_form_view'}"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="product_variant_action" model="ir.actions.act_window">
<field name="name">Product Variants</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.product</field>
<field name="context">{'search_default_product_tmpl_id': [active_id], 'default_product_tmpl_id': active_id}</field>
<field name="search_view_id" ref="product_search_form_view"/>
<field name="view_ids"
eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree'}),
(0, 0, {'view_mode': 'form', 'view_id': ref('product_variant_easy_edit_view')}),
(0, 0, {'view_mode': 'kanban'})]"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to define a new product.
</p><p>
You must define a product for everything you sell, whether it's
a physical product, a consumable or a service you offer to
customers.
</p><p>
The product form contains information to simplify the sale
process: price, notes in the quotation, accounting data,
procurement methods, etc.
</p>
</field>
</record>
<record id="product_product_tree_view" model="ir.ui.view">
<field name="name">product.product.tree</field>
<field name="model">product.product</field>
<field eval="7" name="priority"/>
<field name="arch" type="xml">
<tree string="Product Variants">
<field name="default_code"/>
<field name="name"/>
<field name="attribute_value_ids" widget="many2many_tags" groups="product.group_product_variant"/>
<field name="lst_price"/>
<field name="price" invisible="not context.get('pricelist',False)"/>
<field name="uom_id" options="{'no_open': True, 'no_create': True}" groups="product.group_uom"/>
<field name="barcode"/>
<field name="product_tmpl_id" invisible="1"/>
<field name="active" invisible="1"/>
</tree>
</field>
</record>
<record id="product_normal_form_view" model="ir.ui.view">
<field name="name">product.product.form</field>
<field name="model">product.product</field>
<field name="mode">primary</field>
<field eval="7" name="priority"/>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<form position="attributes">
<attribute name="string">Product Variant</attribute>
</form>
<field name="type" position="after">
<field name="default_code"/>
<field name="barcode"/>
</field>
<field name="list_price" position="attributes">
<attribute name="name">lst_price</attribute>
<attribute name="attrs">{'readonly': [('product_variant_count', '&gt;', 1)]}</attribute>
</field>
<group name="packaging" position="attributes">
<attribute name="attrs">{'invisible': 0}</attribute>
</group>
<field name="name" position="after">
<field name="product_tmpl_id" class="oe_inline" readonly="1" invisible="1" attrs="{'required': [('id', '!=', False)]}"/>
</field>
<field name="item_ids" position="inside">
<field name="pricelist_item_ids" widget="many2many">
<tree string="Pricelist Items">
<field name="pricelist_id"/>
<field name="name" string="Applicable On"/>
<field name="min_quantity"/>
<field name="date_start"/>
<field name="date_end"/>
<field name="price" string="Price"/>
<field name="base" invisible="1"/>
<field name="sequence" invisible="1"/>
<field name="price_discount" invisible="1"/>
<field name="applied_on" invisible="1"/>
<field name="compute_price" invisible="1"/>
</tree>
</field>
</field>
<xpath expr="//div[hasclass('oe_title')]" position="inside">
<field name="attribute_value_ids" widget="many2many_tags" readonly="1"
groups="product.group_product_variant"/>
</xpath>
</field>
</record>
<record id="product_kanban_view" model="ir.ui.view">
<field name="name">Product Kanban</field>
<field name="model">product.product</field>
<field name="arch" type="xml">
<kanban>
<field name="id"/>
<field name="image_small"/>
<field name="lst_price"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div class="o_kanban_image">
<img t-att-src="kanban_image('product.product', 'image_small', record.id.raw_value)"/>
</div>
<div class="oe_kanban_details">
<strong class="o_kanban_record_title"><field name="name"/></strong>
<div class="o_kanban_tags_section">
<field name="attribute_value_ids" groups="product.group_product_variant"/>
</div>
<ul>
<li><strong>Price: <field name="lst_price"></field></strong></li>
</ul>
<div name="tags"/>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="product_normal_action_sell" model="ir.actions.act_window">
<field name="name">Product Variants</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.product</field>
<field name="view_mode">kanban,tree,form</field>
<field name="view_type">form</field>
<field name="context">{"search_default_filter_to_sell":1}</field>
<field name="view_id" ref="product_product_tree_view"/>
<field name="search_view_id" ref="product_search_form_view"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to define a new product.
</p><p>
You must define a product for everything you sell, whether it's
a physical product, a consumable or a service you offer to
customers.
</p><p>
The product form contains information to simplify the sale
process: price, notes in the quotation, accounting data,
procurement methods, etc.
</p>
</field>
</record>
<record id="product_category_search_view" model="ir.ui.view">
<field name="name">product.category.search</field>
<field name="model">product.category</field>
<field name="arch" type="xml">
<search string="Product Categories">
<field name="name" string="Product Categories"/>
<field name="parent_id"/>
</search>
</field>
</record>
<record id="product_category_form_view" model="ir.ui.view">
<field name="name">product.category.form</field>
<field name="model">product.category</field>
<field name="arch" type="xml">
<form class="oe_form_configuration">
<sheet>
<div class="oe_button_box" name="button_box">
<button class="oe_stat_button"
name="%(product_template_action_all)d"
icon="fa-th-list"
type="action"
context="{'search_default_categ_id': active_id}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value"><field name="product_count"/></span>
<span class="o_stat_text"> Products</span>
</div>
</button>
</div>
<div class="oe_title">
<label for="name" string="Category name" class="oe_edit_only"/>
<h1><field name="name" placeholder="e.g. Lamps"/></h1>
</div>
<group name="first" col="2">
<field name="parent_id" class="oe_inline"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="product_category_list_view" model="ir.ui.view">
<field name="name">product.category.list</field>
<field name="model">product.category</field>
<field name="priority">1</field>
<field name="arch" type="xml">
<tree string="Product Categories">
<field name="display_name"/>
</tree>
</field>
</record>
<record id="product_category_action_form" model="ir.actions.act_window">
<field name="name">Product Categories</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.category</field>
<field name="view_type">form</field>
<field name="search_view_id" ref="product_category_search_view"/>
<field name="view_id" ref="product_category_list_view"/>
</record>
<record id="product_packaging_tree_view" model="ir.ui.view">
<field name="name">product.packaging.tree.view</field>
<field name="model">product.packaging</field>
<field name="arch" type="xml">
<tree string="Product Packages">
<field name="sequence" widget="handle"/>
<field name="product_id"/>
<field name="name"/>
<field name="qty"/>
</tree>
</field>
</record>
<record id="product_packaging_form_view" model="ir.ui.view">
<field name="name">product.packaging.form.view</field>
<field name="model">product.packaging</field>
<field name="arch" type="xml">
<form string="Product Packaging">
<sheet>
<label for="name"/>
<h1>
<field name="name"/>
</h1>
<group>
<field name="id" invisible='1'/>
<group>
<field name="product_id" required='True' attrs="{'readonly': [('id', '!=', False)]}"/>
</group>
<group name="qty">
<field name="qty"/>
<field name="barcode"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_packaging_view">
<field name="name">Product Packages</field>
<field name="res_model">product.packaging</field>
<field name="domain">[('product_id', '!=', False)]</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('product_packaging_tree_view')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('product_packaging_form_view')})]"/>
</record>
<record id="product_supplierinfo_form_view" model="ir.ui.view">
<field name="name">product.supplierinfo.form.view</field>
<field name="model">product.supplierinfo</field>
<field name="arch" type="xml">
<form string="Vendor Information">
<group>
<group string="Vendor">
<field name="product_variant_count" invisible="1"/>
<field name="product_id" groups="product.group_product_variant" domain="[('product_tmpl_id', '=', product_tmpl_id)]"/>
<field name="name" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}"/>
<field name="product_name"/>
<field name="product_code"/>
<label for="delay"/>
<div>
<field name="delay" class="oe_inline"/> days
</div>
</group>
<group string="Price List">
<field name="product_tmpl_id" string="Product" invisible="context.get('visible_product_tmpl_id', True)"/>
<label for="min_qty"/>
<div>
<field name="min_qty" class="oe_inline"/>
<field name="product_uom" class="oe_inline" groups="product.group_uom"/>
</div>
<label for="price"/>
<div>
<field name="price" class="oe_inline"/><field name="currency_id" class="oe_inline" groups="base.group_multi_currency"/>
</div>
<label for="date_start" string="Validity"/>
<div><field name="date_start" class="oe_inline"/> to <field name="date_end" class="oe_inline"/></div>
</group>
<group string="Other Information" groups="base.group_multi_company">
<field name="company_id" options="{'no_create': True}"/>
</group>
</group>
</form>
</field>
</record>
<record id="product_supplierinfo_search_view" model="ir.ui.view">
<field name="name">product.supplierinfo.search.view</field>
<field name="model">product.supplierinfo</field>
<field name="arch" type="xml">
<search string="Vendor">
<field name="name"/>
<field name="product_tmpl_id"/>
<filter string="Active" name="active" domain="[('date_end', '&gt;=', (context_today() - datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d'))]"/>
<filter string="Archived" name="archived" domain="[('date_end', '&lt;', (context_today() - datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d'))]"/>
<group expand="0" string="Group By">
<filter string="Product" name="groupby_product" domain="[]" context="{'group_by': 'product_tmpl_id'}"/>
<filter string="Vendor" name="groupby_vendor" domain="[]" context="{'group_by': 'name'}"/>
</group>
</search>
</field>
</record>
<record id="product_supplierinfo_tree_view" model="ir.ui.view">
<field name="name">product.supplierinfo.tree.view</field>
<field name="model">product.supplierinfo</field>
<field name="arch" type="xml">
<tree string="Vendor Information">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="product_id" invisible="context.get('product_template_invisible_variant', False)" groups="product.group_product_variant"/>
<field name="product_tmpl_id" string="Product" invisible="context.get('visible_product_tmpl_id', True)"/>
<field name="min_qty"/>
<field name="price" string="Price"/>
<field name="date_start"/>
<field name="date_end"/>
</tree>
</field>
</record>
<record id="product_supplierinfo_type_action" model="ir.actions.act_window">
<field name="name">Vendor Pricelists</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.supplierinfo</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'visible_product_tmpl_id':False}</field>
</record>
</data>
</flectra>