diff --git a/access_restriction_by_ip/README.rst b/access_restriction_by_ip/README.rst new file mode 100644 index 000000000..ff9a2b61f --- /dev/null +++ b/access_restriction_by_ip/README.rst @@ -0,0 +1,17 @@ +Access Restriction By IP V11 +============================ + +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..f2c9590e3 --- /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 . +# +############################################################################## +import controllers +import models + + diff --git a/access_restriction_by_ip/__manifest__.py b/access_restriction_by_ip/__manifest__.py new file mode 100644 index 000000000..a4dba3eae --- /dev/null +++ b/access_restriction_by_ip/__manifest__.py @@ -0,0 +1,42 @@ +# -*- 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 . +# +############################################################################## +{ + 'name': 'Access Restriction By IP', + 'summary': """User Can Access His Account Only From Specified IP Address""", + 'version': '11.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': [ + '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..d62672370 --- /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 . +# +############################################################################## +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..e8a62f848 --- /dev/null +++ b/access_restriction_by_ip/controllers/main.py @@ -0,0 +1,80 @@ +# -*- 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 = [] + for rec in user_rec.allowed_ips: + ip_list.append(rec.ip_address) + if ip_address in ip_list: + 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") + request.uid = old_uid + values['error'] = _("Not allowed to login from this IP") + 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/models/__init__.py b/access_restriction_by_ip/models/__init__.py new file mode 100644 index 000000000..d8abd2496 --- /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 . +# +############################################################################## +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/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..1b8f41526 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..9f03c006e --- /dev/null +++ b/access_restriction_by_ip/static/description/index.html @@ -0,0 +1,69 @@ +
+
+

Access Restriction By IP

+

User can access his account only from specified IP's

+

Cybrosys Technologies

+
+

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

+
+ +
+

Warning message will be displayed

+
+
+
+ + +
+

Need Any Help?

+ +
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..7f747cbbb --- /dev/null +++ b/access_restriction_by_ip/static/description/index.html~ @@ -0,0 +1,82 @@ +
+
+

Birthday Notification By E-mail

+

This module will wish the employees on their birthday

+ +

Author : Cybrosys Techno Solutions , www.cybrosys.com

+
+

Features:

+
    +
  •    Adds a cron job to invoke email
  • +
  •    Adds an email template
  • +
+
+
+
+ +
+
+
+

Overview

+

+ HR departments need not worry to wish their employees for their Birthday. In this module we have included the feature to send an email Birthday notification to the employee. +

+
+
+
+ +
+
+

Employee Form

+
+

+ ☛ Give Date of Birth for employee.
+ ☛ Give work email.
+

+
+ +
+
+
+
+ +
+
+

Email Template

+
+

+ ☛ The cron job will invoke the email
+ ☛ Email template is very simple
+

+
+ +
+
+
+
+ +
+

Need Any Help?

+ +
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..e6f03f8d1 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/auto_resend_mail/__init__.py b/auto_resend_mail/__init__.py new file mode 100644 index 000000000..51ddb9577 --- /dev/null +++ b/auto_resend_mail/__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 . +# +############################################################################## +import models + diff --git a/auto_resend_mail/__manifest__.py b/auto_resend_mail/__manifest__.py new file mode 100644 index 000000000..358751060 --- /dev/null +++ b/auto_resend_mail/__manifest__.py @@ -0,0 +1,42 @@ +# -*- 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 . +# +############################################################################## +{ + 'name': 'Email - Auto Resend', + 'summary': """Automatically Resend the Failed Emails""", + 'version': '11.0.1.0.', + 'description': """Automatically resend the failed emails""", + 'author': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'category': 'Tools', + 'depends': ['base', 'mail'], + 'license': 'AGPL-3', + 'data': [ + 'views/auto_resend_cron.xml', + ], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'installable': True, + 'auto_install': False, + +} diff --git a/auto_resend_mail/models/__init__.py b/auto_resend_mail/models/__init__.py new file mode 100644 index 000000000..c9228ee8b --- /dev/null +++ b/auto_resend_mail/models/__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 . +# +############################################################################## +import auto_resend + diff --git a/auto_resend_mail/models/auto_resend.py b/auto_resend_mail/models/auto_resend.py new file mode 100644 index 000000000..8bd4e3b17 --- /dev/null +++ b/auto_resend_mail/models/auto_resend.py @@ -0,0 +1,33 @@ +# -*- 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, api + + +class ResendMails(models.Model): + _inherit = 'mail.mail' + + @api.multi + def resend_failed_mails(self): + mail_failed_list = self.env['mail.mail'].search([('state', '=', 'exception')]) + for failed_mail in mail_failed_list: + failed_mail.state = 'outgoing' diff --git a/auto_resend_mail/static/description/banner.jpg b/auto_resend_mail/static/description/banner.jpg new file mode 100644 index 000000000..1639fe1a2 Binary files /dev/null and b/auto_resend_mail/static/description/banner.jpg differ diff --git a/auto_resend_mail/static/description/cybro_logo.png b/auto_resend_mail/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/auto_resend_mail/static/description/cybro_logo.png differ diff --git a/auto_resend_mail/static/description/icon.png b/auto_resend_mail/static/description/icon.png new file mode 100644 index 000000000..ac0d22170 Binary files /dev/null and b/auto_resend_mail/static/description/icon.png differ diff --git a/auto_resend_mail/static/description/index.html b/auto_resend_mail/static/description/index.html new file mode 100644 index 000000000..ca0a68db3 --- /dev/null +++ b/auto_resend_mail/static/description/index.html @@ -0,0 +1,65 @@ +
+
+

Failed Emails - Auto Resend

+

Resend failed E-mails automatically

+

Cybrosys Technologies

+
+

No more worry about the failed E-mails, install Auto Resend to resend the failed E-mails + automatically.

+
+
+

Features:

+
    +
  •    Resending of failed Emails
  • +
  •    Can configure the resending time periods
  • +
  •    The whole mailbox will be checked once a day by default.
  • +
  •    If there are any failed emails, it will resend
  • +
  •    Automatic checking for resending the failed emails can be configured once + a day or once a week, or once an Hour etc.
  • +
+
+
+
+ +
+
+

How to set the resending time period?

+
+

By default, the whole Emails will be checked once a day

+

If there are any failed emails, then it will resend

+

To change the time period

+

Activate the developer mode, Then Settings -> Technical -> Automation -> Scheduled Action

+

Open the record named 'Auto Resend Emails'

+

Configure it here

+
+ +
+
+
+
+ +
+

Need Any Help?

+ +
diff --git a/auto_resend_mail/static/description/index.html~ b/auto_resend_mail/static/description/index.html~ new file mode 100644 index 000000000..7f747cbbb --- /dev/null +++ b/auto_resend_mail/static/description/index.html~ @@ -0,0 +1,82 @@ +
+
+

Birthday Notification By E-mail

+

This module will wish the employees on their birthday

+ +

Author : Cybrosys Techno Solutions , www.cybrosys.com

+
+

Features:

+
    +
  •    Adds a cron job to invoke email
  • +
  •    Adds an email template
  • +
+
+
+
+ +
+
+
+

Overview

+

+ HR departments need not worry to wish their employees for their Birthday. In this module we have included the feature to send an email Birthday notification to the employee. +

+
+
+
+ +
+
+

Employee Form

+
+

+ ☛ Give Date of Birth for employee.
+ ☛ Give work email.
+

+
+ +
+
+
+
+ +
+
+

Email Template

+
+

+ ☛ The cron job will invoke the email
+ ☛ Email template is very simple
+

+
+ +
+
+
+
+ +
+

Need Any Help?

