diff --git a/app_mrp_production_chart/__init__.py b/app_mrp_production_chart/__init__.py
new file mode 100644
index 00000000..cde864ba
--- /dev/null
+++ b/app_mrp_production_chart/__init__.py
@@ -0,0 +1,3 @@
+# -*- coding: utf-8 -*-
+
+from . import models
diff --git a/app_mrp_production_chart/__manifest__.py b/app_mrp_production_chart/__manifest__.py
new file mode 100644
index 00000000..08e0d54f
--- /dev/null
+++ b/app_mrp_production_chart/__manifest__.py
@@ -0,0 +1,70 @@
+# -*- coding: utf-8 -*-
+
+# Created on 2019-01-04
+# author: 广州尚鹏,https://www.sunpop.cn
+# email: 300883@qq.com
+# resource of Sunpop
+# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
+
+# Odoo12在线用户手册(长期更新)
+# https://www.sunpop.cn/documentation/user/12.0/en/index.html
+
+# Odoo12在线开发者手册(长期更新)
+# https://www.sunpop.cn/documentation/12.0/index.html
+
+# Odoo10在线中文用户手册(长期更新)
+# 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/
+
+
+{
+ 'name': 'MRP Production Chart Hierarchy, 生产单多层级结构图',
+ 'version': '13.19.11.29',
+ 'author': 'Sunpop.cn',
+ 'category': 'Base',
+ 'website': 'https://www.sunpop.cn',
+ 'license': 'LGPL-3',
+ 'sequence': 2,
+ 'summary': """
+ Manufacture Order multi level. For Multi level MO MRP Production Order from multi bom.
+ Chart Hierarchy Widget. Hierarchy Chart, Hierarchy Tree for multi level Parent Children relation tree.
+ """,
+ 'description': """
+Need extra paid apps https://www.odoo.com/apps/modules/13.0/app_web_chart_hierarchy/
+This module extend to show a Hierarchy chart.
+(N+1, N+2, direct subordinates)
+image: image_field,
+desc: descript_field,
+direct_sub: children_field, must be one2many,
+child_all_count: child_all_count field, count of direct and indirect children.
+ """,
+ 'price': 0.00,
+ 'currency': 'EUR',
+ 'depends': [
+ 'mrp',
+ ],
+ 'images': ['static/description/banner.gif'],
+ 'data': [
+ 'views/mrp_production_views.xml',
+ ],
+ 'demo': [
+ ],
+ 'test': [
+ ],
+ 'css': [
+ ],
+ 'qweb': [
+ 'static/src/xml/*.xml',
+ ],
+ 'js': [
+ ],
+ 'post_load': None,
+ 'post_init_hook': None,
+ 'installable': True,
+ 'application': True,
+ 'auto_install': False,
+}
diff --git a/app_mrp_production_chart/controllers/__init__.py b/app_mrp_production_chart/controllers/__init__.py
new file mode 100644
index 00000000..7ec351fe
--- /dev/null
+++ b/app_mrp_production_chart/controllers/__init__.py
@@ -0,0 +1,2 @@
+# -*- coding: utf-8 -*
+
diff --git a/app_mrp_production_chart/i18n/zh_CN.po b/app_mrp_production_chart/i18n/zh_CN.po
new file mode 100644
index 00000000..93cfbf6d
--- /dev/null
+++ b/app_mrp_production_chart/i18n/zh_CN.po
@@ -0,0 +1,67 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * app_product_category_chart
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 12.0+e-20190301\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2019-04-09 00:38+0000\n"
+"PO-Revision-Date: 2019-04-09 00:38+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"
+
+#. module: app_product_category_chart
+#: model_terms:ir.ui.view,arch_db:app_product_category_chart.app_product_category_form_view
+msgid "Hierarchy Chart"
+msgstr "目录结构图"
+
+#. module: app_product_category_chart
+#: model:ir.model.fields,field_description:app_product_category_chart.field_product_category__image
+msgid "Image"
+msgstr "图像"
+
+#. module: app_product_category_chart
+#: model:ir.model.fields,field_description:app_product_category_chart.field_product_category__child_all_count
+msgid "Indirect Surbordinates Count"
+msgstr "非直接下属数量"
+
+#. module: app_product_category_chart
+#: model:ir.model.fields,field_description:app_product_category_chart.field_product_category__image_medium
+msgid "Medium-sized image"
+msgstr "中等尺寸图像"
+
+#. module: app_product_category_chart
+#: model:ir.model.fields,help:app_product_category_chart.field_product_category__image_medium
+msgid "Medium-sized image of this Category. It is automatically resized as a 128x128px image, with aspect ratio preserved. Use this field in form views or some kanban views."
+msgstr ""
+
+#. module: app_product_category_chart
+#: model_terms:ir.ui.view,arch_db:app_product_category_chart.app_product_category_form_view
+msgid "Please get widget from https://apps.odoo.com/apps/modules/13.0/app_web_chart_hierarchy/"
+msgstr ""
+
+#. module: app_product_category_chart
+#: model:ir.model,name:app_product_category_chart.model_product_category
+msgid "Product Category"
+msgstr "产品种类"
+
+#. module: app_product_category_chart
+#: model:ir.model.fields,field_description:app_product_category_chart.field_product_category__image_small
+msgid "Small-sized image"
+msgstr "小尺寸图像"
+
+#. module: app_product_category_chart
+#: model:ir.model.fields,help:app_product_category_chart.field_product_category__image_small
+msgid "Small-sized image of this Category. It is automatically resized as a 64x64px image, with aspect ratio preserved. Use this field anywhere a small image is required."
+msgstr ""
+
+#. module: app_product_category_chart
+#: model:ir.model.fields,help:app_product_category_chart.field_product_category__image
+msgid "This field holds the image used as avatar for this category, limited to 1024x1024px"
+msgstr "目录图像最大为 1024x1024px"
+
diff --git a/app_mrp_production_chart/models/__init__.py b/app_mrp_production_chart/models/__init__.py
new file mode 100644
index 00000000..53975db4
--- /dev/null
+++ b/app_mrp_production_chart/models/__init__.py
@@ -0,0 +1,3 @@
+# -*- coding: utf-8 -*-
+
+from . import mrp_production
diff --git a/app_mrp_production_chart/models/mrp_production.py b/app_mrp_production_chart/models/mrp_production.py
new file mode 100644
index 00000000..4ed1a182
--- /dev/null
+++ b/app_mrp_production_chart/models/mrp_production.py
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+
+from odoo import api, fields, models, tools, _
+
+import logging
+
+_logger = logging.getLogger(__name__)
+
+
+class MrpProduction(models.Model):
+ _inherit = 'mrp.production'
+
+ # 注意,res.partner 有 parent_id 和 child_ids
+ _parent_name = "parent_id"
+ _parent_store = True
+
+ # 上级生产单
+ parent_id = fields.Many2one('mrp.production', 'Parent Manufacturing', index=True, ondelete='cascade',
+ help="The parent manufacturing orders that generate this order. Follow the rule of multi level bom.")
+ child_ids = fields.One2many('mrp.production', 'parent_id', string='Sub Manufacturing')
+ child_all_count = fields.Integer('Indirect Surbordinates Count', store=False,
+ compute='_compute_child_all_count')
+
+ image_128 = fields.Image(related='product_id.image_128', readonly=True)
+ product_name = fields.Char(related='product_id.name', readonly=True)
+ parent_path = fields.Char(index=True)
+
+ @api.depends('child_ids.child_all_count')
+ def _compute_child_all_count(self):
+ for rec in self:
+ rec.child_all_count = len(rec.child_ids) + sum(child.child_all_count for child in rec.child_ids)
+
+ @api.model
+ def create(self, values):
+ # 配置层级关系
+ if 'origin' in values and values['origin']:
+ mo = self.env['mrp.production'].search([('name', '=', values['origin'])])
+ if len(mo) == 1:
+ values['parent_id'] = mo.id
+ res = super(MrpProduction, self).create(values)
+ return res
diff --git a/app_mrp_production_chart/static/description/banner.gif b/app_mrp_production_chart/static/description/banner.gif
new file mode 100644
index 00000000..f8c072eb
Binary files /dev/null and b/app_mrp_production_chart/static/description/banner.gif differ
diff --git a/app_mrp_production_chart/static/description/banner.png b/app_mrp_production_chart/static/description/banner.png
new file mode 100644
index 00000000..d67bf6fe
Binary files /dev/null and b/app_mrp_production_chart/static/description/banner.png differ
diff --git a/app_mrp_production_chart/static/description/demo1.jpg b/app_mrp_production_chart/static/description/demo1.jpg
new file mode 100644
index 00000000..03fb1e02
Binary files /dev/null and b/app_mrp_production_chart/static/description/demo1.jpg differ
diff --git a/app_mrp_production_chart/static/description/demo2.jpg b/app_mrp_production_chart/static/description/demo2.jpg
new file mode 100644
index 00000000..632e5db3
Binary files /dev/null and b/app_mrp_production_chart/static/description/demo2.jpg differ
diff --git a/app_mrp_production_chart/static/description/demo4.jpg b/app_mrp_production_chart/static/description/demo4.jpg
new file mode 100644
index 00000000..99cec169
Binary files /dev/null and b/app_mrp_production_chart/static/description/demo4.jpg differ
diff --git a/app_mrp_production_chart/static/description/demo5.jpg b/app_mrp_production_chart/static/description/demo5.jpg
new file mode 100644
index 00000000..de5add33
Binary files /dev/null and b/app_mrp_production_chart/static/description/demo5.jpg differ
diff --git a/app_mrp_production_chart/static/description/demo6.jpg b/app_mrp_production_chart/static/description/demo6.jpg
new file mode 100644
index 00000000..533468d7
Binary files /dev/null and b/app_mrp_production_chart/static/description/demo6.jpg differ
diff --git a/app_mrp_production_chart/static/description/demo7.jpg b/app_mrp_production_chart/static/description/demo7.jpg
new file mode 100644
index 00000000..4673c00e
Binary files /dev/null and b/app_mrp_production_chart/static/description/demo7.jpg differ
diff --git a/app_mrp_production_chart/static/description/demo9.jpg b/app_mrp_production_chart/static/description/demo9.jpg
new file mode 100644
index 00000000..41c9d853
Binary files /dev/null and b/app_mrp_production_chart/static/description/demo9.jpg differ
diff --git a/app_mrp_production_chart/static/description/demo_bom.jpg b/app_mrp_production_chart/static/description/demo_bom.jpg
new file mode 100644
index 00000000..22b68079
Binary files /dev/null and b/app_mrp_production_chart/static/description/demo_bom.jpg differ
diff --git a/app_mrp_production_chart/static/description/demo_mo.jpg b/app_mrp_production_chart/static/description/demo_mo.jpg
new file mode 100644
index 00000000..129af853
Binary files /dev/null and b/app_mrp_production_chart/static/description/demo_mo.jpg differ
diff --git a/app_mrp_production_chart/static/description/icon.png b/app_mrp_production_chart/static/description/icon.png
new file mode 100644
index 00000000..a5a31dfd
Binary files /dev/null and b/app_mrp_production_chart/static/description/icon.png differ
diff --git a/app_mrp_production_chart/static/description/index.html b/app_mrp_production_chart/static/description/index.html
new file mode 100644
index 00000000..73ab7d67
--- /dev/null
+++ b/app_mrp_production_chart/static/description/index.html
@@ -0,0 +1,216 @@
+
+
+
MRP Production Chart Hierarchy, For Multi level MO MRP Production Order from multi bom.
+ Very useful for show parent child relationship, like product category, stock location, hr department
+
+
+

