summaryrefslogtreecommitdiff
path: root/addons/lunch/views
diff options
context:
space:
mode:
authorBarad Mahendra <mba@openerp.com>2020-02-20 10:07:00 +0000
committerYannick Tivisse <yti@odoo.com>2020-06-16 13:18:06 +0000
commit231eaa0fd888f5e795fd987111c0bb805fc8fc71 (patch)
treed14c576f342c8c6b65db43ce6d39481dac6ac2b3 /addons/lunch/views
parent77c231219e1ebea8c099917590234d5c1c328a38 (diff)
[IMP] lunch: Improve the views and multi-company behaviour
Purpose ======= Improve the lunch categories and mutli-company environment. Specifications ============ - Able to archive a product category and this should archive/unarchive all the products in that category also added the filter for same. when unrchive the product if category is archived then raise the Validation to change the category OR unarchive the category. - add a default image for lunch categories - Adapt the size of the default image, currently it's too big, - On lunch order form view if product images is not set then display the category image same as kanban image. - Add a company field on the Product categories (it's already there but it should be visible on the view form). Added the multi company rule for the product category and if company is not set on category then it will be sharable by all the company. so default company on product category null. also on lunch product and report check the multi company and display the product accroding to company. closes odoo/odoo#45797 Taskid: 2200002 Closes: #45797 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/lunch/views')
-rw-r--r--addons/lunch/views/lunch_product_views.xml20
1 files changed, 18 insertions, 2 deletions
diff --git a/addons/lunch/views/lunch_product_views.xml b/addons/lunch/views/lunch_product_views.xml
index d7aa38839e3..b84f1d6b933 100644
--- a/addons/lunch/views/lunch_product_views.xml
+++ b/addons/lunch/views/lunch_product_views.xml
@@ -85,6 +85,7 @@
<group>
<field name="new_until"/>
<field name='description'/>
+ <field name="company_id" groups="base.group_multi_company"/>
</group>
</group>
</sheet>
@@ -125,8 +126,8 @@
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click o_kanban_record_has_image_fill o_kanban_record">
- <field name="image_128" class="o_lunch_image o_kanban_image_fill_left d-none d-md-block" options="{'placeholder': '/lunch/static/img/lunch.png'}" widget="image"/>
- <div class="oe_kanban_details">
+ <field name="image_128" class="o_lunch_image o_kanban_image_fill_left d-none d-md-block" options="{'placeholder': '/lunch/static/img/lunch.png', 'size': [94, 94]}" widget="image"/>
+ <div class="oe_kanban_details ml8">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title">
@@ -247,8 +248,11 @@
<field name="name"/>
</h1>
</div>
+ <label for="company_id" groups="base.group_multi_company"/>
+ <field name="company_id" groups="base.group_multi_company"/>
<group>
<group>
+ <field name="active" invisible="1"/>
<field name="topping_label_1"/>
<field name="topping_quantity_1"/>
</group>
@@ -329,6 +333,17 @@
</field>
</record>
+ <record id="lunch_product_category_view_search" model="ir.ui.view">
+ <field name="name">lunch.product.category.search</field>
+ <field name="model">lunch.product.category</field>
+ <field name="arch" type="xml">
+ <search>
+ <field name="name"/>
+ <filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
+ </search>
+ </field>
+ </record>
+
<record id="lunch_product_action" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="res_model">lunch.product</field>
@@ -362,6 +377,7 @@
<field name="name">Product Categories</field>
<field name="res_model">lunch.product.category</field>
<field name="view_mode">tree,form,kanban</field>
+ <field name="search_view_id" ref="lunch_product_category_view_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new product category