+ +
diff --git a/auto_resend_mail/static/description/set_interval.png b/auto_resend_mail/static/description/set_interval.png new file mode 100644 index 000000000..dae7291ca Binary files /dev/null and b/auto_resend_mail/static/description/set_interval.png differ diff --git a/auto_resend_mail/views/auto_resend_cron.xml b/auto_resend_mail/views/auto_resend_cron.xml new file mode 100644 index 000000000..db438830a --- /dev/null +++ b/auto_resend_mail/views/auto_resend_cron.xml @@ -0,0 +1,16 @@ + + + + + Auto Resend Emails + + code + model.resend_failed_mails() + + 1 + days + -1 + + + + diff --git a/hide_cost_price/README.rst b/hide_cost_price/README.rst new file mode 100644 index 000000000..65d39dfd8 --- /dev/null +++ b/hide_cost_price/README.rst @@ -0,0 +1,13 @@ +Hide Product Cost Price v11 +=========================== +The cost price of the product will be only visible for the users added in the group "view cost price". +If user is not there in the group, the cost price of the product will remain invisible for the user. +By default administrator will be added to this group + +Credits +======= +Cybrosys Techno Solutions + +Author +------ +* Niyas Raphy diff --git a/hide_cost_price/__init__.py b/hide_cost_price/__init__.py new file mode 100644 index 000000000..b01e120da --- /dev/null +++ b/hide_cost_price/__init__.py @@ -0,0 +1,22 @@ +# -*- 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 . +# +############################################################################## diff --git a/hide_cost_price/__manifest__.py b/hide_cost_price/__manifest__.py new file mode 100644 index 000000000..9e5c12ad1 --- /dev/null +++ b/hide_cost_price/__manifest__.py @@ -0,0 +1,43 @@ +# -*- 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 . +# +############################################################################## +{ + 'name': 'Hide Product Cost Price', + 'summary': """Product Cost Price Will be Visible Only for Specified Group""", + 'version': '11.0.1.0.0', + 'description': """Product cost price will be visible only for specified group""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'category': 'Sales', + 'depends': ['base', 'purchase'], + 'license': 'AGPL-3', + 'data': [ + 'security/view_cost_price.xml', + 'views/hide_product_cost.xml' + ], + 'images': ['static/description/banner.jpg'], + 'demo': [], + 'installable': True, + 'auto_install': False, + +} diff --git a/hide_cost_price/__manifest__.py~ b/hide_cost_price/__manifest__.py~ new file mode 100644 index 000000000..cba482d02 --- /dev/null +++ b/hide_cost_price/__manifest__.py~ @@ -0,0 +1,43 @@ +# -*- 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 . +# +############################################################################## +{ + 'name': 'Hide Product Cost Price', + 'summary': """Product Cost Price Will be Visible Only for Specified Users in the Group""", + 'version': '10.0.1.0.0', + 'description': """Product cost price will be visible only users in group""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'http://www.cybrosys.com', + 'category': 'Sales', + 'depends': ['base', 'purchase'], + 'license': 'AGPL-3', + 'data': [ + 'security/view_cost_price.xml', + 'views/hide_product_cost.xml' + ], + 'images': ['static/description/banner.jpg'], + 'demo': [], + 'installable': True, + 'auto_install': False, + +} diff --git a/hide_cost_price/security/view_cost_price.xml b/hide_cost_price/security/view_cost_price.xml new file mode 100644 index 000000000..2c6f33666 --- /dev/null +++ b/hide_cost_price/security/view_cost_price.xml @@ -0,0 +1,9 @@ + + + + + View Cost Price + + + + \ No newline at end of file diff --git a/hide_cost_price/static/description/banner.jpg b/hide_cost_price/static/description/banner.jpg new file mode 100644 index 000000000..27b4163a3 Binary files /dev/null and b/hide_cost_price/static/description/banner.jpg differ diff --git a/hide_cost_price/static/description/cybro_logo.png b/hide_cost_price/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/hide_cost_price/static/description/cybro_logo.png differ diff --git a/hide_cost_price/static/description/icon.png b/hide_cost_price/static/description/icon.png new file mode 100644 index 000000000..fbd832ad0 Binary files /dev/null and b/hide_cost_price/static/description/icon.png differ diff --git a/hide_cost_price/static/description/index.html b/hide_cost_price/static/description/index.html new file mode 100644 index 000000000..622c16803 --- /dev/null +++ b/hide_cost_price/static/description/index.html @@ -0,0 +1,75 @@ +
+
+

Hide Product Cost Price

+

Cost price will be visible only for selected users

+

Cybrosys Technologies

+
+

This module will create a new group and the users added in this group can only view the + cost price of the product

+
+
+

Features:

+
    +
  •    Cost price visibility restricted
  • +
  •    Visible only for the users in the group
  • +
  •    By default administrator will be added to this group
  • +
+
+
+
+ +
+
+

Working

+
+

Adding user to the View Cost Price group

+

User will see the product cost price only if he is added in this group

+
+ +
+
+ +
+

Product View for users not in the Group

+
+

Product form view without cost price

+
+ + + +
+

Product tree view without cost price

+
+ +
+
+
+
+
+ + +
+

Need Any Help?

+ +
diff --git a/hide_cost_price/static/description/index.html~ b/hide_cost_price/static/description/index.html~ new file mode 100644 index 000000000..7f747cbbb --- /dev/null +++ b/hide_cost_price/static/description/index.html~ @@ -0,0 +1,82 @@ +
+
+

Birthday Notification By E-mail

+

This module will wish the employees on their birthday

+ +

Author : Cybrosys Techno Solutions , www.cybrosys.com

+
+

Features:

+
    +
  •    Adds a cron job to invoke email
  • +
  •    Adds an email template
  • +
+
+
+
+ +
+
+
+

Overview

+

+ HR departments need not worry to wish their employees for their Birthday. In this module we have included the feature to send an email Birthday notification to the employee. +

+
+
+
+ +
+
+

Employee Form

+
+

+ ☛ Give Date of Birth for employee.
+ ☛ Give work email.
+

+
+ +
+
+
+
+ +
+
+

Email Template

+
+

+ ☛ The cron job will invoke the email
+ ☛ Email template is very simple
+

+
+ +
+
+
+
+ +
+

Need Any Help?

