diff --git a/app_common/__init__.py b/app_common/__init__.py new file mode 100644 index 00000000..9ea74431 --- /dev/null +++ b/app_common/__init__.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- + +from . import models +from . import controllers +from .hooks import pre_init_hook +from .hooks import post_init_hook +from .hooks import uninstall_hook \ No newline at end of file diff --git a/app_common/__manifest__.py b/app_common/__manifest__.py new file mode 100644 index 00000000..86cec92a --- /dev/null +++ b/app_common/__manifest__.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- + +# Created on 20120-01-05 +# 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 . +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +############################################################################## + +{ + 'name': "Sunpop Odooapp Common Func", + 'version': '13.20.09.05', + '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': [ + 'web', + ], + 'summary': ''' + Core for common use + 基础核心 + ''', + 'description': ''' + Support Odoo 13,12, Enterprise and Community Edition + 1. + 2. + 3. Multi-language Support. + 4. Multi-Company Support. + 5. Support Odoo 13,12, Enterprise and Community Edition + ========== + 1. + 2. + 3. 多语言支持 + 4. 多公司支持 + 5. Odoo 13, 12, 企业版,社区版,多版本支持 + ''', + 'data': [ + # 'security/*.xml', + # 'security/ir.model.access.csv', + # 'data/.xml', + # 'views/.xml', + # 'report/.xml', + ], + 'qweb': [ + 'static/src/xml/*.xml', + ], + 'demo': [], + # 'pre_init_hook': 'pre_init_hook', + # 'post_init_hook': 'post_init_hook', + # 'uninstall_hook': 'uninstall_hook', + 'installable': True, + 'application': True, + 'auto_install': False, +} diff --git a/app_common/controllers/__init__.py b/app_common/controllers/__init__.py new file mode 100644 index 00000000..221005dc --- /dev/null +++ b/app_common/controllers/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +# from . import main \ No newline at end of file diff --git a/app_common/hooks.py b/app_common/hooks.py new file mode 100644 index 00000000..3ba52cbf --- /dev/null +++ b/app_common/hooks.py @@ -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("") + diff --git a/app_common/i18n/zh_CN.po b/app_common/i18n/zh_CN.po new file mode 100644 index 00000000..f1e36e3e --- /dev/null +++ b/app_common/i18n/zh_CN.po @@ -0,0 +1,14 @@ +# Translation of Odoo Server. +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-08 14:28+0000\n" +"PO-Revision-Date: 2018-01-08 14:28+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" diff --git a/app_common/models/__init__.py b/app_common/models/__init__.py new file mode 100644 index 00000000..c6153ef1 --- /dev/null +++ b/app_common/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Part of Sunpop.cn. See LICENSE file for full copyright and licensing details. + +# Created on 2019-04-20 +# author: 广州尚鹏,http://www.sunpop.cn +# email: 300883@qq.com +# resource of Sunpop +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +# Odoo12在线用户手册(长期更新) +# http://www.sunpop.cn/documentation/user/12.0/en/index.html + +# Odoo12在线开发者手册(长期更新) +# http://www.sunpop.cn/documentation/12.0/index.html + +# Odoo10在线中文用户手册(长期更新) +# http://www.sunpop.cn/documentation/user/10.0/zh_CN/index.html + +# Odoo10离线中文用户手册下载 +# http://www.sunpop.cn/odoo10_user_manual_document_offline/ +# Odoo10离线开发手册下载-含python教程,jquery参考,Jinja2模板,PostgresSQL参考(odoo开发必备) +# http://www.sunpop.cn/odoo10_developer_document_offline/ +# description: + +from . import models diff --git a/app_common/models/models.py b/app_common/models/models.py new file mode 100644 index 00000000..965f1a38 --- /dev/null +++ b/app_common/models/models.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +from odoo import models, fields, api, _ + + +class BaseModelExtend(models.AbstractModel): + _name = 'basemodel.extend' + _description = 'Base Extend for Sunpop' + + def _register_hook(self): + ''' + Register method in BaseModel + 如果 该 fieldname 是m2o的,那么如果context没值,就用该模型第一个 + ''' + @api.model + def _app_get_m2o_default(self, fieldname): + if hasattr(self, fieldname) and self._fields[fieldname].type == 'many2one': + if self._context.get(fieldname) or self._context.get('default_%s' % fieldname): + return self._context.get(fieldname) or self._context.get('default_%s' % fieldname) + else: + rec = self.env[self._fields[fieldname].comodel_name].search([], limit=1) + return rec.id if rec else False + return False + + models.BaseModel._app_get_default = _app_get_m2o_default + return super(BaseModelExtend, self)._register_hook() diff --git a/app_common/report/__init__.py b/app_common/report/__init__.py new file mode 100644 index 00000000..633f8661 --- /dev/null +++ b/app_common/report/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- + diff --git a/app_common/security/app_security.xml b/app_common/security/app_security.xml new file mode 100644 index 00000000..a4b85605 --- /dev/null +++ b/app_common/security/app_security.xml @@ -0,0 +1,51 @@ + + + + + + acc_module_user + + + + + + + + + + App... + Helps you manage your ... + 8 + + + + + App User + + + The user will be able to ... + + + + + App Admin + + + The user will be able to config ... + + + + + + + + + + Users are allowed to access their own m/// + + ['|', ('partner_id', 'in', [user.partner_id.id]), ('user_id.id', '=', user.id)] + + + + + diff --git a/app_common/security/ir.model.access.csv b/app_common/security/ir.model.access.csv new file mode 100644 index 00000000..64f91fa5 --- /dev/null +++ b/app_common/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_product_attribute_value_group_user,product_attribute_value_group.user,app_product_variant_pro.model_product_attribute_value_group,base.group_user,1,0,0,0 +access_product_attribute_value_group_manager,product_attribute_value_group.manager,app_product_variant_pro.model_product_attribute_value_group,base.group_erp_manager,1,1,1,1 \ No newline at end of file diff --git a/app_common/static/description/banner.png b/app_common/static/description/banner.png new file mode 100644 index 00000000..f2059fb7 Binary files /dev/null and b/app_common/static/description/banner.png differ diff --git a/app_common/static/description/icon.png b/app_common/static/description/icon.png new file mode 100644 index 00000000..03dd92b7 Binary files /dev/null and b/app_common/static/description/icon.png differ diff --git a/app_common/static/description/index.html b/app_common/static/description/index.html new file mode 100644 index 00000000..1dd94e6d --- /dev/null +++ b/app_common/static/description/index.html @@ -0,0 +1,95 @@ +
+
+
+

