html view odoo , esempi

html view odoo , esempi

Html view odoo , iniziamo ad introdurre il concetto di html.

Acronimo di Hyper Text Markup Language (linguaggio a marcatori per ipertesti), è il più importante linguaggio di markup per il web.

Nasce alla fine degli anni ’80 da Tim Berners-Lee al CERN di Ginevra. HTML è un linguaggio di pubblico dominio la cui sintassi è stabilita dal World Wide Web Consortium (W3C).

L’HTML non è un linguaggio di programmazione, ma un linguaggio di markup, ossia descrive il contenuto, testuale e non, di una pagina web. Punto HTML (.html) o punto HTM (.htm) è anche l’estensione comune dei documenti HTML. Normalmente il programma che deve interpretare il codice HTML viene chiamato Browser.

Il Browser effettua la richiesta di una pagina al server HTTP che risponde con la pagina HTML.

Il browser ha poi il compito di trasformare le istruzioni in HTML (in puro testo), in elementi grafici e ipertestuali.

Una cosa molto importante è che l’HTML non è dinamico ma bensì statico ciò significa che se non si agisce direttamente nel codice HTML, esso rimarrà invariato nel tempo.

L’unica possibilità che il codice cambi è dovuta a codice script che viene inserito in appositi tag. Ricordate comunque che il codice script non muta comunque.

Ecco degli esempi di codice:

<?xml version=”1.0″ encoding=”utf-8″?>
<openerp>
<data>
<menuitem id=”base.menu_product” name=”Product Variants” parent=”base.menu_base_partner” sequence=”9″ groups=”product.group_product_variant”/>

<!– Variants –>
<record id=”product_attribute_value_view_tree” model=”ir.ui.view”>
<field name=”name”>product.attribute.value.view.tree</field>
<field name=”model”>product.attribute.value</field>
<field name=”arch” type=”xml”>
<tree string=”Attributes” editable=”top”>
<field name=”sequence” widget=”handle”/>
<field name=”attribute_id”/>
<field name=”name”/>
<field name=”price_extra”/>
</tree>
</field>
</record>
<record id=”product_attribute_value_action” model=”ir.actions.act_window”>
<field name=”name”>Variant Values</field>
<field name=”type”>ir.actions.act_window</field>
<field name=”res_model”>product.attribute.value</field>
<field name=”view_mode”>tree</field>
<field name=”view_type”>form</field>
<field name=”view_id” ref=”product_attribute_value_view_tree”/>
<field name=”domain”>[(‘product_ids.product_tmpl_id’, ‘=’, active_id)]</field>
<field name=”context”>{‘default_product_tmpl_id’: active_id}</field>
</record>

<!– templates –>

<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)]”/>
<separator/>
<filter string=”Services” name=”services” domain=”[(‘type’,’=’,’service’)]”/>
<filter string=”Products” name=”consumable” domain=”[(‘type’,’=’,’consu’)]” help=”Products your store in the inventory”/>
<separator/>
<filter string=”Can be Sold” name=”filter_to_sell” domain=”[(‘sale_ok’,’=’,1)]”/>
<separator/>
<filter string=”Archived” name=”inactive” domain=”[(‘active’,’=’,False)]”/>
<field string=”Attributes” name=”attribute_line_ids”/>
<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! –>
</search>
</field>
</record>

<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=”name”/>
<field name=”standard_price”/>
<field name=”volume”/>
<field name=”weight”/>
<field name=”categ_id”/>
<field name=”type”/>
<field name=”state”/>
<field name=”uom_id” invisible=”1″/>
</tree>
</field>
</record>