+ +
diff --git a/hide_cost_price/static/description/product_form_view.png b/hide_cost_price/static/description/product_form_view.png new file mode 100644 index 000000000..f9be7a8ab Binary files /dev/null and b/hide_cost_price/static/description/product_form_view.png differ diff --git a/hide_cost_price/static/description/product_tree_view.png b/hide_cost_price/static/description/product_tree_view.png new file mode 100644 index 000000000..31881c6fe Binary files /dev/null and b/hide_cost_price/static/description/product_tree_view.png differ diff --git a/hide_cost_price/static/description/user_adding_group.png b/hide_cost_price/static/description/user_adding_group.png new file mode 100644 index 000000000..29bfab572 Binary files /dev/null and b/hide_cost_price/static/description/user_adding_group.png differ diff --git a/hide_cost_price/views/hide_product_cost.xml b/hide_cost_price/views/hide_product_cost.xml new file mode 100644 index 000000000..2e8129852 --- /dev/null +++ b/hide_cost_price/views/hide_product_cost.xml @@ -0,0 +1,29 @@ + + + + + product.template.cost + product.template + + + + hide_cost_price.view_cost_price + + + hide_cost_price.view_cost_price + + + + + + product.template.cost + product.template + + + + hide_cost_price.view_cost_price + + + + + diff --git a/hr_payslip_monthly_report/README.rst b/hr_payslip_monthly_report/README.rst new file mode 100644 index 000000000..05daa3a00 --- /dev/null +++ b/hr_payslip_monthly_report/README.rst @@ -0,0 +1,14 @@ +Payroll-Payslip Reporting v11 +============================= +This Module help Human resource managers to get a over all view for the payslips as pivot. + +Features +======== + +* Pivot view for HR payslips. +* Group By options like Employee wise, department wise, job title wise, date wise, status wise and Company wise. +* Spot Export to XLS Report. + +Credits +======= +Nikhil Krishnan @ cybrosys, nikhil@cybrosys.in \ No newline at end of file diff --git a/hr_payslip_monthly_report/__init__.py b/hr_payslip_monthly_report/__init__.py new file mode 100644 index 000000000..0c44acb1f --- /dev/null +++ b/hr_payslip_monthly_report/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Nikhil krishnan() +# 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 . +# +############################################################################## +import models diff --git a/hr_payslip_monthly_report/__manifest__.py b/hr_payslip_monthly_report/__manifest__.py new file mode 100644 index 000000000..2ae032f9d --- /dev/null +++ b/hr_payslip_monthly_report/__manifest__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################## +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Nikhil krishnan() +# 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': 'Payroll-Payslip Reporting', + 'version': '11.0.1.0.0', + 'summary': """Payslip Pivot View Report.""", + 'description': """Payslip monthly report. + This module gives a pivot view for the HR managers. they can see all the 'NET' amount of payslips in all states""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'category': 'Generic Modules/Human Resources', + 'depends': ['hr_payroll'], + 'license': 'LGPL-3', + 'data': [ + 'security/ir.model.access.csv', + 'views/menu_payslip_report.xml' + ], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'installable': True, + 'auto_install': False, +} diff --git a/hr_payslip_monthly_report/__manifest__.py~ b/hr_payslip_monthly_report/__manifest__.py~ new file mode 100644 index 000000000..1a56c822e --- /dev/null +++ b/hr_payslip_monthly_report/__manifest__.py~ @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- + +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Nikhil krishnan() +# 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': 'Payroll-Payslip Reporting', + 'version': '10.0.1.0.0', + 'summary': """Payslip Pivot View Report.""", + 'description': """Payslip monthly report. + This module gives a pivot view for the HR managers. they can see all the 'NET' amount of payslips in all states""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'http://www.cybrosys.com', + 'category': 'Human Resources', + 'depends': ['hr_payroll'], + 'license': 'LGPL-3', + 'data': [ + 'security/ir.model.access.csv', + 'views/menu_payslip_report.xml' + ], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'installable': True, + 'auto_install': False, +} diff --git a/hr_payslip_monthly_report/models/__init__.py b/hr_payslip_monthly_report/models/__init__.py new file mode 100644 index 000000000..037f753a3 --- /dev/null +++ b/hr_payslip_monthly_report/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Nikhil krishnan() +# 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 . +# +############################################################################## +import hr_payroll_report + diff --git a/hr_payslip_monthly_report/models/hr_payroll_report.py b/hr_payslip_monthly_report/models/hr_payroll_report.py new file mode 100644 index 000000000..2c05fcad9 --- /dev/null +++ b/hr_payslip_monthly_report/models/hr_payroll_report.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Nikhil krishnan() +# 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 fields, models, tools, api + + +class PayrollReportView(models.Model): + _name = 'hr.payroll.report.view' + _auto = False + + name = fields.Many2one('hr.employee', string='Employee') + date_from = fields.Date(string='From') + date_to = fields.Date(string='To') + state = fields.Selection([('draft', 'Draft'), ('verify', 'Waiting'), ('done', 'Done'), ('cancel', 'Rejected')], + string='Status') + job_id = fields.Many2one('hr.job', string='Job Title') + company_id = fields.Many2one('res.company', string='Company') + department_id = fields.Many2one('hr.department', string='Department') + net = fields.Float(string='Net Salary') + + def _select(self): + select_str = """ + min(ps.id) as id,emp.id as name,jb.id as job_id, + dp.id as department_id,cmp.id as company_id, + ps.date_from, ps.date_to, sum(psl.total) as net, ps.state as state + """ + return select_str + + def _from(self): + from_str = """ + hr_payslip_line psl join hr_payslip ps on (ps.employee_id=psl.employee_id and ps.id=psl.slip_id) + join hr_employee emp on (ps.employee_id=emp.id) join hr_department dp on (emp.department_id=dp.id) + join hr_job jb on (emp.department_id=jb.id) join res_company cmp on (cmp.id=ps.company_id) where psl.code='NET' + """ + return from_str + + def _group_by(self): + group_by_str = """ + group by emp.id,psl.total,ps.date_from, ps.date_to, ps.state,jb.id,dp.id,cmp.id + """ + return group_by_str + + @api.model_cr + def init(self): + tools.drop_view_if_exists(self.env.cr, self._table) + self.env.cr.execute("""CREATE or REPLACE VIEW %s as ( SELECT + %s + FROM %s + %s + )""" % (self._table, self._select(), self._from(), self._group_by())) + diff --git a/hr_payslip_monthly_report/security/ir.model.access.csv b/hr_payslip_monthly_report/security/ir.model.access.csv new file mode 100644 index 000000000..ed054578d --- /dev/null +++ b/hr_payslip_monthly_report/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_hr_payslip_monthly_report_manager,hr.payroll.report.view,hr_payslip_monthly_report.model_hr_payroll_report_view,hr.group_hr_manager,1,1,1,1 diff --git a/hr_payslip_monthly_report/static/description/HR Payslip Report view.png b/hr_payslip_monthly_report/static/description/HR Payslip Report view.png new file mode 100644 index 000000000..c1f9cacf4 Binary files /dev/null and b/hr_payslip_monthly_report/static/description/HR Payslip Report view.png differ diff --git a/hr_payslip_monthly_report/static/description/HR report group by.png b/hr_payslip_monthly_report/static/description/HR report group by.png new file mode 100644 index 000000000..20f53735c Binary files /dev/null and b/hr_payslip_monthly_report/static/description/HR report group by.png differ diff --git a/hr_payslip_monthly_report/static/description/Payslip Graph Report.png b/hr_payslip_monthly_report/static/description/Payslip Graph Report.png new file mode 100644 index 000000000..7c318c474 Binary files /dev/null and b/hr_payslip_monthly_report/static/description/Payslip Graph Report.png differ diff --git a/hr_payslip_monthly_report/static/description/banner.jpg b/hr_payslip_monthly_report/static/description/banner.jpg new file mode 100644 index 000000000..aa8ba62e1 Binary files /dev/null and b/hr_payslip_monthly_report/static/description/banner.jpg differ diff --git a/hr_payslip_monthly_report/static/description/cybro_logo.png b/hr_payslip_monthly_report/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/hr_payslip_monthly_report/static/description/cybro_logo.png differ diff --git a/hr_payslip_monthly_report/static/description/icon.png b/hr_payslip_monthly_report/static/description/icon.png new file mode 100644 index 000000000..e176696bc Binary files /dev/null and b/hr_payslip_monthly_report/static/description/icon.png differ diff --git a/hr_payslip_monthly_report/static/description/index.html b/hr_payslip_monthly_report/static/description/index.html new file mode 100644 index 000000000..ccb8b3cdc --- /dev/null +++ b/hr_payslip_monthly_report/static/description/index.html @@ -0,0 +1,124 @@ +
+
+

Payroll-Payslip Reporting

+

Get an overview of the pay slips as pivot

+

Author : Cybrosys Techno Solutions , www.cybrosys.com

+
+

Features:

+
    +
  •    Retrieve pivot view of pay slips.
  • +
  •    Able to get Reports
  • +
      +
    • Employee wise,
    • +
    • Employee's department wise,
    • +
    • Employee's job title wise,
    • +
    • Pay slip's date wise,
    • +
    • Pay slip's status wise,
    • +
    • Company wise.
    • +
    +
  •    Spot Export to XLS Report.
  • +
+
+
+
+ +
+
+

Payroll Monthly Statement in Pivot View

+
+
+

+ This report helps in payroll analysis. This helps you to check your pay slips and sorting it out from different group + criteria (Employee, Job title, Department, Company, Pay slip etc.). +

+
+
+
+
+ +
+
+

Payroll report as Pivot

+
+
+
+ +
+
+
+

+ HR managers need a complete payroll statement and also payroll monthly statement. From + this pivot view we can easily generate the custom payroll report views in excel format. Also + we can download it from there. From Odoo payroll report we can get only individual employee + pay slip reports. To make the use of HR payroll management system easier we can use this pivot + view to get the payroll/pay slip statement. +

+
+ +
+
+
+ +
+
+

Group by the pivot view

+
+
+
+ +
+
+
+

+ In this View we can easily generate custom reports by using the + button, + That is we can make the filters by groups, also we can get the counts too, from the "Measures" Button +

+
+
+
+
+ +
+
+

Graph View

+
+
+
+ +
+
+
+

+ In Pivot view we can easily generate custom Graphs like Pie Chart,Bar Chart, Line Chart. + With date and net salary or date and pay slip's counts. +

+
+
+
+
+ +
+

Need Any Help?

+ +
diff --git a/hr_payslip_monthly_report/views/menu_payslip_report.xml b/hr_payslip_monthly_report/views/menu_payslip_report.xml new file mode 100644 index 000000000..428aad9fb --- /dev/null +++ b/hr_payslip_monthly_report/views/menu_payslip_report.xml @@ -0,0 +1,67 @@ + + + + + hr.payslip.pivot + hr.payroll.report.view + + + + + + + + + + + hr.payslip.graph + hr.payroll.report.view + + + + + + + + + + hr.payslip.search + hr.payroll.report.view + + + + + + + + + + + + + + + + + + + + + + + + hr.payroll.report.view + Payslips + form + pivot,graph + {'search_default_year':1} + This report helps in payroll analysis. This helps you to check your pay slips and sorting it out from different group + criteria (Employee, Job title, Department, Company, Pay slip etc.). + + + + + + diff --git a/hr_payslip_monthly_report/views/quotation_handler.xml~ b/hr_payslip_monthly_report/views/quotation_handler.xml~ new file mode 100644 index 000000000..8c0e414d9 --- /dev/null +++ b/hr_payslip_monthly_report/views/quotation_handler.xml~ @@ -0,0 +1,112 @@ + + + + + Revised Quotation Orders + sale.order + form + tree,form + + [('parent_so_id', '=', active_id)] + +

+ Revised order against this Quotation Order. +

+
+
+ + + + + Sales Orders + ir.actions.act_window + sale.order + form + tree,kanban,form,calendar,pivot,graph + + {} + [('state', 'not in', ('draft','revised','sent', 'cancel'))] + +

+ Create a Quotation, the first step of a new sale. +

+ Once the quotation is confirmed, it becomes a sales order. + You'll be able to invoice it and collect payments. + From the Sales Orders menu, you can track delivery + orders or services. +

+
+
+ + + Quotations + ir.actions.act_window + sale.order + form + + tree,kanban,form,calendar,pivot,graph + {} + [('state','in',('pre','draft','sent','cancel'))] + + +

+ Create a Quotation, the first step of a new sale. +

+ Your next actions should flow efficiently: confirm the Quotation + to a Sale Order, then create the Invoice and collect the Payment. +

+ Note that once a Quotation becomes a Sale Order, it will be moved + from the Quotations list to the Sales Order list. +

+
+
+ + + sale.order.form + sale.order + + + + + + + + {'readonly': [('state', 'in', ('sent','revised','done','cancel'))]} + + + + {'readonly': [('state', 'in', ('sent','revised','done','cancel'))]} + + + + {'readonly': [('state', 'in', ('sent','revised','done','cancel'))]} + + + + {'readonly': [('state', 'in', ('sent','revised','done','cancel'))]} + + + + + + sale.order.tree + sale.order + + + + + + + +
+
\ No newline at end of file diff --git a/login_user_detail/README.rst b/login_user_detail/README.rst new file mode 100644 index 000000000..a7b12abd3 --- /dev/null +++ b/login_user_detail/README.rst @@ -0,0 +1,20 @@ +User Log Details v11 +==================== + +This module developed to record login details of user. + +Installation +============ + +Just select it from available modules to install it, there is no need to extra installations. + +Configuration +============= + +Nothing to configure. + +Credits +======= + +Developer: Saritha @ cybrosys + diff --git a/login_user_detail/__init__.py b/login_user_detail/__init__.py new file mode 100644 index 000000000..ff4fe0928 --- /dev/null +++ b/login_user_detail/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2016-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 . import models diff --git a/login_user_detail/__manifest__.py b/login_user_detail/__manifest__.py new file mode 100644 index 000000000..82bdb2914 --- /dev/null +++ b/login_user_detail/__manifest__.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2016-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 . +# +############################################################################## +{ + 'name': "User Log Details", + 'version': '11.0.2.0.0', + 'summary': """Login User Details & IP Address""", + 'description': """This module records login information of user""", + 'author': "Cybrosys Techno Solutions ", + 'company': "Cybrosys Techno Solutions ", + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'category': 'Tools', + 'depends': ['base'], + 'license': 'AGPL-3', + 'data': [ + 'security/ir.model.access.csv', + 'views/login_user_views.xml'], + 'demo': [], + 'images': ['static/description/banner.png'], + 'installable': True, + 'auto_install': False, +} diff --git a/login_user_detail/__manifest__.py~ b/login_user_detail/__manifest__.py~ new file mode 100644 index 000000000..43d25803f --- /dev/null +++ b/login_user_detail/__manifest__.py~ @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2016-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 . +# +############################################################################## +{ + 'name': "User Log Details", + 'version': '11.0.1.0.0', + 'summary': """Login User Details & IP Address""", + 'description': """This module records login information of user""", + 'author': "Cybrosys Techno Solutions ", + 'company': "Cybrosys Techno Solutions ", + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'category': 'Tools', + 'depends': ['base'], + 'license': 'AGPL-3', + 'data': [ + 'security/ir.model.access.csv', + 'views/login_user_views.xml'], + 'demo': [], + 'images': ['static/description/banner.png'], + 'installable': True, + 'auto_install': False, +} diff --git a/login_user_detail/doc/changelog.rst b/login_user_detail/doc/changelog.rst new file mode 100644 index 000000000..be9f4d0a8 --- /dev/null +++ b/login_user_detail/doc/changelog.rst @@ -0,0 +1,8 @@ +Changelog +========= +* Saritha Sahadevan contact: saritha@cybrosys.in + + +`10.0.2.0.0` +------------ +- Access Right Issue fix. \ No newline at end of file diff --git a/login_user_detail/models/__init__.py b/login_user_detail/models/__init__.py new file mode 100644 index 000000000..6305c1607 --- /dev/null +++ b/login_user_detail/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2016-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 . import login_user_details diff --git a/login_user_detail/models/login_user_details.py b/login_user_detail/models/login_user_details.py new file mode 100644 index 000000000..821877bec --- /dev/null +++ b/login_user_detail/models/login_user_details.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2016-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 . +# +############################################################################## +import logging +from itertools import chain +from odoo.http import request +from odoo import models, fields, api + +_logger = logging.getLogger(__name__) +USER_PRIVATE_FIELDS = ['password'] +concat = chain.from_iterable + + +class LoginUserDetail(models.Model): + _inherit = 'res.users' + + @api.model + def check_credentials(self, password): + result = super(LoginUserDetail, self).check_credentials(password) + ip_address = request.httprequest.environ['REMOTE_ADDR'] + vals = {'name': self.name, + 'ip_address': ip_address + } + self.env['login.detail'].sudo().create(vals) + return result + + +class LoginUpdate(models.Model): + _name = 'login.detail' + + name = fields.Char(string="User Name") + date_time = fields.Datetime(string="Login Date And Time", default=lambda self: fields.datetime.now()) + ip_address = fields.Char(string="IP Address") diff --git a/login_user_detail/security/ir.model.access.csv b/login_user_detail/security/ir.model.access.csv new file mode 100644 index 000000000..7935bc9e7 --- /dev/null +++ b/login_user_detail/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_user_detail,login_user_detail_login_detail,model_login_detail,,1,1,1,1 diff --git a/login_user_detail/static/description/banner.png b/login_user_detail/static/description/banner.png new file mode 100644 index 000000000..65f71eaa3 Binary files /dev/null and b/login_user_detail/static/description/banner.png differ diff --git a/login_user_detail/static/description/cybro_logo.png b/login_user_detail/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/login_user_detail/static/description/cybro_logo.png differ diff --git a/login_user_detail/static/description/icon.png b/login_user_detail/static/description/icon.png new file mode 100644 index 000000000..724a2717f Binary files /dev/null and b/login_user_detail/static/description/icon.png differ diff --git a/login_user_detail/static/description/index.html b/login_user_detail/static/description/index.html new file mode 100644 index 000000000..6e51e730c --- /dev/null +++ b/login_user_detail/static/description/index.html @@ -0,0 +1,59 @@ +
+
+

