fix auto partner ref

This commit is contained in:
ivan deng
2020-01-06 23:06:31 +08:00
parent 80cef3d182
commit 0dbd5e09ee
18 changed files with 524 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,84 @@
# -*- 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 Parent Child Hierarchy,工作中心分级",
'version': '13.20.01.06',
'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',
],
'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,88 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * app_mrp_workcenter_chart
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0+e-20190512\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-07-28 18:19+0000\n"
"PO-Revision-Date: 2019-07-28 18:19+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_chart
#: model:ir.model.fields,field_description:app_mrp_workcenter_chart.field_mrp_workcenter__child_ids
msgid "Child WCs"
msgstr "下级工作中心"
#. module: app_mrp_workcenter_chart
#: model_terms:ir.ui.view,arch_db:app_mrp_workcenter_chart.app_mrp_workcenter_view
msgid "Hierarchy Chart"
msgstr "工作中心层级"
#. module: app_mrp_workcenter_chart
#: model:ir.model.fields,field_description:app_mrp_workcenter_chart.field_mrp_workcenter__image
msgid "Image"
msgstr "图像"
#. module: app_mrp_workcenter_chart
#: model:ir.model.fields,field_description:app_mrp_workcenter_chart.field_mrp_workcenter__child_all_count
msgid "Indirect Surbordinates Count"
msgstr "非直属下级数量"
#. module: app_mrp_workcenter_chart
#: model:ir.model.fields,field_description:app_mrp_workcenter_chart.field_mrp_workcenter__image_medium
msgid "Medium-sized image"
msgstr "中等尺寸图像"
#. module: app_mrp_workcenter_chart
#: model:ir.model.fields,help:app_mrp_workcenter_chart.field_mrp_workcenter__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_mrp_workcenter_chart
#: model:ir.model.fields,field_description:app_mrp_workcenter_chart.field_mrp_workcenter__parent_path
msgid "Parent Path"
msgstr "父级路径"
#. module: app_mrp_workcenter_chart
#: model:ir.model.fields,field_description:app_mrp_workcenter_chart.field_mrp_workcenter__parent_id
#: model_terms:ir.ui.view,arch_db:app_mrp_workcenter_chart.app_view_mrp_workcenter_search
msgid "Parent WC"
msgstr "上级工作中心"
#. module: app_mrp_workcenter_chart
#: model_terms:ir.ui.view,arch_db:app_mrp_workcenter_chart.app_mrp_workcenter_view
msgid "Please get widget from https://apps.odoo.com/apps/modules/12.0/app_web_chart_hierarchy/"
msgstr ""
#. module: app_mrp_workcenter_chart
#: model:ir.model.fields,field_description:app_mrp_workcenter_chart.field_mrp_workcenter__image_small
msgid "Small-sized image"
msgstr "小尺寸图像"
#. module: app_mrp_workcenter_chart
#: model:ir.model.fields,help:app_mrp_workcenter_chart.field_mrp_workcenter__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_mrp_workcenter_chart
#: model:ir.model.fields,help:app_mrp_workcenter_chart.field_mrp_workcenter__image
msgid "This field holds the image used as avatar for this category, limited to 1024x1024px"
msgstr ""
#. module: app_mrp_workcenter_chart
#: model:ir.model,name:app_mrp_workcenter_chart.model_mrp_workcenter
msgid "Work Center"
msgstr "工作中心"
#. module: app_mrp_workcenter_chart
#: model_terms:ir.ui.view,arch_db:app_mrp_workcenter_chart.app_mrp_workcenter_view
msgid "Work Center Name"
msgstr "工作中心名称"

View File

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

View File

