init from 15
4
app_product_ztree/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import models
|
||||
from .hooks import post_init_hook
|
||||
61
app_product_ztree/__manifest__.py
Normal file
@@ -0,0 +1,61 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Created on 2018-08-15
|
||||
# author: 广州尚鹏,https://www.sunpop.cn
|
||||
# email: 300883@qq.com
|
||||
# resource of Sunpop
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
# 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:
|
||||
|
||||
{
|
||||
'name': "App Product category ztree, parent children tree",
|
||||
'version': '16.23.02.28',
|
||||
'author': 'Sunpop.cn',
|
||||
'category': 'Base',
|
||||
'website': 'https://www.sunpop.cn',
|
||||
'license': 'LGPL-3',
|
||||
'sequence': 2,
|
||||
'summary': """
|
||||
Use for parent children tree list select navigator. Product category tree.
|
||||
ztree widget.
|
||||
""",
|
||||
'description': """
|
||||
zTree widget.
|
||||
Advance search with real parent children tree, ListView or KanbanView ,
|
||||
eg: Product category tree ,Department tree, stock location tree.
|
||||
超级方便的查询,树状视图。
|
||||
""",
|
||||
'price': 0.00,
|
||||
'currency': 'EUR',
|
||||
'depends': [
|
||||
'product',
|
||||
],
|
||||
'images': ['static/description/banner.gif'],
|
||||
'data': [
|
||||
'views/product_views.xml',
|
||||
],
|
||||
'demo': [
|
||||
],
|
||||
'test': [
|
||||
],
|
||||
'css': [
|
||||
],
|
||||
'qweb': [
|
||||
'static/src/xml/*.xml',
|
||||
],
|
||||
'js': [
|
||||
],
|
||||
'post_load': None,
|
||||
'post_init_hook': 'post_init_hook',
|
||||
'installable': True,
|
||||
'application': True,
|
||||
'auto_install': False,
|
||||
}
|
||||
20
app_product_ztree/hooks.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Created on 2018-10-12
|
||||
# author: 广州尚鹏,https://www.sunpop.cn
|
||||
# email: 300883@qq.com
|
||||
# resource of Sunpop
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
# 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:
|
||||
|
||||
def post_init_hook(cr, pool):
|
||||
pass
|
||||
# cr.execute("")
|
||||
14
app_product_ztree/i18n/zh_CN.po
Normal file
@@ -0,0 +1,14 @@
|
||||
# Translation of Odoo Server.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-01-08 14:28+0000\n"
|
||||
"PO-Revision-Date: 2018-01-08 14:28+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
1
app_product_ztree/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
32
app_product_ztree/models/product_category.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# -*- 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_category =1 时,只显示短名
|
||||
def name_get(self):
|
||||
if self._context.get('show_short_category'):
|
||||
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()
|
||||
2
app_product_ztree/report/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
BIN
app_product_ztree/static/description/banner.gif
Normal file
|
After Width: | Height: | Size: 3.0 MiB |
BIN
app_product_ztree/static/description/demo1.jpg
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
app_product_ztree/static/description/demo11.jpg
Normal file
|
After Width: | Height: | Size: 100 KiB |
BIN
app_product_ztree/static/description/demo12.jpg
Normal file
|
After Width: | Height: | Size: 98 KiB |
BIN
app_product_ztree/static/description/demo2.jpg
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
app_product_ztree/static/description/demo3.jpg
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
app_product_ztree/static/description/demo4.jpg
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
app_product_ztree/static/description/demo5.jpg
Normal file
|
After Width: | Height: | Size: 62 KiB |
BIN
app_product_ztree/static/description/icon.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
182
app_product_ztree/static/description/index.html
Normal file
@@ -0,0 +1,182 @@
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced" style="max-width: 95%;">
|
||||
<h2 class="oe_slogan" style="color:#875A7B;">App ztree widget, for parent children tree list. Demo for product category</h2>
|
||||
<h3 class="oe_slogan">Very useful for parent child relationship, like product category, stock location, hr department</h3>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<div class="oe_span12">
|
||||
<div class="alert alert-info" style="padding:8px;font-weight: 300; font-size: 20px;">
|
||||
<i class="fa fa-hand-o-right"></i><b> Key features: </b>
|
||||
<ul class="list-unstyled">
|
||||
<li>
|
||||
<i class="fa fa-check-square-o text-primary"></i>
|
||||
Easy to make custom parent children tree.
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-check-square-o text-primary"></i>
|
||||
Free to Use in product category.
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-check-square-o text-primary"></i>
|
||||
Free to Use in stock location.
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-check-square-o text-primary"></i>
|
||||
Free to Use in hr department, employee.
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-check-square-o text-primary"></i>
|
||||
It's a widget, you can use it in anywhere in odoo.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="alert alert-info" style="padding:8px;font-weight: 300; font-size: 20px;">
|
||||
<i class="fa fa-hand-o-right"></i>
|
||||
<b>
|
||||
<a href="http://www.odoo.com/apps/modules/16.0/app_web_superbar/" target="_blank" class="text-danger">
|
||||
Extend features. superbar advance search navigator
|
||||
</a>
|
||||
</b>
|
||||
<ul class="list-unstyled">
|
||||
<li>
|
||||
<i class="fa fa-check-square-o text-primary"></i>
|
||||
Easy to navigate product, employee in tree or kanban view.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="alert alert-info" style="padding:8px;font-weight: 300; font-size: 20px;">
|
||||
<i class="fa fa-hand-o-right"></i><b>Get relate Demo </b>
|
||||
<ul class="list-unstyled">
|
||||
<li>
|
||||
<i class="fa fa-link text-primary"></i>
|
||||
<a href="http://www.odoo.com/apps/modules/16.0/app_web_widget_ztree/" target="_blank" class="text-danger">zTree widget (must need to use in following demo).</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-link text-primary"></i>
|
||||
<a href="http://www.odoo.com/apps/modules/16.0/app_product_ztree/" target="_blank">Product and category.</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-link text-primary"></i>
|
||||
<a href="http://www.odoo.com/apps/modules/16.0/app_stock_ztree/" target="_blank">Stock and Location.</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-link text-primary"></i>
|
||||
<a href="http://www.odoo.com/apps/modules/16.0/app_hr_ztree/" target="_blank">hr department and employee.</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h4 class="oe_slogan">Use in product.</h4>
|
||||
<div class="oe_demo oe_screenshot">
|
||||
<img src="demo2.jpg">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h4 class="oe_slogan">Free to Use in product category.</h4>
|
||||
<div class="oe_demo oe_screenshot">
|
||||
<img src="demo1.jpg">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h4 class="oe_slogan">Free to Use in stock location.</h4>
|
||||
<div class="oe_demo oe_screenshot">
|
||||
<img src="demo3.jpg">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h4 class="oe_slogan">Use in hr department.</h4>
|
||||
<div class="oe_demo oe_screenshot">
|
||||
<img src="demo4.jpg">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h4 class="oe_slogan">Use in hr employee.</h4>
|
||||
<div class="oe_demo oe_screenshot">
|
||||
<img src="demo5.jpg">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h1> </h1>
|
||||
<h1 class="text-danger text-center">(!Need extra module and pay, release soon)Easy to navigator.</h1>
|
||||
<h4 class="oe_slogan">Product, employee in kanban view</h4>
|
||||
<div class="oe_demo oe_screenshot">
|
||||
<img src="demo11.jpg">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h4 class="oe_slogan">(!Need extra module and pay, release soon)List view</h4>
|
||||
<div class="oe_demo oe_screenshot">
|
||||
<img src="demo12.jpg">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h4 class="oe_slogan">Easy to setup just use widget='widget_select'. like this</h4>
|
||||
<div class="oe_demo oe_screenshot">
|
||||
<img src="setup1.jpg">
|
||||
</div>
|
||||
<h1><br/> Use follow param to setup widget:<br/></h1>
|
||||
<h4>ztree_parent_key: --the key field of parent children relation.</h4>
|
||||
<h4>ztree_expend_level: --how many level to expend the tree for initialize. Default is 2</h4>
|
||||
<h4>limit: --how many record to show ztree. Default is 16</h4>
|
||||
<h4>order: --the field to order by</h4>
|
||||
</div>
|
||||
</section>
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row oe_spaced text-center">
|
||||
<div class="oe_span12">
|
||||
<h2 class="oe_slogan">Technical Help & Support</h2>
|
||||
</div>
|
||||
<div class="col-md-12 pad0">
|
||||
<div class="oe_mt16">
|
||||
<p><h4>
|
||||
For any type of technical help & support requests, Feel free to contact us</h4></p>
|
||||
<a style="background: #002e5a none repeat scroll 0% 0%; color: rgb(255, 255, 255);position: relative; overflow: hidden;"
|
||||
class="btn btn-warning btn-lg" rel="nofollow" href="mailto:guohuadeng@hotmail.com"><span
|
||||
style="height: 354px; width: 354px; top: -147.433px; left: -6.93335px;" class="o_ripple"></span>
|
||||
<i class="fa fa-envelope"></i> guohuadeng@hotmail.com</a>
|
||||
<p><h4>
|
||||
Via QQ: 300883 (App user would not get QQ or any other IM support. Only for odoo project customize.)</h4></p>
|
||||
<a style="background: #002e5a none repeat scroll 0% 0%; color: rgb(255, 255, 255);position: relative; overflow: hidden;"
|
||||
class="btn btn-warning btn-lg" rel="nofollow" href="mailto:300883@qq.com"><span
|
||||
style="height: 354px; width: 354px; top: -147.433px; left: -6.93335px;" class="o_ripple"></span>
|
||||
<i class="fa fa-envelope"></i> 300883@qq.com</a>
|
||||
</div>
|
||||
<div class="oe_mt16">
|
||||
<h4>
|
||||
Visit our website for more support.</h4>
|
||||
<h4>https://www.sunpop.cn</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
BIN
app_product_ztree/static/description/setup1.jpg
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
app_product_ztree/static/img/icon_sunpop.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
app_product_ztree/static/img/logo_sunpop.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
54
app_product_ztree/views/product_views.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<odoo>
|
||||
<data>
|
||||
<!-- Product template -->
|
||||
<record id="app_product_template_tree_view" model="ir.ui.view">
|
||||
<field name="name">app.product.template.tree</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_tree_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='categ_id']" position="attributes">
|
||||
<!-- Add your fields or attributes here -->
|
||||
<attribute name="widget">ztree_select</attribute>
|
||||
<attribute name="options">{'ztree_parent_key': 'parent_id','ztree_expend_level': '2', 'ztree_name_field': 'name', 'order': 'name' }</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="app_product_template_form_view" model="ir.ui.view">
|
||||
<field name="name">app.product.template.form</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='categ_id']" position="attributes">
|
||||
<!-- Add your fields or attributes here -->
|
||||
<attribute name="widget">ztree_select</attribute>
|
||||
<attribute name="options">{'ztree_parent_key': 'parent_id','ztree_expend_level': '2', 'ztree_name_field': 'name', 'order': 'name' }</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- Product product -->
|
||||
<record id="app_product_product_tree_view" model="ir.ui.view">
|
||||
<field name="name">app.product.product.tree</field>
|
||||
<field name="model">product.product</field>
|
||||
<field name="inherit_id" ref="product.product_product_tree_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='categ_id']" position="attributes">
|
||||
<!-- Add your fields or attributes here -->
|
||||
<attribute name="widget">ztree_select</attribute>
|
||||
<attribute name="options">{'ztree_parent_key': 'parent_id','ztree_expend_level': '2', 'ztree_name_field': 'name', 'order': 'name' }</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="app_product_category_form_view" model="ir.ui.view">
|
||||
<field name="name">app.product.category.form</field>
|
||||
<field name="model">product.category</field>
|
||||
<field name="inherit_id" ref="product.product_category_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='parent_id']" position="attributes">
|
||||
<!-- Add your fields or attributes here -->
|
||||
<attribute name="widget">ztree_select</attribute>
|
||||
<attribute name="options">{'ztree_parent_key': 'parent_id','ztree_expend_level': '2', 'order': 'name' }</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||