<!– 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=”is_product_variant” invisible=”1″/>
<field name=’product_variant_count’ 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>
</div>
<notebook>
<page string=”General Information”>
<group>
<group name=”group_general”>
<field name=”type” on_change=”onchange_type(type, context)”/>
</group>
<group name=”group_standard_price”>
<field name=”list_price” widget=’monetary’ options=”{‘currency_field’: ‘currency_id’}”/>
<label for=”standard_price” groups=”base.group_user”/>
<div name=”standard_price_uom” groups=”base.group_user”>
<field name=”standard_price” widget=’monetary’ options=”{‘currency_field’: ‘currency_id’}” class=”oe_inline”/>
</div>
<field name=”uom_id” on_change=”onchange_uom(uom_id,uom_po_id)” groups=”product.group_uom”/>
<field name=”uom_po_id” groups=”product.group_uom”/>
<field name=”currency_id” invisible=”1″/>
</group>
</group>
</page>
<page string=”Inventory”>
<group name=”inventory”>
<group>
<field name=”company_id” groups=”base.group_multi_company”
options=”{‘no_create’: True}”/>
<field name=”categ_id” string=”Internal Category”/>
</group>
<group name=”group_lots_and_weight”>
<label for=”weight” attrs=”{‘invisible’:[(‘type’, ‘not in’, [‘product’, ‘consu’]), (‘product_variant_count’, ‘&gt;’, 1)]}”/>
<div class=”o_row” name=”weight” attrs=”{‘invisible’:[(‘type’, ‘not in’, [‘product’, ‘consu’]), (‘product_variant_count’, ‘&gt;’, 1)]}”>
<field name=”weight” string=”Weight”/>
</div>
<label for=”volume” attrs=”{‘invisible’:[(‘type’, ‘not in’, [‘product’, ‘consu’]), (‘product_variant_count’, ‘&gt;’, 1)]}”/>
<div class=”o_row” name=”volume” attrs=”{‘invisible’:[(‘type’, ‘not in’, [‘product’, ‘consu’]), (‘product_variant_count’, ‘&gt;’, 1)]}”>
<field name=”volume” string=”Volume”/>
</div>
</group>
</group>
<separator string=”Vendors”/>
<field name=”seller_ids” context=”{‘default_product_tmpl_id’: active_id}”/>
<group name=”packaging” string=”Packaging”
colspan=”4″
attrs=”{‘invisible’:[(‘type’, ‘not in’, [‘product’, ‘consu’])]}”
groups=”product.group_stock_packaging”>
<field name=”packaging_ids” nolabel=”1″/>
</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=”sale_condition” string=”Sale Conditions”>
<label for=”warranty”/>
<div>
<field name=”warranty” class=”oe_inline”/> months
</div>
</group>
<group name=”email_template_and_project”
attrs=”{‘invisible’:[(‘type’, ‘!=’, ‘service’)]}”/>
</group>
</page>
<page string=”Notes” name=”notes”>
<group name=”description”>
<separator string=”Description for Quotations” colspan=”4″/>
<field name=”description_sale” colspan=”4″ nolabel=”1″
placeholder=”This note will be displayed on the quotations.”/>
<separator string=”Description for Vendors” colspan=”4″/>
<field name=”description_purchase” nolabel=”1″
placeholder=”This note will be displayed on requests for quotation.” colspan=”4″/>
</group>
</page>
</notebook>
</sheet>
<div class=”oe_chatter”>
<field name=”message_follower_ids” widget=”mail_followers”/>
<field name=”message_ids” widget=”mail_thread”/>
</div>
</form>
</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</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=”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. Odoo Enterprise Susbcription”/></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”/>
</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=”lst_price” widget=’monetary’ options=”{‘currency_field’: ‘currency_id’}”/>
<field name=”standard_price” widget=’monetary’ options=”{‘currency_field’: ‘currency_id’}”/>
<field name=”currency_id” invisible=’1’/>
</group>
<group name=”weight”>
<group name=”weight” string=”Weights”>
<label for=”volume”/>
<div class=”o_row”>
<field digits=”(14, 3)” name=”volume”/>
<span>m³</span>
</div>
<label for=”weight”/>
<div class=”o_row”>
<field name=”weight”/>
<span>kg</span>
</div>
</group>
</group>
</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_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=”type” position=”after”>
<field name=”default_code” attrs=”{‘invisible’: [(‘product_variant_count’, ‘>’, 1)]}”/>
<field name=”barcode” attrs=”{‘invisible’: [(‘product_variant_count’, ‘>’, 1)]}”/>
</field>

<div name=”button_box” position=”inside”>
<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>
</div>

<xpath expr=”//page[@name=’sales’]” 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=”image_small”/>
<field name=”lst_price”/>
<field name=”is_product_variant”/>
<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.value)”/>
</div>
<div class=”oe_kanban_details”>
<strong>
<span t-if=”record.default_code.value”>[<field name=”default_code”/>]</span>
<field name=”name”/>
</strong>
<div t-if=”record.product_variant_count.value &gt; 1″>
<strong>
<t t-esc=”record.product_variant_count.value”/> Variants
</strong>
</div>
<div name=”tags”/>
<ul>
<li>Price: <field name=”lst_price” widget=”monetary”></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=”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_template_action_product” 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”>{“search_default_products”: 1, ‘default_type’: ‘product’}</field>
<field name=”help” type=”html”>
<p class=”oe_view_nocontent_create”>
Click to define a new product.
</p>
</field>
</record>