User Log Details

+

Records User Log Details

+

Cybrosys Technologies

+
+
+ +
+
+
+

Overview

+

+ User Log Details, Record login date,IP Address of login user. +

+
+
+
+ +
+
+

Login Details

+
+
+ +
+
+
+
+ +
+

Need Any Help?

+ +
+ + + + diff --git a/login_user_detail/static/description/login.png b/login_user_detail/static/description/login.png new file mode 100644 index 000000000..7e175adce Binary files /dev/null and b/login_user_detail/static/description/login.png differ diff --git a/login_user_detail/views/login_user_views.xml b/login_user_detail/views/login_user_views.xml new file mode 100644 index 000000000..1b49d4f1c --- /dev/null +++ b/login_user_detail/views/login_user_views.xml @@ -0,0 +1,42 @@ + + + + + Login User Details + login.detail + +
+ + + + + + + +
+
+
+ + + Login User Details + login.detail + + + + + + + + + + + Login User Details + login.detail + tree,form + + + + +
+
\ No newline at end of file diff --git a/pos_ticket/README.rst b/pos_ticket/README.rst new file mode 100644 index 000000000..f948209f1 --- /dev/null +++ b/pos_ticket/README.rst @@ -0,0 +1,14 @@ +POS Ticket v11 +============== + +This module will add company logo & company info in POS receipt. Also it will print the customer name +in the receipt if the customer is selected. +Default POS logo will be replaced by the company logo in POS status bar + +Credits +======= +Cybrosys Techno Solutions + +Author +------ +* Niyas Raphy diff --git a/pos_ticket/README.rst~ b/pos_ticket/README.rst~ new file mode 100644 index 000000000..32a7c5344 --- /dev/null +++ b/pos_ticket/README.rst~ @@ -0,0 +1,11 @@ +POS Ticket +========== + + This module will add company logo & info in POS receipt + +Credits +======= +Cybrosys Techno Solutions +Author +------ +* Cybrosys Techno Solutions diff --git a/pos_ticket/__init__.py b/pos_ticket/__init__.py new file mode 100644 index 000000000..07cd23865 --- /dev/null +++ b/pos_ticket/__init__.py @@ -0,0 +1,22 @@ +# -*- 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 . +# +############################################################################## diff --git a/pos_ticket/__manifest__.py b/pos_ticket/__manifest__.py new file mode 100644 index 000000000..f4ee1bfe2 --- /dev/null +++ b/pos_ticket/__manifest__.py @@ -0,0 +1,41 @@ +# -*- 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 . +# +############################################################################## +{ + 'name': 'Company Logo In POS Receipt', + 'summary': """Add Company Logo ,Info & Customer name to POS Ticket""", + 'version': '11.0.1.0', + 'description': """Add Company Logo , Info & Customer name to POS Ticket""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'http://www.cybrosys.com', + 'category': 'Point of Sale', + 'depends': ['base', 'point_of_sale'], + 'license': 'AGPL-3', + 'data': [], + 'qweb': ['static/src/xml/pos_ticket_view.xml'], + 'images': ['static/description/banner.jpg'], + 'demo': [], + 'installable': True, + 'auto_install': False, + +} diff --git a/pos_ticket/__manifest__.py~ b/pos_ticket/__manifest__.py~ new file mode 100644 index 000000000..b9f7aec77 --- /dev/null +++ b/pos_ticket/__manifest__.py~ @@ -0,0 +1,41 @@ +# -*- 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 . +# +############################################################################## +{ + 'name': 'Company Logo In POS Receipt', + 'summary': """Add Company Logo ,Info & Customer name to POS Ticket""", + 'version': '11.0.1.0', + 'description': """Add Company Logo , Info & Customer name to POS Ticket""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'http://www.cybrosys.com', + 'category': 'Point Of Sale', + 'depends': ['base', 'point_of_sale'], + 'license': 'AGPL-3', + 'data': [], + 'qweb': ['static/src/xml/pos_ticket_view.xml'], + 'images': ['static/description/banner.jpg'], + 'demo': [], + 'installable': True, + 'auto_install': False, + +} diff --git a/pos_ticket/static/description/banner.jpg b/pos_ticket/static/description/banner.jpg new file mode 100644 index 000000000..aad3880ad Binary files /dev/null and b/pos_ticket/static/description/banner.jpg differ diff --git a/pos_ticket/static/description/cybro_logo.png b/pos_ticket/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/pos_ticket/static/description/cybro_logo.png differ diff --git a/pos_ticket/static/description/icon.png b/pos_ticket/static/description/icon.png new file mode 100644 index 000000000..ff378ada1 Binary files /dev/null and b/pos_ticket/static/description/icon.png differ diff --git a/pos_ticket/static/description/index.html b/pos_ticket/static/description/index.html new file mode 100644 index 000000000..ea586fd25 --- /dev/null +++ b/pos_ticket/static/description/index.html @@ -0,0 +1,78 @@ +
+
+

Company Logo In POS Receipt

+

Company logo and info will be displayed in POS receipt

+

Cybrosys Technologies

+
+
+ +
+
+
+

Receipt Details

+
+

+ Currently in Odoo POS receipt there is no company logo. + This module adds the company logo to the POS receipt so that the users will get more information about + the company from the receipt. Also replace the default POS logo in the Status bar with Company logo +

+
+ +
+ +
+
+

Receipt

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

POS Logo

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

Need Any Help?

