diff --git a/access_restriction_by_ip/README.rst b/access_restriction_by_ip/README.rst new file mode 100644 index 000000000..c3cbcf87e --- /dev/null +++ b/access_restriction_by_ip/README.rst @@ -0,0 +1,17 @@ +Access Restriction By IP V12 +============================ + +This module will restrict users access to his account from the specified IP only. If user access his +account from non-specified IP, login will be restricted and a warning message will be displayed in +login page. + +If no IP is specified for a user, then there will not be restriction by IP. He can access from any IP. + + +Credits +======= +Cybrosys Techno Solutions + +Author +------ +* Niyas Raphy diff --git a/access_restriction_by_ip/__init__.py b/access_restriction_by_ip/__init__.py new file mode 100644 index 000000000..bc15df3c2 --- /dev/null +++ b/access_restriction_by_ip/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Niyas Raphy() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import controllers +from . import models + + diff --git a/access_restriction_by_ip/__manifest__.py b/access_restriction_by_ip/__manifest__.py new file mode 100644 index 000000000..2f7c27257 --- /dev/null +++ b/access_restriction_by_ip/__manifest__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Niyas Raphy() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': 'Access Restriction By IP', + 'summary': """User Can Access His Account Only From Specified IP Address""", + 'version': '12.0.1.0.0', + 'description': """User Can Access His Account Only From Specified IP Address""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'category': 'Tools', + 'depends': ['base', 'mail'], + 'license': 'AGPL-3', + 'data': [ + 'security/ir.model.access.csv', + 'views/allowed_ips_view.xml', + ], + 'images': ['static/description/banner.jpg'], + 'demo': [], + 'installable': True, + 'auto_install': False, +} + diff --git a/access_restriction_by_ip/controllers/__init__.py b/access_restriction_by_ip/controllers/__init__.py new file mode 100644 index 000000000..5c02bf07c --- /dev/null +++ b/access_restriction_by_ip/controllers/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Niyas Raphy() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import main + diff --git a/access_restriction_by_ip/controllers/main.py b/access_restriction_by_ip/controllers/main.py new file mode 100644 index 000000000..c4b918c84 --- /dev/null +++ b/access_restriction_by_ip/controllers/main.py @@ -0,0 +1,85 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Niyas Raphy() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo.addons.web.controllers import main +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(main.Home): + + @http.route('/web/login', type='http', auth="public") + def web_login(self, redirect=None, **kw): + main.ensure_db() + request.params['login_success'] = False + if request.httprequest.method == 'GET' and redirect and request.session.uid: + return http.redirect_with_hash(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 + ip_address = request.httprequest.environ['REMOTE_ADDR'] + if request.params['login']: + user_rec = request.env['res.users'].sudo().search([('login', '=', request.params['login'])]) + if user_rec.allowed_ips: + ip_list = [] + print ("ip_list",ip_list) + for rec in user_rec.allowed_ips: + ip_list.append(rec.ip_address) + print("ipaddressssssss",ip_list) + if ip_address in ip_list: + uid = request.session.authenticate(request.session.db, request.params['login'], request.params['password']) + print("uiddddddddd",uid) + if uid is not False: + request.params['login_success'] = True + if not redirect: + redirect = '/web' + return http.redirect_with_hash(redirect) + request.uid = old_uid + values['error'] = _("Wrong login/password") + request.uid = old_uid + values['error'] = _("Not allowed to login from this IP") + print("ippppppppppp",ip_list) + else: + uid = request.session.authenticate(request.session.db, request.params['login'], + request.params['password']) + if uid is not False: + request.params['login_success'] = True + if not redirect: + redirect = '/web' + return http.redirect_with_hash(redirect) + request.uid = old_uid + values['error'] = _("Wrong login/password") + + + return request.render('web.login', values) diff --git a/access_restriction_by_ip/doc/RELEASE_NOTES.md b/access_restriction_by_ip/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..c0ccdf589 --- /dev/null +++ b/access_restriction_by_ip/doc/RELEASE_NOTES.md @@ -0,0 +1,5 @@ +## Module + +#### 20.02.2019 +#### Version 12.0.1.0.0 +#### Module Migrated diff --git a/access_restriction_by_ip/models/__init__.py b/access_restriction_by_ip/models/__init__.py new file mode 100644 index 000000000..00350adcc --- /dev/null +++ b/access_restriction_by_ip/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Niyas Raphy() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import allowed_ips + + diff --git a/access_restriction_by_ip/models/allowed_ips.py b/access_restriction_by_ip/models/allowed_ips.py new file mode 100644 index 000000000..e5dff635d --- /dev/null +++ b/access_restriction_by_ip/models/allowed_ips.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Niyas Raphy() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo import models, fields + + +class ResUsersInherit(models.Model): + _inherit = 'res.users' + + allowed_ips = fields.One2many('allowed.ips', 'users_ip', string='IP') + + +class AllowedIPs(models.Model): + _name = 'allowed.ips' + + users_ip = fields.Many2one('res.users', string='IP') + ip_address = fields.Char(string='Allowed IP') diff --git a/access_restriction_by_ip/security/ir.model.access.csv b/access_restriction_by_ip/security/ir.model.access.csv new file mode 100644 index 000000000..c6ee084c4 --- /dev/null +++ b/access_restriction_by_ip/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_allowed_ips,access.allowed.ips,access_restriction_by_ip.model_allowed_ips,base.group_user,1,1,1,0 diff --git a/access_restriction_by_ip/static/description/access_non_set_ip.png b/access_restriction_by_ip/static/description/access_non_set_ip.png new file mode 100644 index 000000000..0af97d8ae Binary files /dev/null and b/access_restriction_by_ip/static/description/access_non_set_ip.png differ diff --git a/access_restriction_by_ip/static/description/banner.jpg b/access_restriction_by_ip/static/description/banner.jpg new file mode 100644 index 000000000..f5bbd4859 Binary files /dev/null and b/access_restriction_by_ip/static/description/banner.jpg differ diff --git a/access_restriction_by_ip/static/description/cybro_logo.png b/access_restriction_by_ip/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/access_restriction_by_ip/static/description/cybro_logo.png differ diff --git a/access_restriction_by_ip/static/description/icon.png b/access_restriction_by_ip/static/description/icon.png new file mode 100644 index 000000000..401fd1ed3 Binary files /dev/null and b/access_restriction_by_ip/static/description/icon.png differ diff --git a/access_restriction_by_ip/static/description/index.html b/access_restriction_by_ip/static/description/index.html new file mode 100644 index 000000000..aab05af0c --- /dev/null +++ b/access_restriction_by_ip/static/description/index.html @@ -0,0 +1,309 @@ +
+
+

+ Access Restriction By IP +

+

+ User can access his account only from specified IP's +

+
+ Cybrosys Technologies +
+
+
+
+
+

