update app-odoo
3
app_mrp_production_zchart/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import models
|
||||||
75
app_mrp_production_zchart/__manifest__.py
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
# -*- 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 zChart Hierarchy, 生产单多层级结构图',
|
||||||
|
'version': '13.20.08.20',
|
||||||
|
'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. MRP Hierarchy. MO hierarchy
|
||||||
|
Chart Hierarchy Widget. Hierarchy Chart, Hierarchy Tree for multi level Parent Children relation tree.
|
||||||
|
""",
|
||||||
|
'description': """
|
||||||
|
MRP Hierarchy chart, MO Hierarchy chart, mrp multi level.
|
||||||
|
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',
|
||||||
|
],
|
||||||
|
# 不要误装别的,避免冲突
|
||||||
|
'excludes': [
|
||||||
|
'app_mrp_production_chart',
|
||||||
|
],
|
||||||
|
'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,
|
||||||
|
}
|
||||||
2
app_mrp_production_zchart/controllers/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# -*- coding: utf-8 -*
|
||||||
|
|
||||||
53
app_mrp_production_zchart/i18n/zh_CN.po
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * app_mrp_production_zchart
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 13.0+e\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2020-08-20 13:10+0000\n"
|
||||||
|
"PO-Revision-Date: 2020-08-20 13:10+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_mrp_production_zchart
|
||||||
|
#: model:ir.model.fields,field_description:app_mrp_production_zchart.field_mrp_production__image_128
|
||||||
|
msgid "Image 128"
|
||||||
|
msgstr "图片"
|
||||||
|
|
||||||
|
#. module: app_mrp_production_zchart
|
||||||
|
#: model:ir.model.fields,field_description:app_mrp_production_zchart.field_mrp_production__child_all_count
|
||||||
|
msgid "Indirect Surbordinates Count"
|
||||||
|
msgstr "子生产单数量"
|
||||||
|
|
||||||
|
#. module: app_mrp_production_zchart
|
||||||
|
#: model:ir.model.fields,field_description:app_mrp_production_zchart.field_mrp_production__parent_id
|
||||||
|
msgid "Parent Manufacturing"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: app_mrp_production_zchart
|
||||||
|
#: model:ir.model.fields,field_description:app_mrp_production_zchart.field_mrp_production__parent_path
|
||||||
|
msgid "Parent Path"
|
||||||
|
msgstr "上级生产订单"
|
||||||
|
|
||||||
|
#. module: app_mrp_production_zchart
|
||||||
|
#: model:ir.model,name:app_mrp_production_zchart.model_mrp_production
|
||||||
|
msgid "Production Order"
|
||||||
|
msgstr "生产订单"
|
||||||
|
|
||||||
|
#. module: app_mrp_production_zchart
|
||||||
|
#: model:ir.model.fields,field_description:app_mrp_production_zchart.field_mrp_production__child_ids
|
||||||
|
msgid "Sub Manufacturing"
|
||||||
|
msgstr "子生产订单"
|
||||||
|
|
||||||
|
#. module: app_mrp_production_zchart
|
||||||
|
#: model:ir.model.fields,help:app_mrp_production_zchart.field_mrp_production__parent_id
|
||||||
|
msgid ""
|
||||||
|
"The parent manufacturing orders that generate this order. Follow the rule of"
|
||||||
|
" multi level bom."
|
||||||
|
msgstr "本生产订单的来源生产订单,根据多级Bom生成"
|
||||||
3
app_mrp_production_zchart/models/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import mrp_production
|
||||||
41
app_mrp_production_zchart/models/mrp_production.py
Normal file
@@ -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'])], limit=1, order='id desc')
|
||||||
|
if len(mo) == 1:
|
||||||
|
values['parent_id'] = mo[0].id
|
||||||
|
res = super(MrpProduction, self).create(values)
|
||||||
|
return res
|
||||||
BIN
app_mrp_production_zchart/static/description/banner.png
Normal file
|
After Width: | Height: | Size: 234 KiB |
BIN
app_mrp_production_zchart/static/description/icon.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
216
app_mrp_production_zchart/static/description/index.html
Normal file
@@ -0,0 +1,216 @@
|
|||||||
|
<section class="oe_container">
|
||||||
|
<div class="oe_row oe_spaced" style="max-width: 95%;">
|
||||||
|
<h2 class="oe_slogan" style="color:#875A7B;">MRP Production Chart Hierarchy, For Multi level MO MRP Production Order from multi bom.</h2>
|
||||||
|
<h3 class="oe_slogan">Very useful for show parent child relationship, like product category, stock location, hr department</h3>
|
||||||
|
</div>
|
||||||
|
<div class="oe_demo">
|
||||||
|
<img class="oe_demo oe_screenshot" src="banner.gif">
|
||||||
|
</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 show parent children Chart Hierarchy.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-check-square-o text-primary"></i>
|
||||||
|
Free to Use in Manufacture Order multi level. For Multi level MO MRP Production Order from multi bom.
|
||||||
|
</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>
|
||||||
|
Free to Use in Account chart.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-check-square-o text-primary"></i>
|
||||||
|
Free to Use in User Alliance Distribution Multi level.
|
||||||
|
</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>
|
||||||
|
|
||||||
|
<h1 class="text-danger text-center">Buy
|
||||||
|
<a href="https://www.odoo.com/apps/modules/13.0/app_web_chart_hierarchy/">
|
||||||
|
this 1 chart hierarchy
|
||||||
|
</a>
|
||||||
|
in odoo Store. Get free 5 related free apps.
|
||||||
|
</a>
|
||||||
|
</h1>
|
||||||
|
<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/13.0/app_mrp_production_zchart/" target="_blank">MRP Production Chart Hierarchy</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-link text-primary"></i>
|
||||||
|
<a href="http://www.odoo.com/apps/modules/13.0/app_product_category_chart/" target="_blank">Product category chart hierarchy</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-link text-primary"></i>
|
||||||
|
<a href="http://www.odoo.com/apps/modules/13.0/app_stock_location_chart/" target="_blank">Stock Location chart hierarchy</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-link text-primary"></i>
|
||||||
|
<a href="http://www.odoo.com/apps/modules/13.0/app_hr_department_chart/" target="_blank">hr department employee chart hierarchy</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-link text-primary"></i>
|
||||||
|
<a href="http://www.odoo.com/apps/modules/13.0/app_account_account_chart/" target="_blank">Account chart hierarchy(chinese only)</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-link text-primary"></i>
|
||||||
|
<a href="http://www.odoo.com/apps/modules/13.0/app_users_chart_hierarchy/" target="_blank">User Alliance Distribution Multi level</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="oe_container">
|
||||||
|
<div class="oe_row oe_spaced">
|
||||||
|
<h1> </h1>
|
||||||
|
<h1 class="text-danger text-center">MRP Production Chart Hierarchy</h1>
|
||||||
|
<div class="oe_demo oe_screenshot">
|
||||||
|
<img src="demo1.jpg">
|
||||||
|
</div>
|
||||||
|
<h4 class="oe_slogan">If we have a multi Bom like follow:</h4>
|
||||||
|
<div class="oe_demo oe_screenshot">
|
||||||
|
<img src="demo_bom.jpg">
|
||||||
|
</div>
|
||||||
|
<h4 class="oe_slogan">Show sub manufacture order and quick access sub MO</h4>
|
||||||
|
<div class="oe_demo oe_screenshot">
|
||||||
|
<img src="demo_mo.jpg">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="oe_container">
|
||||||
|
<div class="oe_row oe_spaced">
|
||||||
|
<h1> </h1>
|
||||||
|
<h1 class="text-danger text-center">Product category Chart Hierarchy</h1>
|
||||||
|
<div class="oe_demo oe_screenshot">
|
||||||
|
<img src="demo1.jpg">
|
||||||
|
</div>
|
||||||
|
<h4 class="oe_slogan">Show sub category and quick access category</h4>
|
||||||
|
<div class="oe_demo oe_screenshot">
|
||||||
|
<img src="demo2.jpg">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="oe_container">
|
||||||
|
<div class="oe_row oe_spaced">
|
||||||
|
<h1> </h1>
|
||||||
|
<h1 class="text-danger text-center">Stock Location Chart Hierarchy</h1>
|
||||||
|
<div class="oe_demo oe_screenshot">
|
||||||
|
<img src="demo4.jpg">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="oe_container">
|
||||||
|
<div class="oe_row oe_spaced">
|
||||||
|
<h1> </h1>
|
||||||
|
<h1 class="text-danger text-center">HR Department Chart Hierarchy</h1>
|
||||||
|
<div class="oe_demo oe_screenshot">
|
||||||
|
<img src="demo5.jpg">
|
||||||
|
</div>
|
||||||
|
<h1 class="text-danger text-center">HR Emploee Chart Hierarchy (this is include in odoo)</h1>
|
||||||
|
<div class="oe_demo oe_screenshot">
|
||||||
|
<img src="demo6.jpg">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<section class="oe_container">
|
||||||
|
<div class="oe_row oe_spaced">
|
||||||
|
<h1> </h1>
|
||||||
|
<h1 class="text-danger text-center">Account Chart Hierarchy</h1>
|
||||||
|
<div class="oe_demo oe_screenshot">
|
||||||
|
<img src="demo7.jpg">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="oe_container">
|
||||||
|
<div class="oe_row oe_spaced">
|
||||||
|
<h1> </h1>
|
||||||
|
<h1 class="text-danger text-center">User Alliance Distribution Multi level</h1>
|
||||||
|
<div class="oe_demo oe_screenshot">
|
||||||
|
<img src="demo9.jpg">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="oe_container">
|
||||||
|
<div class="oe_row oe_spaced">
|
||||||
|
<h4 class="oe_slogan">Easy to setup just use widget='web_chart_hierarchy'. like this</h4>
|
||||||
|
<div class="oe_demo oe_screenshot">
|
||||||
|
<img src="setup1.jpg">
|
||||||
|
</div>
|
||||||
|
<h4 class="oe_slogan">Also need to change view for better ui</h4>
|
||||||
|
<div class="oe_demo oe_screenshot">
|
||||||
|
<img src="setup2.jpg">
|
||||||
|
</div>
|
||||||
|
<h1><br/> Use follow param to setup widget:<br/></h1>
|
||||||
|
<h4>image: --the field of image.</h4>
|
||||||
|
<h4>desc: --the field of subtitle.</h4>
|
||||||
|
<h4>direct_sub: --the field of sub node.</h4>
|
||||||
|
<h4>child_all_count: --the field of node count.</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">
|
||||||
|
<p><h4>
|
||||||
|
Visit our website for more support.</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="https://www.sunpop.cn" target="_blank"><span
|
||||||
|
style="height: 354px; width: 354px; top: -147.433px; left: -6.93335px;" class="o_ripple"></span>
|
||||||
|
<i class="fa fa-web"></i>https://www.sunpop.cn</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
BIN
app_mrp_production_zchart/static/description/setup1.jpg
Normal file
|
After Width: | Height: | Size: 69 KiB |
BIN
app_mrp_production_zchart/static/description/setup2.jpg
Normal file
|
After Width: | Height: | Size: 37 KiB |
22
app_mrp_production_zchart/views/mrp_production_views.xml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<record model="ir.ui.view" id="app_mrp_production_form_view">
|
||||||
|
<field name="name">app.mrp.production.form</field>
|
||||||
|
<field name="model">mrp.production</field>
|
||||||
|
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='origin']" position="after">
|
||||||
|
<field name="parent_id" groups="base.group_no_one" readonly="0"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//div[hasclass('oe_title')]" position="before">
|
||||||
|
<field name="image_128" widget="image" class="oe_avatar"
|
||||||
|
options="{'preview_image': 'image_128', 'size': [90, 90]}"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//group[1]" position="inside">
|
||||||
|
<group>
|
||||||
|
<field name="child_ids" widget="ztree_chart" nolabel="1"/>
|
||||||
|
</group>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
||||||
@@ -22,10 +22,28 @@ class MrpWorkCenter(models.Model):
|
|||||||
child_all_count = fields.Integer(
|
child_all_count = fields.Integer(
|
||||||
'Indirect Surbordinates Count',
|
'Indirect Surbordinates Count',
|
||||||
compute='_compute_child_all_count', store=False)
|
compute='_compute_child_all_count', store=False)
|
||||||
parent_path = fields.Char(index=True)
|
level = fields.Integer('级别', compute='_compute_level', inverse='_set_level', default=0, store=True)
|
||||||
|
|
||||||
@api.depends('child_ids.child_all_count')
|
@api.depends('child_ids.child_all_count')
|
||||||
def _compute_child_all_count(self):
|
def _compute_child_all_count(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
rec.child_all_count = len(rec.child_ids) + sum(child.child_all_count for child in rec.child_ids)
|
rec.child_all_count = len(rec.child_ids) + sum(child.child_all_count for child in rec.child_ids)
|
||||||
|
|
||||||
|
|
||||||
|
@api.onchange('parent_id')
|
||||||
|
def _onchange_level(self):
|
||||||
|
level = 0
|
||||||
|
if self.parent_id:
|
||||||
|
level = self.parent_id.level + 1
|
||||||
|
self.level = level
|
||||||
|
|
||||||
|
@api.depends('parent_id', 'parent_id.level')
|
||||||
|
def _compute_level(self):
|
||||||
|
for rec in self:
|
||||||
|
level = 0
|
||||||
|
if rec.parent_id:
|
||||||
|
level = rec.parent_id.level + 1
|
||||||
|
rec.level = level
|
||||||
|
|
||||||
|
def _set_level(self):
|
||||||
|
pass
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='name']" position="after">
|
<xpath expr="//field[@name='name']" position="after">
|
||||||
<field name="parent_id" widget="ztree_select"/>
|
<field name="parent_id" widget="ztree_select"/>
|
||||||
|
<field name="level"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='name']" position="replace"/>
|
<xpath expr="//field[@name='name']" position="replace"/>
|
||||||
<xpath expr="//field[@name='costs_hour']" position="after">
|
<xpath expr="//field[@name='costs_hour']" position="after">
|
||||||
@@ -56,6 +57,7 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='name']" position="after">
|
<xpath expr="//field[@name='name']" position="after">
|
||||||
<field name="parent_id"/>
|
<field name="parent_id"/>
|
||||||
|
<field name="level"/>
|
||||||
<field name="note"/>
|
<field name="note"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
|
|||||||
6
app_mrp_workcenter_zchart/__init__.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import models
|
||||||
|
from .hooks import pre_init_hook
|
||||||
|
from .hooks import post_init_hook
|
||||||
|
from .hooks import uninstall_hook
|
||||||
88
app_mrp_workcenter_zchart/__manifest__.py
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Created on 2019-05-26
|
||||||
|
# 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/zh_CN/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/
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Copyright (C) 2009-TODAY Sunpop.cn Ltd. https://www.sunpop.cn
|
||||||
|
# Author: Ivan Deng,300883@qq.com
|
||||||
|
# You can modify it under the terms of the GNU LESSER
|
||||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
|
||||||
|
# See <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
# It is forbidden to publish, distribute, sublicense, or sell copies
|
||||||
|
# of the Software or modified copies of the Software.
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
{
|
||||||
|
'name': "MRP Workcenter zChart Parent Child Hierarchy,工作中心分级",
|
||||||
|
'version': '13.20.08.20',
|
||||||
|
'author': 'Sunpop.cn',
|
||||||
|
'category': 'Base',
|
||||||
|
'website': 'https://www.sunpop.cn',
|
||||||
|
'license': 'LGPL-3',
|
||||||
|
'sequence': 2,
|
||||||
|
'price': 0.00,
|
||||||
|
'currency': 'EUR',
|
||||||
|
'images': ['static/description/banner.png'],
|
||||||
|
'depends': [
|
||||||
|
'mrp_workorder',
|
||||||
|
'app_mrp_superbar',
|
||||||
|
],
|
||||||
|
# 不要误装别的,避免冲突
|
||||||
|
'excludes': [
|
||||||
|
'app_mrp_production_chart',
|
||||||
|
],
|
||||||
|
'summary': """
|
||||||
|
Odoo App of Sunpop.cn
|
||||||
|
""",
|
||||||
|
'description': """
|
||||||
|
Support Odoo 12, 11, Enterprise and Community Edition
|
||||||
|
1. D
|
||||||
|
2.
|
||||||
|
11. Multi-language Support.
|
||||||
|
12. Multi-Company Support.
|
||||||
|
==========
|
||||||
|
1.
|
||||||
|
2.
|
||||||
|
11. 多语言支持
|
||||||
|
12. 多公司支持
|
||||||
|
""",
|
||||||
|
'data': [
|
||||||
|
# 'security/*.xml',
|
||||||
|
# 'security/ir.model.access.csv.csv',
|
||||||
|
# 'data/*.xml',
|
||||||
|
'views/mrp_workcenter_views.xml',
|
||||||
|
'views/mrp_workorder_views.xml',
|
||||||
|
],
|
||||||
|
'qweb': [
|
||||||
|
'static/src/xml/*.xml',
|
||||||
|
],
|
||||||
|
'demo': [],
|
||||||
|
'test': [],
|
||||||
|
'css': [],
|
||||||
|
'js': [],
|
||||||
|
# 'pre_init_hook': 'pre_init_hook',
|
||||||
|
# 'post_init_hook': 'post_init_hook',
|
||||||
|
# 'uninstall_hook': 'uninstall_hook',
|
||||||
|
'installable': True,
|
||||||
|
'application': True,
|
||||||
|
'auto_install': False,
|
||||||
|
}
|
||||||
32
app_mrp_workcenter_zchart/hooks.py
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Created on 2018-10-12
|
||||||
|
# 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, SUPERUSER_ID, _
|
||||||
|
|
||||||
|
|
||||||
|
def pre_init_hook(cr):
|
||||||
|
pass
|
||||||
|
# cr.execute("")
|
||||||
|
|
||||||
|
def post_init_hook(cr, registry):
|
||||||
|
pass
|
||||||
|
# cr.execute("")
|
||||||
|
|
||||||
|
def uninstall_hook(cr, registry):
|
||||||
|
pass
|
||||||
|
# cr.execute("")
|
||||||
|
|
||||||
52
app_mrp_workcenter_zchart/i18n/zh_CN.po
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * app_mrp_workcenter_zchart
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 13.0+e\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2020-08-20 13:30+0000\n"
|
||||||
|
"PO-Revision-Date: 2020-08-20 13:30+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_mrp_workcenter_zchart
|
||||||
|
#: model:ir.model.fields,field_description:app_mrp_workcenter_zchart.field_mrp_workcenter__child_ids
|
||||||
|
msgid "Child WCs"
|
||||||
|
msgstr "下级工作中心"
|
||||||
|
|
||||||
|
#. module: app_mrp_workcenter_zchart
|
||||||
|
#: model:ir.model.fields,field_description:app_mrp_workcenter_zchart.field_mrp_workcenter__child_all_count
|
||||||
|
msgid "Indirect Surbordinates Count"
|
||||||
|
msgstr "非直属下级数量"
|
||||||
|
|
||||||
|
#. module: app_mrp_workcenter_zchart
|
||||||
|
#: model:ir.model.fields,field_description:app_mrp_workcenter_zchart.field_mrp_workcenter__parent_path
|
||||||
|
msgid "Parent Path"
|
||||||
|
msgstr "父级路径"
|
||||||
|
|
||||||
|
#. module: app_mrp_workcenter_zchart
|
||||||
|
#: model:ir.model.fields,field_description:app_mrp_workcenter_zchart.field_mrp_workcenter__parent_id
|
||||||
|
#: model_terms:ir.ui.view,arch_db:app_mrp_workcenter_zchart.app_view_mrp_workcenter_search
|
||||||
|
msgid "Parent WC"
|
||||||
|
msgstr "上级工作中心"
|
||||||
|
|
||||||
|
#. module: app_mrp_workcenter_zchart
|
||||||
|
#: model:ir.model,name:app_mrp_workcenter_zchart.model_mrp_workcenter
|
||||||
|
msgid "Work Center"
|
||||||
|
msgstr "工作中心"
|
||||||
|
|
||||||
|
#. module: app_mrp_workcenter_zchart
|
||||||
|
#: model_terms:ir.ui.view,arch_db:app_mrp_workcenter_zchart.app_view_mrp_workcenter_search
|
||||||
|
msgid "code"
|
||||||
|
msgstr "编码"
|
||||||
|
|
||||||
|
#. module: app_mrp_workcenter_zchart
|
||||||
|
#: model:ir.model.fields,field_description:app_mrp_workcenter_zchart.field_mrp_workcenter__level
|
||||||
|
msgid "Level"
|
||||||
|
msgstr "级别"
|
||||||
3
app_mrp_workcenter_zchart/models/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import mrp_workcenter
|
||||||
48
app_mrp_workcenter_zchart/models/mrp_workcenter.py
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from odoo import api, fields, models, tools, _
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
class MrpWorkCenter(models.Model):
|
||||||
|
_inherit = 'mrp.workcenter'
|
||||||
|
|
||||||
|
# 建立层级关系
|
||||||
|
_parent_name = "parent_id"
|
||||||
|
_parent_store = True
|
||||||
|
_parent_order = 'code'
|
||||||
|
|
||||||
|
parent_id = fields.Many2one('mrp.workcenter', 'Parent WC', index=True, ondelete='cascade')
|
||||||
|
parent_path = fields.Char(index=True)
|
||||||
|
child_ids = fields.One2many('mrp.workcenter', 'parent_id', 'Child WCs')
|
||||||
|
child_all_count = fields.Integer(
|
||||||
|
'Indirect Surbordinates Count',
|
||||||
|
compute='_compute_child_all_count', store=False)
|
||||||
|
level = fields.Integer('Level', compute='_compute_level', inverse='_set_level', default=0, store=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.onchange('parent_id')
|
||||||
|
def _onchange_level(self):
|
||||||
|
level = 0
|
||||||
|
if self.parent_id:
|
||||||
|
level = self.parent_id.level + 1
|
||||||
|
self.level = level
|
||||||
|
|
||||||
|
@api.depends('parent_id', 'parent_id.level')
|
||||||
|
def _compute_level(self):
|
||||||
|
for rec in self:
|
||||||
|
level = 0
|
||||||
|
if rec.parent_id:
|
||||||
|
level = rec.parent_id.level + 1
|
||||||
|
rec.level = level
|
||||||
|
|
||||||
|
def _set_level(self):
|
||||||
|
pass
|
||||||
2
app_mrp_workcenter_zchart/report/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
51
app_mrp_workcenter_zchart/security/app_security.xml
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<data noupdate="1">
|
||||||
|
<!-- model权限 -->
|
||||||
|
<record id="acc_module" model="ir.model.access">
|
||||||
|
<field name="name">acc_module_user</field>
|
||||||
|
<field name="model_id" ref="model_app_order"/>
|
||||||
|
<field name="group_id" ref="base.group_user"/>
|
||||||
|
<field name="perm_read" eval="1"/>
|
||||||
|
<field name="perm_write" eval="1"/>
|
||||||
|
<field name="perm_create" eval="1"/>
|
||||||
|
<field name="perm_unlink" eval="1"/>
|
||||||
|
</record>
|
||||||
|
<!-- 应用权限目录 -->
|
||||||
|
<record model="ir.module.category" id="app_module_category_1">
|
||||||
|
<field name="name">App...</field>
|
||||||
|
<field name="description">Helps you manage your ...</field>
|
||||||
|
<field name="sequence">8</field>
|
||||||
|
</record>
|
||||||
|
<!-- 权限用户 -->
|
||||||
|
<!-- 普通 -->
|
||||||
|
<record id="group_app_user" model="res.groups">
|
||||||
|
<field name="name">App User</field>
|
||||||
|
<field name="category_id" ref="app_module_category_1"/>
|
||||||
|
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
|
||||||
|
<field name="comment">The user will be able to ...</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- 管理员,可以配置 -->
|
||||||
|
<record id="group_app_admin" model="res.groups">
|
||||||
|
<field name="name">App Admin</field>
|
||||||
|
<field name="category_id" ref="app_module_category_1"/>
|
||||||
|
<field name="implied_ids" eval="[(4, ref('group_app_user'))]"/>
|
||||||
|
<field name="comment">The user will be able to config ...</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- group_erp_manager自动有完整权限 -->
|
||||||
|
<record id="base.group_erp_manager" model="res.groups">
|
||||||
|
<field name="implied_ids" eval="[(4, ref('group_app_admin'))]"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- Rules -->
|
||||||
|
<record id="rule_user" model="ir.rule">
|
||||||
|
<field name="name">Users are allowed to access their own m///</field>
|
||||||
|
<field name="model_id" ref="model_app_order"/>
|
||||||
|
<field name="domain_force">['|', ('partner_id', 'in', [user.partner_id.id]), ('user_id.id', '=', user.id)]</field>
|
||||||
|
<field name="groups" eval="[(4, ref('base.group_user'))]"/>
|
||||||
|
</record>
|
||||||
|
<!--End -->
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
1
app_mrp_workcenter_zchart/security/ir.model.access.csv
Normal file
@@ -0,0 +1 @@
|
|||||||
|
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||||
|
BIN
app_mrp_workcenter_zchart/static/description/banner.png
Normal file
|
After Width: | Height: | Size: 238 KiB |
BIN
app_mrp_workcenter_zchart/static/description/icon.png
Normal file
|
After Width: | Height: | Size: 71 KiB |
73
app_mrp_workcenter_zchart/static/description/index.html
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
<section class="oe_container">
|
||||||
|
<div class="oe_row oe_spaced" >
|
||||||
|
<div class="oe_span12">
|
||||||
|
<h2 class="oe_slogan"> </h2>
|
||||||
|
<h3 class="oe_slogan"> </h3>
|
||||||
|
<div class="oe_row">
|
||||||
|
<h3>Lastest update: v12.19.04.28</h3>
|
||||||
|
<div class="oe_span12">
|
||||||
|
<img class="oe_demo oe_screenshot" style="max-height: 100%;" src="banner.png">
|
||||||
|
</div>
|
||||||
|
<div class="oe_span12 oe_spaced">
|
||||||
|
<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>
|
||||||
|
Put key function here.
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="oe_container">
|
||||||
|
<div class="oe_row oe_spaced">
|
||||||
|
<h1 class="text-danger text-center">So Easy to navigator and search any data.</h1>
|
||||||
|
<h4 class="oe_slogan"> </h4>
|
||||||
|
<div class="oe_demo oe_screenshot">
|
||||||
|
<img src=".jpg"/>
|
||||||
|
</div>
|
||||||
|
</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">
|
||||||
|
<p><h4>
|
||||||
|
Visit our website for more support.</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="https://www.sunpop.cn" target="_blank"><span
|
||||||
|
style="height: 354px; width: 354px; top: -147.433px; left: -6.93335px;" class="o_ripple"></span>
|
||||||
|
<i class="fa fa-web"></i>https://www.sunpop.cn</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="oe_row oe_spaced text-center">
|
||||||
|
<h1>More Powerful addons, Make your odoo very easy to use, easy customize:
|
||||||
|
<a class="btn btn-primary mb16" href="http://www.odoo.com/apps/modules/browse?author=Sunpop.cn">Supop.cn Odoo Addons</a>
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
BIN
app_mrp_workcenter_zchart/static/img/icon_sunpop.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
app_mrp_workcenter_zchart/static/img/logo_sunpop.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
84
app_mrp_workcenter_zchart/views/mrp_workcenter_views.xml
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<odoo>
|
||||||
|
<record id="app_mrp_workcenter_view" model="ir.ui.view">
|
||||||
|
<field name="name">mrp.workcenter.form</field>
|
||||||
|
<field name="model">mrp.workcenter</field>
|
||||||
|
<field name="inherit_id" ref="mrp.mrp_workcenter_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='name']" position="after">
|
||||||
|
<field name="parent_id" widget="ztree_select"/>
|
||||||
|
<field name="level"/>
|
||||||
|
</xpath>
|
||||||
|
<!-- 引入树结构图 -->
|
||||||
|
<xpath expr="//group[1]" position="inside">
|
||||||
|
<group>
|
||||||
|
<field name="child_ids" widget="ztree_chart" nolabel="1"/>
|
||||||
|
</group>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="app_mrp_workcenter_tree_view" model="ir.ui.view">
|
||||||
|
<field name="name">mrp.workcenter.tree</field>
|
||||||
|
<field name="model">mrp.workcenter</field>
|
||||||
|
<field name="inherit_id" ref="mrp.mrp_workcenter_tree_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='name']" position="after">
|
||||||
|
<field name="parent_id"/>
|
||||||
|
<field name="level"/>
|
||||||
|
<field name="note"/>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
<!--常规kanban-->
|
||||||
|
<record id="app_mrp_workcenter_view_kanban" model="ir.ui.view">
|
||||||
|
<field name="name">app.mrp.workcenter.kanban1</field>
|
||||||
|
<field name="model">mrp.workcenter</field>
|
||||||
|
<field name="inherit_id" ref="mrp.mrp_workcenter_view_kanban"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//kanban" position="attributes">
|
||||||
|
<attribute name="default_group_by">parent_id</attribute>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
<!-- 工单kanban-->
|
||||||
|
<record id="app_mrp_workcenter_kanban" model="ir.ui.view">
|
||||||
|
<field name="name">app.mrp.workcenter.kanban2</field>
|
||||||
|
<field name="model">mrp.workcenter</field>
|
||||||
|
<field name="inherit_id" ref="mrp.mrp_workcenter_kanban"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//kanban/field[1]" position="after">
|
||||||
|
<field name="code"/>
|
||||||
|
<field name="note"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//templates//field[@name='name']" position="before">
|
||||||
|
<span t-if="record.code.raw_value">[<field name="code"/>]</span>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- 增加字段,superbar -->
|
||||||
|
<record id="app_view_mrp_workcenter_search" model="ir.ui.view">
|
||||||
|
<field name="name">mrp.workcenter.search</field>
|
||||||
|
<field name="model">mrp.workcenter</field>
|
||||||
|
<field name="inherit_id" ref="mrp.view_mrp_workcenter_search"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='name']" position="after">
|
||||||
|
<field name="code" string="code"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//group" position="inside">
|
||||||
|
<filter string="Parent WC" name="group_by_parent_id" context="{'group_by':'parent_id'}"/>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//search" position="inside">
|
||||||
|
<searchpanel view_types="kanban,tree">
|
||||||
|
<field name="parent_id" filter_domain="[('child_ids', '!=', False)]"/>
|
||||||
|
</searchpanel>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="mrp.mrp_workcenter_kanban_action" model="ir.actions.act_window">
|
||||||
|
<field name="context">{'search_default_group_by_parent_id':1}</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
||||||
14
app_mrp_workcenter_zchart/views/mrp_workorder_views.xml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<!--搜索加 superbar-->
|
||||||
|
<record model="ir.ui.view" id="app_view_mrp_production_workorder_form_view_filter">
|
||||||
|
<field name="name">app.mrp.production.work.order.select</field>
|
||||||
|
<field name="model">mrp.workorder</field>
|
||||||
|
<field name="inherit_id" ref="app_mrp_superbar.app_view_mrp_production_workorder_form_view_filter"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//searchpanel//field[@name='workcenter_id']" position="replace">
|
||||||
|
<field name="workcenter_id"/>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
||||||