<menuitem id=”base.menu_sales” name=”Sales” parent=”base.menu_base_partner” sequence=”5″/>
<menuitem action=”product_template_action”
id=”menu_product_template_action”
parent=”base.menu_sales” sequence=”13″ />

<!– product product –>

<menuitem id=”prod_config_main” name=”Products” parent=”base.menu_sale_config” sequence=”2″/>

<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}”/>
<field name=”barcode”/>
<field name=”state” invisible=”1″/>
<field name=”product_tmpl_id” 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>
</field>
<field name=”name” position=”after”>
<field name=”product_tmpl_id” class=”oe_inline” readonly=”1″ invisible=”1″ attrs=”{‘required’: [(‘id’, ‘!=’, False)]}”/>
</field>
<xpath expr=”//div[@class=’oe_title’]” position=”inside”>
<field name=”attribute_value_ids” widget=”many2many_tags” 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=”image_small”/>
<field name=”lst_price”/>
<templates>
<t t-name=”kanban-box”>
<div class=”oe_kanban_global_click”>
<div class=”o_kanban_tags_section”>
<field name=”attribute_value_ids” groups=”product.group_product_variant”/>
</div>
<div class=”o_kanban_image”>
<img t-att-src=”kanban_image(‘product.product’, ‘image_small’, record.id.value)”/>
</div>
<div class=”oe_kanban_details”>
<strong><field name=”name”/></strong>
<ul>
<li>Price: <field name=”lst_price”></field></li>
</ul>
<div name=”tags”/>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>

<!– –>

<record id=”attribute_tree_view” model=”ir.ui.view”>
<field name=”name”>product.attribute.tree</field>
<field name=”model”>product.attribute</field>
<field name=”arch” type=”xml”>
<tree string=”Variant Values” editable=”top”>
<field name=”sequence” widget=”handle”/>
<field name=”name”/>
</tree>
</field>
</record>

<record id=”attribute_action” model=”ir.actions.act_window”>
<field name=”name”>Attributes</field>
<field name=”type”>ir.actions.act_window</field>
<field name=”res_model”>product.attribute</field>
<field name=”view_mode”>tree</field>
<field name=”view_type”>form</field>
</record>

<menuitem action=”attribute_action”
id=”menu_attribute_action”
parent=”product.prod_config_main” sequence=”4″ groups=”product.group_product_variant”/>

<record id=”variants_tree_view” model=”ir.ui.view”>
<field name=”name”>product.attribute.value.tree</field>
<field name=”model”>product.attribute.value</field>
<field name=”arch” type=”xml”>
<tree string=”Variant Values” editable=”top”>
<field name=”sequence” widget=”handle”/>
<field name=”attribute_id”/>
<field name=”name”/>
</tree>
</field>
</record>

<record id=”variants_action” model=”ir.actions.act_window”>
<field name=”name”>Attribute Values</field>
<field name=”type”>ir.actions.act_window</field>
<field name=”res_model”>product.attribute.value</field>
<field name=”view_mode”>tree</field>
<field name=”view_type”>form</field>
</record>

<menuitem action=”variants_action”
id=”menu_variants_action”
parent=”product.prod_config_main” sequence=”5″ groups=”product.group_product_variant”/>

<!– –>

<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>

<menuitem id=”product.menu_products” action=”product.product_normal_action_sell” parent=”base.menu_sales” groups=”product.group_product_variant” sequence=”99″/>

<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”>
<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=”4″ string=”Category Type”>
<field name=”parent_id”/>
<field name=”type”/>
</group>
</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=”complete_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>
<menuitem action=”product_category_action_form”
groups=”base.group_no_one”
id=”menu_product_category_action_form”
parent=”prod_config_main” sequence=”2″/>

<!– Unit of Measure –>

<record id=”product_uom_tree_view” model=”ir.ui.view”>
<field name=”name”>product.uom.tree</field>
<field name=”model”>product.uom</field>
<field name=”arch” type=”xml”>
<tree string=”Units of Measure”>
<field name=”name”/>
<field name=”category_id”/>
</tree>
</field>
</record>