+ +
diff --git a/pos_ticket/static/description/new_pos_logo.png b/pos_ticket/static/description/new_pos_logo.png new file mode 100644 index 000000000..5549b56eb Binary files /dev/null and b/pos_ticket/static/description/new_pos_logo.png differ diff --git a/pos_ticket/static/description/new_receipt_pos.png b/pos_ticket/static/description/new_receipt_pos.png new file mode 100644 index 000000000..e785f4c7b Binary files /dev/null and b/pos_ticket/static/description/new_receipt_pos.png differ diff --git a/pos_ticket/static/description/old_pos_logo.png b/pos_ticket/static/description/old_pos_logo.png new file mode 100644 index 000000000..85a5a50f2 Binary files /dev/null and b/pos_ticket/static/description/old_pos_logo.png differ diff --git a/pos_ticket/static/description/old_receipt.png b/pos_ticket/static/description/old_receipt.png new file mode 100644 index 000000000..99ede150b Binary files /dev/null and b/pos_ticket/static/description/old_receipt.png differ diff --git a/pos_ticket/static/src/xml/pos_ticket_view.xml b/pos_ticket/static/src/xml/pos_ticket_view.xml new file mode 100644 index 000000000..ec297157e --- /dev/null +++ b/pos_ticket/static/src/xml/pos_ticket_view.xml @@ -0,0 +1,158 @@ + + + + + + + + + + + +
+
+
+ + Customer:
+
+ Cashier:
+ + Phone:
+
+ + +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + +
NameQtyPriceValue
+ + +
+ With a % discount +
+
+
+ + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Subtotal: + +
+ +
Discount: + +
Total: + +
+
+ + + + + + + + + + + + + + + +
+ + + + + +
+
+ + + + + + + + + + + +
Change: + + + +
+
+
+
+
\ No newline at end of file diff --git a/product_deletion/README.rst b/product_deletion/README.rst new file mode 100644 index 000000000..c70042ae4 --- /dev/null +++ b/product_deletion/README.rst @@ -0,0 +1,12 @@ +Product Removal Authorisation v11 +================================= +User in the group "Product Deletion" can only delete the products. Those who are not in the +group cant delete the product. Odoo will raise a warning if the user in not in the group + +Credits +======= +Cybrosys Techno Solutions + +Contributors +------------ +* Niyas Raphy, Cybrosys \ No newline at end of file diff --git a/product_deletion/__init__.py b/product_deletion/__init__.py new file mode 100644 index 000000000..735946add --- /dev/null +++ b/product_deletion/__init__.py @@ -0,0 +1,23 @@ +# -*- 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 . +# +############################################################################## +import models diff --git a/product_deletion/__manifest__.py b/product_deletion/__manifest__.py new file mode 100644 index 000000000..b335abd5b --- /dev/null +++ b/product_deletion/__manifest__.py @@ -0,0 +1,41 @@ +# -*- 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 . +# +############################################################################## +{ + 'name': 'Product Removal Authorisation', + 'summary': """Users in the Group "Product Deletion" Can Only Delete the Products""", + 'version': '11.0.1.0', + 'description': """Permission to delete the product""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'category': 'Warehouse', + 'depends': ['base', 'product'], + 'license': 'LGPL-3', + 'data': [ + 'views/product_deletion_group.xml', + ], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'installable': True, + 'auto_install': False, +} diff --git a/product_deletion/models/__init__.py b/product_deletion/models/__init__.py new file mode 100644 index 000000000..88318663a --- /dev/null +++ b/product_deletion/models/__init__.py @@ -0,0 +1,23 @@ +# -*- 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 . +# +############################################################################## +import product_deletion diff --git a/product_deletion/models/product_deletion.py b/product_deletion/models/product_deletion.py new file mode 100644 index 000000000..7322c258d --- /dev/null +++ b/product_deletion/models/product_deletion.py @@ -0,0 +1,38 @@ +# -*- 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, api, _ +from odoo.exceptions import Warning + + +class ProductDeletion(models.Model): + _inherit = 'product.template' + + @api.multi + @api.model + def unlink(self, default=None): + res_user = self.env['res.users'].search([('id', '=', self._uid)]) + if not res_user.has_group('product_deletion.product_deletion_group'): + raise Warning(_( + "You cannot delete the product(s). Please contact the System Administrator")) + + diff --git a/product_deletion/static/description/banner.jpg b/product_deletion/static/description/banner.jpg new file mode 100644 index 000000000..1b584bfda Binary files /dev/null and b/product_deletion/static/description/banner.jpg differ diff --git a/product_deletion/static/description/cybro_logo.png b/product_deletion/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/product_deletion/static/description/cybro_logo.png differ diff --git a/product_deletion/static/description/deletion_warning.png b/product_deletion/static/description/deletion_warning.png new file mode 100644 index 000000000..7a56f304e Binary files /dev/null and b/product_deletion/static/description/deletion_warning.png differ diff --git a/product_deletion/static/description/icon.png b/product_deletion/static/description/icon.png new file mode 100644 index 000000000..08b687c4b Binary files /dev/null and b/product_deletion/static/description/icon.png differ diff --git a/product_deletion/static/description/index.html b/product_deletion/static/description/index.html new file mode 100644 index 000000000..6d3ca5ea7 --- /dev/null +++ b/product_deletion/static/description/index.html @@ -0,0 +1,48 @@ +
+
+

Product Removal Authorisation

+

Users having the permission can only delete the products

+

Cybrosys Technologies

+
+
+ +
+
+

Product Form

+
+

+ ☛ Only users in the group Product Deletion can delete the product.
+ ☛ If user is not in the group Odoo will raise a warning message.
+

+
+ +
+
+
+
+ +
+

Need Any Help?