+ Overview +

+

+ This module will restrict the users access to his account from specified IP address only +

+
+
+ +
+
+

+ Features +

+

+ + Administrator can set a IP or a group of IP address for each users +

+

+ + Users can access their account only from the specified IP's +

+ + Accessing system from a non-specified IP will restrict the user login +

+

+ + A warning message will be displayed

+

+ + If no IP is set to user means there is no any restriction by IP

+

+ + IP Address for each users can be set from users form view

+
+
+
+
+

+ Setting IP address for User +

+

+ + Setting IP address for user from users form view
+ + User will be able to access his account only from this IP's +

+
+ +
+

+ User accessing his account +

+

+ + On accessing account from a non specified IP +

+
+ +
+ +
+
+ + +
+ +
+
+ +
+ +
+ +
+ diff --git a/access_restriction_by_ip/static/description/user_set_ip.png b/access_restriction_by_ip/static/description/user_set_ip.png new file mode 100644 index 000000000..1f6d1b8b1 Binary files /dev/null and b/access_restriction_by_ip/static/description/user_set_ip.png differ diff --git a/access_restriction_by_ip/views/allowed_ips_view.xml b/access_restriction_by_ip/views/allowed_ips_view.xml new file mode 100644 index 000000000..3b7f244d4 --- /dev/null +++ b/access_restriction_by_ip/views/allowed_ips_view.xml @@ -0,0 +1,21 @@ + + + + + res.users + res.users + + + + + + + + + + + + + + + diff --git a/event_management/README.rst b/event_management/README.rst new file mode 100644 index 000000000..4ff54e4b2 --- /dev/null +++ b/event_management/README.rst @@ -0,0 +1,32 @@ +==================== +Event Management v12 +==================== +Event management is a core module which can manage any type of events. +The user can selectively download and install different service modules to extend the scope of this module. +The new service will be automatically get attached to this core Event management module. +It is different from Odoo's event module. +Here you can manage different types of events and allocate services to different users. + +Note: Presently we have released the service “Event Catering” under this module. New services are being developed by our team. + +Features +======== +* Event order creation. +* Automatically creates service orders. +* Allocate the services to different users. +* Integrated with Accounting module. +* Simple Workflow. +* Attractive Design. + +Contributors +============ + +* Avinash Nk + + +Maintainer +========== + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com diff --git a/event_management/__init__.py b/event_management/__init__.py new file mode 100644 index 000000000..37a8d7aa1 --- /dev/null +++ b/event_management/__init__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import models diff --git a/event_management/__manifest__.py b/event_management/__manifest__.py new file mode 100644 index 000000000..dc5b4f82d --- /dev/null +++ b/event_management/__manifest__.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': 'Event Management', + 'version': '12.0.1.0.0', + 'summary': """Core Module for Managing Different Types Of Events.""", + 'description': """Core Module for Managing Different Types Of Events""", + "category": "Industry", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['product', 'account'], + 'data': ['security/event_security.xml', + 'security/ir.model.access.csv', + 'views/event_management_view.xml', + 'views/event_type_view.xml', + 'views/dashboard.xml', + 'data/event_management.xml', + ], + 'demo': [ + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'application': True, +} diff --git a/event_management/data/event_management.xml b/event_management/data/event_management.xml new file mode 100644 index 000000000..f9edf8ad5 --- /dev/null +++ b/event_management/data/event_management.xml @@ -0,0 +1,40 @@ + + + + + + Wedding + + + + Birthday + + + + Family Events + + + + Press Conference + + + + Seminars + + + + Conferences + + + + + Event Order + event.order.sequence + %(day)s/%(month)s/%(year)s + EVE- + 1 + 2 + + + + diff --git a/event_management/doc/RELEASE_NOTES.md b/event_management/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..d8e3a77a1 --- /dev/null +++ b/event_management/doc/RELEASE_NOTES.md @@ -0,0 +1,5 @@ +## Module + +#### 18.02.2019 +#### Version 12.0.1.0.0 +#### Module Migrated diff --git a/event_management/models/__init__.py b/event_management/models/__init__.py new file mode 100644 index 000000000..154890087 --- /dev/null +++ b/event_management/models/__init__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import event_management diff --git a/event_management/models/event_management.py b/event_management/models/event_management.py new file mode 100644 index 000000000..ae78b9170 --- /dev/null +++ b/event_management/models/event_management.py @@ -0,0 +1,222 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Avinash Nk() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from odoo import models, fields, api, _ +from odoo.exceptions import UserError, ValidationError + + +class EventManagement(models.Model): + _name = 'event.management' + + name = fields.Char(string="Name", readonly=True) + type_of_event = fields.Many2one('event.management.type', string="Type", required=True) + partner_id = fields.Many2one('res.partner', string="Customer", required=True) + date = fields.Date(string="Date", default=fields.Date.today, required=True) + start_date = fields.Datetime(string="Start date", default=lambda self: fields.datetime.now(), required=True) + end_date = fields.Datetime(string="End date", required=True) + service_line = fields.One2many('event.service.line', 'event_id', string="Services") + state = fields.Selection([('draft', 'Draft'), ('confirm', 'Confirmed'), ('invoice', 'Invoiced'), + ('close', 'Close'), ('cancel', 'Canceled')], string="State", default="draft") + note = fields.Text('Terms and conditions') + price_subtotal = fields.Float(string='Total', compute='sub_total_update', readonly=True, store=True) + image = fields.Binary("Image", attachment=True, + help="This field holds the image used as image for the event, limited to 1080x720px.") + currency_id = fields.Many2one('res.currency', readonly=True, + default=lambda self: self.env.user.company_id.currency_id) + invoice_count = fields.Integer(string='# of Invoices') + invoice_ids = fields.Many2many("account.invoice", string='Invoices', copy=False) + pending_invoice = fields.Boolean(string="Invoice Pending", compute='pending_invoice_find') + + @api.multi + @api.depends('service_line', 'service_line.state') + def pending_invoice_find(self): + pending = 0 + for lines in self.service_line: + if lines.invoiced is False and lines.state == "done": + pending = 1 + if pending == 1: + self.pending_invoice = True + else: + self.pending_invoice = False + + @api.multi + @api.depends('service_line', 'service_line.amount') + def sub_total_update(self): + total = 0 + for items in self.service_line: + total += items.amount + self.price_subtotal = total + + @api.model + def create(self, values): + start_date = values['start_date'] + end_date = values['end_date'] + if start_date >= end_date: + raise UserError(_('Start date must be less than End date')) + sequence_code = 'event.order.sequence' + sequence_number = self.env['ir.sequence'].next_by_code(sequence_code) + values['name'] = sequence_number + return super(EventManagement, self).create(values) + + @api.multi + def event_confirm(self): + self.state = "confirm" + + @api.multi + def event_cancel(self): + self.state = "cancel" + + @api.multi + def event_close(self): + pending = 0 + for lines in self.service_line: + if lines.invoiced is False: + pending = 1 + if pending == 1: + raise ValidationError(_('You can close an event only when all services is Done and Invoiced')) + else: + self.state = "close" + + @api.multi + def action_view_invoice_event(self): + invoices = self.mapped('invoice_ids') + action = self.env.ref('account.action_invoice_tree1').read()[0] + if len(invoices) > 1: + action['domain'] = [('id', 'in', invoices.ids)] + elif len(invoices) == 1: + action['views'] = [(self.env.ref('account.invoice_form').id, 'form')] + action['res_id'] = invoices.ids[0] + else: + action = {'type': 'ir.actions.act_window_close'} + return action + + @api.multi + def event_invoice_create(self): + product_line = [] + for lines in self.service_line: + if lines.invoiced is False and lines.state == "done": + product_line.append({'product_id': lines.related_product, 'price_unit': lines.amount}) + lines.invoiced = True + if len(product_line) > 0: + journal_id = self.env['account.invoice'].default_get(['journal_id'])['journal_id'] + company_id = self.env.user.company_id.id + inv_obj = self.env['account.invoice'] + inv_line_obj = self.env['account.invoice.line'] + partner = self.partner_id + inv_data = { + 'name': partner.name, + 'reference': partner.name, + 'account_id': partner.property_account_payable_id.id, + 'partner_id': partner.id, + 'currency_id': self.currency_id.id, + 'journal_id': journal_id, + 'origin': self.name, + 'company_id': company_id, + } + inv_id = inv_obj.create(inv_data) + for records in product_line: + product_id = records['product_id'] + price_unit = records['price_unit'] + if product_id.property_account_income_id.id: + income_account = product_id.property_account_income_id.id + elif product_id.categ_id.property_account_income_categ_id.id: + income_account = product_id.categ_id.property_account_income_categ_id.id + else: + raise UserError( + _('Please define income account for this product: "%s" (id:%d).') % (product_id.name, + product_id.id)) + inv_line_data = { + 'name': self.name, + 'account_id': income_account, + 'price_unit': price_unit, + 'quantity': 1, + 'product_id': product_id.id, + 'invoice_id': inv_id.id, + 'uom_id': product_id.uom_id.id, + } + inv_line_obj.create(inv_line_data) + imd = self.env['ir.model.data'] + action = imd.xmlid_to_object('account.action_invoice_tree1') + list_view_id = imd.xmlid_to_res_id('account.invoice_tree') + form_view_id = imd.xmlid_to_res_id('account.invoice_form') + result = { + 'name': action.name, + 'help': action.help, + 'type': 'ir.actions.act_window', + 'views': [[list_view_id, 'tree'], [form_view_id, 'form'], [False, 'graph'], [False, 'kanban'], + [False, 'calendar'], [False, 'pivot']], + 'target': action.target, + 'context': action.context, + 'res_model': 'account.invoice', + } + if len(inv_id) > 1: + result['domain'] = "[('id','in',%s)]" % inv_id.ids + elif len(inv_id) == 1: + result['views'] = [(form_view_id, 'form')] + result['res_id'] = inv_id.ids[0] + else: + result = {'type': 'ir.actions.act_window_close'} + self.state = "invoice" + all_invoice_ids = self.invoice_ids.ids + all_invoice_ids.append(inv_id.id) + self.update({'invoice_ids': all_invoice_ids, 'invoice_count': self.invoice_count + 1}) + return result + + +class EventServiceLine(models.Model): + _name = 'event.service.line' + + service = fields.Selection([('none', 'None')], string="Services", required=True) + event_id = fields.Many2one('event.management', string="Event") + date_from = fields.Datetime(string="Date from", required=True) + date_to = fields.Datetime(string="Date to", required=True) + amount = fields.Float(string="Amount", readonly=True) + state = fields.Selection([('done', 'Done'), ('pending', 'Pending')], string="State", default="pending", + readonly=True) + currency_id = fields.Many2one('res.currency', readonly=True, + default=lambda self: self.env.user.company_id.currency_id) + invoiced = fields.Boolean(string="Invoiced") + related_product = fields.Many2one('product.product', string="Related Product") + + _sql_constraints = [('event_supplier_unique', 'unique(event_id, service)', + 'Duplication Of Service In The Service Lines Is not Allowed')] + + @api.multi + @api.constrains('date_from', 'date_to') + def _check_date_to_date_from(self): + if self.date_to < self.date_from: + raise ValidationError(_('"Date to" cannot be set before "Date from".\n\n' + 'Check the "Date from" and "Date to" of the "%s" service' % self.service)) + + +class EventManagementType(models.Model): + _name = 'event.management.type' + + name = fields.Char(string="Name") + image = fields.Binary("Image", attachment=True, + help="This field holds the image used as image for the event, limited to 1080x720px.") + event_count = fields.Integer(string="# of Events", compute='event_count_calculation') + + @api.multi + def event_count_calculation(self): + for records in self: + events = self.env['event.management'].search([('type_of_event', '=', records.id)]) + records.event_count = len(events) diff --git a/event_management/security/event_security.xml b/event_management/security/event_security.xml new file mode 100644 index 000000000..1635d1bf5 --- /dev/null +++ b/event_management/security/event_security.xml @@ -0,0 +1,17 @@ + + + + + + Event Management + 19 + + + + Event Manager + + + + + + \ No newline at end of file diff --git a/event_management/security/ir.model.access.csv b/event_management/security/ir.model.access.csv new file mode 100644 index 000000000..a3607ac6f --- /dev/null +++ b/event_management/security/ir.model.access.csv @@ -0,0 +1,5 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +event_management_id,event_management,model_event_management,event_management.group_event_manager,1,1,1,1 +event_service_line_id,event_service_line,model_event_service_line,event_management.group_event_manager,1,1,1,1 +event_management_type_id,event_management_type,model_event_management_type,event_management.group_event_manager,1,1,1,1 + diff --git a/event_management/static/description/banner.jpg b/event_management/static/description/banner.jpg new file mode 100644 index 000000000..fde2857f5 Binary files /dev/null and b/event_management/static/description/banner.jpg differ diff --git a/event_management/static/description/cybro_logo.png b/event_management/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/event_management/static/description/cybro_logo.png differ diff --git a/event_management/static/description/cybrosys-event-management-1.png b/event_management/static/description/cybrosys-event-management-1.png new file mode 100644 index 000000000..581b77fe7 Binary files /dev/null and b/event_management/static/description/cybrosys-event-management-1.png differ diff --git a/event_management/static/description/cybrosys-event-management-2.png b/event_management/static/description/cybrosys-event-management-2.png new file mode 100644 index 000000000..ccd7f59f7 Binary files /dev/null and b/event_management/static/description/cybrosys-event-management-2.png differ diff --git a/event_management/static/description/cybrosys-event-management-3.png b/event_management/static/description/cybrosys-event-management-3.png new file mode 100644 index 000000000..15e44e868 Binary files /dev/null and b/event_management/static/description/cybrosys-event-management-3.png differ diff --git a/event_management/static/description/cybrosys-event-management-4.png b/event_management/static/description/cybrosys-event-management-4.png new file mode 100644 index 000000000..b9b4ba60c Binary files /dev/null and b/event_management/static/description/cybrosys-event-management-4.png differ diff --git a/event_management/static/description/cybrosys-event-management-5.gif b/event_management/static/description/cybrosys-event-management-5.gif new file mode 100644 index 000000000..903a6220e Binary files /dev/null and b/event_management/static/description/cybrosys-event-management-5.gif differ diff --git a/event_management/static/description/icon.png b/event_management/static/description/icon.png new file mode 100644 index 000000000..3c0a67266 Binary files /dev/null and b/event_management/static/description/icon.png differ diff --git a/event_management/static/description/index.html b/event_management/static/description/index.html new file mode 100644 index 000000000..4ec02d4c5 --- /dev/null +++ b/event_management/static/description/index.html @@ -0,0 +1,375 @@ +
+
+