<record id=”product_uom_form_view” model=”ir.ui.view”>
<field name=”name”>product.uom.form</field>
<field name=”model”>product.uom</field>
<field name=”arch” type=”xml”>
<form string=”Units of Measure”>
<group>
<group>
<field name=”name”/>
<field name=”category_id”/>
<field name=”uom_type” on_change=”onchange_type(uom_type)”/>
<field name=”factor”
digits=”[42,5]”
attrs=”{‘invisible’:[(‘uom_type’,’!=’,’smaller’)],
‘readonly’:[(‘uom_type’,’=’,’bigger’)]}”/>
<field name=”factor_inv”
digits=”[42,5]”
attrs=”{‘invisible’:[(‘uom_type’,’!=’,’bigger’)],
‘readonly’:[(‘uom_type’,’!=’,’bigger’)]}”/>
<p attrs=”{‘invisible’:[(‘uom_type’,’!=’,’smaller’)]}” class=”oe_grey” colspan=”2″>
e.g: 1 * (reference unit) = ratio * (this unit)
</p>
<p attrs=”{‘invisible’:[(‘uom_type’,’!=’,’bigger’)]}” class=”oe_grey” colspan=”2″>
e.g: 1 * (this unit) = ratio * (reference unit)
</p>
</group>
<group>
<field name=”active”/>
<field name=”rounding” digits=”[42, 5]”/>
</group>
</group>
</form>
</field>
</record>
<record id=”product_uom_form_action” model=”ir.actions.act_window”>
<field name=”name”>Units of Measure</field>
<field name=”type”>ir.actions.act_window</field>
<field name=”res_model”>product.uom</field>
<field name=”view_type”>form</field>
<field name=”view_id” ref=”product_uom_tree_view”/>
<field name=”help” type=”html”>
<p class=”oe_view_nocontent_create”>
Click to add a new unit of measure.
</p><p>
You must define a conversion rate between several Units of
Measure within the same category.
</p>
</field>
</record>
<menuitem id=”next_id_16″ name=”Units of Measure” parent=”prod_config_main” sequence=”30″ groups=”product.group_uom”/>
<menuitem action=”product_uom_form_action” id=”menu_product_uom_form_action” parent=”product.prod_config_main” sequence=”6″ groups=”product.group_uom”/>

<record id=”product_uom_categ_form_view” model=”ir.ui.view”>
<field name=”name”>product.uom.categ.form</field>
<field name=”model”>product.uom.categ</field>
<field name=”arch” type=”xml”>
<form string=”Units of Measure categories”>
<group>
<field name=”name”/>
</group>
</form>
</field>
</record>
<record id=”product_uom_categ_form_action” model=”ir.actions.act_window”>
<field name=”name”>Unit of Measure Categories</field>
<field name=”type”>ir.actions.act_window</field>
<field name=”res_model”>product.uom.categ</field>
<field name=”view_type”>form</field>
<field name=”view_mode”>tree,form</field>
<field name=”help” type=”html”>
<p class=”oe_view_nocontent_create”>
Click to add a new unit of measure category.
</p><p>
Units of measure belonging to the same category can be
converted between each others. For example, in the category
<i>’Time'</i>, you will have the following units of measure:
Hours, Days.
</p>
</field>
</record>
<menuitem action=”product_uom_categ_form_action” id=”menu_product_uom_categ_form_action” parent=”product.prod_config_main” sequence=”7″ groups=”base.group_no_one”/>

<record model=”ir.actions.act_window” id=”action_packaging_view”>
<field name=”name”>Packagings</field>
<field name=”res_model”>product.packaging</field>
</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=”Packaging”>
<field name=”sequence” widget=”handle”/>
<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=”Packaging”>
<sheet>
<label for=”name”/>
<h1>
<field name=”name”/>
</h1>
<group>
<group>
<field name=”qty”/>
</group>
</group>
</sheet>
</form>
</field>
</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=”name” context=”{‘default_customer’: 0, ‘search_default_supplier’: 1, ‘default_supplier’: 1}”/>
<field name=”product_name”/>
<field name=”product_code”/>
<field name=”product_id” domain=”[(‘product_tmpl_id’, ‘=’, product_tmpl_id)]” invisible=”1″/>
<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_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_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”>Supplier Pricelist</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>

se ti è piaciuto questo articolo, ti suggeriamo di vederne altri.

Info sull'autore

giotechsrl administrator

Rispondi

%d blogger hanno fatto clic su Mi Piace per questo: