diff --git a/login_bg_img_knk/COPYRIGHT b/login_bg_img_knk/COPYRIGHT deleted file mode 100644 index 58ce57a4..00000000 --- a/login_bg_img_knk/COPYRIGHT +++ /dev/null @@ -1,15 +0,0 @@ - -Most of the files are - - Copyright (c) 2012-TODAY Kanak Infosystems LLP. - -Many files also contain contributions from third -parties. In this case the original copyright of -the contributions can be traced through the -history of the source version control system. - -When that is not the case, the files contain a prominent -notice stating the original copyright and applicable -license, or come with their own dedicated COPYRIGHT -and/or LICENSE file. - diff --git a/login_bg_img_knk/LICENSE b/login_bg_img_knk/LICENSE deleted file mode 100644 index c283e316..00000000 --- a/login_bg_img_knk/LICENSE +++ /dev/null @@ -1,11 +0,0 @@ -Kanak Infosystems LLP. Proprietary License v1.0 - -This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Kanak Infosystems LLP Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). - -You may develop Kanak Infosystems LLP modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Kanak Infosystems LLP Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). - -It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. - -The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/login_bg_img_knk/__init__.py b/login_bg_img_knk/__init__.py deleted file mode 100644 index 83216f5d..00000000 --- a/login_bg_img_knk/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -# Powered by Kanak Infosystems LLP. -# © 2020 Kanak Infosystems LLP. (). - -from . import controller -from . import models diff --git a/login_bg_img_knk/__manifest__.py b/login_bg_img_knk/__manifest__.py deleted file mode 100644 index 82d76019..00000000 --- a/login_bg_img_knk/__manifest__.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -# Powered by Kanak Infosystems LLP. -# © 2020 Kanak Infosystems LLP. (). - -{ - 'name': "Background image in Login page", - 'version': '16.0.1.0', - 'summary': """Module helps to set background image in Login page.| Background image | image|Login | Login page|website|""", - 'description': """Module helps to set background image in Login page.""", - 'license': 'OPL-1', - 'website': "https://www.kanakinfosystems.com", - 'author': 'Kanak Infosystems LLP.', - 'category': 'Tools', - 'depends': ['base', 'portal'], - 'data': [ - 'views/res_company.xml', - ], - 'assets': { - 'web.assets_frontend': [ - 'login_bg_img_knk/static/src/css/bg_image.scss', - ], - }, - 'images': ['static/description/banner.gif'], - 'sequence': 1, - "application": True, - "installable": True -} diff --git a/login_bg_img_knk/controller/__init__.py b/login_bg_img_knk/controller/__init__.py deleted file mode 100644 index 41c4fedd..00000000 --- a/login_bg_img_knk/controller/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# -*- coding: utf-8 -*- -# Powered by Kanak Infosystems LLP. -# © 2020 Kanak Infosystems LLP. (). - -from . import main diff --git a/login_bg_img_knk/controller/main.py b/login_bg_img_knk/controller/main.py deleted file mode 100644 index 0e4113f0..00000000 --- a/login_bg_img_knk/controller/main.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Powered by Kanak Infosystems LLP. -# © 2020 Kanak Infosystems LLP. (). - -import base64 -from odoo.http import Controller, request, route -from werkzeug.utils import redirect - -DEFAULT_IMAGE = 'login_bg_img_knk/static/src/img/bg.jpg' - - -class DasboardBackground(Controller): - - @route(['/dashboard'], type='http', auth="public") - def dashboard(self, **post): - user = request.env.user - company = user.company_id - if company.bg_image: - image = base64.b64decode(company.bg_image) - else: - return redirect(DEFAULT_IMAGE) - - return request.make_response( - image, [('Content-Type', 'image')]) diff --git a/login_bg_img_knk/models/__init__.py b/login_bg_img_knk/models/__init__.py deleted file mode 100644 index dc14dc60..00000000 --- a/login_bg_img_knk/models/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# -*- coding: utf-8 -*- -# Powered by Kanak Infosystems LLP. -# © 2020 Kanak Infosystems LLP. (). - -from . import res_company diff --git a/login_bg_img_knk/models/res_company.py b/login_bg_img_knk/models/res_company.py deleted file mode 100644 index a5f77d20..00000000 --- a/login_bg_img_knk/models/res_company.py +++ /dev/null @@ -1,12 +0,0 @@ -# -*- coding: utf-8 -*- -# Powered by Kanak Infosystems LLP. -# © 2020 Kanak Infosystems LLP. (). - - -from odoo import models, fields - - -class ResCompany(models.Model): - _inherit = 'res.company' - - bg_image = fields.Binary(string="Image") diff --git a/login_bg_img_knk/static/description/App-Link.png b/login_bg_img_knk/static/description/App-Link.png deleted file mode 100644 index 106b0af7..00000000 Binary files a/login_bg_img_knk/static/description/App-Link.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/Configuration _ Setup.png b/login_bg_img_knk/static/description/Configuration _ Setup.png deleted file mode 100644 index 9abdf890..00000000 Binary files a/login_bg_img_knk/static/description/Configuration _ Setup.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/Demo.png b/login_bg_img_knk/static/description/Demo.png deleted file mode 100644 index 39cd46ec..00000000 Binary files a/login_bg_img_knk/static/description/Demo.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/FAQ_S.png b/login_bg_img_knk/static/description/FAQ_S.png deleted file mode 100644 index 6616bbb8..00000000 Binary files a/login_bg_img_knk/static/description/FAQ_S.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/Hire-Odoo-Developer.png b/login_bg_img_knk/static/description/Hire-Odoo-Developer.png deleted file mode 100644 index 3f7aecfe..00000000 Binary files a/login_bg_img_knk/static/description/Hire-Odoo-Developer.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/Key-feature-icon.png b/login_bg_img_knk/static/description/Key-feature-icon.png deleted file mode 100644 index 685edc97..00000000 Binary files a/login_bg_img_knk/static/description/Key-feature-icon.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/Odoo-Customization.png b/login_bg_img_knk/static/description/Odoo-Customization.png deleted file mode 100644 index b6fc7fa7..00000000 Binary files a/login_bg_img_knk/static/description/Odoo-Customization.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/Odoo-Development.png b/login_bg_img_knk/static/description/Odoo-Development.png deleted file mode 100644 index c3c5aca0..00000000 Binary files a/login_bg_img_knk/static/description/Odoo-Development.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/Odoo-Installation.png b/login_bg_img_knk/static/description/Odoo-Installation.png deleted file mode 100644 index 6f741031..00000000 Binary files a/login_bg_img_knk/static/description/Odoo-Installation.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/Odoo-Integration.png b/login_bg_img_knk/static/description/Odoo-Integration.png deleted file mode 100644 index 8187244b..00000000 Binary files a/login_bg_img_knk/static/description/Odoo-Integration.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/Odoo-Resources.png b/login_bg_img_knk/static/description/Odoo-Resources.png deleted file mode 100644 index ac38e452..00000000 Binary files a/login_bg_img_knk/static/description/Odoo-Resources.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/Odoo-Themes.png b/login_bg_img_knk/static/description/Odoo-Themes.png deleted file mode 100644 index fbec74cf..00000000 Binary files a/login_bg_img_knk/static/description/Odoo-Themes.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/Odoo-Training.png b/login_bg_img_knk/static/description/Odoo-Training.png deleted file mode 100644 index af795fed..00000000 Binary files a/login_bg_img_knk/static/description/Odoo-Training.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/Release Notes.png b/login_bg_img_knk/static/description/Release Notes.png deleted file mode 100644 index 500d6e8f..00000000 Binary files a/login_bg_img_knk/static/description/Release Notes.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/Support.png b/login_bg_img_knk/static/description/Support.png deleted file mode 100644 index 8fd57089..00000000 Binary files a/login_bg_img_knk/static/description/Support.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/banner.gif b/login_bg_img_knk/static/description/banner.gif deleted file mode 100644 index 9164bc32..00000000 Binary files a/login_bg_img_knk/static/description/banner.gif and /dev/null differ diff --git a/login_bg_img_knk/static/description/bg1.png b/login_bg_img_knk/static/description/bg1.png deleted file mode 100644 index d3af7dc1..00000000 Binary files a/login_bg_img_knk/static/description/bg1.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/bg2.png b/login_bg_img_knk/static/description/bg2.png deleted file mode 100644 index 9ed3dc64..00000000 Binary files a/login_bg_img_knk/static/description/bg2.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/bg3.png b/login_bg_img_knk/static/description/bg3.png deleted file mode 100644 index fadc99f3..00000000 Binary files a/login_bg_img_knk/static/description/bg3.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/congi_1.png b/login_bg_img_knk/static/description/congi_1.png deleted file mode 100644 index 71ff733e..00000000 Binary files a/login_bg_img_knk/static/description/congi_1.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/email.png b/login_bg_img_knk/static/description/email.png deleted file mode 100644 index c7519d2c..00000000 Binary files a/login_bg_img_knk/static/description/email.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/icon.png b/login_bg_img_knk/static/description/icon.png deleted file mode 100644 index b35f574b..00000000 Binary files a/login_bg_img_knk/static/description/icon.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/index.html b/login_bg_img_knk/static/description/index.html deleted file mode 100644 index 9b98219f..00000000 --- a/login_bg_img_knk/static/description/index.html +++ /dev/null @@ -1,409 +0,0 @@ -
-
-
-
- - kanakinfosystems-logo - -
-
- Supported Editions -
-
Community
-
Enterprise
-
Odoo.sh
-
-
-
- - odoo-logo - -
-
-
-
-
-
-
-
-