+ Event Management +

+

+ Manage different types of events.
+ Core Module for Event Management. +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+
+
+

+ Overview +

+

+ Event management is a core module which can manage any type of events. The user can selectively download and install different service modules to extend the scope of this module. The new service will be automatically get attached to this core Event management module. It is different from Odoo's event module. Here you can manage different types of events and allocate services to different users. + Note: Presently we have released the service 'Event Catering' under this module. New services are being developed by our team. +

+
+
+
+
+

+ Features +

+

+ + Event order creation. +

+

+ + Automatically creates service orders. +

+

+ + Allocate the services to different users. +

+

+ + Integrated with Accounting module. +

+

+ + Simple Workflow. +

+

+ + Attractive Design. +

+
+
+
+
+

+ Screenshots +

+

+ + Event Dashboard +

+
+ +
+

+ + Event Order View +

+
+ +
+

+ + Event Order Form View +

+
+ +
+

+ + Event Type +

+
+ +
+

+ + Event Services +

+

+

After installing a new service, you will get an option to select the service in the event order.

+

+

+

Creating an Event Order

+

+
+ +
+
+
+ +
+
+ cybrosys technologies +
+
+
+
+

+ Our Services +

+
+ + + +
+ +
+ + + +
+

+ + Odoo Support +

+ +
+ +
+
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
\ No newline at end of file diff --git a/event_management/static/img/event_type_image1.jpg b/event_management/static/img/event_type_image1.jpg new file mode 100644 index 000000000..208cf6045 Binary files /dev/null and b/event_management/static/img/event_type_image1.jpg differ diff --git a/event_management/static/img/event_type_image2.jpeg b/event_management/static/img/event_type_image2.jpeg new file mode 100644 index 000000000..c74b7c25f Binary files /dev/null and b/event_management/static/img/event_type_image2.jpeg differ diff --git a/event_management/static/img/event_type_image3.jpeg b/event_management/static/img/event_type_image3.jpeg new file mode 100644 index 000000000..c63d5de66 Binary files /dev/null and b/event_management/static/img/event_type_image3.jpeg differ diff --git a/event_management/static/img/event_type_image4.jpeg b/event_management/static/img/event_type_image4.jpeg new file mode 100644 index 000000000..e60d88943 Binary files /dev/null and b/event_management/static/img/event_type_image4.jpeg differ diff --git a/event_management/static/img/event_type_image5.jpeg b/event_management/static/img/event_type_image5.jpeg new file mode 100644 index 000000000..777a7eeba Binary files /dev/null and b/event_management/static/img/event_type_image5.jpeg differ diff --git a/event_management/static/img/event_type_image6.jpeg b/event_management/static/img/event_type_image6.jpeg new file mode 100644 index 000000000..686b70056 Binary files /dev/null and b/event_management/static/img/event_type_image6.jpeg differ diff --git a/event_management/static/src/css/event_dashboard.css b/event_management/static/src/css/event_dashboard.css new file mode 100644 index 000000000..f7461404d --- /dev/null +++ b/event_management/static/src/css/event_dashboard.css @@ -0,0 +1,12 @@ +.style_event { + text-align: center; + flex: none !important; + background: none !important; + box-shadow: none !important; +} +.style_event_type { + text-align: center; + flex: none !important; + background: none !important; + box-shadow: none !important; +} diff --git a/event_management/views/dashboard.xml b/event_management/views/dashboard.xml new file mode 100644 index 000000000..8e6a6a24d --- /dev/null +++ b/event_management/views/dashboard.xml @@ -0,0 +1,63 @@ + + + + + event_management_kanban.dashboard + event.management.type + kanban + + + + + + + +
+
+
+

