update app-odoo

This commit is contained in:
ivan deng
2020-08-21 13:02:14 +08:00
parent eaecdf56fd
commit 6f749af1be
30 changed files with 890 additions and 1 deletions

View 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

View 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 Deng300883@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,
}

View 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("")

View 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 "级别"

View File

@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import mrp_workcenter

View 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

View File

@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-

View 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>

View File

@@ -0,0 +1 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View 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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View 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>

View 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>