2.1 Code Sample - Views
2.1 Code Sample - Views
Dismiss
Join GitHub today
GitHub is home to over 40 million developers working together to
host and review code, manage projects, and build software together.
Sign up
tdi-odoo [IMP] purchase: add supplier's pricelist search view filters and grou…
6 contributors
https://github.com/odoo/odoo/blob/76c443eda331b75bf5dfa7ec22b8eb22e1084343/addons/product/views/product_views.xml 1/16
3/6/2020 odoo/product_views.xml at 76c443eda331b75bf5dfa7ec22b8eb22e1084343 · odoo/odoo · GitHub
https://github.com/odoo/odoo/blob/76c443eda331b75bf5dfa7ec22b8eb22e1084343/addons/product/views/product_views.xml 2/16
3/6/2020 odoo/product_views.xml at 76c443eda331b75bf5dfa7ec22b8eb22e1084343 · odoo/odoo · GitHub
48 <group name="group_standard_price">
49 <field name="list_price" widget='monetary' options="{'currency_field': 'currency_id'}"/>
50 <label for="standard_price" groups="base.group_user" attrs="{'invisible': [('product_varian
51 <div name="standard_price_uom" groups="base.group_user">
52 <field name="standard_price" widget='monetary' options="{'currency_field': 'currency_id
53 </div>
54 <field name="company_id" groups="base.group_multi_company"
55 options="{'no_create': True}"/>
56 <field name="uom_id" groups="product.group_uom" options="{'no_create': True}"/>
57 <field name="uom_po_id" groups="product.group_uom" options="{'no_create': True}"/>
58 <field name="currency_id" invisible="1"/>
59 </group>
60 </group>
61 </page>
62 <page string="Sales" attrs="{'invisible':[('sale_ok','=',False)]}" name="sales">
63 <div name="pricelist_item" groups="product.group_product_pricelist">
64 <separator string="Pricing"/>
65 <field name="item_ids" nolabel="1" context="{'default_base':'list_price', 'default_applied_on'
66 <tree string="Pricelist Items" editable="bottom">
67 <field name="pricelist_id" string="Pricelist" required='1'/>
68 <field name="fixed_price" string="Price" required='1'/>
69 <field name="min_quantity"/>
70 <field name="date_start"/>
71 <field name="date_end"/>
72 <field name="applied_on" invisible="1"/>
73 </tree>
74 </field>
75 </div>
76 <group name="sale">
77 <group name="email_template_and_project"
78 attrs="{'invisible':[('type', '!=', 'service')]}"/>
79 </group>
80 </page>
81 <page string="Notes" name="notes">
82 <group name="description">
83 <separator string="Description for Quotations" colspan="4"/>
https://github.com/odoo/odoo/blob/76c443eda331b75bf5dfa7ec22b8eb22e1084343/addons/product/views/product_views.xml 3/16
3/6/2020 odoo/product_views.xml at 76c443eda331b75bf5dfa7ec22b8eb22e1084343 · odoo/odoo · GitHub
https://github.com/odoo/odoo/blob/76c443eda331b75bf5dfa7ec22b8eb22e1084343/addons/product/views/product_views.xml 4/16
3/6/2020 odoo/product_views.xml at 76c443eda331b75bf5dfa7ec22b8eb22e1084343 · odoo/odoo · GitHub
https://github.com/odoo/odoo/blob/76c443eda331b75bf5dfa7ec22b8eb22e1084343/addons/product/views/product_views.xml 5/16
3/6/2020 odoo/product_views.xml at 76c443eda331b75bf5dfa7ec22b8eb22e1084343 · odoo/odoo · GitHub
https://github.com/odoo/odoo/blob/76c443eda331b75bf5dfa7ec22b8eb22e1084343/addons/product/views/product_views.xml 6/16
3/6/2020 odoo/product_views.xml at 76c443eda331b75bf5dfa7ec22b8eb22e1084343 · odoo/odoo · GitHub
192 <group>
193 <field name="active"/>
194 <field name="type" invisible="1"/>
195 </group>
196 </group>
197 <group>
198 <group name="pricing" string="Pricing">
199 <field name="product_variant_count" invisible="1"/>
200 <field name="lst_price" widget='monetary' options="{'currency_field': 'currency_id'}" attrs="{'
201 <field name="standard_price" widget='monetary' options="{'currency_field': 'currency_id'}"/>
202 <field name="currency_id" invisible='1'/>
203 </group>
204 <group name="weight">
205 <group name="weight" string="Weights">
206 <label for="volume"/>
207 <div class="o_row">
208 <field digits="(14, 3)" name="volume"/>
209 <span>m³</span>
210 </div>
211 <label for="weight"/>
212 <div class="o_row">
213 <field name="weight"/>
214 <span>kg</span>
215 </div>
216 </group>
217 </group>
218 </group>
219 </sheet>
220 </form>
221 </field>
222 </record>
223
224 <record id="product_variant_action" model="ir.actions.act_window">
225 <field name="name">Product Variants</field>
226 <field name="type">ir.actions.act_window</field>
227 <field name="res_model">product.product</field>
https://github.com/odoo/odoo/blob/76c443eda331b75bf5dfa7ec22b8eb22e1084343/addons/product/views/product_views.xml 7/16
3/6/2020 odoo/product_views.xml at 76c443eda331b75bf5dfa7ec22b8eb22e1084343 · odoo/odoo · GitHub
https://github.com/odoo/odoo/blob/76c443eda331b75bf5dfa7ec22b8eb22e1084343/addons/product/views/product_views.xml 8/16
3/6/2020 odoo/product_views.xml at 76c443eda331b75bf5dfa7ec22b8eb22e1084343 · odoo/odoo · GitHub
https://github.com/odoo/odoo/blob/76c443eda331b75bf5dfa7ec22b8eb22e1084343/addons/product/views/product_views.xml 9/16
3/6/2020 odoo/product_views.xml at 76c443eda331b75bf5dfa7ec22b8eb22e1084343 · odoo/odoo · GitHub
https://github.com/odoo/odoo/blob/76c443eda331b75bf5dfa7ec22b8eb22e1084343/addons/product/views/product_views.xml 10/16
3/6/2020 odoo/product_views.xml at 76c443eda331b75bf5dfa7ec22b8eb22e1084343 · odoo/odoo · GitHub
336 </div>
337 </t>
338 </templates>
339 </kanban>
340 </field>
341 </record>
342
343 <record id="product_normal_action_sell" model="ir.actions.act_window">
344 <field name="name">Product Variants</field>
345 <field name="type">ir.actions.act_window</field>
346 <field name="res_model">product.product</field>
347 <field name="view_mode">kanban,tree,form</field>
348 <field name="view_type">form</field>
349 <field name="context">{"search_default_filter_to_sell":1}</field>
350 <field name="view_id" ref="product_product_tree_view"/>
351 <field name="search_view_id" ref="product_search_form_view"/>
352 <field name="help" type="html">
353 <p class="oe_view_nocontent_create">
354 Click to define a new product.
355 </p><p>
356 You must define a product for everything you sell, whether it's
357 a physical product, a consumable or a service you offer to
358 customers.
359 </p><p>
360 The product form contains information to simplify the sale
361 process: price, notes in the quotation, accounting data,
362 procurement methods, etc.
363 </p>
364 </field>
365 </record>
366
367 <record id="product_category_search_view" model="ir.ui.view">
368 <field name="name">product.category.search</field>
369 <field name="model">product.category</field>
370 <field name="arch" type="xml">
371 <search string="Product Categories">
https://github.com/odoo/odoo/blob/76c443eda331b75bf5dfa7ec22b8eb22e1084343/addons/product/views/product_views.xml 11/16
3/6/2020 odoo/product_views.xml at 76c443eda331b75bf5dfa7ec22b8eb22e1084343 · odoo/odoo · GitHub
https://github.com/odoo/odoo/blob/76c443eda331b75bf5dfa7ec22b8eb22e1084343/addons/product/views/product_views.xml 12/16
3/6/2020 odoo/product_views.xml at 76c443eda331b75bf5dfa7ec22b8eb22e1084343 · odoo/odoo · GitHub
https://github.com/odoo/odoo/blob/76c443eda331b75bf5dfa7ec22b8eb22e1084343/addons/product/views/product_views.xml 13/16
3/6/2020 odoo/product_views.xml at 76c443eda331b75bf5dfa7ec22b8eb22e1084343 · odoo/odoo · GitHub
https://github.com/odoo/odoo/blob/76c443eda331b75bf5dfa7ec22b8eb22e1084343/addons/product/views/product_views.xml 14/16
3/6/2020 odoo/product_views.xml at 76c443eda331b75bf5dfa7ec22b8eb22e1084343 · odoo/odoo · GitHub
https://github.com/odoo/odoo/blob/76c443eda331b75bf5dfa7ec22b8eb22e1084343/addons/product/views/product_views.xml 15/16
3/6/2020 odoo/product_views.xml at 76c443eda331b75bf5dfa7ec22b8eb22e1084343 · odoo/odoo · GitHub
516 </record>
517
518 <record id="product_supplierinfo_tree_view" model="ir.ui.view">
519 <field name="name">product.supplierinfo.tree.view</field>
520 <field name="model">product.supplierinfo</field>
521 <field name="arch" type="xml">
522 <tree string="Vendor Information">
523 <field name="sequence" widget="handle"/>
524 <field name="name"/>
525 <field name="product_tmpl_id" string="Product" invisible="context.get('visible_product_tmpl_id', True)"/>
526 <field name="min_qty"/>
527 <field name="price" string="Price"/>
528 <field name="date_start"/>
529 <field name="date_end"/>
530 </tree>
531 </field>
532 </record>
533
534 <record id="product_supplierinfo_type_action" model="ir.actions.act_window">
535 <field name="name">Vendor Pricelists</field>
536 <field name="type">ir.actions.act_window</field>
537 <field name="res_model">product.supplierinfo</field>
538 <field name="view_type">form</field>
539 <field name="view_mode">tree,form</field>
540 <field name="context">{'visible_product_tmpl_id':False}</field>
541 </record>
542
543 </data>
544 </odoo>
https://github.com/odoo/odoo/blob/76c443eda331b75bf5dfa7ec22b8eb22e1084343/addons/product/views/product_views.xml 16/16