diff --git a/soong_workflow/__manifest__.py b/soong_workflow/__manifest__.py index 646266375..05ce54166 100644 --- a/soong_workflow/__manifest__.py +++ b/soong_workflow/__manifest__.py @@ -22,6 +22,7 @@ "views/soong_workflow_record.xml", "views/soong_approval_group.xml", 'wizard/approval_notice_wizard_views.xml', + 'wizard/soong_transmitted_wizard_views.xml', "wizard/soong_workflow_comment_wizard_view.xml", "templates/soong_workflow_templates.xml", ], diff --git a/soong_workflow/models/soong_workflow.py b/soong_workflow/models/soong_workflow.py index 3e9a6c682..9e8652b10 100644 --- a/soong_workflow/models/soong_workflow.py +++ b/soong_workflow/models/soong_workflow.py @@ -45,27 +45,16 @@ class SoongWorkflow(models.Model): domain=MODEL_DOMAIN, help="Enter business model you would like to modify its workflow.", ) - node_ids = fields.One2many( - comodel_name="soong.workflow.node", inverse_name="workflow_id", string="Nodes" - ) - link_ids = fields.One2many( - comodel_name="soong.workflow.link", inverse_name="workflow_id", string="Links" - ) - remove_default_btn_until_end = fields.Boolean( - string="是否覆盖表头按钮状态", default=False - ) - is_enable_return_button = fields.Boolean( - string="是否启用收回", default=True - ) - - current_stage_highlight_color = fields.Char( - default="rgb(0, 255, 255)", - help="The color to highlight the current stage on flow", - ) + node_ids = fields.One2many(comodel_name="soong.workflow.node", inverse_name="workflow_id", string="Nodes") + link_ids = fields.One2many(comodel_name="soong.workflow.link", inverse_name="workflow_id", string="Links") + remove_default_btn_until_end = fields.Boolean(string="是否覆盖表头按钮状态", default=False) + current_stage_highlight_color = fields.Char(default="rgb(0, 255, 255)",help="The color to highlight the current stage on flow",) start_time = fields.Datetime(string="生效日期", copy=False, default=fields.Datetime.now) end_time = fields.Datetime(string="失效日期", copy=False) is_enable = fields.Boolean(string="是否启用", default="False", compute="compute_is_enable", store=True) + is_enable_return_button = fields.Boolean(string="是否启用收回", default=True) + is_enable_transmitted_button = fields.Boolean(string="是否启用转交", default=True) approvals_group_id = fields.Many2one('soong.approval.group', string="审批分组") def copy(self, default=None): diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py index 2a8c90990..eb1d71d0b 100644 --- a/soong_workflow/models/soong_workflow_mixin.py +++ b/soong_workflow/models/soong_workflow_mixin.py @@ -242,14 +242,17 @@ class SoongWorkflowMixin(models.AbstractModel): res = self._update_fields_view(view_type, res) # res = self._add_state_tree_view(view_type, res) res = self._add_soong_workflow_log(view_type, res, params) - # 收回 + # todo 后许可拓展退回层级 res = self._add_return_button(view_type, res) + # 转交 如果一条链路直接跳转,如果多条链路选择跳转 + # res = self._add_transmitted_button(view_type, res) return res + # 收回逻辑 def _add_return_button(self, view_type, res): model = self._name wkf_obj = self.env["soong.workflow"] - wkf_rec = wkf_obj.search([("model_id", "=", model)]) + wkf_rec = wkf_obj.search([("model_id", "=", model), ('is_enable', '=', True)]) if not wkf_rec.is_enable_return_button: return res @@ -260,9 +263,9 @@ class SoongWorkflowMixin(models.AbstractModel): header_el = header_el[0] if header_el else False if header_el: button = etree.Element("button", { - "name": "action_return", # 这里定义了按钮执行的服务器端动作 - "type": "object", # 触发自定义对象动作 - "string": "收回", # 按钮显示的名称 + "name": "action_return", + "type": "object", + "string": "收回", "class": "btn-primary", # 按钮的样式 # "icon": "fa-undo", # 按钮图标 (如果需要) }) @@ -328,6 +331,35 @@ class SoongWorkflowMixin(models.AbstractModel): # btn_invisible = btn_invisible + " or " + button.attrib["invisible"] # button.set("invisible", btn_invisible) + # 转交 + def _add_transmitted_button(self, view_type, res): + model = self._name + wkf_obj = self.env["soong.workflow"] + wkf_rec = wkf_obj.search([("model_id", "=", model), ('is_enable', '=', True)]) + + if not wkf_rec.is_enable_transmitted_button: + return res + + arch = etree.fromstring(res["arch"]) + if view_type == "form": + header_el = arch.xpath("//form/header") + header_el = header_el[0] if header_el else False + if header_el: + button = etree.Element("button", { + "name": "action_transmitted", + "type": "object", + "string": "转交", + "class": "btn-primary", # 按钮的样式 + }) + header_el.append(button) + res["arch"] = etree.tostring(arch, encoding="unicode").replace("\t", "") + return res + + def action_transmitted(self): + # 判断链路是一个就跳转 + # 是多个就弹窗选择 + pass + def _remove_default_header(self, view_type, res): """ Removes default header element from form view. @@ -337,7 +369,7 @@ class SoongWorkflowMixin(models.AbstractModel): """ model = self._name wkf_obj = self.env["soong.workflow"] - wkf_rec = wkf_obj.search([("model_id", "=", model)]) + wkf_rec = wkf_obj.search([("model_id", "=", model), ('is_enable', '=', True)]) if not wkf_rec.remove_default_btn_until_end: return res @@ -441,7 +473,7 @@ class SoongWorkflowMixin(models.AbstractModel): header_el = etree.Element("header") form_el.insert(0, header_el) # Construct Buttons & Fields Tags - wkf_rec = wkf_obj.search([("model_id", "=", model)]) + wkf_rec = wkf_obj.search([("model_id", "=", model), ('is_enable', '=', True)]) for node in wkf_rec.node_ids: for button in node.button_ids: # Check Condition Code @@ -528,7 +560,7 @@ class SoongWorkflowMixin(models.AbstractModel): model = self._name visible_seq = [] arch = etree.fromstring(res["arch"]) - wkf_rec = wkf_obj.search([("model_id", "=", model)]) + wkf_rec = wkf_obj.search([("model_id", "=", model), ('is_enable', '=', True)]) # Find header & ADD state if view_type == "form": @@ -618,7 +650,7 @@ class SoongWorkflowMixin(models.AbstractModel): # Variables model = self._name uid = self._uid - wkf_rec = wkf_obj.search([("model_id", "=", model)]) + wkf_rec = wkf_obj.search([("model_id", "=", model), ('is_enable', '=', True)]) arch = etree.fromstring(res["arch"]) # Helper Functions diff --git a/soong_workflow/models/soong_workflow_node.py b/soong_workflow/models/soong_workflow_node.py index 706168c81..40df51c27 100644 --- a/soong_workflow/models/soong_workflow_node.py +++ b/soong_workflow/models/soong_workflow_node.py @@ -129,9 +129,7 @@ class SoongWorkflowNode(models.Model): compute="_compute_custom_colors", readonly=True, string="Label Color" ) - @api.depends( - "bg_color", "label_color", "use_custom_colors", "flow_start", "flow_end" - ) + @api.depends("bg_color", "label_color", "use_custom_colors", "flow_start", "flow_end") def _compute_custom_colors(self): for rec in self: if rec.use_custom_colors: @@ -290,7 +288,7 @@ class SoongWorkflowNodeButton(models.Model): rec.workflow_id = ( self.env["soong.workflow"] .sudo() - .search([("model_id", "=", model_id)]) + .search([("model_id", "=", model_id), ('is_enable', '=', 'yes')]) ) @api.constrains("btn_key") diff --git a/soong_workflow/security/ir.model.access.csv b/soong_workflow/security/ir.model.access.csv index ceb16fda0..bd24009db 100644 --- a/soong_workflow/security/ir.model.access.csv +++ b/soong_workflow/security/ir.model.access.csv @@ -23,4 +23,6 @@ access_soong_approval_group,soong_approval_group,model_soong_approval_group,soon access_soong_approval_notice_wizard,soong_approval_notice_wizard,model_soong_approval_notice_wizard,base.group_user,1,1,1,1 access_soong_workflow_log_user,soong_workflow_log_user,model_soong_workflow_log,soong_workflow.group_soong_workflow_user,1,1,1,1 -access_soong_workflow_comment_wizard_user,soong_workflow_comment_wizard_user,model_soong_workflow_comment_wizard,soong_workflow.group_soong_workflow_user,1,1,1,1 \ No newline at end of file +access_soong_workflow_comment_wizard_user,soong_workflow_comment_wizard_user,model_soong_workflow_comment_wizard,soong_workflow.group_soong_workflow_user,1,1,1,1 + +access_soong_approval_transmitted_wizard,soong_approval_transmitted_wizard,model_soong_approval_transmitted_wizard,soong_workflow.group_soong_workflow_user,1,1,1,1 \ No newline at end of file diff --git a/soong_workflow/views/soong_note_views.xml b/soong_workflow/views/soong_note_views.xml index f2c1de165..9e3d00a56 100644 --- a/soong_workflow/views/soong_note_views.xml +++ b/soong_workflow/views/soong_note_views.xml @@ -39,7 +39,7 @@ action="soong_note_action"/> diff --git a/soong_workflow/views/soong_workflow_views.xml b/soong_workflow/views/soong_workflow_views.xml index ca069047d..502a5ee36 100644 --- a/soong_workflow/views/soong_workflow_views.xml +++ b/soong_workflow/views/soong_workflow_views.xml @@ -90,10 +90,10 @@ tree,form - + + + + + diff --git a/soong_workflow/wizard/__init__.py b/soong_workflow/wizard/__init__.py index 442fe0891..b8d44c6f0 100644 --- a/soong_workflow/wizard/__init__.py +++ b/soong_workflow/wizard/__init__.py @@ -3,6 +3,9 @@ from . import approval_notice_wizard +from . import soong_transmitted_wizard from . import soong_workflow_comment_wizard + + diff --git a/soong_workflow/wizard/soong_transmitted_wizard.py b/soong_workflow/wizard/soong_transmitted_wizard.py new file mode 100644 index 000000000..3fa508c64 --- /dev/null +++ b/soong_workflow/wizard/soong_transmitted_wizard.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from odoo import api, fields, models, tools, _ +from datetime import datetime, date, time, timedelta +from odoo.tools.safe_eval import safe_eval +from odoo.exceptions import ValidationError, UserError +import logging + +_logger = logging.getLogger(__name__) + + +class SoongApprovalTransmittedWizard(models.TransientModel): + _name = 'soong.approval.transmitted.wizard' + _description = """ 转交弹窗 """ + + name = fields.Char(string='名称') + + def confirm(self): + pass \ No newline at end of file diff --git a/soong_workflow/wizard/soong_transmitted_wizard_views.xml b/soong_workflow/wizard/soong_transmitted_wizard_views.xml new file mode 100644 index 000000000..162ea4ab4 --- /dev/null +++ b/soong_workflow/wizard/soong_transmitted_wizard_views.xml @@ -0,0 +1,19 @@ + + + + 一键转交 + soong.approval.transmitted.wizard + + + + + + + + + + + \ No newline at end of file diff --git a/xw_kk_preview/__init__.py b/xw_kk_preview/__init__.py deleted file mode 100644 index 511a0ca3a..000000000 --- a/xw_kk_preview/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# -*- coding: utf-8 -*- - -from . import controllers -from . import models \ No newline at end of file diff --git a/xw_kk_preview/__manifest__.py b/xw_kk_preview/__manifest__.py deleted file mode 100644 index ccba0d429..000000000 --- a/xw_kk_preview/__manifest__.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -{ - 'name': "xw_kk_preview", - - 'summary': """ - kk file preview for odoo - """, - - 'description': """ - file preview, - kk file preview - """, - - 'author': "masterjmz", - 'website': "https://www.openerpnext.com", - - 'category': 'Apps/preview', - 'version': '16.0.0.1', - 'license': 'AGPL-3', - 'price': 9999, - - 'depends': ['base'], - - 'data': [ - 'security/ir.model.access.csv', - 'views/views.xml', - ], - - 'assets': { - 'web.assets_backend': [ - 'xw_kk_preview/static/src/binary_field/*.*', - 'xw_kk_preview/static/libs/*.*', - 'xw_kk_preview/static/src/kk_dialog_patch.js', - 'xw_kk_preview/static/css/*.*', - ] - }, -} diff --git a/xw_kk_preview/controllers/__init__.py b/xw_kk_preview/controllers/__init__.py deleted file mode 100644 index 457bae27e..000000000 --- a/xw_kk_preview/controllers/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- - -from . import controllers \ No newline at end of file diff --git a/xw_kk_preview/controllers/controllers.py b/xw_kk_preview/controllers/controllers.py deleted file mode 100644 index 0d653c63c..000000000 --- a/xw_kk_preview/controllers/controllers.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# from odoo import http - - -# class XwKkPreview(http.Controller): -# @http.route('/xw_kk_preview/xw_kk_preview', auth='public') -# def index(self, **kw): -# return "Hello, world" - -# @http.route('/xw_kk_preview/xw_kk_preview/objects', auth='public') -# def list(self, **kw): -# return http.request.render('xw_kk_preview.listing', { -# 'root': '/xw_kk_preview/xw_kk_preview', -# 'objects': http.request.env['xw_kk_preview.xw_kk_preview'].search([]), -# }) - -# @http.route('/xw_kk_preview/xw_kk_preview/objects/', auth='public') -# def object(self, obj, **kw): -# return http.request.render('xw_kk_preview.object', { -# 'object': obj -# }) diff --git a/xw_kk_preview/models/__init__.py b/xw_kk_preview/models/__init__.py deleted file mode 100644 index 5305644df..000000000 --- a/xw_kk_preview/models/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- - -from . import models \ No newline at end of file diff --git a/xw_kk_preview/models/models.py b/xw_kk_preview/models/models.py deleted file mode 100644 index 5a093005b..000000000 --- a/xw_kk_preview/models/models.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- - -from odoo import models, fields, api -import base64 - - -class XwKKPreview(models.AbstractModel): - """ - xw_kk_preview.xw_kk_preview - """ - _name = 'xw_kk_preview.xw_kk_preview' - _description = 'xw_kk_preview.xw_kk_preview' - - @api.model - def get_preview_url(self, res_model, res_id, field_name, file_name_field): - """ - get file info - """ - base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url') - record = self.env[res_model].sudo().browse(res_id) - - file_name = None - if file_name_field: - file_name = record[file_name_field] - - if not file_name: - stream = None - try: - stream = self.env['ir.binary'].sudo()._get_stream_from( - record, field_name, False, file_name_field or 'name') - except Exception as e: - return { - 'status': 'error', - 'message': str(e), - } - file_name = stream.download_name - - # http://124.223.107.118:8012/onlinePreview - preivew_url = self.env['ir.config_parameter'].sudo().get_param('xw_kk_preview.preivew_url') - if not preivew_url: - return { - 'status': 'error', - 'message': 'please set preivew_url in system parameters', - } - - return { - 'status': 'success', - 'preview_url': preivew_url, - 'url': f'{base_url}/web/content/{res_model}/{res_id}/{field_name}/{file_name}?download=true', - } diff --git a/xw_kk_preview/security/ir.model.access.csv b/xw_kk_preview/security/ir.model.access.csv deleted file mode 100644 index 06372f500..000000000 --- a/xw_kk_preview/security/ir.model.access.csv +++ /dev/null @@ -1,2 +0,0 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_xw_kk_preview_xw_kk_preview,xw_kk_preview.xw_kk_preview,model_xw_kk_preview_xw_kk_preview,base.group_user,1,1,1,1 \ No newline at end of file diff --git a/xw_kk_preview/static/css/style.scss b/xw_kk_preview/static/css/style.scss deleted file mode 100644 index 13b224c8c..000000000 --- a/xw_kk_preview/static/css/style.scss +++ /dev/null @@ -1,18 +0,0 @@ - -.modal-full { - width: 100% !important; - height: 100% !important; - max-width: 100%; - padding: 0 !important; - - .modal-content { - height: 100% !important; - max-height: 100% !important; - .modal-body { - > div { - height: 100% !important; - max-height: 100% !important; - } - } - } -} \ No newline at end of file diff --git a/xw_kk_preview/static/description/icon.png b/xw_kk_preview/static/description/icon.png deleted file mode 100644 index 30172b538..000000000 Binary files a/xw_kk_preview/static/description/icon.png and /dev/null differ diff --git a/xw_kk_preview/static/libs/base64.js b/xw_kk_preview/static/libs/base64.js deleted file mode 100644 index f2cc36af0..000000000 --- a/xw_kk_preview/static/libs/base64.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Minified by jsDelivr using Terser v5.3.5. - * Original file: /npm/js-base64@3.6.0/base64.js - * - * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files - */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):function(){const r=e.Base64,o=t();o.noConflict=()=>(e.Base64=r,o),e.Meteor&&(Base64=o),e.Base64=o}()}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:this,(function(){"use strict";const e="3.6.0",t="function"==typeof atob,r="function"==typeof btoa,o="function"==typeof Buffer,n="function"==typeof TextDecoder?new TextDecoder:void 0,a="function"==typeof TextEncoder?new TextEncoder:void 0,f=[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],i=(e=>{let t={};return e.forEach(((e,r)=>t[e]=r)),t})(f),c=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,u=String.fromCharCode.bind(String),s="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(e,t=(e=>e))=>new Uint8Array(Array.prototype.slice.call(e,0).map(t)),d=e=>e.replace(/[+\/]/g,(e=>"+"==e?"-":"_")).replace(/=+$/m,""),l=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),h=e=>{let t,r,o,n,a="";const i=e.length%3;for(let i=0;i255||(o=e.charCodeAt(i++))>255||(n=e.charCodeAt(i++))>255)throw new TypeError("invalid character found");t=r<<16|o<<8|n,a+=f[t>>18&63]+f[t>>12&63]+f[t>>6&63]+f[63&t]}return i?a.slice(0,i-3)+"===".substring(i):a},p=r?e=>btoa(e):o?e=>Buffer.from(e,"binary").toString("base64"):h,y=o?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,o=e.length;rt?d(y(e)):y(e),b=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?u(192|t>>>6)+u(128|63&t):u(224|t>>>12&15)+u(128|t>>>6&63)+u(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return u(240|t>>>18&7)+u(128|t>>>12&63)+u(128|t>>>6&63)+u(128|63&t)},g=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,B=e=>e.replace(g,b),x=o?e=>Buffer.from(e,"utf8").toString("base64"):a?e=>y(a.encode(e)):e=>p(B(e)),C=(e,t=!1)=>t?d(x(e)):x(e),m=e=>C(e,!0),U=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,F=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return u(55296+(t>>>10))+u(56320+(1023&t));case 3:return u((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return u((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},w=e=>e.replace(U,F),S=e=>{if(e=e.replace(/\s+/g,""),!c.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,r,o,n="";for(let a=0;a>16&255):64===o?u(t>>16&255,t>>8&255):u(t>>16&255,t>>8&255,255&t);return n},E=t?e=>atob(l(e)):o?e=>Buffer.from(e,"base64").toString("binary"):S,v=o?e=>s(Buffer.from(e,"base64")):e=>s(E(e),(e=>e.charCodeAt(0))),D=e=>v(z(e)),R=o?e=>Buffer.from(e,"base64").toString("utf8"):n?e=>n.decode(v(e)):e=>w(E(e)),z=e=>l(e.replace(/[-_]/g,(e=>"-"==e?"+":"/"))),T=e=>R(z(e)),Z=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),j=function(){const e=(e,t)=>Object.defineProperty(String.prototype,e,Z(t));e("fromBase64",(function(){return T(this)})),e("toBase64",(function(e){return C(this,e)})),e("toBase64URI",(function(){return C(this,!0)})),e("toBase64URL",(function(){return C(this,!0)})),e("toUint8Array",(function(){return D(this)}))},I=function(){const e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,Z(t));e("toBase64",(function(e){return A(this,e)})),e("toBase64URI",(function(){return A(this,!0)})),e("toBase64URL",(function(){return A(this,!0)}))},O={version:e,VERSION:"3.6.0",atob:E,atobPolyfill:S,btoa:p,btoaPolyfill:h,fromBase64:T,toBase64:C,encode:C,encodeURI:m,encodeURL:m,utob:B,btou:w,decode:T,isValid:e=>{if("string"!=typeof e)return!1;const t=e.replace(/\s+/g,"").replace(/=+$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},fromUint8Array:A,toUint8Array:D,extendString:j,extendUint8Array:I,extendBuiltins:()=>{j(),I()},Base64:{}};return Object.keys(O).forEach((e=>O.Base64[e]=O[e])),O})); -//# sourceMappingURL=/sm/8bca8602e2256d240cef904e1c1df432ccfdd2a2a73f6911c60be79e526e3e1e.map \ No newline at end of file diff --git a/xw_kk_preview/static/src/binary_field/kk_binary_preview.js b/xw_kk_preview/static/src/binary_field/kk_binary_preview.js deleted file mode 100644 index 652922a1c..000000000 --- a/xw_kk_preview/static/src/binary_field/kk_binary_preview.js +++ /dev/null @@ -1,55 +0,0 @@ -/** @odoo-module **/ - -import { patch } from "@web/core/utils/patch"; -import { BinaryField } from "@web/views/fields/binary/binary_field"; -import { useOwnedDialogs, useService } from "@web/core/utils/hooks"; -import { _lt } from "@web/core/l10n/translation"; -import { KKPreviewDialog } from "./kk_preview_dialog"; - - -/** - * binary field patch - * @param {Object} param0 - */ -patch(BinaryField.prototype, "xc_utils_binary_field_patch", { - - setup() { - this._super(...arguments); - this.addDialog = useOwnedDialogs(); - this.orm = useService("orm"); - this.notification = useService("notification"); - }, - - /** - * do preview - */ - do_preview() { - - let res_id = this.props.record.data.id; - let res_model = this.props.record.resModel; - let file_name = this.props.filename; - let field_name = this.props.name; - - this.orm.call( - "xw_kk_preview.xw_kk_preview", "get_preview_url", [ - res_model, res_id, field_name, file_name]).then((result) => { - if (result && result.status == 'success') { - - let preview_url = result.preview_url; - let finalUrl = preview_url + '?url=' + encodeURIComponent(Base64.encode(result.url)); - this.addDialog(KKPreviewDialog, { - url: finalUrl, - close: () => {}, - size: 'full' - }); - } else { - this.notification.add( - this.env._t("Warning"), { - title: this.env._t('Get File Preview URL Failed!'), - type: "warning" - } - ); - } - }); - } -}); diff --git a/xw_kk_preview/static/src/binary_field/kk_binary_preview.xml b/xw_kk_preview/static/src/binary_field/kk_binary_preview.xml deleted file mode 100644 index 70f3532ab..000000000 --- a/xw_kk_preview/static/src/binary_field/kk_binary_preview.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - Preview - - - - Preview - - - - - diff --git a/xw_kk_preview/static/src/binary_field/kk_preview_dialog.js b/xw_kk_preview/static/src/binary_field/kk_preview_dialog.js deleted file mode 100644 index 980ec0244..000000000 --- a/xw_kk_preview/static/src/binary_field/kk_preview_dialog.js +++ /dev/null @@ -1,24 +0,0 @@ -/** @odoo-module **/ - -import { Dialog } from "@web/core/dialog/dialog"; -import { _lt } from "@web/core/l10n/translation"; - -import { Component } from "@odoo/owl"; - -export class KKPreviewDialog extends Component {}; - -KKPreviewDialog.props = { - url: String, - close: Function, - size: { - type: String, - optional: true, - } -}; - -KKPreviewDialog.defaultProps = { - fullscreen: false, -}; - -KKPreviewDialog.components = { Dialog }; -KKPreviewDialog.template = "xc_utils.kk_preview_dialog"; \ No newline at end of file diff --git a/xw_kk_preview/static/src/binary_field/kk_preview_dialog.xml b/xw_kk_preview/static/src/binary_field/kk_preview_dialog.xml deleted file mode 100644 index caa2755f9..000000000 --- a/xw_kk_preview/static/src/binary_field/kk_preview_dialog.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - Discard - - - - - diff --git a/xw_kk_preview/static/src/kk_dialog_patch.js b/xw_kk_preview/static/src/kk_dialog_patch.js deleted file mode 100644 index ee9622726..000000000 --- a/xw_kk_preview/static/src/kk_dialog_patch.js +++ /dev/null @@ -1,14 +0,0 @@ -/** @odoo-module **/ - -import { Dialog } from "@web/core/dialog/dialog"; -import { patch } from "@web/core/utils/patch"; - -patch(Dialog.prototype, 'xw_kk_preview.dialog_patch', {}); - -Dialog.props = { - ...Dialog.props, - size: { - type: String, - optional: true, - } -}; diff --git a/xw_kk_preview/views/templates.xml b/xw_kk_preview/views/templates.xml deleted file mode 100644 index cea6b39ad..000000000 --- a/xw_kk_preview/views/templates.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - \ No newline at end of file diff --git a/xw_kk_preview/views/views.xml b/xw_kk_preview/views/views.xml deleted file mode 100644 index c8e242054..000000000 --- a/xw_kk_preview/views/views.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/xw_kk_preview_demo/__init__.py b/xw_kk_preview_demo/__init__.py deleted file mode 100644 index 5305644df..000000000 --- a/xw_kk_preview_demo/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- - -from . import models \ No newline at end of file diff --git a/xw_kk_preview_demo/__manifest__.py b/xw_kk_preview_demo/__manifest__.py deleted file mode 100644 index ec977f4c1..000000000 --- a/xw_kk_preview_demo/__manifest__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -{ - 'name': "preview_demo", - - 'summary': """ - Short (1 phrase/line) summary of the module's purpose, used as - subtitle on modules listing or apps.openerp.com""", - - 'description': """ - Long description of module's purpose - """, - - 'author': "My Company", - 'website': "https://www.yourcompany.com", - - 'category': 'apps/demo', - 'version': '16.0.0.1', - - 'depends': ['base', 'web'], - - 'data': [ - 'security/ir.model.access.csv', - 'views/views.xml', - ] -} diff --git a/xw_kk_preview_demo/models/__init__.py b/xw_kk_preview_demo/models/__init__.py deleted file mode 100644 index b379a50b9..000000000 --- a/xw_kk_preview_demo/models/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -# -*- coding: utf-8 -*- - -from . import models -from . import patch_attachment \ No newline at end of file diff --git a/xw_kk_preview_demo/models/models.py b/xw_kk_preview_demo/models/models.py deleted file mode 100644 index 5dbf80a5f..000000000 --- a/xw_kk_preview_demo/models/models.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- - -from odoo import models, fields, api - - -class preview_demo(models.Model): - _name = 'xw_kk_preview_demo.preview_demo' - _description = 'kk preview demo' - - name = fields.Char() - value = fields.Integer() - value2 = fields.Float(compute="_value_pc", store=True) - description = fields.Text() - test_preview = fields.Binary(string="test_preview") - - @api.depends('value') - def _value_pc(self): - for record in self: - record.value2 = float(record.value) / 100 diff --git a/xw_kk_preview_demo/models/patch_attachment.py b/xw_kk_preview_demo/models/patch_attachment.py deleted file mode 100644 index 01197dca0..000000000 --- a/xw_kk_preview_demo/models/patch_attachment.py +++ /dev/null @@ -1,19 +0,0 @@ - -# -*- coding: utf-8 -*- - -from odoo import models, fields, api - - -class MdContractAttachment(models.Model): - ''' - attachment - ''' - _inherit = 'ir.attachment' - - @api.model - def check(self, mode, values=None): - """ - Restricts the access to an ir.attachment, according to referred mode - """ - return True - # return super().check(mode, values) diff --git a/xw_kk_preview_demo/security/ir.model.access.csv b/xw_kk_preview_demo/security/ir.model.access.csv deleted file mode 100644 index ea0f89ddf..000000000 --- a/xw_kk_preview_demo/security/ir.model.access.csv +++ /dev/null @@ -1,2 +0,0 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_xw_kk_preview_demo_preview_demo,xw_kk_preview_demo.preview_demo,model_xw_kk_preview_demo_preview_demo,,1,1,1,1 \ No newline at end of file diff --git a/xw_kk_preview_demo/static/description/icon.png b/xw_kk_preview_demo/static/description/icon.png deleted file mode 100644 index 30172b538..000000000 Binary files a/xw_kk_preview_demo/static/description/icon.png and /dev/null differ diff --git a/xw_kk_preview_demo/views/views.xml b/xw_kk_preview_demo/views/views.xml deleted file mode 100644 index b3dbb0247..000000000 --- a/xw_kk_preview_demo/views/views.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - preview_demo - xw_kk_preview_demo.preview_demo - - - - - - - - - - - - - preview_demo form - xw_kk_preview_demo.preview_demo - - - - - - - - - - test_preview - - - - - - - - - - - preview_demo window - xw_kk_preview_demo.preview_demo - tree,form - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/yuthon_hr_attendance/views/all_attendance_menu.xml b/yuthon_hr_attendance/views/all_attendance_menu.xml index 449dcfc7c..58d2bfaf8 100644 --- a/yuthon_hr_attendance/views/all_attendance_menu.xml +++ b/yuthon_hr_attendance/views/all_attendance_menu.xml @@ -24,5 +24,6 @@ sequence="15" action="attendance_iot_manager_action"/> - + \ No newline at end of file diff --git a/yuthon_hr_attendance/views/attendance_iot_manager_views.xml b/yuthon_hr_attendance/views/attendance_iot_manager_views.xml index 7d02ea86e..6b6b07b99 100644 --- a/yuthon_hr_attendance/views/attendance_iot_manager_views.xml +++ b/yuthon_hr_attendance/views/attendance_iot_manager_views.xml @@ -25,7 +25,7 @@ - 假期类型配置 + 考勤机设备管理 attendance.iot.manager tree diff --git a/yuthon_hr_employee/__manifest__.py b/yuthon_hr_employee/__manifest__.py index 45d2e9028..e5536f65c 100644 --- a/yuthon_hr_employee/__manifest__.py +++ b/yuthon_hr_employee/__manifest__.py @@ -13,9 +13,8 @@ 'website': 'https://www.pengyuthon.com', 'depends': ['base', 'hr'], 'data': [ - # 'data/hr_department_data.xml', - # 'data/user_role_data.xml', 'data/yuthon.job.lv.csv', + 'data/employee_code_data.xml', 'security/ir.model.access.csv', 'views/yuthon_hr_employee_views.xml', 'views/yuthon_hr_department_views.xml', diff --git a/yuthon_hr_employee/data/employee_code_data.xml b/yuthon_hr_employee/data/employee_code_data.xml new file mode 100644 index 000000000..d65994304 --- /dev/null +++ b/yuthon_hr_employee/data/employee_code_data.xml @@ -0,0 +1,9 @@ + + + + 员工编号 + employee_code + US%(y)s%(month)s%(day)s + 3 + + diff --git a/yuthon_hr_employee/data/hr_department_data.xml b/yuthon_hr_employee/data/hr_department_data.xml deleted file mode 100644 index 1935d5e05..000000000 --- a/yuthon_hr_employee/data/hr_department_data.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - 天河投资 - False - False - - - - 新兴协会 - 广州市天河区龙口西路90号天成大厦3楼东侧 - True - False - - - - 科创中心 - 广州市天河区龙口西路90号天成大厦4楼东侧 - True - False - - - - 管理员 - 广州市天河区龙口西路90号天成大厦5楼东侧 - False - False - - - - 外派 - 广州市天河区龙口西路90号天成大厦6楼东侧 - False - False - - - - 粮储公司 - 广州市天河区龙口西路90号天成大厦7楼东侧 - False - False - - - - 商业总公司 - 广州市天河区龙口西路90号天成大厦8楼东侧 - False - False - - - - 领导班子 - 广州市天河区龙口西路90号天成大厦9楼东侧 - False - False - - - - - 财务部 - 广州市天河区龙口西路90号天成大厦10楼东侧 - False - False - - - - - 办公室 - 广州市天河区龙口西路90号天成大厦11楼东侧 - False - False - - - - - 企业管理部 - 广州市天河区龙口西路90号天成大厦12楼东侧 - False - False - - - - - 租务二部(原物业经营部) - 广州市天河区龙口西路90号天成大厦13楼东侧 - False - False - - - - - 资本运营部 - 广州市天河区龙口西路90号天成大厦14楼东侧 - False - False - - - - - 投资发展部 - 广州市天河区龙口西路90号天成大厦15楼东侧 - False - False - - - - - 党群人力资源部 - 广州市天河区龙口西路90号天成大厦16楼东侧 - False - False - - - - - 风控审计部 - 广州市天河区龙口西路90号天成大厦17楼东侧 - False - False - - - - - 人事部 - 广州市天河区龙口西路90号天成大厦18楼东侧 - False - False - - - - - 厨位人员 - 广州市天河区龙口西路90号天成大厦19楼东侧 - False - False - - - \ No newline at end of file diff --git a/yuthon_hr_employee/data/user_role_data.xml b/yuthon_hr_employee/data/user_role_data.xml deleted file mode 100644 index 19fc7dd2f..000000000 --- a/yuthon_hr_employee/data/user_role_data.xml +++ /dev/null @@ -1,396 +0,0 @@ - - - - 普通员工 - system_global_user - - - - 常务副秘书长 - departmental_role - association - - - - 总经理 - system_global_user - - - - 理事长 - system_global_user - - - - 常务副会长 - system_global_user - - - - 副总经理 - system_global_user - - - - 监事会主席 - system_global_user - - - - 秘书处办公室主任 - system_global_user - - - - 分管领导 - system_global_user - - - - 部门副经理 - system_global_user - - - - 秘书处办公室副主任 - system_global_user - - - - 部门经理 - system_global_user - - - - 各企业班子(发文) - system_global_user - - - - 试用期员工 - system_global_user - - - - 物业部副总经理 - departmental_role - rent2 - - - - 理事会成员 - system_global_user - - - - 安全办成员 - system_global_user - - - - 实习 - system_global_user - - - - 副院长 - system_global_user - - - - 院长 - system_global_user - - - - 党员 - system_global_user - - - - 科创中心 - system_global_user - - - - 需考勤人员 - system_global_user - - - - 财务(物业) - system_global_user - - - - 集团安委会 - system_global_user - - - - 天投城建安全办 - system_global_user - - - - 集团安全办 - system_global_user - - - - 天投城建安委会 - system_global_user - - - - 天投城建安委会 - system_global_user - - - - 公司领导 - system_global_user - - - - 领导班子 - system_global_user - - - - 董事长 - system_global_user - - - - 执行董事 - departmental_role - storage_company - - - - 秘书长 - departmental_role - association - - - - 副主任 - system_global_user - - - - 工会委员 - system_global_user - - - - 风控审计经理 - departmental_role - risk_department - - - - 风控管理岗 - departmental_role - risk_department - - - - 系统管理员 - oa_admin - - - - 安全办副主任 - system_global_user - - - - 投融资部经理 - departmental_role - capital_department - - - - 投融资部副总经理 - departmental_role - capital_department - - - - 投融资部副经理 - departmental_role - capital_department - - - - 投融资发展部 - departmental_role - capital_department - - - - 项目开发部 - departmental_role - investment_department - - - - 项目部经理 - departmental_role - investment_department - - - - 人事专员 - departmental_role - party_department - - - - 党建专员 - departmental_role - party_department - - - - 人事管理员 - departmental_role - party_department - - - - 人事主管 - departmental_role - party_department - - - - 物业部 - departmental_role - rent2 - - - - 物业部经理 - departmental_role - rent2 - - - - 物业部副经理 - departmental_role - rent2 - - - - 工程主管 - departmental_role - rent2 - - - - 企业管理部 - departmental_role - enterprise_department - - - - 企业管理部经理 - departmental_role - enterprise_department - - - - 财务部 - departmental_role - accounting_department - - - - 财务部经理 - departmental_role - accounting_department - - - - 财务部副经理 - departmental_role - accounting_department - - - - 会计 - departmental_role - accounting_department - - - - 出纳 - departmental_role - accounting_department - - - - 办公室 - departmental_role - office - - - - 主任 - departmental_role - office - - - - 办公室副主任 - departmental_role - office - - - - 公文管理员 - departmental_role - office - - - - 厨卫人员 - departmental_role - office - - - - 办公库管 - departmental_role - office - - - - 子企业人员 - departmental_role - office - - - - 信息发布员 - departmental_role - office - - - - 交通安全员 - system_global_user - - - - - 外派 - departmental_role - expatriate - - - - \ No newline at end of file diff --git a/yuthon_hr_employee/models/yuthon_hr_department.py b/yuthon_hr_employee/models/yuthon_hr_department.py index cb6b1e21a..a9606bd1e 100644 --- a/yuthon_hr_employee/models/yuthon_hr_department.py +++ b/yuthon_hr_employee/models/yuthon_hr_department.py @@ -4,6 +4,7 @@ from odoo import api, fields, models class YuthonHrDepartment(models.Model): _inherit = "hr.department" + _order = 'department_code' department_phone = fields.Char(string="部门电话") department_fax = fields.Char(string="部门传真") @@ -13,3 +14,4 @@ class YuthonHrDepartment(models.Model): is_global_department = fields.Boolean(string="是否全局部门") create_time = fields.Datetime(string="创建时间", default=fields.Datetime.now) end_time = fields.Datetime(string="结束时间") + department_code = fields.Char(string="部门序号") diff --git a/yuthon_hr_employee/models/yuthon_hr_employee.py b/yuthon_hr_employee/models/yuthon_hr_employee.py index 11cfa7472..79316a0ea 100644 --- a/yuthon_hr_employee/models/yuthon_hr_employee.py +++ b/yuthon_hr_employee/models/yuthon_hr_employee.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from odoo import api, fields, models from datetime import datetime +from odoo.exceptions import UserError, ValidationError nation_list = [('a', '汉族'), ('b', '壮族'), ('v', '满族'), ('d', '回族'), ('e', '苗族'), ('f', '维吾尔族'), ('g', '土家族'), ('h', '彝族'), ('i', '蒙古族'), ('j', '藏族'), ('k', '布依族'), ('l', '侗族'), @@ -19,13 +20,15 @@ class YuthonHrEmployee(models.Model): 对原模型数据的隐藏,字段的开发和添加 """ _inherit = "hr.employee" + _order = 'number' # odoo里是这样做的,一个用户可以多个公司绑定多个员工,每个员工都有自己的部门和岗位 - number = fields.Char(string="编号") + number = fields.Char(string="序号", store=True) + user_number = fields.Char(string="员工编号", default=lambda self: self.env['ir.sequence'].next_by_code('employee_code')) use_user_type = fields.Selection([('formal', '正式职工'), ('labor', '劳务协议'), ('part_time', '兼职协议'), ('employment', '兼职用工')], string="用工形式") - user_number = fields.Char(string="员工编号") + job_lv_id = fields.Many2one('yuthon.job.lv', string="最新职级") # 个人信息 user_salary = fields.Float(string="基本工资") @@ -34,7 +37,8 @@ class YuthonHrEmployee(models.Model): confirmation_date = fields.Date(string="转正时间") company_old = fields.Char(string="司龄", compute='_compute_company_old') user_sex = fields.Selection([('girl', '女'), ('boy', '男')], string="性别") - user_state = fields.Selection([('in', '在职'), ('leave', '离职'), ('withdraw', '退休')], string="员工状态") + user_state = fields.Selection([('in', '在职'), ('leave', '离职'), ('withdraw', '退休')], + string="员工状态", compute='_compute_user_state') user_number_start_time = fields.Date(string="身份中有效开始时间") user_number_end_time = fields.Date(string="身份证有效到期时间") nation = fields.Selection(nation_list, string="民族") @@ -43,7 +47,8 @@ class YuthonHrEmployee(models.Model): user_type = fields.Char(string="人员类别") retire_date = fields.Date(string="退休日期") retire_years = fields.Integer(string="离退休年限", compute='_compute_retire_years') - political_aspects = fields.Selection([('cpc_dang', '中共党员'), ('nld', '民盟'), ('league_member', '共青团员'), ('people', '群众')], string="政治面貌") + political_aspects = fields.Selection([('cpc_dang', '中共党员'), ('nld', '民盟'), + ('league_member', '共青团员'), ('people', '群众')], string="政治面貌") dang_data = fields.Date(string="入团(党)时间") user_origin = fields.Char(string="籍贯") user_location = fields.Char(string="户口所在地") @@ -101,6 +106,11 @@ class YuthonHrEmployee(models.Model): # 技能证书管理 skills_certificates_ids = fields.One2many('yuthon.skills.certificates.line', 'employee_id', string="教育经历明细行") + @api.onchange('number') + def onchange_number(self): + if self.department_id.department_code: + self.number = self.department_id.department_code + self.number + def action_hr_employee(self): return { "type": "ir.actions.act_window", @@ -159,3 +169,21 @@ class YuthonHrEmployee(models.Model): record.retire_years = 0 else: record.retire_years = 0 + + @api.depends('new_start_contract_data', 'new_end_contract_data') + def _compute_user_state(self): + for record in self: + today = datetime.now().date() + start_time = record.new_start_contract_data + end_time = record.new_end_contract_data + if start_time and end_time: + if start_time >= end_time: + raise ValidationError('合同开始日期不能大于合同结束日期') + if start_time <= today <= end_time: + record.user_state = 'in' + else: + record.user_state = 'leave' + else: + record.user_state = '' + + diff --git a/yuthon_hr_employee/views/yuthon_hr_department_views.xml b/yuthon_hr_employee/views/yuthon_hr_department_views.xml index 7bd5f6286..8f2c8fd4e 100644 --- a/yuthon_hr_employee/views/yuthon_hr_department_views.xml +++ b/yuthon_hr_employee/views/yuthon_hr_department_views.xml @@ -7,6 +7,7 @@ + diff --git a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml index 3c5e8b3b6..5f8c07127 100644 --- a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml +++ b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml @@ -200,8 +200,37 @@ 1 - - 上级领导 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/yuthon_party/views/menuitem.xml b/yuthon_party/views/menuitem.xml index 832b1b221..44f638cdb 100644 --- a/yuthon_party/views/menuitem.xml +++ b/yuthon_party/views/menuitem.xml @@ -1,50 +1,133 @@ - 党群 - yuthon.party - tree,form + 党建 + yuthon.party + tree,form - - - + - - - + + + + + + + + + + + + - - - - - - + + + + + + + + \ No newline at end of file diff --git a/yuthon_performance/views/yuthon_performance_menus.xml b/yuthon_performance/views/yuthon_performance_menus.xml index 3ae519d36..09566a447 100644 --- a/yuthon_performance/views/yuthon_performance_menus.xml +++ b/yuthon_performance/views/yuthon_performance_menus.xml @@ -47,17 +47,17 @@ action="yuthon_index_management_action"/> - - - - - - - - - - - + + diff --git a/yuthon_property/__manifest__.py b/yuthon_property/__manifest__.py index 65723f965..4af517a72 100644 --- a/yuthon_property/__manifest__.py +++ b/yuthon_property/__manifest__.py @@ -1,11 +1,26 @@ +# -*- coding: utf-8 -*- { 'name': "yuthon property", 'summary': "物业管理", 'description': """""", + 'author': 'zhou', + 'website': 'https://www.pengyuthon.com', + 'version': '0.1', + 'license': 'LGPL-3', 'data': [ - 'security/ir.model.access.csv', # 模块的访问控制文件。这些文件通常包括 CSV 文件,用于定义模型、字段、组等的访问权限。 - 'views/menuitem.xml',], # 模块的数据文件列表。这些文件通常包括 XML 文件,用于定义模型、视图、菜单、动作等。 - 'demo': [], # 模块的演示数据文件列表。这些文件通常包括 XML 文件,用于定义演示数据。 - 'depends': [], # 模块所依赖的其他模块列表。这些模块必须先安装才能安装此模块。 + 'data/sale_renting_code_data.xml', + 'security/ir.model.access.csv', + 'views/yuthon_property_views.xml', + 'views/property_assess_views.xml', + 'views/property_confirm_views.xml', + 'views/property_move_views.xml', + 'views/property_open_rent_views.xml', + 'views/property_record_views.xml', + 'views/property_type_views.xml', + 'views/menuitem.xml', + ], + 'demo': [], + 'depends': ['mail', 'soong_workflow'], + 'installable': True, + 'application': True, } - diff --git a/yuthon_sale_renting/data/sale_renting_code_data.xml b/yuthon_property/data/sale_renting_code_data.xml similarity index 100% rename from yuthon_sale_renting/data/sale_renting_code_data.xml rename to yuthon_property/data/sale_renting_code_data.xml diff --git a/yuthon_property/models/__init__.py b/yuthon_property/models/__init__.py index 2e70e1e24..82ac8c5b5 100644 --- a/yuthon_property/models/__init__.py +++ b/yuthon_property/models/__init__.py @@ -1 +1,7 @@ -from . import yuthon_property \ No newline at end of file +from . import yuthon_property +from . import property_assess +from . import property_confirm +from . import property_move +from . import property_open_rent +from . import property_record +from . import property_type diff --git a/yuthon_sale_renting/models/property_assess.py b/yuthon_property/models/property_assess.py similarity index 100% rename from yuthon_sale_renting/models/property_assess.py rename to yuthon_property/models/property_assess.py diff --git a/yuthon_sale_renting/models/property_confirm.py b/yuthon_property/models/property_confirm.py similarity index 100% rename from yuthon_sale_renting/models/property_confirm.py rename to yuthon_property/models/property_confirm.py diff --git a/yuthon_sale_renting/models/property_move.py b/yuthon_property/models/property_move.py similarity index 100% rename from yuthon_sale_renting/models/property_move.py rename to yuthon_property/models/property_move.py diff --git a/yuthon_sale_renting/models/property_open_rent.py b/yuthon_property/models/property_open_rent.py similarity index 100% rename from yuthon_sale_renting/models/property_open_rent.py rename to yuthon_property/models/property_open_rent.py diff --git a/yuthon_sale_renting/models/property_record.py b/yuthon_property/models/property_record.py similarity index 100% rename from yuthon_sale_renting/models/property_record.py rename to yuthon_property/models/property_record.py diff --git a/yuthon_property/models/property_type.py b/yuthon_property/models/property_type.py new file mode 100644 index 000000000..14806844e --- /dev/null +++ b/yuthon_property/models/property_type.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import models, fields, api, exceptions, _ +from datetime import datetime +from odoo.exceptions import UserError, ValidationError + + +class PropertyType(models.Model): + _name = 'property.type' + _description = '物业状态' + _rec_name = 'name' + + name = fields.Char(string='名称') + create_time = fields.Datetime(string="创建日期", default=lambda self: fields.Datetime.now()) + start_time = fields.Datetime(string="生效日期") + end_time = fields.Datetime(string="终止日期") + is_enable = fields.Boolean(string="是否启用", compute='_compute_is_enable') + + @api.depends('start_time', 'end_time') + def _compute_is_enable(self): + for rec in self: + if rec.start_time >= rec.end_time: + raise ValidationError('合同开始日期不能大于合同结束日期') + if rec.start_time and rec.end_time: + if rec.start_time < datetime.now() < rec.end_time: + rec.is_enable = True + else: + rec.is_enable = False + else: + rec.is_enable = False + + + + + + + + diff --git a/yuthon_property/models/yuthon_property.py b/yuthon_property/models/yuthon_property.py index f063fd882..0312fde28 100644 --- a/yuthon_property/models/yuthon_property.py +++ b/yuthon_property/models/yuthon_property.py @@ -4,5 +4,27 @@ from odoo import models, fields, api class YuthonProperty(models.Model): _name = 'yuthon.property' _description = '物业管理' + _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin'] + _rec_name = 'name' - name = fields.Char(string='名称') \ No newline at end of file + name = fields.Char(string="名称") + property_precinct = fields.Char(string="楼盘片区") + property_floor = fields.Integer(string="楼层") + property_room = fields.Char(string="区") + property_house = fields.Char(string="户型") + property_orientation = fields.Char(string="朝向") + property_use_id = fields.Integer(string="物业用途ID") + property_asset_type = fields.Selection([('plant', '厂房'), ('goods', '商品'), + ('office', '写字楼'), ('dormitory', '宿舍'), + ('rig', '设备等管理用房')], string='资产类型') + property_asset_use = fields.Selection([('hire', '出租'), ('personal', '自用')], string='资产用途') + property_use_type = fields.Selection([('work', '办公'), ('dorm', '宿舍'), ('cater', '餐饮')], string='使用类型') + property_use_time = fields.Datetime(string="使用年限") + property_rent_type = fields.Selection([('could', '可租'), ('no', '不可租'), + ('done', '已租'), ('none', '空置')], string="出租状态") + state_id = fields.Many2one('property.type', string='状态') + property_source = fields.Selection([('cut', '划入'), ('self', '自建'), + ('replace', '置换'), ('buy', '购入'), + ('entrust', '委托'), ('Rent', '租入')], string='来源') + image_1920 = fields.Image(string="图片") + description = fields.Html(string="描述") diff --git a/yuthon_property/security/ir.model.access.csv b/yuthon_property/security/ir.model.access.csv index 28183f201..36f5d9a1e 100644 --- a/yuthon_property/security/ir.model.access.csv +++ b/yuthon_property/security/ir.model.access.csv @@ -1,3 +1,9 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_yuthon_property,yuthon_property,model_yuthon_property,base.group_user,1,1,1,1 +access_property_assess,property_assess,model_property_assess,base.group_user,1,1,1,1 +access_property_confirm,property_confirm,model_property_confirm,base.group_user,1,1,1,1 +access_property_move,property_move,model_property_move,base.group_user,1,1,1,1 +access_property_open_rent,property_open_rent,model_property_open_rent,base.group_user,1,1,1,1 +access_property_record,property_record,model_property_record,base.group_user,1,1,1,1 +access_property_type,property_type,model_property_type,base.group_user,1,1,1,1 diff --git a/yuthon_property/views/menuitem.xml b/yuthon_property/views/menuitem.xml index e2b25bced..381b02387 100644 --- a/yuthon_property/views/menuitem.xml +++ b/yuthon_property/views/menuitem.xml @@ -1,9 +1,9 @@ - + 物业管理 - yuthon.property - tree,form + yuthon.property + tree,form @@ -11,70 +11,83 @@ sequence="4" web_icon="yuthon_property,static/description/icon.png" name="物业管理"/> - + - - - - - - - - - + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + + + + + + + + parent="yuthon_property_menu_root"/> + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + action="property_assess_action"/> + + + + diff --git a/yuthon_sale_renting/views/property_assess_views.xml b/yuthon_property/views/property_assess_views.xml similarity index 100% rename from yuthon_sale_renting/views/property_assess_views.xml rename to yuthon_property/views/property_assess_views.xml diff --git a/yuthon_sale_renting/views/property_confirm_views.xml b/yuthon_property/views/property_confirm_views.xml similarity index 100% rename from yuthon_sale_renting/views/property_confirm_views.xml rename to yuthon_property/views/property_confirm_views.xml diff --git a/yuthon_sale_renting/views/property_move_views.xml b/yuthon_property/views/property_move_views.xml similarity index 100% rename from yuthon_sale_renting/views/property_move_views.xml rename to yuthon_property/views/property_move_views.xml diff --git a/yuthon_sale_renting/views/property_open_rent_views.xml b/yuthon_property/views/property_open_rent_views.xml similarity index 100% rename from yuthon_sale_renting/views/property_open_rent_views.xml rename to yuthon_property/views/property_open_rent_views.xml diff --git a/yuthon_sale_renting/views/property_record_views.xml b/yuthon_property/views/property_record_views.xml similarity index 100% rename from yuthon_sale_renting/views/property_record_views.xml rename to yuthon_property/views/property_record_views.xml diff --git a/yuthon_property/views/property_type_views.xml b/yuthon_property/views/property_type_views.xml new file mode 100644 index 000000000..72b126aa1 --- /dev/null +++ b/yuthon_property/views/property_type_views.xml @@ -0,0 +1,22 @@ + + + + property.type.tree + property.type + + + + + + + + + + + + + 物业调拨审批 + property.type + tree + + diff --git a/yuthon_property/views/yuthon_property_views.xml b/yuthon_property/views/yuthon_property_views.xml new file mode 100644 index 000000000..4adfec663 --- /dev/null +++ b/yuthon_property/views/yuthon_property_views.xml @@ -0,0 +1,139 @@ + + + + yuthon.property.tree + yuthon.property + + + + + + + + + + + + + + + + + + + + yuthon.property.form + yuthon.property + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + yuthon.property.search + yuthon.property + + + + + + + + + + + + + + + + + yuthon.property.kanban + yuthon.property + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 物业 + yuthon.property + kanban,tree,form + + + + \ No newline at end of file diff --git a/yuthon_sale_renting/__manifest__.py b/yuthon_sale_renting/__manifest__.py index d117dcbd6..d47ab333b 100644 --- a/yuthon_sale_renting/__manifest__.py +++ b/yuthon_sale_renting/__manifest__.py @@ -16,13 +16,6 @@ 'security/ir.model.access.csv', 'views/yuthon_res_partner_views.xml', 'views/contacts_inherit_menu_views.xml', - 'views/property_assess_views.xml', - 'views/property_confirm_views.xml', - 'views/property_move_views.xml', - 'views/property_open_rent_views.xml', - 'views/property_record_views.xml', - 'views/yuthon_product_template_views.xml', - 'views/menus.xml', ], 'installable': True, 'application': True, diff --git a/yuthon_sale_renting/models/__init__.py b/yuthon_sale_renting/models/__init__.py index 87362a99a..b1bc2f8f4 100644 --- a/yuthon_sale_renting/models/__init__.py +++ b/yuthon_sale_renting/models/__init__.py @@ -2,9 +2,5 @@ from . import yuthon_res_partner from . import yuthon_product_template -from . import property_assess -from . import property_confirm -from . import property_move -from . import property_open_rent -from . import property_record + diff --git a/yuthon_sale_renting/models/yuthon_product_template.py b/yuthon_sale_renting/models/yuthon_product_template.py deleted file mode 100644 index 0b0be2cb4..000000000 --- a/yuthon_sale_renting/models/yuthon_product_template.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from odoo import models, fields, api, exceptions, _ - - -class ProductTemplate(models.Model): - _inherit = 'product.template' - _description = '物业基本信息字段添加' - - property_number = fields.Char(string="物业编号") - property_name = fields.Char(string="物业简称") - property_precinct = fields.Char(string="楼盘片区") - property_floor = fields.Char(string="楼层") - # 区,街道 - property_statu = fields.Char(string="物业状态") - property_main_user = fields.Char(string="权属人") - property_all_m = fields.Float(string="产权面积") - # 单位 - property_rent_m = fields.Float(string="可租面积") - # 单位 - property_certificate = fields.Char(string="产权证号") - property_start_date = fields.Datetime(string="生效日期") - property_end_date = fields.Datetime(string="失效日期") - - - diff --git a/yuthon_sale_renting/security/ir.model.access.csv b/yuthon_sale_renting/security/ir.model.access.csv index e77afa129..d7595f820 100644 --- a/yuthon_sale_renting/security/ir.model.access.csv +++ b/yuthon_sale_renting/security/ir.model.access.csv @@ -1,8 +1,4 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_property_assess,property_assess,model_property_assess,base.group_user,1,1,1,1 -access_property_confirm,property_confirm,model_property_confirm,base.group_user,1,1,1,1 -access_property_move,property_move,model_property_move,base.group_user,1,1,1,1 -access_property_open_rent,property_open_rent,model_property_open_rent,base.group_user,1,1,1,1 -access_property_record,property_record,model_property_record,base.group_user,1,1,1,1 + diff --git a/yuthon_sale_renting/views/contacts_inherit_menu_views.xml b/yuthon_sale_renting/views/contacts_inherit_menu_views.xml index 7baa720a6..9575665c5 100644 --- a/yuthon_sale_renting/views/contacts_inherit_menu_views.xml +++ b/yuthon_sale_renting/views/contacts_inherit_menu_views.xml @@ -16,16 +16,16 @@ [('partner_type', '=', 'employee')] {'default_is_company': True} - - 承租方 - res.partner - kanban,tree,form,activity - - [('partner_type', '=', 'tenant')] - {'default_is_company': True} - - + + + + + + + + + + - - - - - - - - - \ No newline at end of file diff --git a/yuthon_sale_renting/views/yuthon_product_template_views.xml b/yuthon_sale_renting/views/yuthon_product_template_views.xml deleted file mode 100644 index 562ac3dfd..000000000 --- a/yuthon_sale_renting/views/yuthon_product_template_views.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - product.template.inherit.property.form - product.template - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/yuthon_tianhe/__manifest__.py b/yuthon_tianhe/__manifest__.py index 22277e90d..d38517eb7 100644 --- a/yuthon_tianhe/__manifest__.py +++ b/yuthon_tianhe/__manifest__.py @@ -33,9 +33,6 @@ 'views/right_login_template.xml', 'views/right_login_template.xml', 'views/inherit_board_views.xml', - - 'views/menuitem_sequence.xml', - ] } diff --git a/yuthon_tianhe/views/menuitem_sequence.xml b/yuthon_tianhe/views/menuitem_sequence.xml deleted file mode 100644 index a1f880f96..000000000 --- a/yuthon_tianhe/views/menuitem_sequence.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - 工作台 - 0 - - - - - 项目管理 - 2 - - - - 流程中心 - 3 - - - - 人力资源 - 5 - - - - 文档管理 - 6 - - - - 物业系统 - 7 - - - - 会议管理 - 8 - - - - 采购 - 9 - - - - 出勤 - 11 - - - - 工资 - 12 - - - - 待办 - 13 - - - - 日历 - 14 - - - - 车辆管理 - 15 - - - - 培训学习 - 16 - - - - 门户网站 - 17 - - - - 讨论 - 18 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/yuthon_work/views/menuitem.xml b/yuthon_work/views/menuitem.xml index f9457829e..486f6e673 100644 --- a/yuthon_work/views/menuitem.xml +++ b/yuthon_work/views/menuitem.xml @@ -2,13 +2,9 @@ 协同办公 - yuthon.work - tree,form + yuthon.work + tree,form - - - - + + + + False + + + + False + + + + False + + + + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/yuthon_work_brand/views/work_menus.xml b/yuthon_work_brand/views/work_menus.xml new file mode 100644 index 000000000..854d4eaed --- /dev/null +++ b/yuthon_work_brand/views/work_menus.xml @@ -0,0 +1,166 @@ + + + + + False + + + + False + + + + False + + + + False + + + + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/yuthon_work_brand/views/yuthon_none_views.xml b/yuthon_work_brand/views/yuthon_none_views.xml new file mode 100644 index 000000000..ea7504b50 --- /dev/null +++ b/yuthon_work_brand/views/yuthon_none_views.xml @@ -0,0 +1,18 @@ + + + + yuthon.none.tree + yuthon.none + + + + + + + + + 待开发 + yuthon.none + tree,form + + \ No newline at end of file