- Background image in Login page -

-
-
-
-
-

Background image in Login page module helps to set background image in Login page. -

-
-
-
-

Key Features of Background image in Login page

-
    -
  • set background image in Login page. -
  • -
  • Support Multi Company. -
  • -
-
-
-
-
-
-
- -
-
-
-
-
-
-
- - Allows you to set login background image. -
-
- -
-
-
- -
-
-
- -
-
-
-

-
-
-
-
-
-
-
- -
-
-
-
    -
  1. -

    Background image in Login page

    -
  2. -
  3. -

    Optimized code.

    -
  4. -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Q Is this app compatible with Odoo Enterprise? -
- -
-
-
-
- Yes, our app works with Odoo Enterprise. -
-
-
-
-
-
-
Q Is this app compatible with Windows or Ubuntu? -
- -
-
-
-
- Yes, our app works with Windows or Ubuntu operating system. -
-
-
-
-
-
-
-
-
-
-
- -
-
-

-
- FREE 3 MONTHS SUPPORT -
-

-

Kanak Infosystems LLP. will provide free 3 months support for bug fixes, any doubts or queries, installation, configuration support or any types of issues related related to this module.

-
- NOTE: - This module do not required extra configuration. -
-
-
-
-
-
-
-
-
- - - -
-
-
-
- Suggested Apps -
- - -
-
-
-
-
- Our Services -
- - -
- \ No newline at end of file diff --git a/login_bg_img_knk/static/description/knk_sale_return.jpg b/login_bg_img_knk/static/description/knk_sale_return.jpg deleted file mode 100644 index cca98c5a..00000000 Binary files a/login_bg_img_knk/static/description/knk_sale_return.jpg and /dev/null differ diff --git a/login_bg_img_knk/static/description/logo.png b/login_bg_img_knk/static/description/logo.png deleted file mode 100644 index 78fdb08b..00000000 Binary files a/login_bg_img_knk/static/description/logo.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/odoo-logo.png b/login_bg_img_knk/static/description/odoo-logo.png deleted file mode 100644 index 28be83cf..00000000 Binary files a/login_bg_img_knk/static/description/odoo-logo.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/order_history.jpg b/login_bg_img_knk/static/description/order_history.jpg deleted file mode 100644 index ebf60f2b..00000000 Binary files a/login_bg_img_knk/static/description/order_history.jpg and /dev/null differ diff --git a/login_bg_img_knk/static/description/sale_approval_kanak.jpg b/login_bg_img_knk/static/description/sale_approval_kanak.jpg deleted file mode 100644 index 44da796e..00000000 Binary files a/login_bg_img_knk/static/description/sale_approval_kanak.jpg and /dev/null differ diff --git a/login_bg_img_knk/static/description/sale_estimate.jpg b/login_bg_img_knk/static/description/sale_estimate.jpg deleted file mode 100644 index eb201f2b..00000000 Binary files a/login_bg_img_knk/static/description/sale_estimate.jpg and /dev/null differ diff --git a/login_bg_img_knk/static/description/sale_loyalty.jpg b/login_bg_img_knk/static/description/sale_loyalty.jpg deleted file mode 100644 index f522104b..00000000 Binary files a/login_bg_img_knk/static/description/sale_loyalty.jpg and /dev/null differ diff --git a/login_bg_img_knk/static/description/schedule_delivery_knk.jpg b/login_bg_img_knk/static/description/schedule_delivery_knk.jpg deleted file mode 100644 index 7a096db4..00000000 Binary files a/login_bg_img_knk/static/description/schedule_delivery_knk.jpg and /dev/null differ diff --git a/login_bg_img_knk/static/description/skype.png b/login_bg_img_knk/static/description/skype.png deleted file mode 100644 index 2826b373..00000000 Binary files a/login_bg_img_knk/static/description/skype.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/support-ticket.png b/login_bg_img_knk/static/description/support-ticket.png deleted file mode 100644 index 385638db..00000000 Binary files a/login_bg_img_knk/static/description/support-ticket.png and /dev/null differ diff --git a/login_bg_img_knk/static/description/whatsapp.png b/login_bg_img_knk/static/description/whatsapp.png deleted file mode 100644 index 6961455b..00000000 Binary files a/login_bg_img_knk/static/description/whatsapp.png and /dev/null differ diff --git a/login_bg_img_knk/static/src/css/bg_image.scss b/login_bg_img_knk/static/src/css/bg_image.scss deleted file mode 100644 index de8268c9..00000000 --- a/login_bg_img_knk/static/src/css/bg_image.scss +++ /dev/null @@ -1,4 +0,0 @@ -// -// .right_align_x { -// text-align: center; -// } \ No newline at end of file diff --git a/login_bg_img_knk/static/src/img/bg.jpg b/login_bg_img_knk/static/src/img/bg.jpg deleted file mode 100644 index 9508c3d1..00000000 Binary files a/login_bg_img_knk/static/src/img/bg.jpg and /dev/null differ diff --git a/login_bg_img_knk/views/res_company.xml b/login_bg_img_knk/views/res_company.xml deleted file mode 100644 index 3fefbd28..00000000 --- a/login_bg_img_knk/views/res_company.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - res.company.form.inherit.account - res.company - - - - - - - - - - \ No newline at end of file diff --git a/sf_base/models/base.py b/sf_base/models/base.py index a6e1d4cc..a6baa813 100644 --- a/sf_base/models/base.py +++ b/sf_base/models/base.py @@ -86,7 +86,7 @@ class MachineTool(models.Model): brand_id = fields.Many2one('sf.machine.brand', string='品牌') state = fields.Selection( [("正常", "正常"), ("故障", "故障"), ("不可用", "不可用")], - default='正常', string="状态") + default='正常', string="机床状态") # 一个机床对应一個加工工厂,一个加工工厂对应多个机床 factory_id = fields.Many2one('res.partner', string='所属工厂', @@ -95,7 +95,7 @@ class MachineTool(models.Model): supplier_id = fields.Many2one('res.partner', string='制造商', domain="[('is_vendor', '=', True)]") registration_date = fields.Date('注册日期') - + state_zc = fields.Selection([("已注册", "已注册"), ("未注册", "未注册")], string="注册状态", default='未注册') active = fields.Boolean('有效', default=True) @api.constrains('rotate_speed') @@ -198,6 +198,7 @@ class MachineTool(models.Model): r = requests.post(strurl, json={}, data={'kw': kw, 'token': token}, headers=headers) ret = r.json() self.code = ret['message'] + self.state_zc = "已注册" if r == 200: return "机床注册成功" else: diff --git a/sf_base/views/base_view.xml b/sf_base/views/base_view.xml index 7d4854d3..6dffe5e0 100644 --- a/sf_base/views/base_view.xml +++ b/sf_base/views/base_view.xml @@ -347,8 +347,7 @@ - - + @@ -365,6 +364,7 @@ + - fullscreen + + current [('state', 'not in', ['done', 'cancel'])] {'search_default_workcenter_id': active_id} diff --git a/yizuo_login_background_and_styles/.DS_Store b/yizuo_login_background_and_styles/.DS_Store new file mode 100644 index 00000000..6974e9ac Binary files /dev/null and b/yizuo_login_background_and_styles/.DS_Store differ diff --git a/yizuo_login_background_and_styles/__init__.py b/yizuo_login_background_and_styles/__init__.py new file mode 100644 index 00000000..91c5580f --- /dev/null +++ b/yizuo_login_background_and_styles/__init__.py @@ -0,0 +1,2 @@ +from . import controllers +from . import models diff --git a/yizuo_login_background_and_styles/__manifest__.py b/yizuo_login_background_and_styles/__manifest__.py new file mode 100644 index 00000000..805bb0c8 --- /dev/null +++ b/yizuo_login_background_and_styles/__manifest__.py @@ -0,0 +1,28 @@ +# -*- encoding: utf-8 -*- +{ + 'name': 'Login Background And Styles', + 'version': '16.0.2.0.0', + 'category': 'website', + 'summary': """ + You can customised login page like add background image or color and change position of login form. + """, + 'author': 'YiZuo ltd.,', + 'website': 'https://www.yizuo.ltd', + 'license': 'AGPL-3', + 'depends': ['base', 'base_setup', 'web', 'auth_signup'], + 'data': [ + 'security/ir.model.access.csv', + 'views/res_config_settings_views.xml', + 'views/login_image.xml', + 'templates/assets.xml', + 'templates/left_login_template.xml', + 'templates/right_login_template.xml', + 'templates/middle_login_template.xml', + ], + 'qweb': [ + ], + 'installable': True, + 'application': True, + 'images': ['static/description/banner.png'], +} + diff --git a/yizuo_login_background_and_styles/controllers/__init__.py b/yizuo_login_background_and_styles/controllers/__init__.py new file mode 100644 index 00000000..f2a52524 --- /dev/null +++ b/yizuo_login_background_and_styles/controllers/__init__.py @@ -0,0 +1,3 @@ +# -*- encoding: utf-8 -*- + +from . import main diff --git a/yizuo_login_background_and_styles/controllers/main.py b/yizuo_login_background_and_styles/controllers/main.py new file mode 100644 index 00000000..4ddcdf6f --- /dev/null +++ b/yizuo_login_background_and_styles/controllers/main.py @@ -0,0 +1,149 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Changsha Yizuo Intelligent Technology Co., Ltd. +# +# Copyright (C) 2020-TODAY Yizuo Intelligent Technology.(). +# Author: Van(v16)(pengyb@yizuo.ltd) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +try: + import httpagentparser +except ImportError: + pass +from time import gmtime, strftime +from odoo.addons.web.controllers import home +from odoo.http import request +from odoo.exceptions import Warning +import odoo +import odoo.modules.registry +from odoo.tools.translate import _ +from odoo import http + + +class Home(home.Home): + + @http.route('/web/login', type='http', auth="public") + def web_login(self, redirect=None, **kw): + home.ensure_db() + request.params['login_success'] = False + if request.httprequest.method == 'GET' and redirect and request.session.uid: + return request.redirect(redirect) + + if not request.uid: + request.uid = odoo.SUPERUSER_ID + + values = request.params.copy() + try: + values['databases'] = http.db_list() + except odoo.exceptions.AccessDenied: + values['databases'] = None + if request.httprequest.method == 'POST': + old_uid = request.uid + uid = request.session.authenticate(request.session.db, + request.params['login'], + request.params['password']) + if uid is not False: + # user_rec = request.env['res.users'].sudo().search( + # [('id', '=', uid)]) + # if user_rec.partner_id.email and user_rec.has_group( + # 'user_login_alert.receive_login_notification'): + # send_mail = 0 + # agent = request.httprequest.environ.get('HTTP_USER_AGENT') + # agent_details = httpagentparser.detect(agent) + # user_os = agent_details['os']['name'] + # browser_name = agent_details['browser']['name'] + # ip_address = request.httprequest.environ['REMOTE_ADDR'] + # if user_rec.last_logged_ip and user_rec.last_logged_browser and user_rec.last_logged_os: + # if user_rec.last_logged_ip != ip_address or user_rec.last_logged_browser != browser_name or user_rec.last_logged_os != user_os: + # send_mail = 1 + # user_rec.last_logged_ip = ip_address + # user_rec.last_logged_browser = browser_name + # user_rec.last_logged_os = user_os + # else: + # send_mail = 0 + # else: + # send_mail = 1 + # user_rec.last_logged_ip = ip_address + # user_rec.last_logged_browser = browser_name + # user_rec.last_logged_os = user_os + # if send_mail == 1: + # email_to = user_rec.partner_id.email + # current_date_time = strftime("%Y-%m-%d %H:%M:%S", + # gmtime()) + # message_body = 'Hi ' + user_rec.name + ' , Your account has been ' \ + # 'accessed successfully. The details of the ' \ + # 'system from which the account is accessed ...,' + # message_body += '' + # message_body += '' \ + # '' \ + # '' \ + # '' \ + # '' \ + # '' \ + # '' \ + # '' \ + # '' + # message_body += '
' + 'OS' + '' + user_os + '
' + 'Browser' + '' + browser_name + '
' + 'IP Address' + '' + ip_address + '
' + # message_body += 'Thank you' + # template_obj = request.env['mail.mail'] + # template_data = { + # 'subject': 'Login Alert : ' + current_date_time, + # 'body_html': message_body, + # 'email_from': request.env.user.company_id.email, + # 'email_to': email_to + # } + # template_id = template_obj.create(template_data) + # template_obj.send(template_id) + request.params['login_success'] = True + if not redirect: + redirect = '/web' + return request.redirect( + self._login_redirect(uid, redirect=redirect)) + request.uid = old_uid + values['error'] = _("Wrong login/password") + + # get confi login set + param_obj = request.env['ir.config_parameter'].sudo() + values['reset_password_enabled'] = param_obj.get_param('auth_signup.reset_password') + values['signup_enabled'] = param_obj.get_param('auth_signup.invitation_scope') == 'b2c' + values['disable_footer'] = param_obj.get_param('disable_footer') + style = param_obj.get_param('login_background.style') + background = param_obj.get_param('login_background.background') + values['background_color'] = param_obj.get_param('login_background.color') + background_image = param_obj.get_param('login_background.background_image') + + if background == 'image': + image_url = '' + if background_image: + base_url = param_obj.get_param('web.base.url') + image_url = base_url + '/web/image?' + 'model=login.image&id=' + background_image + '&field=image' + values['background_src'] = image_url or '' + values['background_color'] = '' + + if background == 'color': + values['background_src'] = '' + + if style == 'default' or style is False: + response = request.render('web.login', values) + elif style == 'left': + response = request.render('yizuo_login_background_and_styles.left_login_template', values) + elif style == 'right': + response = request.render('yizuo_login_background_and_styles.right_login_template', values) + else: + response = request.render('yizuo_login_background_and_styles.middle_login_template', values) + + response.headers['X-Frame-Options'] = 'DENY' + return response diff --git a/yizuo_login_background_and_styles/models/__init__.py b/yizuo_login_background_and_styles/models/__init__.py new file mode 100644 index 00000000..2943adba --- /dev/null +++ b/yizuo_login_background_and_styles/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- + +from . import res_config_settings +from . import login_image +# from . import website diff --git a/yizuo_login_background_and_styles/models/login_image.py b/yizuo_login_background_and_styles/models/login_image.py new file mode 100644 index 00000000..5b3b19fe --- /dev/null +++ b/yizuo_login_background_and_styles/models/login_image.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +from odoo import models, fields, api, _ + + +class LoginImage(models.Model): + _name = 'login.image' + _rec_name = 'name' + + image = fields.Binary(string="Image") + name = fields.Char(string="Name") diff --git a/yizuo_login_background_and_styles/models/res_config_settings.py b/yizuo_login_background_and_styles/models/res_config_settings.py new file mode 100644 index 00000000..e891ae0e --- /dev/null +++ b/yizuo_login_background_and_styles/models/res_config_settings.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +from odoo import api, fields, models, modules + + +class ResConfigSettings(models.TransientModel): + _inherit = 'res.config.settings' + + style = fields.Selection([('default', 'Default'), ('left', 'Left'), ('right', 'Right'), ('middle', 'Middle')], help='Select Background Theme') + background = fields.Selection([('image', 'Image'), ('color', 'Color')], default='color', help='Select Background Theme') + background_image = fields.Many2one('login.image', string="Image", help='Select Background Image For Login Page') + color = fields.Char(string="Color", help="Choose your Background color") + + @api.onchange('background') + def onchange_background(self): + if self.background == 'image': + self.color = False + elif self.background == 'color': + self.background_image = False + else: + self.background_image = self.color = False + + @api.onchange('style') + def onchange_style(self): + if self.style == 'default' or self.style is False: + self.background = self.background_image = self.color = False + + @api.model + def get_values(self): + res = super(ResConfigSettings, self).get_values() + image_id = int(self.env['ir.config_parameter'].sudo().get_param('login_background.background_image')) + res.update( + background_image=image_id, + color=self.env['ir.config_parameter'].sudo().get_param('login_background.color'), + background=self.env['ir.config_parameter'].sudo().get_param('login_background.background'), + style=self.env['ir.config_parameter'].sudo().get_param('login_background.style'), + ) + return res + + def set_values(self): + super(ResConfigSettings, self).set_values() + param = self.env['ir.config_parameter'].sudo() + + set_image = self.background_image.id or False + set_color = self.color or False + set_background = self.background or False + set_style = self.style or False + + param.set_param('login_background.background_image', set_image) + param.set_param('login_background.color', set_color) + param.set_param('login_background.background', set_background) + param.set_param('login_background.style', set_style) diff --git a/yizuo_login_background_and_styles/security/ir.model.access.csv b/yizuo_login_background_and_styles/security/ir.model.access.csv new file mode 100644 index 00000000..965046dd --- /dev/null +++ b/yizuo_login_background_and_styles/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_login_image,access_login_image,model_login_image,,1,1,1,1 diff --git a/yizuo_login_background_and_styles/static/.DS_Store b/yizuo_login_background_and_styles/static/.DS_Store new file mode 100644 index 00000000..81229e8d Binary files /dev/null and b/yizuo_login_background_and_styles/static/.DS_Store differ diff --git a/yizuo_login_background_and_styles/static/description/banner.png b/yizuo_login_background_and_styles/static/description/banner.png new file mode 100644 index 00000000..7024216d Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/banner.png differ diff --git a/yizuo_login_background_and_styles/static/description/fims_logo.png b/yizuo_login_background_and_styles/static/description/fims_logo.png new file mode 100644 index 00000000..1ffecd36 Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/fims_logo.png differ diff --git a/yizuo_login_background_and_styles/static/description/icon.png b/yizuo_login_background_and_styles/static/description/icon.png new file mode 100644 index 00000000..92e7718e Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/icon.png differ diff --git a/yizuo_login_background_and_styles/static/description/index.html b/yizuo_login_background_and_styles/static/description/index.html new file mode 100644 index 00000000..b45fa878 --- /dev/null +++ b/yizuo_login_background_and_styles/static/description/index.html @@ -0,0 +1,149 @@ +
+
+
+
+
+
    +
    Key Features
    +
  • This module is used for customized login page.
  • +
  • User can Select Login Form Position and also select background color or image.
  • +