+
+
+
+
+
+
+
+
Key features:
+
+ -
+
+ Easy to make show parent children Chart Hierarchy.
+
+ -
+
+ Free to Use in Manufacture Order multi level. For Multi level MO MRP Production Order from multi bom.
+
+ -
+
+ Free to Use in product category.
+
+ -
+
+ Free to Use in stock location.
+
+ -
+
+ Free to Use in hr department, employee.
+
+ -
+
+ Free to Use in Account chart.
+
+ -
+
+ Free to Use in User Alliance Distribution Multi level.
+
+ -
+
+ It's a widget, you can use it in anywhere in odoo.
+
+
+
+
+
Buy
+
+ this 1 chart hierarchy
+
+ in odoo Store. Get free 5 related free apps.
+
+
+
+
+
+
+
+
+
+
+
MRP Production Chart Hierarchy
+
+

+
+
If we have a multi Bom like follow:
+
+

+
+
Show sub manufacture order and quick access sub MO
+
+

+
+
+
+
+
+
+
+
Product category Chart Hierarchy
+
+

+
+
Show sub category and quick access category
+
+

+
+
+
+
+
+
+
+
Stock Location Chart Hierarchy
+
+

+
+
+
+
+
+
+
+
HR Department Chart Hierarchy
+
+

+
+
HR Emploee Chart Hierarchy (this is include in odoo)
+
+