@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
from odoo import api, fields, models, tools, _
import logging
_logger = logging.getLogger(__name__)
class MrpWorkCenter(models.Model):
_name = 'mrp.workcenter'
_inherit = ['mrp.workcenter', 'image.mixin']
# 建立层级关系
_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)
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)

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: 241 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,116 @@
<?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"/>
</xpath>
<!-- <xpath expr="//field[@name='code']" position="after">-->
<!-- <field name="sequence"/>-->
<!-- </xpath>-->
<xpath expr="//field[@name='name']" position="replace"/>
<xpath expr="//field[@name='costs_hour']" position="after">
<xpath expr="//field[@name='resource_calendar_id']" position="move"/>
</xpath>
<!-- 引入树结构图 -->
<xpath expr="//group[1]" position="before">
<div id="o_node_container">
<div id="o_node_main">
<field name="image_128" widget="image" class="oe_avatar"
options="{'preview_image': 'image_128', 'size': [90, 90]}"/>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1>
<field name="name" placeholder="Work Center Name " required="True"/>
</h1>
</div>
<span id="add_group"/>
<span id="add_notebook"/>
</div>
<div id="o_node_right">
<h4 class="o_chart_hierarchy_title mb16 mt0">Hierarchy Chart</h4>
<field name="child_ids" widget="web_chart_hierarchy"
string="Please get widget from https://apps.odoo.com/apps/modules/13.0/app_web_chart_hierarchy/"
options="{
'image': 'image_128',
'desc': 'code',
'direct_sub': 'child_ids',
'child_all_count':'child_all_count'}"/>
</div>
</div>
</xpath>
<xpath expr="//span[@id='add_group']" position="after">
<xpath expr="//group[1]" position="move"/>
</xpath>
<xpath expr="//span[@id='add_notebook']" position="after">
<xpath expr="//notebook" position="move"/>
</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="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">
<superbar view_types="kanban,tree">
<field name="parent_id" domain="[('child_ids', '!=', False)]"/>
</superbar>
</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="//superbar//field[@name='workcenter_id']" position="replace">
<field name="workcenter_id" options="{'ztree_parent_key': 'parent_id','ztree_expend_level': '2', 'ztree_name_field': 'name'}"/>
</xpath>
</field>
</record>
</odoo>

View File

@@ -23,7 +23,7 @@
{ {
'name': 'Odoo Customize(Boost,Debranding, My Odoo)', 'name': 'Odoo Customize(Boost,Debranding, My Odoo)',
'version': '13.19.12.28', 'version': '13.20.01.06',
'author': 'Sunpop.cn', 'author': 'Sunpop.cn',
'category': 'Productivity', 'category': 'Productivity',
'website': 'https://www.sunpop.cn', 'website': 'https://www.sunpop.cn',
@@ -68,6 +68,7 @@
25. Add remove expense data 25. Add remove expense data
26. Add multi uninstall modules 26. Add multi uninstall modules
27. Add odoo boost modules link. 27. Add odoo boost modules link.
28. Easy Menu manager.
This module can help to white label the Odoo. This module can help to white label the Odoo.
Also helpful for training and support for your odoo end-user. Also helpful for training and support for your odoo end-user.
@@ -89,6 +90,7 @@
'views/res_config_settings_views.xml', 'views/res_config_settings_views.xml',
'views/ir_model_views.xml', 'views/ir_model_views.xml',
'views/ir_views.xml', 'views/ir_views.xml',
'views/ir_ui_menu_views.xml',
# data # data
'data/ir_config_parameter.xml', 'data/ir_config_parameter.xml',
'data/ir_module_module.xml', 'data/ir_module_module.xml',

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<!-- 将菜单管理在设置中提前-->
<record id="base.menu_grant_menu_access" model="ir.ui.menu">
<field name="parent_id" ref="base.menu_administration"/>
</record>
<record id="app_edit_menu_access_search" model="ir.ui.view">
<field name="name">app.ir.ui.menu.search</field>
<field name="model">ir.ui.menu</field>
<field name="inherit_id" ref="base.edit_menu_access_search"/>
<field name="arch" type="xml">
<filter name="inactive" position="before">
<filter string="Top Menu" name="top_menu" domain="[('parent_id','=', False)]"/>
</filter>
</field>
</record>
</data>
</odoo>