+
+
+
+
+
+
+
+
+
+
+
+ + Settings +
+

+

General Settings

+

In this setting user can add Image to use as login background image.

+ +

+

+

Select Style

+

Here user can select position of login form

+ +

+

+

Select Background

+

Here user can select image or color as login Background

+ +

+

+

Select Image

+

Here user can select Background image

+ +

+

+

Left align login form with Background Image

+

+ +

+

+

Right align login form with Background Image

+

+ +

+

+

Select Color

+

Here user can select Background color

+ +

+

+

Center align login form with Background Color

+

+ +

+
+
+
+
+
+
+
+
+
+
+
    +
    Our Service
    +
+ + + + + + + + + + + +
Odoo CustomizationOdoo ImplementationOdoo Integration
+

+ + + + + + + + + + + +
Odoo MigrationOdoo TrainingOdoo Installation
+

+ + + + + + + + + + + +
Odoo ConsultingOdoo SupportHire Developer
+
+
+
+
+
+
+
+
+
+
+
    +
    Get Help & Support
    +
  • You will get 30 Days free support incase any bugs or issue.
  • +
    +
  • +

    +
+ + + + + + + + + + + +
www.fortutechims.cominfo@fortutechims.cominfo@fortutechims.com
+
+
+
+
+
\ No newline at end of file diff --git a/yizuo_login_background_and_styles/static/description/left_login_view.png b/yizuo_login_background_and_styles/static/description/left_login_view.png new file mode 100644 index 00000000..aa754832 Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/left_login_view.png differ diff --git a/yizuo_login_background_and_styles/static/description/mail.png b/yizuo_login_background_and_styles/static/description/mail.png new file mode 100644 index 00000000..233d8941 Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/mail.png differ diff --git a/yizuo_login_background_and_styles/static/description/menu.png b/yizuo_login_background_and_styles/static/description/menu.png new file mode 100644 index 00000000..5136bf5a Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/menu.png differ diff --git a/yizuo_login_background_and_styles/static/description/middle_login_view.png b/yizuo_login_background_and_styles/static/description/middle_login_view.png new file mode 100644 index 00000000..4611d7ae Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/middle_login_view.png differ diff --git a/yizuo_login_background_and_styles/static/description/right_login_view.png b/yizuo_login_background_and_styles/static/description/right_login_view.png new file mode 100644 index 00000000..d89dd8d5 Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/right_login_view.png differ diff --git a/yizuo_login_background_and_styles/static/description/select_background.png b/yizuo_login_background_and_styles/static/description/select_background.png new file mode 100644 index 00000000..5e0d6133 Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/select_background.png differ diff --git a/yizuo_login_background_and_styles/static/description/select_color.png b/yizuo_login_background_and_styles/static/description/select_color.png new file mode 100644 index 00000000..f31407c0 Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/select_color.png differ diff --git a/yizuo_login_background_and_styles/static/description/select_image.png b/yizuo_login_background_and_styles/static/description/select_image.png new file mode 100644 index 00000000..6eeb9079 Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/select_image.png differ diff --git a/yizuo_login_background_and_styles/static/description/service/Consulting.png b/yizuo_login_background_and_styles/static/description/service/Consulting.png new file mode 100644 index 00000000..0d7a0d37 Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/service/Consulting.png differ diff --git a/yizuo_login_background_and_styles/static/description/service/Customization.png b/yizuo_login_background_and_styles/static/description/service/Customization.png new file mode 100644 index 00000000..f1cff958 Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/service/Customization.png differ diff --git a/yizuo_login_background_and_styles/static/description/service/Hire.png b/yizuo_login_background_and_styles/static/description/service/Hire.png new file mode 100644 index 00000000..b8e6ac12 Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/service/Hire.png differ diff --git a/yizuo_login_background_and_styles/static/description/service/Implementation.png b/yizuo_login_background_and_styles/static/description/service/Implementation.png new file mode 100644 index 00000000..b054046c Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/service/Implementation.png differ diff --git a/yizuo_login_background_and_styles/static/description/service/Installation.png b/yizuo_login_background_and_styles/static/description/service/Installation.png new file mode 100644 index 00000000..ff9cf8e7 Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/service/Installation.png differ diff --git a/yizuo_login_background_and_styles/static/description/service/Integration.png b/yizuo_login_background_and_styles/static/description/service/Integration.png new file mode 100644 index 00000000..1be73396 Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/service/Integration.png differ diff --git a/yizuo_login_background_and_styles/static/description/service/Migration.png b/yizuo_login_background_and_styles/static/description/service/Migration.png new file mode 100644 index 00000000..1c420ed4 Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/service/Migration.png differ diff --git a/yizuo_login_background_and_styles/static/description/service/Support.png b/yizuo_login_background_and_styles/static/description/service/Support.png new file mode 100644 index 00000000..0324fe61 Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/service/Support.png differ diff --git a/yizuo_login_background_and_styles/static/description/service/Training.png b/yizuo_login_background_and_styles/static/description/service/Training.png new file mode 100644 index 00000000..ba17d747 Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/service/Training.png differ diff --git a/yizuo_login_background_and_styles/static/description/skype.png b/yizuo_login_background_and_styles/static/description/skype.png new file mode 100644 index 00000000..08fd4e08 Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/skype.png differ diff --git a/yizuo_login_background_and_styles/static/description/style.png b/yizuo_login_background_and_styles/static/description/style.png new file mode 100644 index 00000000..57eb643a Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/style.png differ diff --git a/yizuo_login_background_and_styles/static/description/website.png b/yizuo_login_background_and_styles/static/description/website.png new file mode 100644 index 00000000..c3fd85bd Binary files /dev/null and b/yizuo_login_background_and_styles/static/description/website.png differ diff --git a/yizuo_login_background_and_styles/static/src/css/web_login_style.css b/yizuo_login_background_and_styles/static/src/css/web_login_style.css new file mode 100644 index 00000000..bcfaa353 --- /dev/null +++ b/yizuo_login_background_and_styles/static/src/css/web_login_style.css @@ -0,0 +1,55 @@ +.container{ + max-width: 100%; +} +.background{ + height:100%; + display: block; + background-repeat: no-repeat; + background-position: center center; + background-attachment: fixed; + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; + -webkit-filter: blur(0px); + z-index: -1; +} +.body_login { + display: inline-block; + text-align: center; + white-space: nowrap; + width: 100%; + position: relative; + margin: 0px; + padding: 0px; + opacity:0.7; +} +#mcard{ + margin-top: 7%; + padding: 3%; + max-width:350px +} + +#bcard{ + padding: 3%; + height: 100%; +} + +.body_login input, +.body_login select { + background-color: transparent !important; + border-top: 0px; + border-left: 0px; + border-right: 0px; + /* border-bottom: 1px solid #FED766; */ + border-radius: 0px; + color: black; + font-size: 18px; + font-weight: 300; + transition: border-color 0.7s ease; + box-shadow: none!important; + text-align: center; +} +.effect:hover{ + box-shadow: 5px 5px 5px black; +} \ No newline at end of file diff --git a/yizuo_login_background_and_styles/static/src/css/yizuo_login_style.css b/yizuo_login_background_and_styles/static/src/css/yizuo_login_style.css new file mode 100644 index 00000000..caddd797 --- /dev/null +++ b/yizuo_login_background_and_styles/static/src/css/yizuo_login_style.css @@ -0,0 +1,165 @@ +html, body { + margin: 0; + padding: 0; +} + +.left { + float: left; + width: 510px; + height: 300px; + #background: #bfbfbf; + margin-right: -100%; +} + +.right { + float: left; + width: 100%; +} + +.right-content { + height: 300px; + margin-left: 532px; + + padding-left:81px; + #background: #efefef; +} + +.banner { + left: 0px; + width: 510px; + height: 978px; + margin: 22px; + + background: #005EFE; +} +.banner p{ + position: absolute; + left: 65px; + top: 59px; + width: 172px; + height: 64px; + opacity: 1; + + #background: #FFFFFF; +} + +.banner .logo{ + position: absolute; + left: 0px; + top: 8px; + width: 46.02px; + height: 38px; + opacity: 1; + + #background: #FFFFFF; +} + +.banner .logo_name { + /* CKYC */ + + position: absolute; + left: 55px; + top: 0px; + width: 117px; + height: 64px; + opacity: 1; + + font-family: Roboto-Bold; + font-size: 46px; + font-weight: bold; + line-height: 64px; + letter-spacing: 0px; + + color: #FFFFFF; +} + +.right .login_top{ + padding-top: 248px; + height:0px; + margin: 0px; +} + +.right .login_title { + /* Login */ + margin:0px; + font-family: Poppins-SemiBold; + font-size: 28px; + font-weight: 600; + line-height: 39px; + letter-spacing: 0px; + + color: #0D1D54; + +} + + +.right .login_small_title { + /* Login */ + + /* Thank you for get back to CKYC. */ + margin:15px 0px 0px 0px; + width: 258px; + height: 22px; + opacity: 1; + + font-family: Poppins-Medium; + font-size: 16px; + font-weight: 500; + line-height: 22px; + letter-spacing: 0px; + + color: #404B7C; +} + +.right .input_label { + /* Email */ + + margin: 72px 0px 0px 0px; + width: 44px; + height: 22px; + opacity: 1; + + font-family: Poppins-Regular; + font-size: 16px; + font-weight: normal; + line-height: 22px; + letter-spacing: 0px; + + color: #404B7C; + +} + +.right input { +/* Rectangle 2 */ + + margin: 15px 0px 0px 0px; + + width: 432px; + height: 68px; + border-radius: 8px; + opacity: 1; + + padding: 0px 28px 0px 28px; + + background: #FFFFFF; + + box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.08); + + font-family: Poppins-Regular; + font-size: 16px; + font-weight: normal; + line-height: 22px; + letter-spacing: 0px; + + #color: #D5D5D5; + + +} + +.right .password { + +} + +.right .password input { + +} diff --git a/yizuo_login_background_and_styles/static/src/css/yizuo_login_style_bootstrap.css b/yizuo_login_background_and_styles/static/src/css/yizuo_login_style_bootstrap.css new file mode 100644 index 00000000..66eea21b --- /dev/null +++ b/yizuo_login_background_and_styles/static/src/css/yizuo_login_style_bootstrap.css @@ -0,0 +1,57 @@ + + +.left { + background: #005EFE; +} + +.left p{ + + #position:absolute; + margin: 65px 0px 0px 0px; + #width: 1px; + opacity: 1; + + #background: #FFFFFF; +} + +.left .logo{ + #position: absolute; + width: 46.02px; + height: 38px; + + #background: #FFFFFF; +} + +.left .logo_name { + /* CKYC */ + font-family: Roboto-Bold; + font-size: 46px; + font-weight: bold; + line-height: 64px; + letter-spacing: 0px; + + color: #FFFFFF; +} + +.right{ + +} + +.right .login_top{ + padding-top: 248px; + height:0px; + margin: 0px; +} + +.right .login_title { + /* Login */ + margin:0px; + font-family: Poppins-SemiBold; + font-size: 28px; + font-weight: 600; + line-height: 39px; + letter-spacing: 0px; + + color: #0D1D54; + +} diff --git a/yizuo_login_background_and_styles/static/src/images/MRS.png b/yizuo_login_background_and_styles/static/src/images/MRS.png new file mode 100644 index 00000000..be0e907d Binary files /dev/null and b/yizuo_login_background_and_styles/static/src/images/MRS.png differ diff --git a/yizuo_login_background_and_styles/static/src/images/login_logo.png b/yizuo_login_background_and_styles/static/src/images/login_logo.png new file mode 100644 index 00000000..8e390827 Binary files /dev/null and b/yizuo_login_background_and_styles/static/src/images/login_logo.png differ diff --git a/yizuo_login_background_and_styles/static/src/images/logo.png b/yizuo_login_background_and_styles/static/src/images/logo.png new file mode 100644 index 00000000..88790a64 Binary files /dev/null and b/yizuo_login_background_and_styles/static/src/images/logo.png differ diff --git a/yizuo_login_background_and_styles/static/src/images/智能工厂.png b/yizuo_login_background_and_styles/static/src/images/智能工厂.png new file mode 100644 index 00000000..8e390827 Binary files /dev/null and b/yizuo_login_background_and_styles/static/src/images/智能工厂.png differ diff --git a/yizuo_login_background_and_styles/static/src/images/电子商务管理系统.png b/yizuo_login_background_and_styles/static/src/images/电子商务管理系统.png new file mode 100644 index 00000000..9d2f02cc Binary files /dev/null and b/yizuo_login_background_and_styles/static/src/images/电子商务管理系统.png differ diff --git a/yizuo_login_background_and_styles/static/src/login-bootstrap.html b/yizuo_login_background_and_styles/static/src/login-bootstrap.html new file mode 100644 index 00000000..6637269d --- /dev/null +++ b/yizuo_login_background_and_styles/static/src/login-bootstrap.html @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + Login by Bootstrap + + +
+
+
+

