From 28f3cb44d00fda9481f8b3b483cde4c2c7f46b09 Mon Sep 17 00:00:00 2001 From: ivan deng Date: Fri, 14 Jun 2019 22:43:15 +0800 Subject: [PATCH] opt grn and ztree --- .../static/description/index.html | 2 +- .../static/description/index.html | 2 +- .../static/description/index.html | 2 +- .../static/description/index.html | 2 +- .../static/description/index.html | 2 +- .../static/description/index.html | 2 +- .../static/description/index.html | 2 +- .../static/description/index.html | 2 +- app_hr_superbar/static/description/index.html | 2 +- .../static/description/index.html | 2 +- .../static/description/index.html | 2 +- .../static/description/index.html | 2 +- app_mrp_superbar/__manifest__.py | 4 +-- .../static/description/index.html | 2 +- .../static/description/index.html | 2 +- .../models/product_category.py | 2 +- .../static/description/index.html | 2 +- .../models/product_category.py | 2 +- .../static/description/index.html | 2 +- app_product_ztree/models/product_category.py | 33 +++++++++++++++++++ .../static/description/index.html | 2 +- .../static/description/index.html | 2 +- .../static/description/index.html | 2 +- .../static/description/index.html | 2 +- .../static/description/index.html | 2 +- 25 files changed, 58 insertions(+), 25 deletions(-) create mode 100644 app_product_ztree/models/product_category.py diff --git a/app_account_searchpanel/static/description/index.html b/app_account_searchpanel/static/description/index.html index dd55bb89..374416aa 100644 --- a/app_account_searchpanel/static/description/index.html +++ b/app_account_searchpanel/static/description/index.html @@ -208,7 +208,7 @@
  • - Easy to show custom parent children tree for tree, kanban, pivot, graph view. + Easy to show custom parent children tree for tree, kanban, pivot, graph view.(Note that there would be little different in UI between odoo12,11,10)
  • diff --git a/app_account_superbar/static/description/index.html b/app_account_superbar/static/description/index.html index f15381c3..1065b047 100644 --- a/app_account_superbar/static/description/index.html +++ b/app_account_superbar/static/description/index.html @@ -28,7 +28,7 @@
  • - Easy to show custom parent children tree for tree, kanban, pivot, graph view. + Easy to show custom parent children tree for tree, kanban, pivot, graph view.(Note that there would be little different in UI between odoo12,11,10)
  • diff --git a/app_account_superbar_chinese/static/description/index.html b/app_account_superbar_chinese/static/description/index.html index f15381c3..1065b047 100644 --- a/app_account_superbar_chinese/static/description/index.html +++ b/app_account_superbar_chinese/static/description/index.html @@ -28,7 +28,7 @@
  • - Easy to show custom parent children tree for tree, kanban, pivot, graph view. + Easy to show custom parent children tree for tree, kanban, pivot, graph view.(Note that there would be little different in UI between odoo12,11,10)
  • diff --git a/app_base_superbar/static/description/index.html b/app_base_superbar/static/description/index.html index 4271f4cc..88d98c36 100644 --- a/app_base_superbar/static/description/index.html +++ b/app_base_superbar/static/description/index.html @@ -81,7 +81,7 @@
  • - Easy to show custom parent children tree for tree, kanban, pivot, graph view. + Easy to show custom parent children tree for tree, kanban, pivot, graph view.(Note that there would be little different in UI between odoo12,11,10)
  • diff --git a/app_contacts_searchpanel/static/description/index.html b/app_contacts_searchpanel/static/description/index.html index 3b32af81..835bea6c 100644 --- a/app_contacts_searchpanel/static/description/index.html +++ b/app_contacts_searchpanel/static/description/index.html @@ -200,7 +200,7 @@
  • - Easy to show custom parent children tree for tree, kanban, pivot, graph view. + Easy to show custom parent children tree for tree, kanban, pivot, graph view.(Note that there would be little different in UI between odoo12,11,10)
  • diff --git a/app_contacts_superbar/static/description/index.html b/app_contacts_superbar/static/description/index.html index dfcc02cd..bb8ba08d 100644 --- a/app_contacts_superbar/static/description/index.html +++ b/app_contacts_superbar/static/description/index.html @@ -28,7 +28,7 @@
  • - Easy to show custom parent children tree for tree, kanban, pivot, graph view. + Easy to show custom parent children tree for tree, kanban, pivot, graph view.(Note that there would be little different in UI between odoo12,11,10)
  • diff --git a/app_crm_superbar/static/description/index.html b/app_crm_superbar/static/description/index.html index 5ec7efe9..6049846f 100644 --- a/app_crm_superbar/static/description/index.html +++ b/app_crm_superbar/static/description/index.html @@ -28,7 +28,7 @@
  • - Easy to show custom parent children tree for tree, kanban, pivot, graph view. + Easy to show custom parent children tree for tree, kanban, pivot, graph view.(Note that there would be little different in UI between odoo12,11,10)
  • diff --git a/app_hr_searchpanel/static/description/index.html b/app_hr_searchpanel/static/description/index.html index 893f62a7..fa50f019 100644 --- a/app_hr_searchpanel/static/description/index.html +++ b/app_hr_searchpanel/static/description/index.html @@ -200,7 +200,7 @@
  • - Easy to show custom parent children tree for tree, kanban, pivot, graph view. + Easy to show custom parent children tree for tree, kanban, pivot, graph view.(Note that there would be little different in UI between odoo12,11,10)
  • diff --git a/app_hr_superbar/static/description/index.html b/app_hr_superbar/static/description/index.html index 615dc820..4d4ead32 100644 --- a/app_hr_superbar/static/description/index.html +++ b/app_hr_superbar/static/description/index.html @@ -28,7 +28,7 @@
  • - Easy to show custom parent children tree for tree, kanban, pivot, graph view. + Easy to show custom parent children tree for tree, kanban, pivot, graph view.(Note that there would be little different in UI between odoo12,11,10)
  • diff --git a/app_mail_superbar/static/description/index.html b/app_mail_superbar/static/description/index.html index 0e6aa645..f4100739 100644 --- a/app_mail_superbar/static/description/index.html +++ b/app_mail_superbar/static/description/index.html @@ -67,7 +67,7 @@
  • - Easy to show custom parent children tree for tree, kanban, pivot, graph view. + Easy to show custom parent children tree for tree, kanban, pivot, graph view.(Note that there would be little different in UI between odoo12,11,10)
  • diff --git a/app_module_searchpanel/static/description/index.html b/app_module_searchpanel/static/description/index.html index a5f30bff..c6733596 100644 --- a/app_module_searchpanel/static/description/index.html +++ b/app_module_searchpanel/static/description/index.html @@ -200,7 +200,7 @@
  • - Easy to show custom parent children tree for tree, kanban, pivot, graph view. + Easy to show custom parent children tree for tree, kanban, pivot, graph view.(Note that there would be little different in UI between odoo12,11,10)
  • diff --git a/app_module_superbar/static/description/index.html b/app_module_superbar/static/description/index.html index da1655a4..00728412 100644 --- a/app_module_superbar/static/description/index.html +++ b/app_module_superbar/static/description/index.html @@ -44,7 +44,7 @@
  • - Easy to show custom parent children tree for tree, kanban, pivot, graph view. + Easy to show custom parent children tree for tree, kanban, pivot, graph view.(Note that there would be little different in UI between odoo12,11,10)
  • diff --git a/app_mrp_superbar/__manifest__.py b/app_mrp_superbar/__manifest__.py index bd8c541b..d702a529 100644 --- a/app_mrp_superbar/__manifest__.py +++ b/app_mrp_superbar/__manifest__.py @@ -17,7 +17,7 @@ { 'name': "App mrp Manufacturing Orders browse by state workcenter navigator", - 'version': '12.19.05.28', + 'version': '12.19.06.10', 'author': 'Sunpop.cn', 'category': 'Base', 'website': 'https://www.sunpop.cn', @@ -37,7 +37,7 @@ 'price': 0.00, 'currency': 'EUR', 'depends': [ - 'mrp_workorder', + 'mrp', ], 'images': ['static/description/banner.gif'], 'data': [ diff --git a/app_mrp_superbar/static/description/index.html b/app_mrp_superbar/static/description/index.html index c03d821c..521fdcd1 100644 --- a/app_mrp_superbar/static/description/index.html +++ b/app_mrp_superbar/static/description/index.html @@ -37,7 +37,7 @@
  • - Easy to show custom parent children tree for tree, kanban, pivot, graph view. + Easy to show custom parent children tree for tree, kanban, pivot, graph view.(Note that there would be little different in UI between odoo12,11,10)
  • diff --git a/app_pos_superbar/static/description/index.html b/app_pos_superbar/static/description/index.html index e9ddf161..7f4370cb 100644 --- a/app_pos_superbar/static/description/index.html +++ b/app_pos_superbar/static/description/index.html @@ -37,7 +37,7 @@
  • - Easy to show custom parent children tree for tree, kanban, pivot, graph view. + Easy to show custom parent children tree for tree, kanban, pivot, graph view.(Note that there would be little different in UI between odoo12,11,10)
  • diff --git a/app_product_searchpanel/models/product_category.py b/app_product_searchpanel/models/product_category.py index 709d0af2..377ddafc 100644 --- a/app_product_searchpanel/models/product_category.py +++ b/app_product_searchpanel/models/product_category.py @@ -23,7 +23,7 @@ class ProductCategory(models.Model): # 更新 complete_name 算法,当有context: show_short =1 时,只显示短名 @api.multi def name_get(self): - if self._context.get('category_show_short'): + if self._context.get('show_short'): new_res = [] for category in self: name = category.name diff --git a/app_product_searchpanel/static/description/index.html b/app_product_searchpanel/static/description/index.html index 79febeae..f51bf105 100644 --- a/app_product_searchpanel/static/description/index.html +++ b/app_product_searchpanel/static/description/index.html @@ -207,7 +207,7 @@
  • - Easy to show custom parent children tree for tree, kanban, pivot, graph view. + Easy to show custom parent children tree for tree, kanban, pivot, graph view.(Note that there would be little different in UI between odoo12,11,10)
  • diff --git a/app_product_superbar/models/product_category.py b/app_product_superbar/models/product_category.py index 709d0af2..377ddafc 100644 --- a/app_product_superbar/models/product_category.py +++ b/app_product_superbar/models/product_category.py @@ -23,7 +23,7 @@ class ProductCategory(models.Model): # 更新 complete_name 算法,当有context: show_short =1 时,只显示短名 @api.multi def name_get(self): - if self._context.get('category_show_short'): + if self._context.get('show_short'): new_res = [] for category in self: name = category.name diff --git a/app_product_superbar/static/description/index.html b/app_product_superbar/static/description/index.html index 73493421..07769334 100644 --- a/app_product_superbar/static/description/index.html +++ b/app_product_superbar/static/description/index.html @@ -37,7 +37,7 @@
  • - Easy to show custom parent children tree for tree, kanban, pivot, graph view. + Easy to show custom parent children tree for tree, kanban, pivot, graph view.(Note that there would be little different in UI between odoo12,11,10)
  • diff --git a/app_product_ztree/models/product_category.py b/app_product_ztree/models/product_category.py new file mode 100644 index 00000000..377ddafc --- /dev/null +++ b/app_product_ztree/models/product_category.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- + +# Created on 2017-11-28 +# author: 广州尚鹏,https://www.sunpop.cn +# email: 300883@qq.com +# resource of Sunpop +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + +# Odoo在线中文用户手册(长期更新) +# https://www.sunpop.cn/documentation/user/10.0/zh_CN/index.html + +# Odoo10离线中文用户手册下载 +# https://www.sunpop.cn/odoo10_user_manual_document_offline/ +# Odoo10离线开发手册下载-含python教程,jquery参考,Jinja2模板,PostgresSQL参考(odoo开发必备) +# https://www.sunpop.cn/odoo10_developer_document_offline/ +# description: + +from odoo import api, fields, models, exceptions, _ + +class ProductCategory(models.Model): + _inherit = 'product.category' + + # 更新 complete_name 算法,当有context: show_short =1 时,只显示短名 + @api.multi + def name_get(self): + if self._context.get('show_short'): + new_res = [] + for category in self: + name = category.name + new_res.append((category.id, name)) + return new_res + else: + return super(ProductCategory, self).name_get() diff --git a/app_purchase_searchpanel/static/description/index.html b/app_purchase_searchpanel/static/description/index.html index 00fb093b..4e8afb96 100644 --- a/app_purchase_searchpanel/static/description/index.html +++ b/app_purchase_searchpanel/static/description/index.html @@ -200,7 +200,7 @@
  • - Easy to show custom parent children tree for tree, kanban, pivot, graph view. + Easy to show custom parent children tree for tree, kanban, pivot, graph view.(Note that there would be little different in UI between odoo12,11,10)
  • diff --git a/app_purchase_superbar/static/description/index.html b/app_purchase_superbar/static/description/index.html index 11696f49..771891b5 100644 --- a/app_purchase_superbar/static/description/index.html +++ b/app_purchase_superbar/static/description/index.html @@ -28,7 +28,7 @@
  • - Easy to show custom parent children tree for tree, kanban, pivot, graph view. + Easy to show custom parent children tree for tree, kanban, pivot, graph view.(Note that there would be little different in UI between odoo12,11,10)
  • diff --git a/app_sale_searchpanel/static/description/index.html b/app_sale_searchpanel/static/description/index.html index 787461f2..f482e91e 100644 --- a/app_sale_searchpanel/static/description/index.html +++ b/app_sale_searchpanel/static/description/index.html @@ -200,7 +200,7 @@
  • - Easy to show custom parent children tree for tree, kanban, pivot, graph view. + Easy to show custom parent children tree for tree, kanban, pivot, graph view.(Note that there would be little different in UI between odoo12,11,10)
  • diff --git a/app_sale_superbar/static/description/index.html b/app_sale_superbar/static/description/index.html index 2d00d302..53653b78 100644 --- a/app_sale_superbar/static/description/index.html +++ b/app_sale_superbar/static/description/index.html @@ -28,7 +28,7 @@
  • - Easy to show custom parent children tree for tree, kanban, pivot, graph view. + Easy to show custom parent children tree for tree, kanban, pivot, graph view.(Note that there would be little different in UI between odoo12,11,10)
  • diff --git a/app_stock_searchpanel/static/description/index.html b/app_stock_searchpanel/static/description/index.html index 4aeb4ba4..cf8a3144 100644 --- a/app_stock_searchpanel/static/description/index.html +++ b/app_stock_searchpanel/static/description/index.html @@ -200,7 +200,7 @@
  • - Easy to show custom parent children tree for tree, kanban, pivot, graph view. + Easy to show custom parent children tree for tree, kanban, pivot, graph view.(Note that there would be little different in UI between odoo12,11,10)