+ +
diff --git a/product_deletion/views/product_deletion_group.xml b/product_deletion/views/product_deletion_group.xml new file mode 100644 index 000000000..2e03d7674 --- /dev/null +++ b/product_deletion/views/product_deletion_group.xml @@ -0,0 +1,10 @@ + + + + + + Product Deletion + + + + \ No newline at end of file diff --git a/sale_discount_total/__init__.py b/sale_discount_total/__init__.py new file mode 100644 index 000000000..af16c9fb5 --- /dev/null +++ b/sale_discount_total/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: fasluca() +# +# 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 +from . import reports + diff --git a/sale_discount_total/__manifest__.py b/sale_discount_total/__manifest__.py new file mode 100644 index 000000000..a6e1522e6 --- /dev/null +++ b/sale_discount_total/__manifest__.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: fasluca() +# +# 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': 'Sale Discount on Total Amount', + 'version': '11.0.1.0.0', + 'category': 'Sales Management', + 'summary': "Discount on Total in Sale and Invoice With Discount Limit and Approval", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'http://www.cybrosys.com', + 'description': """ + +Sale Discount for Total Amount +======================= +Module to manage discount on total amount in Sale. + as an specific amount or percentage +""", + 'depends': ['sale', + 'account' + ], + 'data': [ + 'views/sale_view.xml', + 'views/account_invoice_view.xml', + 'views/invoice_report.xml', + 'views/sale_order_report.xml', + 'views/res_config_view.xml', + + ], + 'demo': [ + ], + 'images': ['static/description/banner.jpg'], + 'application': True, + 'installable': True, + 'auto_install': False, +} diff --git a/sale_discount_total/models/__init__.py b/sale_discount_total/models/__init__.py new file mode 100644 index 000000000..a5e468a63 --- /dev/null +++ b/sale_discount_total/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: fasluca() +# +# 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 sale +from . import account_invoice +from . import discount_approval + diff --git a/sale_discount_total/models/account_invoice.py b/sale_discount_total/models/account_invoice.py new file mode 100644 index 000000000..9f82af6c7 --- /dev/null +++ b/sale_discount_total/models/account_invoice.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: fasluca() +# +# 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 api, fields, models + + +class AccountInvoice(models.Model): + _inherit = "account.invoice" + + @api.one + @api.depends('invoice_line_ids.price_subtotal', 'tax_line_ids.amount', 'tax_line_ids.amount_rounding', + 'currency_id', 'company_id', 'date_invoice', 'type') + def _compute_amount(self): + self.amount_untaxed = sum(line.price_subtotal for line in self.invoice_line_ids) + self.amount_tax = sum(line.amount_total for line in self.tax_line_ids) + self.amount_total = self.amount_untaxed + self.amount_tax + self.amount_discount = sum((line.quantity * line.price_unit * line.discount)/100 for line in self.invoice_line_ids) + amount_total_company_signed = self.amount_total + amount_untaxed_signed = self.amount_untaxed + if self.currency_id and self.currency_id != self.company_id.currency_id: + currency_id = self.currency_id.with_context(date=self.date_invoice) + amount_total_company_signed = currency_id.compute(self.amount_total, self.company_id.currency_id) + amount_untaxed_signed = currency_id.compute(self.amount_untaxed, self.company_id.currency_id) + sign = self.type in ['in_refund', 'out_refund'] and -1 or 1 + self.amount_total_company_signed = amount_total_company_signed * sign + self.amount_total_signed = self.amount_total * sign + self.amount_untaxed_signed = amount_untaxed_signed * sign + + discount_type = fields.Selection([('percent', 'Percentage'), ('amount', 'Amount')], string='Discount Type', + readonly=True, states={'draft': [('readonly', False)]}, default='percent') + discount_rate = fields.Float('Discount Amount', digits=(16, 2), readonly=True, states={'draft': [('readonly', False)]}) + amount_discount = fields.Monetary(string='Discount', store=True, readonly=True, compute='_compute_amount', + track_visibility='always') + + @api.onchange('discount_type', 'discount_rate', 'invoice_line_ids') + def supply_rate(self): + for inv in self: + if inv.discount_type == 'percent': + for line in inv.invoice_line_ids: + line.discount = inv.discount_rate + else: + total = discount = 0.0 + for line in inv.invoice_line_ids: + total += (line.quantity * line.price_unit) + if inv.discount_rate != 0: + discount = (inv.discount_rate / total) * 100 + else: + discount = inv.discount_rate + for line in inv.invoice_line_ids: + line.discount = discount + + @api.multi + def compute_invoice_totals(self, company_currency, invoice_move_lines): + total = 0 + total_currency = 0 + for line in invoice_move_lines: + if self.currency_id != company_currency: + currency = self.currency_id.with_context(date=self.date or self.date_invoice or fields.Date.context_today(self)) + line['currency_id'] = currency.id + line['amount_currency'] = currency.round(line['price']) + line['price'] = currency.compute(line['price'], company_currency) + else: + line['currency_id'] = False + line['amount_currency'] = False + line['price'] = line['price'] + if self.type in ('out_invoice', 'in_refund'): + total += line['price'] + total_currency += line['amount_currency'] or line['price'] + line['price'] = - line['price'] + else: + total -= line['price'] + total_currency -= line['amount_currency'] or line['price'] + return total, total_currency, invoice_move_lines + + @api.multi + def button_dummy(self): + self.supply_rate() + return True + +class AccountInvoiceLine(models.Model): + _inherit = "account.invoice.line" + + discount = fields.Float(string='Discount (%)', digits=(16, 20), default=0.0) \ No newline at end of file diff --git a/sale_discount_total/models/discount_approval.py b/sale_discount_total/models/discount_approval.py new file mode 100644 index 000000000..bd17fc6f8 --- /dev/null +++ b/sale_discount_total/models/discount_approval.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: fasluca() +# +# 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 api, fields, models + + +class sale_discount(models.Model): + _inherit = 'sale.order' + + state = fields.Selection([ + ('draft', 'Quotation'), + ('sent', 'Quotation Sent'), + ('waiting', 'Waiting Approval'), + ('sale', 'Sales Order'), + ('done', 'Locked'), + ('cancel', 'Cancelled'), + ], string='Status', readonly=True, copy=False, index=True, track_visibility='onchange', default='draft') + + @api.multi + def action_confirm(self): + discnt = 0.0 + no_line = 0.0 + for order in self: + if self.company_id.so_double_validation == 'two_step': + for line in order.order_line: + no_line += 1 + discnt += line.discount + discnt = (discnt / no_line) + if order.company_id.so_double_validation_limit and discnt > order.company_id.so_double_validation_limit: + order.state = 'waiting' + return True + order._action_confirm() + if order.env['ir.config_parameter'].sudo().get_param('sale.auto_done_setting'): + order.action_done() + return True + + @api.multi + def action_approve(self): + self._action_confirm() + if self.env['ir.config_parameter'].sudo().get_param('sale.auto_done_setting'): + self.action_done() + return True + + +class Company(models.Model): + _inherit = 'res.company' + + so_double_validation = fields.Selection([ + ('one_step', 'Confirm sale orders in one step'), + ('two_step', 'Get 2 levels of approvals to confirm a sale order') + ], string="Levels of Approvals", default='one_step', + help="Provide a double validation mechanism for sales discount") + + so_double_validation_limit = fields.Float(string="Percentage of Discount that requires double validation'", + help="Minimum discount percentage for which a double validation is required") + + + # @api.multi + # def set_default_discount(self): + # if self.discount_approval and self.discount_approval != self.company_id.discount_approval: + # self.company_id.write({'discount_approval': self.discount_approval}) + # if self.limit_discount and self.limit_discount != self.company_id.limit_discount: + # self.company_id.write({'limit_discount': self.limit_discount}) + + +class ResDiscountSettings(models.TransientModel): + _inherit = 'res.config.settings' + + so_order_approval = fields.Boolean("Sale Discount Approval", default=lambda self: self.env.user.company_id.so_double_validation == 'two_step') + + so_double_validation = fields.Selection(related='company_id.so_double_validation',) + # help='Provide a double validation mechanism for sale exceeding maximum discount limit.') + so_double_validation_limit = fields.Float(string="Discount limit requires approval in %", + related='company_id.so_double_validation_limit') + + + # @api.model + # def get_values(self): + # res = super(ResDiscountSettings, self).get_values() + # res.update( + # limit_discount=self.company_id.limit_discount if self.company_id.limit_discount else 0.0, + # discount_approval=True if self.company_id.discount_approval else False + # ) + # return res + # + # @api.multi + # def set_values(self): + # super(ResDiscountSettings, self).set_values() + # self.company_id.limit_discount = self.limit_discount + # self.company_id.discount_approval = self.discount_approval + + def set_values(self): + super(ResDiscountSettings, self).set_values() + self.so_double_validation = 'two_step' if self.so_order_approval else 'one_step' \ No newline at end of file diff --git a/sale_discount_total/models/sale.py b/sale_discount_total/models/sale.py new file mode 100644 index 000000000..e919ee84f --- /dev/null +++ b/sale_discount_total/models/sale.py @@ -0,0 +1,167 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: fasluca() +# +# 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 api, fields, models +import odoo.addons.decimal_precision as dp + + +class SaleOrder(models.Model): + _inherit = "sale.order" + + @api.depends('order_line.price_total') + def _amount_all(self): + """ + Compute the total amounts of the SO. + """ + for order in self: + amount_untaxed = amount_tax = amount_discount = 0.0 + for line in order.order_line: + amount_untaxed += line.price_subtotal + amount_tax += line.price_tax + amount_discount += (line.product_uom_qty * line.price_unit * line.discount)/100 + order.update({ + 'amount_untaxed': order.pricelist_id.currency_id.round(amount_untaxed), + 'amount_tax': order.pricelist_id.currency_id.round(amount_tax), + 'amount_discount': order.pricelist_id.currency_id.round(amount_discount), + 'amount_total': amount_untaxed + amount_tax, + }) + + discount_type = fields.Selection([('percent', 'Percentage'), ('amount', 'Amount')], string='Discount type', + readonly=True,states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, + default='percent') + discount_rate = fields.Float('Discount Rate', digits=dp.get_precision('Account'), + readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}) + amount_untaxed = fields.Monetary(string='Untaxed Amount', store=True, readonly=True, compute='_amount_all', + track_visibility='always') + amount_tax = fields.Monetary(string='Taxes', store=True, readonly=True, compute='_amount_all', + track_visibility='always') + amount_total = fields.Monetary(string='Total', store=True, readonly=True, compute='_amount_all', + track_visibility='always') + amount_discount = fields.Monetary(string='Discount', store=True, readonly=True, compute='_amount_all', + digits=dp.get_precision('Account'), track_visibility='always') + + @api.onchange('discount_type', 'discount_rate', 'order_line') + def supply_rate(self): + for order in self: + if order.discount_type == 'percent': + for line in order.order_line: + line.discount = order.discount_rate + else: + total = discount = 0.0 + for line in order.order_line: + total += round((line.product_uom_qty * line.price_unit)) + if order.discount_rate != 0: + discount = (order.discount_rate / total) * 100 + else: + discount = order.discount_rate + for line in order.order_line: + line.discount = discount + + @api.multi + def _prepare_invoice(self,): + invoice_vals = super(SaleOrder, self)._prepare_invoice() + invoice_vals.update({ + 'discount_type': self.discount_type, + 'discount_rate': self.discount_rate + }) + return invoice_vals + + @api.multi + def button_dummy(self): + self.supply_rate() + return True + + +class AccountTax(models.Model): + _inherit = 'account.tax' + + @api.multi + def compute_all(self, price_unit, currency=None, quantity=1.0, product=None, partner=None): + if len(self) == 0: + company_id = self.env.user.company_id + else: + company_id = self[0].company_id + if not currency: + currency = company_id.currency_id + taxes = [] + prec = currency.decimal_places + round_tax = False if company_id.tax_calculation_rounding_method == 'round_globally' else True + round_total = True + if 'round' in self.env.context: + round_tax = bool(self.env.context['round']) + round_total = bool(self.env.context['round']) + + if not round_tax: + prec += 5 + # total_excluded = total_included = base = round(price_unit * quantity, prec) + total_excluded = total_included = base = (price_unit * quantity) + + for tax in self.sorted(key=lambda r: r.sequence): + if tax.amount_type == 'group': + ret = tax.children_tax_ids.compute_all(price_unit, currency, quantity, product, partner) + total_excluded = ret['total_excluded'] + base = ret['base'] + total_included = ret['total_included'] + tax_amount = total_included - total_excluded + taxes += ret['taxes'] + continue + + tax_amount = tax._compute_amount(base, price_unit, quantity, product, partner) + if not round_tax: + tax_amount = round(tax_amount, prec) + else: + tax_amount = currency.round(tax_amount) + + if tax.price_include: + total_excluded -= tax_amount + base -= tax_amount + else: + total_included += tax_amount + + tax_base = base + + if tax.include_base_amount: + base += tax_amount + + taxes.append({ + 'id': tax.id, + 'name': tax.with_context(**{'lang': partner.lang} if partner else {}).name, + 'amount': tax_amount, + 'sequence': tax.sequence, + 'account_id': tax.account_id.id, + 'refund_account_id': tax.refund_account_id.id, + 'analytic': tax.analytic, + 'base': tax_base, + }) + return { + 'taxes': sorted(taxes, key=lambda k: k['sequence']), + 'total_excluded': total_excluded, + 'total_included': total_included, + 'base': base, + } + + +class SaleOrderLine(models.Model): + _inherit = "sale.order.line" + + discount = fields.Float(string='Discount (%)', digits=(16, 20), default=0.0) + diff --git a/sale_discount_total/reports/__init__.py b/sale_discount_total/reports/__init__.py new file mode 100644 index 000000000..c3a13d243 --- /dev/null +++ b/sale_discount_total/reports/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: fasluca() +# +# 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 invoice_report +from . import sale_report diff --git a/sale_discount_total/reports/invoice_report.py b/sale_discount_total/reports/invoice_report.py new file mode 100644 index 000000000..567f36fc2 --- /dev/null +++ b/sale_discount_total/reports/invoice_report.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: fasluca() +# +# 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 fields, models + + +class AccountInvoiceReport(models.Model): + _inherit = 'account.invoice.report' + + discount = fields.Float('Discount', readonly=True) + + def _select(self): + res = super(AccountInvoiceReport,self)._select() + select_str = res + """, sub.discount AS discount """ + return select_str + + def _sub_select(self): + res = super(AccountInvoiceReport,self)._sub_select() + select_str = res + """,SUM ((invoice_type.sign * ail.quantity) / (u.factor * u2.factor) * ail.price_unit * + ail.discount / 100) AS discount""" + return select_str \ No newline at end of file diff --git a/sale_discount_total/reports/sale_report.py b/sale_discount_total/reports/sale_report.py new file mode 100644 index 000000000..4ac0b8646 --- /dev/null +++ b/sale_discount_total/reports/sale_report.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: fasluca() +# +# 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 fields, models + + +class DiscountSaleReport(models.Model): + _inherit = 'sale.report' + + discount = fields.Float('Discount', readonly=True) + + def _select(self): + res = super(DiscountSaleReport,self)._select() + select_str = res+""",sum(l.product_uom_qty / u.factor * u2.factor * cr.rate * l.price_unit * l.discount / 100.0) + as discount""" + return select_str diff --git a/sale_discount_total/static/description/banner.jpg b/sale_discount_total/static/description/banner.jpg new file mode 100644 index 000000000..ccb8e1556 Binary files /dev/null and b/sale_discount_total/static/description/banner.jpg differ diff --git a/sale_discount_total/static/description/cybro_logo.png b/sale_discount_total/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/sale_discount_total/static/description/cybro_logo.png differ diff --git a/sale_discount_total/static/description/icon.png b/sale_discount_total/static/description/icon.png new file mode 100644 index 000000000..6a1daaf65 Binary files /dev/null and b/sale_discount_total/static/description/icon.png differ diff --git a/sale_discount_total/static/description/index.html b/sale_discount_total/static/description/index.html new file mode 100644 index 000000000..a0332cfc2 --- /dev/null +++ b/sale_discount_total/static/description/index.html @@ -0,0 +1,98 @@ +
+
+