+
+
+ +
+
+ +
+
+ + Total Orders : + + + + +
+
+
+
+
+
+
+
+ + + + + + Dashboard + event.management.type + form + kanban,form + {} + + + +
+
\ No newline at end of file diff --git a/event_management/views/event_management_view.xml b/event_management/views/event_management_view.xml new file mode 100644 index 000000000..136fd9b9f --- /dev/null +++ b/event_management/views/event_management_view.xml @@ -0,0 +1,206 @@ + + + + + + + + event_management_tree_view.tree + event.management + + + + + + + + + + + + + + + + + event_management_kanban_view.kanban + event.management + + + + + +
+ + +
+ + + +
+
+
+ +
+
+
+
+ + + + + + + + + + event_management_form_view.form + event.management + +
+
+
+ +
+ +
+

+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + event_management_view.search + event.management + + + + + + + + + + + + + + + + + + event_management_view.calendar + event.management + + + + + + + + + + + + + event_management_view.graph + event.management + + + + + + + + + + + + Event Management + event.management + ir.actions.act_window + form + kanban,tree,form,calendar,graph + +

+ Click to add an event order. +

+ Here you can create and manage your events. +

+
+
+ + + + + + + + + \ No newline at end of file diff --git a/event_management/views/event_type_view.xml b/event_management/views/event_type_view.xml new file mode 100644 index 000000000..0931b9edf --- /dev/null +++ b/event_management/views/event_type_view.xml @@ -0,0 +1,52 @@ + + + + + + event_type_tree_view.tree + event.management.type + + + + + + + + + event_type_form_view.form + event.management.type + +
+ +
+ +
+

+ +

+
+
+
+
+ + + Event type + event.management.type + ir.actions.act_window + form + tree,form + +

+ Click to add an event type. +

+ Here you can create different types of events. +