+

+
+

Lastest update: v13.20.01.01

+
+ +
+
+
+ Key features: +
    +
  • + + Put key function here. +
  • +
  • + + 3. Multi-language Support. +
  • +
  • + + 4. Multi-Company Support. +
  • +
  • + + 5. Support Odoo 13,12, 11, Enterprise and Community Edition. +
  • +
+
+
+
+
+
+
+ +
+
+

So Easy to navigator and search any data.

+

+
+ +
+
+
+ +
+
+

Multi-language Support..

+

+
+ +
+
+
+ +
+
+
+

Technical Help & Support

+
+
+
+

+ For any type of technical help & support requests, Feel free to contact us

+ + guohuadeng@hotmail.com +

+ Via QQ: 300883 (App user would not get QQ or any other IM support. Only for odoo project customize.)

+ + 300883@qq.com +
+
+

+ Visit our website for more support.

+ + https://www.sunpop.cn +
+
+
+
+

More Powerful addons, Make your odoo very easy to use, easy customize: + Supop.cn Odoo Addons +

+
+
+ diff --git a/app_common/static/img/icon_sunpop.png b/app_common/static/img/icon_sunpop.png new file mode 100644 index 00000000..aa490954 Binary files /dev/null and b/app_common/static/img/icon_sunpop.png differ diff --git a/app_common/static/img/logo_sunpop.png b/app_common/static/img/logo_sunpop.png new file mode 100644 index 00000000..bc32c24e Binary files /dev/null and b/app_common/static/img/logo_sunpop.png differ diff --git a/app_common/static/src/js/sunpop.cn b/app_common/static/src/js/sunpop.cn new file mode 100644 index 00000000..e69de29b diff --git a/app_common/static/src/xml/sunpop.cn b/app_common/static/src/xml/sunpop.cn new file mode 100644 index 00000000..e69de29b diff --git a/app_common/views/product_brand_views.xml b/app_common/views/product_brand_views.xml new file mode 100644 index 00000000..546d4033 --- /dev/null +++ b/app_common/views/product_brand_views.xml @@ -0,0 +1,116 @@ + + + + product.brand.search + product.brand + + + + + + + + + + + + + + product.brand.form + product.brand + +
+ +
+ +
+ +
+
+ + + + + + + + +
+
+
+
+ + + product.brand.tree + product.brand + + + + + + + + + + + + product.brand.kanban + product.brand + + + + + + + + +
+
+ Logo +
+
+

+ +

+ +
+
+
+
+
+
+
+ + + Brand + product.brand + kanban,form,tree + + + +
diff --git a/app_common/views/product_product_views.xml b/app_common/views/product_product_views.xml new file mode 100644 index 00000000..e25deae4 --- /dev/null +++ b/app_common/views/product_product_views.xml @@ -0,0 +1,24 @@ + + + + + + app.product.product.tree + product.product + + + + + + + + + + Product Manager + ir.actions.act_window + product.product + tree,form + + + diff --git a/app_common/views/product_template_views.xml b/app_common/views/product_template_views.xml new file mode 100644 index 00000000..8db19037 --- /dev/null +++ b/app_common/views/product_template_views.xml @@ -0,0 +1,59 @@ + + + + + + product.template.search.brand + product.template + + + + + + + + + + + + product.template.product.form + product.template + + + + +
+ + + + + + product kanban view add brand + product.template + + + +
+ + + +
+
+
+
+ + + product tree view add brand + product.template + + + + + + + + + + diff --git a/app_common/wizard/sunpop.cn b/app_common/wizard/sunpop.cn new file mode 100644 index 00000000..e69de29b diff --git a/app_odoo_customize/models/ir_module_module.py b/app_odoo_customize/models/ir_module_module.py index 203ce54a..7596837c 100644 --- a/app_odoo_customize/models/ir_module_module.py +++ b/app_odoo_customize/models/ir_module_module.py @@ -14,7 +14,7 @@ class IrModule(models.Model): # installed_version = fields.Char('Latest Version', compute='_get_latest_version') # latest_version = fields.Char('Installed Version', readonly=True) - local_updatable = fields.Boolean('Local updatable', compute='_get_latest_version', default=False, store=True) + local_updatable = fields.Boolean('Local updatable', compute='_get_latest_version', compute_sudo=False, default=False, store=True) def module_multi_uninstall(self): """ Perform the various steps required to uninstall a module completely diff --git a/app_odoo_customize/static/description/banner.gif b/app_odoo_customize/static/description/banner.gif deleted file mode 100644 index 29482a71..00000000 Binary files a/app_odoo_customize/static/description/banner.gif and /dev/null differ