[IMP] various: clean product search views

Lots of modules are adding their search view for products
this commit tries to clean them in order to have something clearer
This commit is contained in:
Kirti Choudhary
2018-08-08 14:51:12 +02:00
committed by RomainLibert
parent 5118d248cc
commit 815154df2e
10 changed files with 52 additions and 17 deletions
@@ -323,6 +323,7 @@
<field name="res_model">product.product</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field>
<field name="search_view_id" ref="product.product_search_form_view"/>
<field name="context">{"default_can_be_expensed": 1, 'default_type': 'service'}</field>
<field name="domain">[('can_be_expensed', '=', True)]</field>
<field name="help" type="html">
+6 -5
View File
@@ -260,6 +260,10 @@
<separator/>
<filter string="Late" domain="['&amp;', ('date_planned_start', '&lt;', current_date), ('state', '=', 'confirmed')]"
name="late" help="Production started late"/>
<filter string="Done Last 365 Days" name="last_year_mo_order"
domain="[('date_planned_start', '&gt;', (context_today() - relativedelta(days=365)).strftime('%Y-%m-%d'))]"/>
<filter string="My Activities" name="activities_my"
domain="[('activity_ids.user_id', '=', uid)]"/>
<separator/>
<filter string="No Routing" domain="[('routing_id','=', False)]" name="norouting" groups="mrp.group_mrp_routings"/>
<field name="product_id"/>
@@ -267,9 +271,6 @@
<field name="name" string="Work Center" filter_domain="[('routing_id.operation_ids.workcenter_id','ilike',self)]"/>
<field name="routing_id" groups="mrp.group_mrp_routings"/>
<separator/>
<filter string="My Activities" name="activities_my"
domain="[('activity_ids.user_id', '=', uid)]"/>
<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"/>
@@ -281,8 +282,8 @@
<group expand="0" string="Group By...">
<filter string="Product" name="product" domain="[]" context="{'group_by':'product_id'}"/>
<filter string="Routing" name="routing" domain="[]" context="{'group_by':'routing_id'}" groups="mrp.group_mrp_routings"/>
<filter string="Status" name="status" domain="[]" context="{'group_by':'state'}"/>
<filter string="Scheduled Date" name="scheduled_month" domain="[]" context="{'group_by':'date_planned_start'}"/>
<filter string="Scheduled Month" name="scheduled_month" domain="[]" context="{'group_by':'date_planned_start'}" help="Scheduled Date by Month"/>
<filter string="Status" name="status" domain="[]" context="{'group_by': 'state'}"/>
</group>
</search>
</field>
+20 -10
View File
@@ -15,39 +15,49 @@
</xpath>
</field>
</record>
<record id="product_template_search_view_procurment" model="ir.ui.view">
<field name="name">product.template.search.bom</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_search_view"/>
<field name="arch" type="xml">
<record id="mrp_product_template_search_view" model="ir.ui.view">
<field name="name">mrp.product.template.search</field>
<field name="model">product.template</field>
<field name="mode">primary</field>
<field name="inherit_id" ref="product.product_template_search_view"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='consumable']" position="after">
<separator/>
<filter string="Manufactured Products" name="manufactured_products" domain="[('bom_ids', '!=', False)]"/>
<filter string="BoM Components" name="components" domain="[('bom_line_ids', '!=', False)]"/>
</xpath>
</field>
</field>
</record>
<record id="view_mrp_product_product_form_inherited_view" model="ir.ui.view">
<field name="name">product.form.mrp.inherited</field>
<record id="mrp_product_product_search_view" model="ir.ui.view">
<field name="name">mrp.product.product.search</field>
<field name="model">product.product</field>
<field name="mode">primary</field>
<field name="inherit_id" ref="product.product_search_form_view"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='manufactured_products']" position="replace">
<filter string="Manufactured Products" name="manufactured_products" domain="['|',('bom_ids.product_id','=', False),('variant_bom_ids','!=', False)]"/>
<xpath expr="//filter[@name='consumable']" position="after">
<separator/>
<filter string="Manufactured Products" name="manufactured_products" domain="[('bom_ids', '!=', False)]"/>
<filter string="BoM Components" name="components" domain="[('bom_line_ids', '!=', False)]"/>
</xpath>
</field>
</record>
<record id="product_template_action" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="res_model">product.template</field>
<field name="view_type">form</field>
<field name="search_view_id" ref="mrp_product_template_search_view"/>
<field name="view_mode">kanban,tree,form</field>
<field name="context">{"search_default_consumable": 1, 'default_type': 'product'}</field>
</record>
<menuitem id="menu_mrp_product_form"
name="Products"
action="product_template_action"
parent="menu_mrp_bom" sequence="1"/>
<menuitem id="product_variant_mrp" name="Product Variants"
action="product.product_normal_action"
parent="menu_mrp_bom" groups="product.group_product_variant" sequence="2"/>
@@ -107,6 +107,7 @@
<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="search_view_id" ref="product.product_template_search_view"/>
<field name="context">{"search_default_filter_to_sell":1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
@@ -56,6 +56,8 @@
<search string="Purchase Orders">
<filter string="Quotations" name="quotes" domain="[('state','=','draft')]"/>
<filter string="Orders" name="orders" domain="[('state','!=','draft'),('state','!=','cancel')]"/>
<filter string="Purchased Last 365 Days" name="last_year_purchase"
domain="[('date_order', '&gt;', (context_today() - relativedelta(days=365)).strftime('%Y-%m-%d'))]"/>
<field name="partner_id"/>
<field name="product_id"/>
<group expand="0" string="Extended Filters">
@@ -70,10 +72,10 @@
<filter string="Partner's Country" name="country_id" context="{'group_by':'country_id'}"/>
<filter string="Purchase Representative" name="user_id" context="{'group_by':'user_id'}"/>
<filter string="Product Category" name="group_category_id" context="{'group_by':'category_id'}"/>
<filter string="Order Date" name="order_month" context="{'group_by': 'date_order:month'}"/>
<filter string="Status" name="status" context="{'group_by':'state'}"/>
<filter string="Company" name="company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator/>
<filter string="Order Date" name="order_month" context="{'group_by':'date_order:month'}"/>
<filter string="Fiscal Position" name="fiscal_position" context="{'group_by':'fiscal_position_id'}" help="Purchase Order Fiscal Position"/>
</group>
</search>
+2 -1
View File
@@ -56,7 +56,7 @@
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field>
<field name="context">{"search_default_filter_to_purchase":1, "purchase_product_template": 1}</field>
<field name="search_view_id" eval="False"/> <!-- Force empty -->
<field name="search_view_id" ref="product.product_template_search_view"/>
<field name="view_id" eval="False"/> <!-- Force empty -->
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
@@ -77,6 +77,7 @@
<field name="res_model">product.product</field>
<field name="view_mode">tree,kanban,form</field>
<field name="view_type">form</field>
<field name="search_view_id" ref="product.product_search_form_view"/>
<field name="context">{"search_default_filter_to_purchase": 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
@@ -17,7 +17,9 @@
<field name="arch" type="xml">
<search string="Sales by Channel Analysis">
<field name="date_order"/>
<field name="product_id"/>
<filter string="Date" name="current_year" date="date_order" default_period="this_year"/>
<filter string="Last 365 Days" name="last_year" domain="[('date_order', '&gt;=', (context_today() - datetime.timedelta(days=365)).strftime('%Y-%m-%d'))]"/>
<group expand="1" string="Group By">
<filter string="Sales Team" name="team_id" context="{'group_by':'team_id'}"/>
</group>
+1
View File
@@ -62,6 +62,7 @@
<field name="view_mode">kanban,tree,form</field>
<field name="view_type">form</field>
<field name="view_id" ref="product.product_template_kanban_view"/>
<field name="search_view_id" ref="product.product_template_search_view"/>
<field name="context">{"search_default_filter_to_sell":1, "sale_multi_pricelist_product_template": 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
+15
View File
@@ -76,6 +76,20 @@
</field>
</record>
<record id="stock_product_search_form_view" model="ir.ui.view">
<field name="name">product.product.search.stock.form</field>
<field name="model">product.product</field>
<field name="mode">primary</field>
<field name="inherit_id" ref="product.product_search_form_view"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='inactive']" position="after">
<separator/>
<filter name="real_stock_available" string="Available Products" domain="[('qty_available','&gt;',0)]"/>
<filter name="real_stock_negative" string="Negative Forecasted Quantity" domain="[('virtual_available','&lt;',0)]"/>
</xpath>
</field>
</record>
<!-- view common to both template and product -->
<record id="view_template_property_form" model="ir.ui.view">
<field name="name">product.template.stock.property.form.inherit</field>
@@ -340,6 +354,7 @@
<field name="res_model">product.template</field>
<field name="view_mode">kanban,tree,form</field>
<field name="view_type">form</field>
<field name="search_view_id" ref="product_template_search_form_view_stock"/>
<field name="context">{"search_default_consumable": 1, 'default_type': 'product'}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
@@ -17,6 +17,7 @@
<field name="res_model">product.template</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field>
<field name="search_view_id" ref="product_template_search_view_website"/>
<field name="context">{'search_default_published': 1, 'default_website_published': True}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">