+
+
+ + + + +
+
\ No newline at end of file diff --git a/invoice_stock_move/README.rst b/invoice_stock_move/README.rst new file mode 100644 index 000000000..0973262e3 --- /dev/null +++ b/invoice_stock_move/README.rst @@ -0,0 +1,17 @@ +Stock Move With Invoice v12 +=========================== +This module is developed to manage the stock picking from invoice .It helps to transfer/receive products from +customer/supplier invoice. + +Installation +============ +Just select it from available modules to install it, there is no need to extra installations. + +Configuration +============= + +Nothing to configure. + +Credits +======= +Developer: Saritha Sahadevan @ cybrosys, odoo@cybrosys.com diff --git a/invoice_stock_move/__init__.py b/invoice_stock_move/__init__.py new file mode 100644 index 000000000..4049446af --- /dev/null +++ b/invoice_stock_move/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import models diff --git a/invoice_stock_move/__manifest__.py b/invoice_stock_move/__manifest__.py new file mode 100644 index 000000000..11da27614 --- /dev/null +++ b/invoice_stock_move/__manifest__.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': "Stock Picking From Invoice", + 'version': '12.0.1.0.0', + 'summary': """Stock Picking From Customer/Supplier Invoice""", + 'description': """This Module Enables To Create Stocks Picking From Customer/Supplier Invoice""", + 'author': "Cybrosys Techno Solutions", + 'company': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'category': 'Accounting', + 'depends': ['base', 'account', 'stock'], + 'data': ['views/invoice_stock_move_view.xml'], + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/invoice_stock_move/doc/RELEASE_NOTES.md b/invoice_stock_move/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..a0b6dbdaa --- /dev/null +++ b/invoice_stock_move/doc/RELEASE_NOTES.md @@ -0,0 +1,5 @@ +## Module + +#### 19.02.2019 +#### Version 12.0.1.0.0 +#### Module Migrated diff --git a/invoice_stock_move/models/__init__.py b/invoice_stock_move/models/__init__.py new file mode 100644 index 000000000..bf87c8d91 --- /dev/null +++ b/invoice_stock_move/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from . import invoice_stock diff --git a/invoice_stock_move/models/invoice_stock.py b/invoice_stock_move/models/invoice_stock.py new file mode 100644 index 000000000..b4280a4d8 --- /dev/null +++ b/invoice_stock_move/models/invoice_stock.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +from odoo.exceptions import UserError +from odoo import models, fields, api, _ + + +class InvoiceStockMove(models.Model): + _inherit = 'account.invoice' + + @api.model + def _default_picking_receive(self): + type_obj = self.env['stock.picking.type'] + company_id = self.env.context.get('company_id') or self.env.user.company_id.id + types = type_obj.search([('code', '=', 'incoming'), ('warehouse_id.company_id', '=', company_id)], limit=1) + if not types: + types = type_obj.search([('code', '=', 'incoming'), ('warehouse_id', '=', False)]) + return types[:1] + + @api.model + def _default_picking_transfer(self): + type_obj = self.env['stock.picking.type'] + company_id = self.env.context.get('company_id') or self.env.user.company_id.id + types = type_obj.search([('code', '=', 'outgoing'), ('warehouse_id.company_id', '=', company_id)], limit=1) + if not types: + types = type_obj.search([('code', '=', 'outgoing'), ('warehouse_id', '=', False)]) + return types[:4] + + picking_count = fields.Integer(string="Count") + invoice_picking_id = fields.Many2one('stock.picking', string="Picking Id") + picking_type_id = fields.Many2one('stock.picking.type', 'Picking Type', required=True, + default=_default_picking_receive, + help="This will determine picking type of incoming shipment") + picking_transfer_id = fields.Many2one('stock.picking.type', 'Deliver To', required=True, + default=_default_picking_transfer, + help="This will determine picking type of outgoing shipment") + state = fields.Selection([ + ('draft', 'Draft'), + ('proforma', 'Pro-forma'), + ('proforma2', 'Pro-forma'), + ('open', 'Open'), + ('paid', 'Paid'), + ('cancel', 'Cancelled'), + ('done', 'Received'), + ], string='Status', index=True, readonly=True, default='draft', + track_visibility='onchange', copy=False) + + @api.multi + def action_stock_receive(self): + for order in self: + if not order.invoice_line_ids: + raise UserError(_('Please create some invoice lines.')) + if not self.number: + raise UserError(_('Please Validate invoice.')) + if not self.invoice_picking_id: + pick = { + 'picking_type_id': self.picking_type_id.id, + 'partner_id': self.partner_id.id, + 'origin': self.number, + 'location_dest_id': self.picking_type_id.default_location_dest_id.id, + 'location_id': self.partner_id.property_stock_supplier.id + } + picking = self.env['stock.picking'].create(pick) + self.invoice_picking_id = picking.id + self.picking_count = len(picking) + moves = order.invoice_line_ids.filtered(lambda r: r.product_id.type in ['product', 'consu'])._create_stock_moves(picking) + move_ids = moves._action_confirm() + move_ids._action_assign() + + @api.multi + def action_stock_transfer(self): + for order in self: + if not order.invoice_line_ids: + raise UserError(_('Please create some invoice lines.')) + if not self.number: + raise UserError(_('Please Validate invoice.')) + if not self.invoice_picking_id: + pick = { + 'picking_type_id': self.picking_transfer_id.id, + 'partner_id': self.partner_id.id, + 'origin': self.number, + 'location_dest_id': self.partner_id.property_stock_customer.id, + 'location_id': self.picking_transfer_id.default_location_src_id.id + } + picking = self.env['stock.picking'].create(pick) + self.invoice_picking_id = picking.id + self.picking_count = len(picking) + moves = order.invoice_line_ids.filtered(lambda r: r.product_id.type in ['product', 'consu'])._create_stock_moves_transfer(picking) + move_ids = moves._action_confirm() + move_ids._action_assign() + + @api.multi + def action_view_picking(self): + action = self.env.ref('stock.action_picking_tree_ready') + result = action.read()[0] + result.pop('id', None) + result['context'] = {} + result['domain'] = [('id', '=', self.invoice_picking_id.id)] + pick_ids = sum([self.invoice_picking_id.id]) + if pick_ids: + res = self.env.ref('stock.view_picking_form', False) + result['views'] = [(res and res.id or False, 'form')] + result['res_id'] = pick_ids or False + return result + + +class SupplierInvoiceLine(models.Model): + _inherit = 'account.invoice.line' + + @api.multi + def _create_stock_moves(self, picking): + moves = self.env['stock.move'] + done = self.env['stock.move'].browse() + for line in self: + price_unit = line.price_unit + template = { + 'name': line.name or '', + 'product_id': line.product_id.id, + 'product_uom': line.uom_id.id, + 'location_id': line.invoice_id.partner_id.property_stock_supplier.id, + 'location_dest_id': picking.picking_type_id.default_location_dest_id.id, + 'picking_id': picking.id, + 'move_dest_id': False, + 'state': 'draft', + 'company_id': line.invoice_id.company_id.id, + 'price_unit': price_unit, + 'picking_type_id': picking.picking_type_id.id, + 'procurement_id': False, + 'route_ids': 1 and [ + (6, 0, [x.id for x in self.env['stock.location.route'].search([('id', 'in', (2, 3))])])] or [], + 'warehouse_id': picking.picking_type_id.warehouse_id.id, + } + diff_quantity = line.quantity + tmp = template.copy() + tmp.update({ + 'product_uom_qty': diff_quantity, + }) + template['product_uom_qty'] = diff_quantity + done += moves.create(template) + return done + + def _create_stock_moves_transfer(self, picking): + moves = self.env['stock.move'] + done = self.env['stock.move'].browse() + for line in self: + price_unit = line.price_unit + template = { + 'name': line.name or '', + 'product_id': line.product_id.id, + 'product_uom': line.uom_id.id, + 'location_id': picking.picking_type_id.default_location_src_id.id, + 'location_dest_id': line.invoice_id.partner_id.property_stock_customer.id, + 'picking_id': picking.id, + 'move_dest_id': False, + 'state': 'draft', + 'company_id': line.invoice_id.company_id.id, + 'price_unit': price_unit, + 'picking_type_id': picking.picking_type_id.id, + 'procurement_id': False, + 'route_ids': 1 and [ + (6, 0, [x.id for x in self.env['stock.location.route'].search([('id', 'in', (2, 3))])])] or [], + 'warehouse_id': picking.picking_type_id.warehouse_id.id, + } + diff_quantity = line.quantity + tmp = template.copy() + tmp.update({ + 'product_uom_qty': diff_quantity, + }) + template['product_uom_qty'] = diff_quantity + done += moves.create(template) + return done + + + diff --git a/invoice_stock_move/static/description/banner.jpg b/invoice_stock_move/static/description/banner.jpg new file mode 100644 index 000000000..5da168516 Binary files /dev/null and b/invoice_stock_move/static/description/banner.jpg differ diff --git a/invoice_stock_move/static/description/cust_warehouse.png b/invoice_stock_move/static/description/cust_warehouse.png new file mode 100644 index 000000000..c66556fb4 Binary files /dev/null and b/invoice_stock_move/static/description/cust_warehouse.png differ diff --git a/invoice_stock_move/static/description/cybro_logo.png b/invoice_stock_move/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/invoice_stock_move/static/description/cybro_logo.png differ diff --git a/invoice_stock_move/static/description/icon.png b/invoice_stock_move/static/description/icon.png new file mode 100644 index 000000000..31df27645 Binary files /dev/null and b/invoice_stock_move/static/description/icon.png differ diff --git a/invoice_stock_move/static/description/index.html b/invoice_stock_move/static/description/index.html new file mode 100644 index 000000000..915bf3ec6 --- /dev/null +++ b/invoice_stock_move/static/description/index.html @@ -0,0 +1,350 @@ + +
+
+

