├── web_qiniu_uploader ├── requirements.txt ├── __init__.py ├── models │ ├── __init__.py │ └── models.py ├── static │ ├── description │ │ └── icon.png │ └── src │ │ ├── xml │ │ └── base.xml │ │ ├── js │ │ └── web_qiniu_uploader.js │ │ └── lib │ │ └── qiniu@2.2.2.min.js ├── views │ ├── web_qiniu_uploader.xml │ └── views.xml ├── __manifest__.py └── README.md ├── srm_purchase ├── controllers │ ├── __init__.py │ └── portal.py ├── __init__.py ├── security │ ├── ir.model.access.csv │ ├── res_groups.xml │ └── ir_rule.xml ├── models │ ├── __init__.py │ ├── product.py │ ├── stock_move.py │ ├── res_config_settings.py │ └── purchase.py ├── data │ ├── ir_sequence_data.xml │ └── approval_strategy.xml ├── .flake8 ├── .gitignore ├── views │ ├── parent_menus.xml │ ├── product_attribute_views.xml │ ├── product_attribute_value_views.xml │ ├── product_public_category_views.xml │ ├── product_template_views.xml │ ├── templates.xml │ ├── approval_views.xml │ ├── portal │ │ ├── home.xml │ │ ├── purchase_quote.xml │ │ └── purchase_portal_templates.xml │ ├── new_res_config_settings_views.xml │ ├── srm_purchase_stock.xml │ ├── res_config_settings_views.xml │ ├── srm_purchase_partner.xml │ └── purchase_views.xml ├── scenter │ ├── purchase_order.py │ └── __init__.py ├── i18n │ └── zh_CN.po ├── .gitlab-ci.yml ├── __openerp__.py ├── README.md └── static │ └── src │ └── js │ ├── utils.js │ └── srm_purchase.js ├── web_form_dynamic_button ├── __init__.py ├── static │ ├── description │ │ └── icon.png │ └── src │ │ └── js │ │ └── web_form_dynamic_button.js ├── views │ └── web_form_dynamic_button.xml ├── __manifest__.py └── README.md ├── web_tree_view_cp_buttons ├── __init__.py ├── static │ ├── description │ │ └── icon.png │ └── src │ │ └── js │ │ └── web_tree_view_cp_buttons.js ├── views │ └── web_tree_view_cp_buttons.xml ├── __manifest__.py └── README.md ├── web_widget_colored_field ├── __init__.py ├── static │ ├── description │ │ └── icon.png │ └── src │ │ └── js │ │ └── web_widget_colored_field.js ├── views │ └── web_widget_colored_field.xml ├── __manifest__.py └── README.md ├── web_widget_many2many_tags_open ├── __init__.py ├── static │ ├── description │ │ └── icon.png │ └── src │ │ └── js │ │ └── web_widget_many2many_tags_open.js ├── views │ └── web_widget_many2many_tags_open.xml ├── __manifest__.py └── README.md ├── user_log ├── __init__.py ├── models │ ├── __init__.py │ └── res_users.py ├── __manifest__.py └── views │ └── res_users_view.xml ├── README.md ├── .gitignore └── LICENSE /web_qiniu_uploader/requirements.txt: -------------------------------------------------------------------------------- 1 | qiniu==7.2.2 2 | -------------------------------------------------------------------------------- /srm_purchase/controllers/__init__.py: -------------------------------------------------------------------------------- 1 | from . import portal 2 | -------------------------------------------------------------------------------- /web_form_dynamic_button/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | -------------------------------------------------------------------------------- /web_tree_view_cp_buttons/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | -------------------------------------------------------------------------------- /web_widget_colored_field/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | -------------------------------------------------------------------------------- /web_widget_many2many_tags_open/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | -------------------------------------------------------------------------------- /user_log/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from . import models 4 | -------------------------------------------------------------------------------- /srm_purchase/__init__.py: -------------------------------------------------------------------------------- 1 | from . import models 2 | from . import controllers 3 | -------------------------------------------------------------------------------- /user_log/models/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from . import res_users 4 | -------------------------------------------------------------------------------- /web_qiniu_uploader/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from . import models 4 | -------------------------------------------------------------------------------- /web_qiniu_uploader/models/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from . import models -------------------------------------------------------------------------------- /srm_purchase/security/ir.model.access.csv: -------------------------------------------------------------------------------- 1 | id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -------------------------------------------------------------------------------- /srm_purchase/models/__init__.py: -------------------------------------------------------------------------------- 1 | from . import stock_move 2 | from . import purchase 3 | from . import product 4 | from . import res_config_settings -------------------------------------------------------------------------------- /srm_purchase/data/ir_sequence_data.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /web_qiniu_uploader/static/description/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cognichain/odoo-basic-extension/HEAD/web_qiniu_uploader/static/description/icon.png -------------------------------------------------------------------------------- /srm_purchase/.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | ignore = W292,E722,E231,E265,F821, E501 3 | max-line-length = 120 4 | max-complexity = 10 5 | exclude = *__init__.py,*/__init__.py 6 | -------------------------------------------------------------------------------- /web_form_dynamic_button/static/description/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cognichain/odoo-basic-extension/HEAD/web_form_dynamic_button/static/description/icon.png -------------------------------------------------------------------------------- /web_tree_view_cp_buttons/static/description/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cognichain/odoo-basic-extension/HEAD/web_tree_view_cp_buttons/static/description/icon.png -------------------------------------------------------------------------------- /web_widget_colored_field/static/description/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cognichain/odoo-basic-extension/HEAD/web_widget_colored_field/static/description/icon.png -------------------------------------------------------------------------------- /srm_purchase/.gitignore: -------------------------------------------------------------------------------- 1 | *.py[co] 2 | 3 | # C extensions 4 | *.so 5 | 6 | 7 | # Mr Developer 8 | .mr.developer.cfg 9 | .project 10 | .pydevproject 11 | 12 | .idea/ 13 | -------------------------------------------------------------------------------- /web_widget_many2many_tags_open/static/description/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cognichain/odoo-basic-extension/HEAD/web_widget_many2many_tags_open/static/description/icon.png -------------------------------------------------------------------------------- /srm_purchase/models/product.py: -------------------------------------------------------------------------------- 1 | from odoo import api, fields, models 2 | from odoo.tools import float_compare 3 | 4 | 5 | class Product(models.Model): 6 | _name = "product.product" 7 | _inherit = ['product.product'] 8 | -------------------------------------------------------------------------------- /srm_purchase/models/stock_move.py: -------------------------------------------------------------------------------- 1 | from odoo import fields, models 2 | from odoo.addons import decimal_precision as dp 3 | 4 | 5 | class StockMove(models.Model): 6 | _inherit = "stock.move" 7 | 8 | ordered_qty = fields.Float('Ordered Quantity', digits=dp.get_precision('Product Unit of Measure')) 9 | -------------------------------------------------------------------------------- /srm_purchase/views/parent_menus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /srm_purchase/views/product_attribute_views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /srm_purchase/views/product_attribute_value_views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /srm_purchase/scenter/purchase_order.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | from . import BaseDao 4 | 5 | 6 | class PurchaseOrderDao(BaseDao): 7 | 8 | def create(self, data): 9 | return self.api_client.purchase_order.create(data) 10 | 11 | def update(self, slug, data): 12 | return self.api_client.purchase_order.update(slug, data) 13 | -------------------------------------------------------------------------------- /srm_purchase/views/product_public_category_views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /srm_purchase/views/product_template_views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /web_form_dynamic_button/views/web_form_dynamic_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /srm_purchase/data/approval_strategy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 采购单审批流 7 | purchase.order 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /web_tree_view_cp_buttons/views/web_tree_view_cp_buttons.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /web_widget_colored_field/views/web_widget_colored_field.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /user_log/__manifest__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | { 3 | 'name': "User Log", 4 | 5 | 'summary': "记录用户登录时的元信息", 6 | 7 | 'author': "深圳市知链科技有限公司", 8 | 'website': "https://github.com/cognichain/odoo-basic-extension", 9 | 10 | 'category': 'Tools', 11 | 'version': '11.0.1.0.1', 12 | 13 | 'depends': ['base'], 14 | 15 | 'data': [ 16 | 'views/res_users_view.xml', 17 | ] 18 | } -------------------------------------------------------------------------------- /web_widget_many2many_tags_open/views/web_widget_many2many_tags_open.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![11.0](https://img.shields.io/badge/12.0-success-brightgreen.svg) 2 | [![License](https://img.shields.io/badge/license-LGPL--3.0-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0-standalone.html) 3 | 4 | # Basic extensions for Odoo 5 | 6 | The basic extensions for Odoo ✨ 7 | 8 | ## 新发布odoo采购协同模块v0.1 9 | 10 | 项目地址: 11 | https://github.com/cognichain/srm_purchase 12 | 13 | 讨论群: 14 | 713722419 (Odoo SRM采购管理讨论群) 15 | -------------------------------------------------------------------------------- /web_qiniu_uploader/views/web_qiniu_uploader.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /web_form_dynamic_button/__manifest__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | { 3 | 'name': "Hide buttons in form views", 4 | 'summary': "Allows you to dynamically hide buttons on form views", 5 | 6 | 'author': "深圳市知链科技有限公司", 7 | 'website': "https://github.com/cognichain/odoo-basic-extension", 8 | 9 | 'category': 'Tools', 10 | 'version': '11.0.1.0.1', 11 | 'license': 'LGPL-3', 12 | 13 | 'depends': ['web'], 14 | 15 | 'data': ['views/web_form_dynamic_button.xml'], 16 | 'demo': [], 17 | } -------------------------------------------------------------------------------- /srm_purchase/views/templates.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /web_widget_many2many_tags_open/__manifest__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | { 3 | 'name': "Open many2many_tags record in form views", 4 | 'summary': "Make many2many_tags clickable on form views", 5 | 6 | 'author': "深圳市知链科技有限公司", 7 | 'website': "https://github.com/cognichain/odoo-basic-extension", 8 | 9 | 'category': 'Tools', 10 | 'version': '11.0.1.0.1', 11 | 'license': 'LGPL-3', 12 | 13 | 'depends': ['web'], 14 | 15 | 'data': ['views/web_widget_many2many_tags_open.xml'], 16 | 'demo': [], 17 | } -------------------------------------------------------------------------------- /web_tree_view_cp_buttons/__manifest__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | { 3 | 'name': "Add custom buttons in tree views", 4 | 'summary': "Allows you to add more control panel buttons on tree view control panel", 5 | 6 | 'author': "深圳市知链科技有限公司", 7 | 'website': "https://github.com/cognichain/odoo-basic-extension", 8 | 9 | 'category': 'Tools', 10 | 'version': '11.0.1.0.1', 11 | 'license': 'LGPL-3', 12 | 13 | 'depends': ['web'], 14 | 15 | 'data': ['views/web_tree_view_cp_buttons.xml'], 16 | 'demo': [], 17 | } -------------------------------------------------------------------------------- /web_widget_colored_field/__manifest__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | { 3 | 'name': "Colorize field in form views", 4 | 'summary': "Allows you to dynamically color Char, Float, Integer and Selection fields on form views", 5 | 6 | 'author': "深圳市知链科技有限公司", 7 | 'website': "https://github.com/cognichain/odoo-basic-extension", 8 | 9 | 'category': 'Tools', 10 | 'version': '11.0.1.0.1', 11 | 'license': 'LGPL-3', 12 | 13 | 'depends': ['web'], 14 | 15 | 'data': ['views/web_widget_colored_field.xml'], 16 | 'demo': [], 17 | } -------------------------------------------------------------------------------- /web_qiniu_uploader/__manifest__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | { 3 | 'name': "Qiniu attachment uploader in form views", 4 | 'summary': "Allows you to upload attachment with ``ir.attachment`` field on form views", 5 | 6 | 'author': "深圳市知链科技有限公司", 7 | 'website': "https://github.com/cognichain/odoo-basic-extension", 8 | 9 | 'category': 'Tools', 10 | 'version': '11.0.1.0.1', 11 | 'license': 'LGPL-3', 12 | 13 | 'depends': ['web'], 14 | 15 | 'data': [ 16 | 'views/views.xml', 17 | 'views/web_qiniu_uploader.xml' 18 | ], 19 | 'qweb': ['static/src/xml/base.xml'], 20 | 'demo': [], 21 | } -------------------------------------------------------------------------------- /srm_purchase/i18n/zh_CN.po: -------------------------------------------------------------------------------- 1 | # Translation of Odoo Server. 2 | # This file contains the translation of the following modules: 3 | # * portal 4 | # 5 | msgid "" 6 | msgstr "" 7 | "Project-Id-Version: Odoo Server 12.0\n" 8 | "Report-Msgid-Bugs-To: \n" 9 | "POT-Creation-Date: 2019-11-15 06:16+0000\n" 10 | "PO-Revision-Date: 2019-11-15 06:16+0000\n" 11 | "Last-Translator: <>\n" 12 | "Language-Team: \n" 13 | "MIME-Version: 1.0\n" 14 | "Content-Type: text/plain; charset=UTF-8\n" 15 | "Content-Transfer-Encoding: \n" 16 | "Plural-Forms: \n" 17 | 18 | #. module: portal 19 | #: model_terms:ir.ui.view,arch_db:portal.my_account_link 20 | msgid "My Account" 21 | msgstr "个人中心" -------------------------------------------------------------------------------- /srm_purchase/.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | stages: 2 | - flake8 3 | - update 4 | 5 | flake8x: 6 | stage: flake8 7 | image: xxx008/pyflake8 8 | tags: 9 | - 174_docker 10 | script: 11 | - echo $CI_PROJECT_NAME 12 | - echo $CI_COMMIT_REF_NAME 13 | - flake8 . 14 | 15 | 174_update: 16 | stage: update 17 | tags: 18 | - 174_mro 19 | script: 20 | - echo $CI_PROJECT_NAME 21 | - echo $CI_COMMIT_REF_NAME 22 | - echo $CI_COMMIT_MESSAGE 23 | - /workspace/srm_sale/scripts/dev_update_code.sh $CI_PROJECT_NAME $CI_COMMIT_REF_NAME $CI_COMMIT_MESSAGE 24 | only: 25 | - tags 26 | - master 27 | variables: 28 | GIT_STRATEGY: none 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /user_log/models/res_users.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from odoo import models, fields, api 4 | from odoo.http import request 5 | 6 | 7 | class ResUsersLog(models.Model): 8 | 9 | _inherit = 'res.users.log' 10 | 11 | ip = fields.Char('IP', readonly=True) 12 | location = fields.Char('Location', readonly=True) 13 | user_agent = fields.Char('User Agent', readonly=True) 14 | 15 | 16 | class Users(models.Model): 17 | 18 | _inherit = 'res.users' 19 | 20 | @api.model 21 | def _update_last_login(self): 22 | self.env['res.users.log'].create({ 23 | 'ip': request.httprequest.remote_addr, 24 | 'user_agent': request.httprequest.user_agent.string 25 | }) 26 | -------------------------------------------------------------------------------- /srm_purchase/views/approval_views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 审批流 8 | approval.strategy 9 | form 10 | tree,form 11 | [('res_model', '=', 'purchase.order')] 12 | current 13 | 14 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /user_log/views/res_users_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | res.users.log.form 4 | res.users 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /srm_purchase/__openerp__.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | 3 | { 4 | 'name': 'SRM Purchase Collaboration', 5 | 'version': '0.1', 6 | 'summary': 'An extension to Odoo Purchase App to allow you collaborate with suppliers on RFQ, Purchase Order, Shipment via a supplier portal.', 7 | 'description': """""", 8 | 'author': 'Cognichain', 9 | 'website': 'http://www.cognichain.com/', 10 | 'depends': ['purchase', 'stock', 'website'], 11 | 'data': [ 12 | 'security/res_groups.xml', 13 | 'security/ir_rule.xml', 14 | 'security/ir.model.access.csv', 15 | 16 | 'views/templates.xml', 17 | 'views/new_res_config_settings_views.xml', 18 | 'views/parent_menus.xml', 19 | 20 | 'views/portal/purchase_portal_templates.xml', 21 | 'views/portal/home.xml', 22 | 'views/portal/purchase_quote.xml', 23 | ], 24 | 'qweb': ['static/src/xml/*.xml'], 25 | 'application': True, 26 | 'installable': True, 27 | 'auto_install': False, 28 | } 29 | -------------------------------------------------------------------------------- /srm_purchase/views/portal/home.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /web_widget_many2many_tags_open/README.md: -------------------------------------------------------------------------------- 1 | [![License](https://img.shields.io/badge/license-LGPL--3.0-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0-standalone.html) 2 | 3 | # Open many2many_tags record in form views 4 | 5 | 该模块可以在只读模式下打开 `many2many_tags` 对应的记录的表单视图。 6 | 7 | ## Usage 8 | 9 | - 在定义表单字段时,添加属性 `{'open_view': True}` 到 `widget="many2many_tags"` 的字段的 `options` 中: 10 | 11 | ```xml 12 | 13 | ... 14 | 15 |
16 | ... 17 | 18 | ... 19 | 20 |
21 | ... 22 | ``` 23 | 24 | ## Bug Tracker 25 | 26 | 如果遇到任何问题,欢迎在 [GitHub Issues](https://github.com/cognichain/odoo-basic-extension/issues) 进行反馈。 27 | 28 | ## Credits 29 | 30 | ### Contributors 31 | 32 | - Ruter 33 | 34 | ### Maintainer 35 | 36 | 深圳市知链科技有限公司 37 | 38 | 该模块由深圳市知链科技有限公司开发及维护。 -------------------------------------------------------------------------------- /srm_purchase/security/res_groups.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 进销存 6 | False 7 | 0 8 | 9 | 10 | 11 | 产品管理 12 | 13 | 16 | 17 | 18 | 19 | 采购 20 | 21 | 24 | 25 | 26 | 27 | 销售 28 | 29 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /web_widget_many2many_tags_open/static/src/js/web_widget_many2many_tags_open.js: -------------------------------------------------------------------------------- 1 | odoo.define('web_widget_many2many_tags_open', function (require) { 2 | "use strict"; 3 | 4 | var relational_fields = require('web.relational_fields'); 5 | var FormFieldMany2ManyTags = relational_fields.FormFieldMany2ManyTags; 6 | 7 | FormFieldMany2ManyTags.include({ 8 | _onOpenColorPicker: function (ev) { 9 | if (this.mode === 'readonly' && this.nodeOptions.open_view) { 10 | ev.preventDefault(); 11 | ev.stopPropagation(); 12 | var self = this; 13 | var tagID = $(ev.currentTarget).parent().data('id'); 14 | this._rpc({ 15 | model: this.field.relation, 16 | method: 'get_formview_action', 17 | args: [[tagID]], 18 | context: this.record.getContext(this.recordParams), 19 | }).then(function (action) { 20 | self.trigger_up('do_action', {action: action}); 21 | }); 22 | } else { 23 | this._super.apply(this, arguments); 24 | } 25 | } 26 | }); 27 | }); -------------------------------------------------------------------------------- /srm_purchase/views/new_res_config_settings_views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | res.config.settings.view.form.inherit.srm.purchase.use.approval.workflow.module 6 | res.config.settings 7 | 8 | 9 | 10 | 11 |
12 |
13 |
16 |
17 |
18 |
19 |
20 | 21 |
-------------------------------------------------------------------------------- /srm_purchase/views/srm_purchase_stock.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 库存 6 | stock.picking.type 7 | ir.actions.act_window 8 | form 9 | kanban,form 10 | 11 |

12 | Click to create a new operation type. 13 |

14 | The operation type system allows you to assign each stock 15 | operation a specific type which will alter its views accordingly. 16 | On the operation type you could e.g. specify if packing is needed by default, 17 | if it should show the customer. 18 |

19 |
20 |
21 | 22 | 27 |
28 |
-------------------------------------------------------------------------------- /web_tree_view_cp_buttons/README.md: -------------------------------------------------------------------------------- 1 | [![License](https://img.shields.io/badge/license-LGPL--3.0-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0-standalone.html) 2 | 3 | # Add custom buttons in tree views 4 | 5 | 该模块可以为列表视图添加额外的操作按钮,而非 `server actions` 的按钮一样显示在 `Action` 下拉按钮列表中。 6 | 7 | ## Usage 8 | 9 | - 在定义窗口动作(`ir.actions.act_window`)时,在 `context` 中添加 `{'tree': {'buttons': [{'name': 'My Action', 'classes': 'oe_link', 'action': 'act_name'}]}}` 10 | 11 | ```xml 12 | 13 | ... 14 | 15 | ... 16 | my.model 17 | tree,form 18 | {'tree': {'buttons': [{'name': 'My Action', 'classes': 'oe_link', 'action': 'act_name'}]}} 19 | ... 20 | 21 | ... 22 | ``` 23 | 24 | 其中 `classes` 是要为按钮添加的类,多个类以空格分隔;`action` 是该按钮点击时所要执行的动作,其值为当前所打开的列表视图记录所属模型下的方法的名称。 25 | 26 | 在 `buttons` 列表中可以定义多个按钮的数据,为列表视图同时添加多个操作按钮。 27 | 28 | ## Bug Tracker 29 | 30 | 如果遇到任何问题,欢迎在 [GitHub Issues](https://github.com/cognichain/odoo-basic-extension/issues) 进行反馈。 31 | 32 | ## Credits 33 | 34 | ### Contributors 35 | 36 | - Ruter 37 | 38 | ### Maintainer 39 | 40 | 深圳市知链科技有限公司 41 | 42 | 该模块由深圳市知链科技有限公司开发及维护。 -------------------------------------------------------------------------------- /srm_purchase/security/ir_rule.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Portal Purchase Orders 6 | 7 | ['|', ('message_partner_ids','child_of',[user.commercial_partner_id.id]), '|', ('partner_id', 'child_of', [user.commercial_partner_id.id]),('partner_id', 'in', [user.partner_id.parent_id.id, user.partner_id.id])] 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Portal Purhcase Orders Line 17 | 18 | ['|', ('order_id.message_partner_ids','child_of',[user.commercial_partner_id.id]), '|', ('order_id.partner_id','child_of',[user.commercial_partner_id.id]),('order_id.partner_id', 'in', [user.partner_id.parent_id.id, user.partner_id.id])] 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /web_qiniu_uploader/static/src/xml/base.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 |
6 |

7 | 请选择要添加的附件 8 |

9 |
10 |
11 |
12 | 14 | 15 | 21 | 22 | 23 | 26 | 27 |
28 |
29 |
30 |
31 |
-------------------------------------------------------------------------------- /web_form_dynamic_button/README.md: -------------------------------------------------------------------------------- 1 | [![License](https://img.shields.io/badge/license-LGPL--3.0-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0-standalone.html) 2 | 3 | # Hide buttons in form views 4 | 5 | 该模块可根据表达式对表单视图上的控制按钮进行动态显示或隐藏,目前支持对如下按钮进行处理: 6 | 7 | - 编辑按钮 `Edit` 8 | - 创建按钮 `Create` 9 | - 删除按钮 `Delete` 10 | - 复制按钮 `Duplicate` 11 | 12 | ## Features 13 | 14 | - 添加属性 `edit_expr` 到表单 `form` 标签中以在表达式成立时才显示编辑按钮 15 | - 添加属性 `create_expr` 到表单 `form` 标签中以在表达式成立时才显示创建按钮 16 | - 添加属性 `delete_expr` 到表单 `form` 标签中以在表达式成立时才显示删除按钮 17 | - 添加属性 `duplicate_expr` 到表单 `form` 标签中以在表达式成立时才显示复制按钮 18 | 19 | ## Usage 20 | 21 | - 在定义表单视图时,添加属性 `edit_expr="state == 'draft'"` 到 `form` 标签内: 22 | 23 | ```xml 24 | 25 | ... 26 | 27 |
28 |
29 | 30 |
31 | ... 32 | 33 | ... 34 | 35 |
36 | ... 37 | ``` 38 | 39 | 在 `Features` 中列出的属性可以同时使用,如上例所示,直接添加相应的属性到 `form` 标签中即可。 40 | 41 | ## Bug Tracker 42 | 43 | 如果遇到任何问题,欢迎在 [GitHub Issues](https://github.com/cognichain/odoo-basic-extension/issues) 进行反馈。 44 | 45 | ## Credits 46 | 47 | ### Contributors 48 | 49 | - Ruter 50 | 51 | ### Maintainer 52 | 53 | 深圳市知链科技有限公司 54 | 55 | 该模块由深圳市知链科技有限公司开发及维护。 -------------------------------------------------------------------------------- /web_tree_view_cp_buttons/static/src/js/web_tree_view_cp_buttons.js: -------------------------------------------------------------------------------- 1 | odoo.define('web_tree_view_cp_buttons', function (require) { 2 | "use strict"; 3 | 4 | var ListController = require('web.ListController'); 5 | 6 | ListController.include({ 7 | renderButtons: function ($node) { 8 | this._super.apply(this, arguments); 9 | var ctx = this.initialState.context; 10 | if ('tree' in ctx && 'buttons' in ctx.tree) { 11 | var self = this; 12 | var tree_buttons = ctx.tree.buttons; 13 | _.each(tree_buttons, function (button, index) { 14 | var $btn = $(' 40 | 47 | 48 | 49 |
50 | 51 |

52 | 53 |

54 |
55 | 56 | 57 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 82 | 83 | 84 | 85 | 87 | 90 | 92 | 93 | 94 | 95 | 98 | 99 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 111 | 120 | 121 | 124 | 125 | 127 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 146 | 148 | 151 | 153 | 154 | 156 |
157 | 158 | 159 | 160 | 161 | 179 | 180 | 181 | 183 | 185 | 186 | 187 | 188 | 189 | 190 | 191 |
192 | 193 | 194 | 195 |
196 | 197 | 198 | 199 | 200 | 201 | 采购订单 202 | ir.actions.act_window 203 | purchase.order 204 | tree,kanban,form,pivot,graph,calendar 205 | 212 | {'search_default_todo':1, 'show_purchase': True} 213 | 214 | 215 |

216 | 点击创建一张采购订单。 217 |

218 |
219 |
220 | 222 | 223 | 224 | -------------------------------------------------------------------------------- /srm_purchase/views/portal/purchase_portal_templates.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 41 | 42 | 47 | 48 | 92 | 93 | 235 | 236 | 280 | 281 | 321 | 322 | 347 | 348 | 349 | -------------------------------------------------------------------------------- /web_qiniu_uploader/static/src/lib/qiniu@2.2.2.min.js: -------------------------------------------------------------------------------- 1 | !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.qiniu=e():t.qiniu=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=58)}([function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(30)("wks"),o=n(20),i=n(0).Symbol,u="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=u&&i[t]||(u?i:o)("Symbol."+t))}).store=r},function(t,e){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(7);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var r=n(0),o=n(2),i=n(17),u=n(5),s=function(t,e,n){var a,c,f,l=t&s.F,p=t&s.G,h=t&s.S,d=t&s.P,v=t&s.B,y=t&s.W,m=p?o:o[e]||(o[e]={}),g=m.prototype,b=p?r:h?r[e]:(r[e]||{}).prototype;for(a in p&&(n=e),n)(c=!l&&b&&void 0!==b[a])&&a in m||(f=c?b[a]:n[a],m[a]=p&&"function"!=typeof b[a]?n[a]:v&&c?i(f,r):y&&b[a]==f?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(f):d&&"function"==typeof f?i(Function.call,f):f,d&&((m.virtual||(m.virtual={}))[a]=f,t&s.R&&g&&!g[a]&&u(g,a,f)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,e,n){var r=n(6),o=n(19);t.exports=n(8)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(3),o=n(41),i=n(28),u=Object.defineProperty;e.f=n(8)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){t.exports=!n(10)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var r=n(45),o=n(26);t.exports=function(t){return r(o(t))}},function(t,e){t.exports={}},function(t,e,n){var r=n(44),o=n(31);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){return(0,d.default)(t).filter(function(t){return t.startsWith("x:")}).map(function(e){return[e,t[e].toString()]})}function i(t){return"qiniu_js_sdk_upload_file_"+t.name+"_size_"+t.size}function u(t){return{Authorization:"UpToken "+t}}function s(){return window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP")}function a(t){return new l.default(function(e,n){var r=new FileReader;r.readAsArrayBuffer(t),r.onload=function(t){var n=t.target.result;e(n)},r.onerror=function(){n(new Error("fileReader 读取错误"))}})}function c(t,e){return new l.default(function(n,r){var o=s();o.open(e.method,t),e.onCreate&&e.onCreate(o),e.headers&&(0,d.default)(e.headers).forEach(function(t){return o.setRequestHeader(t,e.headers[t])}),o.upload.addEventListener("progress",function(t){t.lengthComputable&&e.onProgress&&e.onProgress({loaded:t.loaded,total:t.total})}),o.onreadystatechange=function(){var t=o.responseText;if(4===o.readyState){var e=o.getResponseHeader("x-reqId")||"";if(200!==o.status){var i="xhr request failed, code: "+o.status+";";return t&&(i=i+" response: "+t),void r({code:o.status,message:i,reqId:e,isRequestError:!0})}try{n({data:JSON.parse(t),reqId:e})}catch(t){r(t)}}},o.send(e.body)})}function f(){return"http:"===window.location.protocol?"http:":"https:"}e.__esModule=!0;var l=r(n(24)),p=r(n(54)),h=r(n(85)),d=r(n(55));e.isChunkExpired=function(t){var e=t+864e5;return(new Date).getTime()>e},e.getChunks=function(t,e){for(var n=[],r=Math.ceil(t.size/e),o=0;o-1};var v=n(56),y=n(37),m=r(n(90))},function(t,e){t.exports=!0},function(t,e,n){var r=n(18);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e,n){var r=n(6).f,o=n(9),i=n(1)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){t.exports={default:n(59),__esModule:!0}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(7),o=n(0).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e,n){var r=n(7);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(30)("keys"),o=n(20);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e,n){var r=n(0),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(26);t.exports=function(t){return Object(r(t))}},function(t,e,n){"use strict";var r=n(18);t.exports.f=function(t){return new function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r}),this.resolve=r(e),this.reject=r(n)}(t)}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){e.f=n(1)},function(t,e,n){var r=n(0),o=n(2),i=n(16),u=n(35),s=n(6).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:u.f(t)})}},function(t,e,n){"use strict";e.__esModule=!0,e.regionUphostMap={z0:{srcUphost:"up.qiniup.com",cdnUphost:"upload.qiniup.com"},z1:{srcUphost:"up-z1.qiniup.com",cdnUphost:"upload-z1.qiniup.com"},z2:{srcUphost:"up-z2.qiniup.com",cdnUphost:"upload-z2.qiniup.com"},na0:{srcUphost:"up-na0.qiniup.com",cdnUphost:"upload-na0.qiniup.com"},as0:{srcUphost:"up-as0.qiniup.com",cdnUphost:"upload-as0.qiniup.com"}},e.region={z0:"z0",z1:"z1",z2:"z2",na0:"na0",as0:"as0"}},function(t,e){},function(t,e,n){"use strict";var r=n(60)(!0);n(40)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){"use strict";var r=n(16),o=n(4),i=n(42),u=n(5),s=n(9),a=n(12),c=n(61),f=n(21),l=n(65),p=n(1)("iterator"),h=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(t,e,n,v,y,m,g){c(n,e,v);var b,_,w,x=function(t){if(!h&&t in P)return P[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",k="values"==y,C=!1,P=t.prototype,O=P[p]||P["@@iterator"]||y&&P[y],M=!h&&O||x(y),U=y?k?x("entries"):M:void 0,E="Array"==e&&P.entries||O;if(E&&(w=l(E.call(new t)))!==Object.prototype&&w.next&&(f(w,S,!0),r||s(w,p)||u(w,p,d)),k&&O&&"values"!==O.name&&(C=!0,M=function(){return O.call(this)}),r&&!g||!h&&!C&&P[p]||u(P,p,M),a[e]=M,a[S]=d,y)if(b={values:k?M:x("values"),keys:m?M:x("keys"),entries:U},g)for(_ in b)_ in P||i(P,_,b[_]);else o(o.P+o.F*(h||C),e,b);return b}},function(t,e,n){t.exports=!n(8)&&!n(10)(function(){return 7!=Object.defineProperty(n(27)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){t.exports=n(5)},function(t,e,n){var r=n(3),o=n(62),i=n(31),u=n(29)("IE_PROTO"),s=function(){},a=function(){var t,e=n(27)("iframe"),r=i.length;for(e.style.display="none",n(47).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("