Global Discount In Sale

+

Cybrosys Technologies

+
+
+
+
+

+ This module allows you to mention discount on Total of sale order and Total of Customer Invoice in two ways +

+
+
+

As percentage

+

+ Select 'Percentage' from Discount type and give discount percentage as Discount rate. + System will update the value of Discount and Total +

+

As amount

+

+ Select 'Amount' from Discount type and give discount amount as Discount rate. + System will update the value of Discount and Total +

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

+ And the module also allows you to set a limit for total discount in percentage. Exceeding this limit + will require approval. +

+
+
+
+
+ +
+
+
+
+

+ Manager level users can approve sale orders in 'Waiting Approval' stage. +

+
+
+
+ +
+
+
+ +
+

Need Any Help?

+ +
+ diff --git a/sale_discount_total/static/description/s_d_inv.png b/sale_discount_total/static/description/s_d_inv.png new file mode 100644 index 000000000..5a144d79b Binary files /dev/null and b/sale_discount_total/static/description/s_d_inv.png differ diff --git a/sale_discount_total/static/description/s_d_settings.png b/sale_discount_total/static/description/s_d_settings.png new file mode 100644 index 000000000..25f73c747 Binary files /dev/null and b/sale_discount_total/static/description/s_d_settings.png differ diff --git a/sale_discount_total/static/description/s_d_so.png b/sale_discount_total/static/description/s_d_so.png new file mode 100644 index 000000000..7a4ba720a Binary files /dev/null and b/sale_discount_total/static/description/s_d_so.png differ diff --git a/sale_discount_total/static/description/s_d_state.png b/sale_discount_total/static/description/s_d_state.png new file mode 100644 index 000000000..c0443deff Binary files /dev/null and b/sale_discount_total/static/description/s_d_state.png differ diff --git a/sale_discount_total/views/account_invoice_view.xml b/sale_discount_total/views/account_invoice_view.xml new file mode 100644 index 000000000..61456b7ae --- /dev/null +++ b/sale_discount_total/views/account_invoice_view.xml @@ -0,0 +1,41 @@ + + + + + + discount.account.invoice + account.invoice + + + + (16, 2) + + + + + +
+
+
+
+
+
+
+ + + discount.account.invoice.line.tree + account.invoice.line + + + + (16, 2) + + + + +
+
diff --git a/sale_discount_total/views/invoice_report.xml b/sale_discount_total/views/invoice_report.xml new file mode 100644 index 000000000..bf3d69fde --- /dev/null +++ b/sale_discount_total/views/invoice_report.xml @@ -0,0 +1,18 @@ + + + + + + + + \ No newline at end of file diff --git a/sale_discount_total/views/res_config_view.xml b/sale_discount_total/views/res_config_view.xml new file mode 100644 index 000000000..c9f7d5fc8 --- /dev/null +++ b/sale_discount_total/views/res_config_view.xml @@ -0,0 +1,33 @@ + + + + res.config.settings.view.form.inherit.sale.discount + res.config.settings + + + + + +
+
+ +
+
+
+
+ +
+
+
+
diff --git a/sale_discount_total/views/sale_order_report.xml b/sale_discount_total/views/sale_order_report.xml new file mode 100644 index 000000000..9847f0e11 --- /dev/null +++ b/sale_discount_total/views/sale_order_report.xml @@ -0,0 +1,21 @@ + + + + + + + + \ No newline at end of file diff --git a/sale_discount_total/views/sale_view.xml b/sale_discount_total/views/sale_view.xml new file mode 100644 index 000000000..53b756892 --- /dev/null +++ b/sale_discount_total/views/sale_view.xml @@ -0,0 +1,43 @@ + + + + + + discount.sale.order.form + sale.order + + + +