+ Stock Picking From Invoice +

+

+ This Module Enables To Stock Pickings From Customer/Supplier Invoice. +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+
+
+

+ Overview +

+

+ Currently in Odoo , We cannot transfer stocks directly from customer/supplier invoice. + We need to depend sales module or purchase module to transfer or receive goods. + This module enable to transfer stocks from invoices without depending sales and purchase module. +

+
+
+ +
+
+

+ Features +

+

+ + Stock Picking From Customer Invoice. +

+

+ + Stock Picking From Supplier Invoice. +

+ +
+
+
+
+

+ Screenshots +

+

+ + Transfer Button in Customer invoice +

+
+ +
+

+ + On clicking Transfer Button, Stock Is Moved To Customer Inventory. +

+
+ +
+

+ + Receive Button in Vendor Bill. +

+
+ +
+

+ + >On clicking Receive Button, Stock Is Moved To Our Inventory. +

+
+ +
+ +
+
+ +
+
+ cybrosys technologies +
+
+
+
+

+ Our Services +

+
+ + + +
+ +
+ + + +
+

+ + Odoo Support +

+ +
+ +
+
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
\ No newline at end of file diff --git a/invoice_stock_move/static/description/stock-picking-cybrosys-1.png b/invoice_stock_move/static/description/stock-picking-cybrosys-1.png new file mode 100644 index 000000000..9118c5dd5 Binary files /dev/null and b/invoice_stock_move/static/description/stock-picking-cybrosys-1.png differ diff --git a/invoice_stock_move/static/description/stock-picking-cybrosys-2.png b/invoice_stock_move/static/description/stock-picking-cybrosys-2.png new file mode 100644 index 000000000..ec28fc57d Binary files /dev/null and b/invoice_stock_move/static/description/stock-picking-cybrosys-2.png differ diff --git a/invoice_stock_move/static/description/stock-picking-cybrosys-3.png b/invoice_stock_move/static/description/stock-picking-cybrosys-3.png new file mode 100644 index 000000000..3a27e73a3 Binary files /dev/null and b/invoice_stock_move/static/description/stock-picking-cybrosys-3.png differ diff --git a/invoice_stock_move/views/invoice_stock_move_view.xml b/invoice_stock_move/views/invoice_stock_move_view.xml new file mode 100644 index 000000000..1cbe89d6e --- /dev/null +++ b/invoice_stock_move/views/invoice_stock_move_view.xml @@ -0,0 +1,56 @@ + + + + + Move Name + account.invoice + + + + +
+ +
+
+ + + Move Name + account.invoice + + + + + + + + +
+
\ No newline at end of file diff --git a/pos_lock_session/README.rst b/pos_lock_session/README.rst new file mode 100644 index 000000000..48146e715 --- /dev/null +++ b/pos_lock_session/README.rst @@ -0,0 +1,54 @@ +==================== +POS Session Lock V12 +==================== + +This module allows pos user to lock pos screen. + +Installation +============ + +- www.odoo.com/documentation/12.0/setup/install.html +- Install our custom addon + + +Configuration +============= + +* Using the Boolean button in POS configuration you can enable screen lock. +* Security pin for each pos user can be set from Point of Sale tab under Settings -> Users -> Users. + + +Features +======== + +* Screen lock option in POS session configuration. +* Screen lock button in pos. +* Lock screen using keyboard shortcut 'CTRL+L'. +* Login/Unlock screen in pos. +* Extra layer of security. + + +License +======= +GNU LESSER GENERAL PUBLIC LICENSE, Version 3 (LGPLv3) +(http://www.gnu.org/licenses/agpl.html) + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Credits +======= +* Cybrosys Techno Solutions + +Author +------ + +Developer: Aswani PC @ cybrosys, odoo@cybrosys.com + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. diff --git a/pos_lock_session/__init__.py b/pos_lock_session/__init__.py new file mode 100644 index 000000000..8e3a966e0 --- /dev/null +++ b/pos_lock_session/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import models diff --git a/pos_lock_session/__manifest__.py b/pos_lock_session/__manifest__.py new file mode 100644 index 000000000..fbe019003 --- /dev/null +++ b/pos_lock_session/__manifest__.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': "POS Session Lock", + 'version': '12.0.1.0.0', + 'summary': """The Module Allows the POS User to Set Screen Lock for POS Screen""", + 'description': """This module allows pos user to lock pos screen.""", + 'author': "Cybrosys Techno Solutions", + 'maintainer': 'Cybrosys Techno Solutions', + 'company': "Cybrosys Techno Solutions", + 'website': "https://www.cybrosys.com", + 'category': 'Point of Sale', + 'depends': ['point_of_sale'], + 'data': [ + 'views/pos_lock.xml', + 'views/pos_templates.xml', + ], + 'qweb': ['static/src/xml/session_lock.xml'], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/pos_lock_session/doc/RELEASE_NOTES.md b/pos_lock_session/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..74e259a74 --- /dev/null +++ b/pos_lock_session/doc/RELEASE_NOTES.md @@ -0,0 +1,5 @@ +## Module + +#### 13.02.2019 +#### Version 12.0.1.0.0 +#### Module Migrated diff --git a/pos_lock_session/models/__init__.py b/pos_lock_session/models/__init__.py new file mode 100644 index 000000000..9e296cc7a --- /dev/null +++ b/pos_lock_session/models/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import pos_lock diff --git a/pos_lock_session/models/pos_lock.py b/pos_lock_session/models/pos_lock.py new file mode 100644 index 000000000..c2c3196d4 --- /dev/null +++ b/pos_lock_session/models/pos_lock.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- + +from odoo import models, fields + + +class PosLockConfig(models.Model): + _inherit = 'pos.config' + + pos_lock = fields.Boolean(string='Enable Lock Screen') + bg_color = fields.Char('Background Color', default='rgb(218, 218, 218)', + help='The background color of the lock screen, ' + '(must be specified in a html-compatible format)') diff --git a/pos_lock_session/static/description/banner.jpg b/pos_lock_session/static/description/banner.jpg new file mode 100644 index 000000000..aca853b8e Binary files /dev/null and b/pos_lock_session/static/description/banner.jpg differ diff --git a/pos_lock_session/static/description/cybro_logo.png b/pos_lock_session/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/pos_lock_session/static/description/cybro_logo.png differ diff --git a/pos_lock_session/static/description/icon.png b/pos_lock_session/static/description/icon.png new file mode 100644 index 000000000..54a21af32 Binary files /dev/null and b/pos_lock_session/static/description/icon.png differ diff --git a/pos_lock_session/static/description/index.html b/pos_lock_session/static/description/index.html new file mode 100644 index 000000000..00495e368 --- /dev/null +++ b/pos_lock_session/static/description/index.html @@ -0,0 +1,352 @@ +
+
+

+ POS Session Lock +

+

+ CLock Pos Screen +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+
+
+

+ Overview +

+

+ The module allows the POS user to set screen lock for his/her POS screen when it is left unattended. The lock feature will provide an extra layer security for individual POS. +

+
+
+
+
+

+ Features +

+

+ + Screen lock option in POS session configuration. +

+

+ + Screen lock button in POS. +

+

+ + Lock screen using keyboard shortcut 'CTRL+L'. +

+

+ + Login/Unlock screen in pos. +

+

+ + Extra layer of security. +

+
+
+
+
+

+ Screenshots +

+

+ + Configuration +

+ Using the newly appeared Boolean button in POS configuration user can enable screen lock option. +

+ +
+ +
+

+ + Lock Screen +

+
+ +
+

+ + Login/Unlock Screen +

+
+ +
+
+
+ +
+
+ cybrosys technologies +
+
+
+
+

+ Our Services +

+
+ + + +
+ +
+ + + +
+

+ + Odoo Support +

+ +
+ +
+
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
\ No newline at end of file diff --git a/pos_lock_session/static/description/pos_session_lock_01.png b/pos_lock_session/static/description/pos_session_lock_01.png new file mode 100644 index 000000000..d4c1225f6 Binary files /dev/null and b/pos_lock_session/static/description/pos_session_lock_01.png differ diff --git a/pos_lock_session/static/description/pos_session_lock_02.png b/pos_lock_session/static/description/pos_session_lock_02.png new file mode 100644 index 000000000..57a52853b Binary files /dev/null and b/pos_lock_session/static/description/pos_session_lock_02.png differ diff --git a/pos_lock_session/static/description/pos_session_lock_03.png b/pos_lock_session/static/description/pos_session_lock_03.png new file mode 100644 index 000000000..997a6fe1d Binary files /dev/null and b/pos_lock_session/static/description/pos_session_lock_03.png differ diff --git a/pos_lock_session/static/src/css/session_lock.css b/pos_lock_session/static/src/css/session_lock.css new file mode 100644 index 000000000..9c4e613e8 --- /dev/null +++ b/pos_lock_session/static/src/css/session_lock.css @@ -0,0 +1,53 @@ +.login-screen{ + position:fixed !important; +} +.pos .modal-dialog .screen_lock{ + position: absolute; + top: 0; left: 0; right: 0; bottom: 0; + margin: auto; + width:100px; + height:100px; + text-align:center; + border-radius: 3px; + z-index:1200; +} + +.pos .modal-dialog .screen_lock .fa-lock { + position: absolute; + left: 13px; + top: 13px; + color:black; + font-size: 100px; + border-radius: 100%; +} + +.pos_login .fa-arrow-circle-right { + font-size: 40px; + background: #FFFFFF; + color: rgb(0,128,0); + line-height: 30px; + width: 30px; + border-radius: 100%; + margin-top: 8px; +} + +.back_pos .fa-arrow-circle-left { + position: absolute; + left: 13px; + top: 13px; + margin-right: 8px; + font-size: 40px; + background: #FFFFFF; + color: red; + line-height: 30px; + width: 30px; + border-radius: 100%; +} + +.pos_invalid_password{ + color: red; +} + +.login-picture{ + padding-top:130px; +} \ No newline at end of file diff --git a/pos_lock_session/static/src/js/session_lock.js b/pos_lock_session/static/src/js/session_lock.js new file mode 100644 index 000000000..559aaf767 --- /dev/null +++ b/pos_lock_session/static/src/js/session_lock.js @@ -0,0 +1,109 @@ +odoo.define('pos_lock_session.session_lock', function (require) { +"use strict"; + +var core = require('web.core'); +var chrome = require('point_of_sale.chrome'); +var gui = require('point_of_sale.gui'); +var PopupWidget = require('point_of_sale.popups'); +var _t = core._t; + +var SessionLock = PopupWidget.extend({ + template:'SessionLock', + events: _.extend({}, PopupWidget.prototype.events,{ + "click .screen_lock" : "unlock_screen", + }), + show: function(options){ + var self = this; + this._super(options); + $(document).keydown(function(e) { + if(e.keyCode == 13) { + e.preventDefault(); + self.gui.show_screen('login',{lock:true}); + } + }); + }, + unlock_screen:function(){ + var self = this; + this.gui.show_screen('login',{lock:true}); + } +}); +gui.define_popup({name:'lock', widget: SessionLock}); + + +chrome.Chrome.include({ + events: { + "click .pos-lock": "on_click_pos_lock", + }, + + init: function() { + var self = this; + this._super(); + $(document).keydown(function(e) { + if(self.pos.config.pos_lock){ + if(e.keyCode == 76 && e.ctrlKey) { + e.preventDefault(); + e.stopPropagation(); + var cashier = self.pos.get_cashier().id; + for (var i = 0; i < self.pos.users.length; i++) { + var user = self.pos.users[i]; + if (user.id === cashier) { + var cashier_pswd = user.pos_security_pin; + } + } + if(!cashier_pswd){ + self.gui.show_popup('error', { + 'title': _t('Security pin is not set'), + 'body': _t('Please set a security pin.'), + }); + } + else{ + self.gui.show_popup('lock',{}); + } + } + } + }); + }, + renderElement: function(){ + var self = this; + return this._super(); + + }, + + build_widgets: function(){ + this._super(); + var cashier = this.pos.get_cashier().id; + for (var i = 0; i < this.pos.users.length; i++) { + var user = this.pos.users[i]; + if (user.id === cashier) { + var cashier_pswd = user.pos_security_pin; + } + } + if (this.pos.config.pos_lock && cashier_pswd) { + this.gui.set_startup_screen('login'); + } + }, + + on_click_pos_lock: function (e) { + var self = this; + e.stopPropagation(); + var cashier = this.pos.get_cashier().id; + for (var i = 0; i < this.pos.users.length; i++) { + var user = this.pos.users[i]; + if (user.id === cashier) { + var cashier_pswd = user.pos_security_pin; + } + } + if(!cashier_pswd){ + this.gui.show_popup('error', { + 'title': _t('Security pin is not set'), + 'body': _t('Please set a security pin.'), + }); + } + else{ + self.gui.show_popup('lock',{}); + } + }, + +}); + +}); \ No newline at end of file diff --git a/pos_lock_session/static/src/js/unlock_screen.js b/pos_lock_session/static/src/js/unlock_screen.js new file mode 100644 index 000000000..b59086640 --- /dev/null +++ b/pos_lock_session/static/src/js/unlock_screen.js @@ -0,0 +1,125 @@ +odoo.define('pos_lock_session.screen', function (require) { +"use strict"; + +var screens = require('point_of_sale.screens'); +var gui = require('point_of_sale.gui'); +var models = require('point_of_sale.models'); +var _super_posmodel = models.PosModel.prototype; + +var _t = require('web.core')._t; + +var LoginScreenWidget = screens.ScreenWidget.extend({ + template: 'LoginScreenWidget', + + barcode_product_action: function(code){}, + barcode_discount_action: function(code){}, + barcode_client_action: function(code){}, + + init: function(parent, options) { + this._super(parent, options); + + }, + + show: function(){ + var self = this; + this._super(); + this.renderElement(); + this.$('.pos_invalid_password').val(''); + this.$('.user_password').val(''); + var cashier = this.pos.get_cashier().id; + for (var i = 0; i < this.pos.users.length; i++) { + var user = this.pos.users[i]; + if (user.id === cashier) { + this.user = user; + } + } + // this.user = this.pos.get_cashier(); + this.chrome.$('.pos-topheader').hide(); + if(this.pos.config.iface_vkeyboard && this.chrome.widget.keyboard){ + this.chrome.widget.keyboard.connect(this.$('.user_password')); + } + this.$el.css({"background-color": _.escape(this.pos.config.bg_color)}); + if (! this.user.pos_security_pin){ + self.$('.pos_invalid_password').text('Please set a security pin.'); + } + this.$('.back').click(function(){ + if (self.gui.get_current_screen_param('lock')){ + self.gui.show_screen('products'); + self.chrome.$('.pos-topheader').show(); + if(self.pos.config.iface_vkeyboard && self.chrome.widget.keyboard){ + self.chrome.widget.keyboard.hide(); + } + self.gui.show_popup('lock',{}); + } + else{ + self.gui.close(); + } + + }); + this.$('.login').click(function(){ + if (self.$('.user_password').val() === self.user.pos_security_pin){ + if (!self.gui.get_current_screen_param('lock')){ + _super_posmodel.set_start_order.call(self.pos); + } + self.gui.show_screen('products'); + self.chrome.$('.pos-topheader').show(); + if(self.pos.config.iface_vkeyboard && self.chrome.widget.keyboard){ + self.chrome.widget.keyboard.hide(); + } + } + else{ + self.$('.pos_invalid_password').text('Invalid Password'); + } + }); + $(document).keyup(function(e) { + if(e.keyCode == 13) { + e.preventDefault(); + e.stopPropagation(); + if (self.$('.user_password').val() === self.user.pos_security_pin){ + if (!self.gui.get_current_screen_param('lock')){ + _super_posmodel.set_start_order.call(self.pos); + } + self.gui.show_screen('products'); + self.chrome.$('.pos-topheader').show(); + if(self.pos.config.iface_vkeyboard && self.chrome.widget.keyboard){ + self.chrome.widget.keyboard.hide(); + } + } + else{ + self.$('.pos_invalid_password').text('Invalid Password'); + } + } + }); + }, + user_icon_url: function(id){ + return '/web/image?model=res.users&id='+id+'&field=image'; + }, + +}); + +gui.define_screen({ + 'name': 'login', + 'widget': LoginScreenWidget, + 'condition': function(){ + return this.pos.config.pos_lock; + }, +}); + +models.PosModel = models.PosModel.extend({ + // set when the user login to session. + set_start_order: function() { + var cashier = this.get_cashier().id; + for (var i = 0; i < this.users.length; i++) { + var user = this.users[i]; + if (user.id === cashier) { + var cashier_pswd = user.pos_security_pin; + } + } + if (!this.config.pos_lock || !cashier_pswd) { + _super_posmodel.set_start_order.apply(this,arguments); + } + }, + +}); + +}); \ No newline at end of file diff --git a/pos_lock_session/static/src/xml/session_lock.xml b/pos_lock_session/static/src/xml/session_lock.xml new file mode 100644 index 000000000..a9e605816 --- /dev/null +++ b/pos_lock_session/static/src/xml/session_lock.xml @@ -0,0 +1,47 @@ + + + + + + +
+ +
+
+
+
+ + + + + + +