+
+
+
+
+
+
+
Account Chart Hierarchy
+
+

+
+
+
+
+
+
+
+
User Alliance Distribution Multi level
+
+

+
+
+
+
+
+
+
Easy to setup just use widget='web_chart_hierarchy'. like this
+
+

+
+
Also need to change view for better ui
+
+

+
+
Use follow param to setup widget:
+
image: --the field of image.
+
desc: --the field of subtitle.
+
direct_sub: --the field of sub node.
+
child_all_count: --the field of node count.
+
+
+
+
+
+
+
Technical Help & Support
+
+
+
+
+
diff --git a/app_mrp_production_chart/static/description/setup1.jpg b/app_mrp_production_chart/static/description/setup1.jpg
new file mode 100644
index 00000000..310b1e36
Binary files /dev/null and b/app_mrp_production_chart/static/description/setup1.jpg differ
diff --git a/app_mrp_production_chart/static/description/setup2.jpg b/app_mrp_production_chart/static/description/setup2.jpg
new file mode 100644
index 00000000..0eb197c6
Binary files /dev/null and b/app_mrp_production_chart/static/description/setup2.jpg differ
diff --git a/app_mrp_production_chart/static/img/专家顾问.png b/app_mrp_production_chart/static/img/专家顾问.png
new file mode 100644
index 00000000..20353c64
Binary files /dev/null and b/app_mrp_production_chart/static/img/专家顾问.png differ
diff --git a/app_mrp_production_chart/static/img/值班经理.png b/app_mrp_production_chart/static/img/值班经理.png
new file mode 100644
index 00000000..b8fa6afb
Binary files /dev/null and b/app_mrp_production_chart/static/img/值班经理.png differ
diff --git a/app_mrp_production_chart/static/img/内部往来挂账.png b/app_mrp_production_chart/static/img/内部往来挂账.png
new file mode 100644
index 00000000..68f32682
Binary files /dev/null and b/app_mrp_production_chart/static/img/内部往来挂账.png differ
diff --git a/app_mrp_production_chart/static/img/办公家具.png b/app_mrp_production_chart/static/img/办公家具.png
new file mode 100644
index 00000000..12971616
Binary files /dev/null and b/app_mrp_production_chart/static/img/办公家具.png differ
diff --git a/app_mrp_production_chart/static/img/半成品质检.png b/app_mrp_production_chart/static/img/半成品质检.png
new file mode 100644
index 00000000..37c42899
Binary files /dev/null and b/app_mrp_production_chart/static/img/半成品质检.png differ
diff --git a/app_mrp_production_chart/static/img/原材料.png b/app_mrp_production_chart/static/img/原材料.png
new file mode 100644
index 00000000..57d2bb36
Binary files /dev/null and b/app_mrp_production_chart/static/img/原材料.png differ
diff --git a/app_mrp_production_chart/static/img/成品.png b/app_mrp_production_chart/static/img/成品.png
new file mode 100644
index 00000000..0ad857f4
Binary files /dev/null and b/app_mrp_production_chart/static/img/成品.png differ
diff --git a/app_mrp_production_chart/static/img/所有.png b/app_mrp_production_chart/static/img/所有.png
new file mode 100644
index 00000000..e6d08c65
Binary files /dev/null and b/app_mrp_production_chart/static/img/所有.png differ
diff --git a/app_mrp_production_chart/static/img/旅游.png b/app_mrp_production_chart/static/img/旅游.png
new file mode 100644
index 00000000..a856ca6d
Binary files /dev/null and b/app_mrp_production_chart/static/img/旅游.png differ
diff --git a/app_mrp_production_chart/static/img/服务.png b/app_mrp_production_chart/static/img/服务.png
new file mode 100644
index 00000000..9d5192be
Binary files /dev/null and b/app_mrp_production_chart/static/img/服务.png differ
diff --git a/app_mrp_production_chart/static/img/消耗品.png b/app_mrp_production_chart/static/img/消耗品.png
new file mode 100644
index 00000000..7ec2ccf0
Binary files /dev/null and b/app_mrp_production_chart/static/img/消耗品.png differ
diff --git a/app_mrp_production_chart/static/img/管理.png b/app_mrp_production_chart/static/img/管理.png
new file mode 100644
index 00000000..5cb89a2e
Binary files /dev/null and b/app_mrp_production_chart/static/img/管理.png differ
diff --git a/app_mrp_production_chart/static/img/费用管理.png b/app_mrp_production_chart/static/img/费用管理.png
new file mode 100644
index 00000000..ee5a94aa
Binary files /dev/null and b/app_mrp_production_chart/static/img/费用管理.png differ
diff --git a/app_mrp_production_chart/static/img/软件.png b/app_mrp_production_chart/static/img/软件.png
new file mode 100644
index 00000000..691b5900
Binary files /dev/null and b/app_mrp_production_chart/static/img/软件.png differ
diff --git a/app_mrp_production_chart/static/img/运费.png b/app_mrp_production_chart/static/img/运费.png
new file mode 100644
index 00000000..10c8be96
Binary files /dev/null and b/app_mrp_production_chart/static/img/运费.png differ
diff --git a/app_mrp_production_chart/static/img/销售.png b/app_mrp_production_chart/static/img/销售.png
new file mode 100644
index 00000000..9e8a70a2
Binary files /dev/null and b/app_mrp_production_chart/static/img/销售.png differ
diff --git a/app_mrp_production_chart/views/mrp_production_views.xml b/app_mrp_production_chart/views/mrp_production_views.xml
new file mode 100644
index 00000000..01faebbc
--- /dev/null
+++ b/app_mrp_production_chart/views/mrp_production_views.xml
@@ -0,0 +1,40 @@
+
+
+
+ app.mrp.production.form
+ mrp.production
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Hierarchy Chart
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app_mrp_production_chart/views/product_category_views.xml b/app_mrp_production_chart/views/product_category_views.xml
new file mode 100644
index 00000000..c6f5c5a2
--- /dev/null
+++ b/app_mrp_production_chart/views/product_category_views.xml
@@ -0,0 +1,36 @@
+
+
+
+ app.product.category.form
+ product.category
+
+
+
+
+
+
+
+
+
+
+
Hierarchy Chart
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app_product_category_chart/__manifest__.py b/app_product_category_chart/__manifest__.py
index aaf6b725..563048f0 100644
--- a/app_product_category_chart/__manifest__.py
+++ b/app_product_category_chart/__manifest__.py
@@ -34,6 +34,7 @@
Free for category Hierarchy chart, stock Hierarchy chart. account chart.
""",
'description': """
+Need extra paid apps https://www.odoo.com/apps/modules/13.0/app_web_chart_hierarchy/
This module extend to show a Hierarchy chart.
(N+1, N+2, direct subordinates)
image: image_field,
diff --git a/app_product_category_chart/static/description/banner.gif b/app_product_category_chart/static/description/banner.gif
index 54fb9413..f8c072eb 100644
Binary files a/app_product_category_chart/static/description/banner.gif and b/app_product_category_chart/static/description/banner.gif differ
diff --git a/app_product_category_chart/static/description/demo_bom.jpg b/app_product_category_chart/static/description/demo_bom.jpg
new file mode 100644
index 00000000..22b68079
Binary files /dev/null and b/app_product_category_chart/static/description/demo_bom.jpg differ
diff --git a/app_product_category_chart/static/description/demo_mo.jpg b/app_product_category_chart/static/description/demo_mo.jpg
new file mode 100644
index 00000000..129af853
Binary files /dev/null and b/app_product_category_chart/static/description/demo_mo.jpg differ
diff --git a/app_product_category_chart/static/description/index.html b/app_product_category_chart/static/description/index.html
index 3c5ca9a9..0ba3a4a9 100644
--- a/app_product_category_chart/static/description/index.html
+++ b/app_product_category_chart/static/description/index.html
@@ -14,6 +14,10 @@
Easy to make show parent children Chart Hierarchy.
+
+
+ Free to Use in Manufacture Order multi level. For Multi level MO MRP Production Order from multi bom.
+
Free to Use in product category.
@@ -55,6 +59,10 @@
+
+
+
+
MRP Production Chart Hierarchy
+
+

+
+
If we have a multi Bom like follow:
+
+

+
+
Show sub manufacture order and quick access sub MO
+
+

+
+
+
+