+ + CKYC +

+
+
+ + + + + +

password

+ +
+
+
+ + + + \ No newline at end of file diff --git a/yizuo_login_background_and_styles/static/src/login.html b/yizuo_login_background_and_styles/static/src/login.html new file mode 100644 index 00000000..cb18961e --- /dev/null +++ b/yizuo_login_background_and_styles/static/src/login.html @@ -0,0 +1,32 @@ + + + + + Title + + + +
+
+ +
+
+
+ + + + + +

password

+ +
+
+
+ + \ No newline at end of file diff --git a/yizuo_login_background_and_styles/templates/assets.xml b/yizuo_login_background_and_styles/templates/assets.xml new file mode 100644 index 00000000..64c1eae8 --- /dev/null +++ b/yizuo_login_background_and_styles/templates/assets.xml @@ -0,0 +1,9 @@ + + + + + Login CSS + web.assets_frontend + /yizuo_login_background_and_styles/static/src/css/web_login_style.css + + diff --git a/yizuo_login_background_and_styles/templates/left_login_template.xml b/yizuo_login_background_and_styles/templates/left_login_template.xml new file mode 100644 index 00000000..e875fcf1 --- /dev/null +++ b/yizuo_login_background_and_styles/templates/left_login_template.xml @@ -0,0 +1,78 @@ + + + + + \ No newline at end of file diff --git a/yizuo_login_background_and_styles/templates/middle_login_template.xml b/yizuo_login_background_and_styles/templates/middle_login_template.xml new file mode 100644 index 00000000..8dc746e3 --- /dev/null +++ b/yizuo_login_background_and_styles/templates/middle_login_template.xml @@ -0,0 +1,81 @@ + + + + + \ No newline at end of file diff --git a/yizuo_login_background_and_styles/templates/right_login_template.xml b/yizuo_login_background_and_styles/templates/right_login_template.xml new file mode 100644 index 00000000..b371304e --- /dev/null +++ b/yizuo_login_background_and_styles/templates/right_login_template.xml @@ -0,0 +1,77 @@ + + + + + \ No newline at end of file diff --git a/yizuo_login_background_and_styles/views/login_image.xml b/yizuo_login_background_and_styles/views/login_image.xml new file mode 100644 index 00000000..cc88d7e5 --- /dev/null +++ b/yizuo_login_background_and_styles/views/login_image.xml @@ -0,0 +1,34 @@ + + + + login.image + login.image + + + + + + + + + login.image + login.image + + +
+ + + + +
+
+
+ + + Image + login.image + tree,form + + +
+
\ No newline at end of file diff --git a/yizuo_login_background_and_styles/views/res_config_settings_views.xml b/yizuo_login_background_and_styles/views/res_config_settings_views.xml new file mode 100644 index 00000000..9e245a10 --- /dev/null +++ b/yizuo_login_background_and_styles/views/res_config_settings_views.xml @@ -0,0 +1,45 @@ + + + + + res.config.settings.form.inherit + res.config.settings + + + +
+

Login Background

+
+
+
+
+
+
+
+
+
+
+
+
+ + + + + \ No newline at end of file