@ -0,0 +1,17 @@ |
|||
Access Restriction By IP V10 |
|||
============================ |
|||
|
|||
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 <niyas@cybrosys.in> |
@ -0,0 +1,25 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Niyas Raphy(<http://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
import controllers |
|||
import models |
|||
|
@ -0,0 +1,41 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Niyas Raphy(<http://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
{ |
|||
'name': 'Access Restriction By IP', |
|||
'summary': """User Can Access His Account Only From Specified IP Address""", |
|||
'version': '10.0.1.0.0', |
|||
'description': """User Can Access His Account Only From Specified IP Address""", |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'website': 'http://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, |
|||
} |
@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Niyas Raphy(<http://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
import main |
@ -0,0 +1,80 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Niyas Raphy(<http://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
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) |
@ -0,0 +1,24 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Niyas Raphy(<http://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
import allowed_ips |
|||
|
@ -0,0 +1,36 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Niyas Raphy(<http://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
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') |
After Width: | Height: | Size: 8.5 KiB |
After Width: | Height: | Size: 133 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 32 KiB |
@ -0,0 +1,69 @@ |
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h2 class="oe_slogan">Access Restriction By IP</h2> |
|||
<h3 class="oe_slogan">User can access his account only from specified IP's</h3> |
|||
<h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a> </h4> |
|||
<div> |
|||
<p>This module will restrict the users access to his account from specified IP address only</p> |
|||
</div> |
|||
<div> |
|||
<h4><p>Features:</p></h4> |
|||
<ul> |
|||
<li style="list-style:none !important;"><span style="color:green;"> ☑</span> Administrator can set a IP or a group of IP address for each users </li> |
|||
<li style="list-style:none !important;"><span style="color:green;"> ☑</span> Users can access their account only from the specified IP's</li> |
|||
<li style="list-style:none !important;"><span style="color:green;"> ☑</span> Accessing system from a non-specified IP will restrict the user login</li> |
|||
<li style="list-style:none !important;"><span style="color:green;"> ☑</span> A warning message will be displayed</li> |
|||
<li style="list-style:none !important;"><span style="color:green;"> ☑</span> If no IP is set to user means there is no any restriction by IP</li> |
|||
<li style="list-style:none !important;"><span style="color:green;"> ☑</span> IP Address for each users can be set from users form view</li> |
|||
</ul> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h4 class="oe_slogan">Setting IP address for User</h4> |
|||
<div class="oe_span12"> |
|||
<p>Setting IP address for user from users form view </p> |
|||
<p>User will be able to access his account only from this IP's</p> |
|||
<div class="oe_row_img oe_centered"> |
|||
<img style="border:10px solid white;" class="oe_picture oe_screenshot" src="user_set_ip.png"> |
|||
</div> |
|||
</div> |
|||
<h4 class="oe_slogan">User accessing his account</h4> |
|||
<div class="oe_span12"> |
|||
<p>On accessing account from a non specified IP</p> |
|||
<div class="oe_row_img oe_centered"> |
|||
<img style="border:10px solid white;" class="oe_picture oe_screenshot" src="access_non_set_ip.png"> |
|||
</div> |
|||
<p>Warning message will be displayed</p> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
|
|||
<section class="oe_container"> |
|||
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2> |
|||
<div class="oe_slogan" style="margin-top:10px !important;"> |
|||
<div> |
|||
<a class="btn btn-primary btn-lg mt8" |
|||
style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com"><i |
|||
class="fa fa-envelope"></i> Email </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="https://www.cybrosys.com/contact/"><i |
|||
class="fa fa-phone"></i> Contact Us </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="https://www.cybrosys.com/odoo-customization-and-installation/"><i |
|||
class="fa fa-check-square"></i> Request Customization </a> |
|||
</div> |
|||
<br> |
|||
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block"> |
|||
<div> |
|||
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td> |
|||
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td> |
|||
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td> |
|||
</div> |
|||
</div> |
|||
</section> |
@ -0,0 +1,82 @@ |
|||
<section class="oe_container"> |
|||
<div class="oe_spaced"> |
|||
<h2 class="oe_slogan">Birthday Notification By E-mail</h2> |
|||
<h3 class="oe_slogan">This module will wish the employees on their birthday</h3> |
|||
|
|||
<h4 class="oe_slogan">Author : Cybrosys Techno Solutions , www.cybrosys.com</h4> |
|||
<div style="padding-left:66px;"> |
|||
<h4>Features:</h4> |
|||
<ul> |
|||
<li style="list-style:none !important;"><span style="color:green;"> →</span> Adds a cron job to invoke email</li> |
|||
<li style="list-style:none !important;"><span style="color:green;"> →</span> Adds an email template</li> |
|||
</ul> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_spaced"> |
|||
<div class="oe_picture"> |
|||
<h3 class="oe_slogan">Overview</h3> |
|||
<p class="oe_mt32"> |
|||
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. |
|||
</p> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h4 class="oe_slogan">Employee Form</h4> |
|||
<div class="oe_span12"> |
|||
<p class='oe_mt32'> |
|||
☛ Give Date of Birth for employee.<br> |
|||
☛ Give work email.<br> |
|||
</p> |
|||
<div class="oe_row_img oe_centered"> |
|||
<img class="oe_picture oe_screenshot" src="birthday_1.png"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h4 class="oe_slogan">Email Template</h4> |
|||
<div class="oe_span12"> |
|||
<p class='oe_mt32'> |
|||
☛ The cron job will invoke the email<br> |
|||
☛ Email template is very simple<br> |
|||
</p> |
|||
<div class="oe_row_img oe_centered"> |
|||
<img class="oe_picture oe_screenshot" src="temp.png"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2> |
|||
<div class="oe_slogan" style="margin-top:10px !important;"> |
|||
<div> |
|||
<a class="btn btn-primary btn-lg mt8" |
|||
style="color: #FFFFFF !important;border-radius: 0;" href="http://www.cybrosys.com"><i |
|||
class="fa fa-envelope"></i> Email </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="http://www.cybrosys.com/contact/"><i |
|||
class="fa fa-phone"></i> Contact Us </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="http://www.cybrosys.com/odoo-customization-and-installation/"><i |
|||
class="fa fa-check-square"></i> Request Customization </a> |
|||
</div> |
|||
<br> |
|||
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block"> |
|||
<div> |
|||
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td> |
|||
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td> |
|||
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td> |
|||
</div> |
|||
</div> |
|||
</section> |
After Width: | Height: | Size: 24 KiB |
@ -0,0 +1,21 @@ |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<odoo> |
|||
<data> |
|||
<record model="ir.ui.view" id="res_users_allowed_ips"> |
|||
<field name="name">res.users</field> |
|||
<field name="model">res.users</field> |
|||
<field name="inherit_id" ref="base.view_users_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//page[1]" position='after'> |
|||
<page string="Allowed IP"> |
|||
<field name="allowed_ips"> |
|||
<tree editable="bottom"> |
|||
<field name="ip_address"/> |
|||
</tree> |
|||
</field> |
|||
</page> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
@ -0,0 +1,24 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Jesni Banu(<https://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
import models |
|||
import reports |
@ -0,0 +1,49 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Jesni Banu(<https://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
{ |
|||
'name': 'Account Budget Report', |
|||
'version': '10.0.1.0.0', |
|||
'summary': """Enables Budget Summary Report""", |
|||
'description': """Providing budget analysis through different pdf reports. So we can take |
|||
quick budget analysis.""", |
|||
'category': 'Accounting', |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'website': "https://www.cybrosys.com", |
|||
'depends': ['base', 'account_budget'], |
|||
'data': [ |
|||
'views/budget_report_view.xml', |
|||
'views/budget_summary_view.xml', |
|||
'views/budget_print_view.xml', |
|||
'views/analytic_budget_report_view.xml', |
|||
'reports/account_budget_report.xml', |
|||
'reports/report_crossovered_budget.xml', |
|||
'reports/report_analytic_account_budget.xml', |
|||
], |
|||
'images': ['static/description/banner.jpg'], |
|||
'license': 'AGPL-3', |
|||
'demo': [], |
|||
'installable': True, |
|||
'auto_install': False, |
|||
'application': False, |
|||
} |
@ -0,0 +1,28 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Jesni Banu(<https://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
import budget_report |
|||
import budget_summary |
|||
import budget |
|||
import analytic_budget_report |
|||
|
|||
|
@ -0,0 +1,44 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Jesni Banu(<https://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
import time |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class AccountBudgetAnalytic(models.TransientModel): |
|||
|
|||
_name = 'account.budget.analytic' |
|||
_description = 'Account Budget report for analytic account' |
|||
|
|||
date_from = fields.Date('Start of period', required=True, default=lambda *a: time.strftime('%Y-01-01')) |
|||
date_to = fields.Date('End of period', required=True, default=lambda *a: time.strftime('%Y-%m-%d')) |
|||
|
|||
def check_report(self): |
|||
data = self.read()[0] |
|||
active_ids = self.env.context.get('active_ids', []) |
|||
datas = { |
|||
'ids': active_ids, |
|||
'model': 'account.analytic.account', |
|||
'form': data |
|||
} |
|||
datas['form']['ids'] = datas['ids'] |
|||
return self.env['report'].get_action([], 'account_budget_report.report_analytic_account_budget', data=datas) |
@ -0,0 +1,44 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Jesni Banu(<https://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
import time |
|||
from odoo import models, fields |
|||
|
|||
|
|||
class AccountBudgetCrossOverReport(models.TransientModel): |
|||
_name = "account.budget.cross.over.report" |
|||
_description = "Account Budget cross over report" |
|||
|
|||
date_from = fields.Date('Start of period', required=True, default=lambda *a: time.strftime('%Y-01-01')) |
|||
date_to = fields.Date('End of period', required=True, default=lambda *a: time.strftime('%Y-%m-%d')) |
|||
|
|||
def check_report(self): |
|||
data = self.read()[0] |
|||
active_ids = self.env.context.get('active_ids', []) |
|||
datas = { |
|||
'ids': active_ids, |
|||
'model': 'crossovered.budget', |
|||
'form': data |
|||
} |
|||
datas['form']['ids'] = datas['ids'] |
|||
datas['form']['report'] = 'analytic-full' |
|||
return self.env['report'].get_action([], 'account_budget_report.report_cross_over_budget', data=datas) |
@ -0,0 +1,46 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Jesni Banu(<https://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
import time |
|||
from odoo import models, fields |
|||
|
|||
|
|||
class AccountBudgetAnalytic(models.TransientModel): |
|||
_name = 'account.budget.report' |
|||
_description = 'Account Budget report for analytic account' |
|||
|
|||
date_from = fields.Date('Start of period', required=True, default=lambda *a: time.strftime('%Y-01-01')) |
|||
date_to = fields.Date('End of period', required=True, default=lambda *a: time.strftime('%Y-%m-%d')) |
|||
|
|||
def check_report(self): |
|||
active_ids = self.env.context.get('active_ids', []) |
|||
data = self.read()[0] |
|||
datas = { |
|||
'ids': active_ids, |
|||
'model': 'account.budget.post', |
|||
'form': data |
|||
} |
|||
datas['form']['ids'] = datas['ids'] |
|||
datas['form']['report'] = 'analytic-full' |
|||
return self.env['report'].get_action([], 'account_budget_report.report_budget', data=datas) |
|||
|
|||
|
@ -0,0 +1,44 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Jesni Banu(<https://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
import time |
|||
from odoo import models, fields |
|||
|
|||
|
|||
class AccountBudgetCrossOverSummaryReport(models.TransientModel): |
|||
_name = 'account.budget.cross.over.summary.report' |
|||
_description = 'Account Budget cross over summary report' |
|||
|
|||
date_from = fields.Date('Start of period', required=True, default=lambda *a: time.strftime('%Y-01-01')) |
|||
date_to = fields.Date('End of period', required=True, default=lambda *a: time.strftime('%Y-%m-%d')) |
|||
|
|||
def check_report(self): |
|||
data = self.read()[0] |
|||
active_ids = self.env.context.get('active_ids', []) |
|||
datas = { |
|||
'ids': active_ids, |
|||
'model': 'crossovered.budget', |
|||
'form': data |
|||
} |
|||
datas['form']['ids'] = datas['ids'] |
|||
datas['form']['report'] = 'analytic-one' |
|||
return self.env['report'].get_action([], 'account_budget_report.report_cross_over_budget', data=datas) |
@ -0,0 +1,26 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Jesni Banu(<https://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
import budget_parser |
|||
import cross_overed_budget_report |
|||
import analytic_budget |
|||
|
@ -0,0 +1,85 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<template id="report_budget"> |
|||
<t t-call="report.html_container"> |
|||
<t t-foreach="docs" t-as="o"> |
|||
<t t-call="report.internal_layout"> |
|||
<div class="page"> |
|||
<h2>Budget</h2> |
|||
<div class="row mt32"> |
|||
<div class="col-xs-3"> |
|||
<strong>Currency:</strong> |
|||
<p t-esc="res_company.currency_id.name"/> |
|||
</div> |
|||
<div class="col-xs-3"> |
|||
<strong>Printed at:</strong> |
|||
<p><span t-esc="formatLang(time.strftime('%Y-%m-%d'), date=True)"/> at |
|||
<span t-esc="time.strftime('%H:%M:%S')"/></p> |
|||
</div> |
|||
<div class="col-xs-3"> |
|||
<strong>Analysis from:</strong> |
|||
<p><span t-esc="formatLang(data['form']['date_from'], date=True)"/> to |
|||
<span t-esc="formatLang(data['form']['date_to'], date=True)"/></p> |
|||
</div> |
|||
<div class="col-xs-3"> |
|||
<strong>Budget:</strong> |
|||
<p t-field="o.name"/> |
|||
</div> |
|||
</div> |
|||
|
|||
<table class="table table-condensed"> |
|||
<thead> |
|||
<tr> |
|||
<th>Description</th> |
|||
<th class="text-right">Theoretical Amount</th> |
|||
<th class="text-right">Planned Amount</th> |
|||
<th class="text-right">Practical Amount</th> |
|||
<th class="text-right">Perc(%)</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<t t-foreach="funct(o, data['form'])" t-as="line"> |
|||
<t t-if="line['status'] == 1"> |
|||
<tr> |
|||
<td><strong t-esc="line['name']"/></td> |
|||
<td class="text-right"> |
|||
<strong t-esc="formatLang(line['theo'], dp='Account', currency_obj = res_company.currency_id)"/> |
|||
</td> |
|||
<td class="text-right"><strong t-esc="formatLang(line['pln'], dp='Account', currency_obj=res_company.currency_id)"/></td> |
|||
<td class="text-right"><strong t-esc="formatLang(line['prac'], dp='Account', currency_obj=res_company.currency_id)"/></td> |
|||
<td class="text-right"><strong t-esc="formatLang(line['perc'],digits=2)"/> %</td> |
|||
</tr> |
|||
</t> |
|||
<tr t-if="line['status'] != 1"> |
|||
<td><span style="color: white;" t-esc="'.....'*(line['status'] - 1)"/><span t-esc="line['name']"/></td> |
|||
<td class="text-right"><span t-esc="formatLang(line['theo'], dp='Account', currency_obj=res_company.currency_id)"/></td> |
|||
<td class="text-right"><span t-esc="formatLang(line['pln'], dp='Account', currency_obj=res_company.currency_id)"/></td> |
|||
<td class="text-right"><span t-esc="formatLang(line['prac'], dp='Account', currency_obj=res_company.currency_id)"/></td> |
|||
<td class="text-right"><span t-esc="formatLang(line['perc'],digits=2)"/> % </td> |
|||
</tr> |
|||
</t> |
|||
<tr t-foreach="funct_total(data['form'])" t-as="tot"> |
|||
<td><strong>Total:</strong></td> |
|||
<td class="text-right"><strong t-esc="formatLang(tot['tot_theo'], dp='Account', currency_obj = res_company.currency_id)"/></td> |
|||
<td class="text-right"><strong t-esc="formatLang(tot['tot_pln'], dp='Account', currency_obj = res_company.currency_id)"/></td> |
|||
<td class="text-right"><strong t-esc="formatLang(tot['tot_prac'], dp='Account', currency_obj=res_company.currency_id)"/></td> |
|||
<td class="text-right"><strong t-esc="formatLang(tot['tot_perc'], digits=2)"/> %</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
|
|||
<report |
|||
id="action_report_budget" |
|||
model="account.budget.post" |
|||
string="Budget" |
|||
report_type="qweb-pdf" |
|||
name="account_budget_report.report_budget" |
|||
file="account_budget_report.report_budget" |
|||
menu="False" |
|||
/> |
|||
</odoo> |
@ -0,0 +1,177 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Jesni Banu(<https://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
import time |
|||
from odoo.osv import osv |
|||
from odoo.report import report_sxw |
|||
from odoo.http import request |
|||
|
|||
|
|||
class AnalyticAccountBudgetReport(report_sxw.rml_parse): |
|||
def __init__(self, cr, uid, name, context): |
|||
super(AnalyticAccountBudgetReport, self).__init__(cr, uid, name, context=context) |
|||
self.localcontext.update({ |
|||
'funct': self.funct, |
|||
'funct_total': self.funct_total, |
|||
'time': time, |
|||
}) |
|||
self.context = context |
|||
|
|||
def funct(self, object, form, ids=None, done=None, level=1): |
|||
if ids is None: |
|||
ids = {} |
|||
if not ids: |
|||
ids = self.ids |
|||
if not done: |
|||
done = {} |
|||
|
|||
global tot |
|||
tot = { |
|||
'theo': 0.00, |
|||
'pln': 0.00, |
|||
'prac': 0.00, |
|||
'perc': 0.00 |
|||
} |
|||
result = [] |
|||
accounts = request.env['account.analytic.account'].browse(object.id) |
|||
c_b_lines_obj = request.env['crossovered.budget.lines'] |
|||
obj_c_budget = request.env['crossovered.budget'] |
|||
|
|||
for account_id in accounts: |
|||
res = {} |
|||
b_line_ids = [] |
|||
for line in account_id.crossovered_budget_line: |
|||
b_line_ids.append(line.id) |
|||
if not b_line_ids: |
|||
return [] |
|||
d_from = form['date_from'] |
|||
d_to = form['date_to'] |
|||
self.cr.execute('SELECT DISTINCT(crossovered_budget_id) FROM ' |
|||
'crossovered_budget_lines WHERE id =ANY(%s)', (b_line_ids,)) |
|||
budget_ids = self.cr.fetchall() |
|||
|
|||
context = {'wizard_date_from': d_from, 'wizard_date_to': d_to} |
|||
for i in range(0, len(budget_ids)): |
|||
budget_name = obj_c_budget.browse([budget_ids[i][0]]) |
|||
res = { |
|||
'b_id': '-1', |
|||
'a_id': '-1', |
|||
'name': budget_name[0].name, |
|||
'status': 1, |
|||
'theo': 0.00, |
|||
'pln': 0.00, |
|||
'prac': 0.00, |
|||
'perc': 0.00 |
|||
} |
|||
result.append(res) |
|||
|
|||
line_ids = c_b_lines_obj.search([('id', 'in', b_line_ids), |
|||
('crossovered_budget_id', '=', budget_ids[i][0])]) |
|||
line_id = line_ids |
|||
tot_theo = tot_pln = tot_prac = tot_perc = 0 |
|||
|
|||
done_budget = [] |
|||
for line in line_id: |
|||
if line.id in b_line_ids: |
|||
theo = pract = 0.00 |
|||
theo = line.theoritical_amount |
|||
pract = line.practical_amount |
|||
if line.general_budget_id.id in done_budget: |
|||
for record in result: |
|||
if record['b_id'] == line.general_budget_id.id and \ |
|||
record['a_id'] == line.analytic_account_id.id: |
|||
record['theo'] += theo |
|||
record['pln'] += line.planned_amount |
|||
record['prac'] += pract |
|||
record['perc'] += line.percentage |
|||
tot_theo += theo |
|||
tot_pln += line.planned_amount |
|||
tot_prac += pract |
|||
tot_perc += line.percentage |
|||
else: |
|||
res1 = { |
|||
'b_id': line.general_budget_id.id, |
|||
'a_id': line.analytic_account_id.id, |
|||
'name': line.general_budget_id.name, |
|||
'status': 2, |
|||
'theo': theo, |
|||
'pln': line.planned_amount, |
|||
'prac': pract, |
|||
'perc': line.percentage |
|||
} |
|||
tot_theo += theo |
|||
tot_pln += line.planned_amount |
|||
tot_prac += pract |
|||
tot_perc += line.percentage |
|||
result.append(res1) |
|||
done_budget.append(line.general_budget_id.id) |
|||
else: |
|||
if line.general_budget_id.id in done_budget: |
|||
continue |
|||
else: |
|||
res1 = { |
|||
'b_id': line.general_budget_id.id, |
|||
'a_id': line.analytic_account_id.id, |
|||
'name': line.general_budget_id.name, |
|||
'status': 2, |
|||
'theo': 0.00, |
|||
'pln': 0.00, |
|||
'prac': 0.00, |
|||
'perc': 0.00 |
|||
} |
|||
result.append(res1) |
|||
done_budget.append(line.general_budget_id.id) |
|||
if tot_theo == 0.00: |
|||
tot_perc = 0.00 |
|||
else: |
|||
tot_perc = float(tot_prac / tot_theo) * 100 |
|||
|
|||
result[-(len(done_budget) + 1)]['theo'] = tot_theo |
|||
tot['theo'] += tot_theo |
|||
result[-(len(done_budget) + 1)]['pln'] = tot_pln |
|||
tot['pln'] += tot_pln |
|||
result[-(len(done_budget) + 1)]['prac'] = tot_prac |
|||
tot['prac'] += tot_prac |
|||
result[-(len(done_budget) + 1)]['perc'] = tot_perc |
|||
if tot['theo'] == 0.00: |
|||
tot['perc'] = 0.00 |
|||
else: |
|||
tot['perc'] = float(tot['prac'] / tot['theo']) * 100 |
|||
return result |
|||
|
|||
def funct_total(self, form): |
|||
result = [] |
|||
res = { |
|||
'tot_theo': tot['theo'], |
|||
'tot_pln': tot['pln'], |
|||
'tot_prac': tot['prac'], |
|||
'tot_perc': tot['perc'] |
|||
} |
|||
result.append(res) |
|||
return result |
|||
|
|||
|
|||
class ReportAnalyticAccountBudget(osv.AbstractModel): |
|||
_name = 'report.account_budget_report.report_analytic_account_budget' |
|||
_inherit = 'report.abstract_report' |
|||
_template = 'account_budget_report.report_analytic_account_budget' |
|||
_wrapped_report_class = AnalyticAccountBudgetReport |
@ -0,0 +1,198 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Jesni Banu(<https://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
import time |
|||
from odoo.osv import osv |
|||
from odoo.report import report_sxw |
|||
from odoo.http import request |
|||
|
|||
tot = {} |
|||
|
|||
|
|||
class BudgetReport(report_sxw.rml_parse): |
|||
def __init__(self, cr, uid, name, context): |
|||
super(BudgetReport, self).__init__(cr, uid, name, context=context) |
|||
self.localcontext.update({ |
|||
'funct': self.funct, |
|||
'funct_total': self.funct_total, |
|||
'time': time, |
|||
}) |
|||
self.context = context |
|||
|
|||
def funct(self, object, form, ids=None, done=None, level=1): |
|||
if ids is None: |
|||
ids = {} |
|||
if not ids: |
|||
ids = self.ids |
|||
if not done: |
|||
done = {} |
|||
global tot |
|||
tot = { |
|||
'theo': 0.00, |
|||
'pln': 0.00, |
|||
'prac': 0.00, |
|||
'perc': 0.00 |
|||
} |
|||
result = [] |
|||
|
|||
budgets = request.env['account.budget.post'].browse(object.id) |
|||
c_b_lines_obj = request.env['crossovered.budget.lines'] |
|||
acc_analytic_obj = request.env['account.analytic.account'] |
|||
for budget_id in budgets: |
|||
res = {} |
|||
budget_ids = [] |
|||
d_from = form['date_from'] |
|||
d_to = form['date_to'] |
|||
|
|||
for line in budget_id.crossovered_budget_line: |
|||
budget_ids.append(line.id) |
|||
|
|||
if not budget_ids: |
|||
return [] |
|||
self.cr.execute('SELECT DISTINCT(analytic_account_id) FROM ' |
|||
'crossovered_budget_lines WHERE id = ANY(%s)', (budget_ids,)) |
|||
an_ids = self.cr.fetchall() |
|||
context = {'wizard_date_from': d_from, 'wizard_date_to': d_to} |
|||
for i in range(0, len(an_ids)): |
|||
if not an_ids[i][0]: |
|||
continue |
|||
analytic_name = acc_analytic_obj.browse(an_ids[i][0]) |
|||
res= { |
|||
'b_id': '-1', |
|||
'a_id': '-1', |
|||
'name': analytic_name[0].name, |
|||
'status': 1, |
|||
'theo': 0.00, |
|||
'pln': 0.00, |
|||
'prac': 0.00, |
|||
'perc': 0.00 |
|||
} |
|||
result.append(res) |
|||
line_ids = c_b_lines_obj.search([('id', 'in', budget_ids), ('analytic_account_id', '=', an_ids[i][0])]) |
|||
line_id = line_ids |
|||
tot_theo = tot_pln = tot_prac = tot_perc = 0.00 |
|||
|
|||
done_budget = [] |
|||
for line in line_id: |
|||
if line.id in budget_ids: |
|||
theo = pract = 0.00 |
|||
theo = line.theoritical_amount |
|||
pract = line.practical_amount |
|||
if line.general_budget_id.id in done_budget: |
|||
for record in result: |
|||
if record['b_id'] == line.general_budget_id.id and \ |
|||
record['a_id'] == line.analytic_account_id.id: |
|||
record['theo'] += theo |
|||
record['pln'] += line.planned_amount |
|||
record['prac'] += pract |
|||
if record['theo'] <> 0.00: |
|||
perc = (record['prac'] / record['theo']) * 100 |
|||
else: |
|||
perc = 0.00 |
|||
record['perc'] = perc |
|||
tot_theo += theo |
|||
tot_pln += line.planned_amount |
|||
tot_prac += pract |
|||
tot_perc += perc |
|||
else: |
|||
if theo <> 0.00: |
|||
perc = (pract / theo) * 100 |
|||
else: |
|||
perc = 0.00 |
|||
res1 = { |
|||
'a_id': line.analytic_account_id.id, |
|||
'b_id': line.general_budget_id.id, |
|||
'name': line.general_budget_id.name, |
|||
'status': 2, |
|||
'theo': theo, |
|||
'pln': line.planned_amount, |
|||
'prac': pract, |
|||
'perc': perc, |
|||
} |
|||
tot_theo += theo |
|||
tot_pln += line.planned_amount |
|||
tot_prac += pract |
|||
tot_perc += perc |
|||
if form['report'] == 'analytic-full': |
|||
result.append(res1) |
|||
done_budget.append(line.general_budget_id.id) |
|||
else: |
|||
|
|||
if line.general_budget_id.id in done_budget: |
|||
continue |
|||
else: |
|||
res1 = { |
|||
'a_id': line.analytic_account_id.id, |
|||
'b_id': line.general_budget_id.id, |
|||
'name': line.general_budget_id.name, |
|||
'status': 2, |
|||
'theo': 0.00, |
|||
'pln': 0.00, |
|||
'prac': 0.00, |
|||
'perc': 0.00 |
|||
} |
|||
if form['report'] == 'analytic-full': |
|||
result.append(res1) |
|||
done_budget.append(line.general_budget_id.id) |
|||
if tot_theo == 0.00: |
|||
tot_perc = 0.00 |
|||
else: |
|||
tot_perc = float(tot_prac / tot_theo) * 100 |
|||
if form['report'] == 'analytic-full': |
|||
result[-(len(done_budget) + 1)]['theo'] = tot_theo |
|||
tot['theo'] += tot_theo |
|||
result[-(len(done_budget) + 1)]['pln'] = tot_pln |
|||
tot['pln'] += tot_pln |
|||
result[-(len(done_budget) + 1)]['prac'] = tot_prac |
|||
tot['prac'] += tot_prac |
|||
result[-(len(done_budget) + 1)]['perc'] = tot_perc |
|||
else: |
|||
result[-1]['theo'] = tot_theo |
|||
tot['theo'] += tot_theo |
|||
result[-1]['pln'] = tot_pln |
|||
tot['pln'] += tot_pln |
|||
result[-1]['prac'] = tot_prac |
|||
tot['prac'] += tot_prac |
|||
result[-1]['perc'] = tot_perc |
|||
if tot['theo'] == 0.00: |
|||
tot['perc'] = 0.00 |
|||
else: |
|||
tot['perc'] = float(tot['prac'] / tot['theo']) * 100 |
|||
return result |
|||
|
|||
def funct_total(self, form): |
|||
result = [] |
|||
res = { |
|||
'tot_theo': tot['theo'], |
|||
'tot_pln': tot['pln'], |
|||
'tot_prac': tot['prac'], |
|||
'tot_perc': tot['perc'] |
|||
} |
|||
result.append(res) |
|||
return result |
|||
|
|||
|
|||
class ReportBudget(osv.AbstractModel): |
|||
_name = 'report.account_budget_report.report_budget' |
|||
_inherit = 'report.abstract_report' |
|||
_template = 'account_budget_report.report_budget' |
|||
_wrapped_report_class = BudgetReport |
@ -0,0 +1,201 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Jesni Banu(<https://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
import time |
|||
from odoo.osv import osv |
|||
from odoo.report import report_sxw |
|||
from odoo.http import request |
|||
|
|||
|
|||
class BudgetReport(report_sxw.rml_parse): |
|||
def __init__(self, cr, uid, name, context): |
|||
super(BudgetReport, self).__init__(cr, uid, name, context=context) |
|||
self.localcontext.update({ |
|||
'funct': self.funct, |
|||
'funct_total': self.funct_total, |
|||
'time': time, |
|||
}) |
|||
self.context = context |
|||
|
|||
def funct(self, object, form, ids=None, done=None, level=1): |
|||
if ids is None: |
|||
ids = {} |
|||
if not ids: |
|||
ids = self.ids |
|||
if not done: |
|||
done = {} |
|||
global tot |
|||
tot = { |
|||
'theo': 0.00, |
|||
'pln': 0.00, |
|||
'prac': 0.00, |
|||
'perc': 0.00 |
|||
} |
|||
result = [] |
|||
|
|||
budgets = request.env['crossovered.budget'].browse(object.id) |
|||
c_b_lines_obj = request.env['crossovered.budget.lines'] |
|||
acc_analytic_obj = request.env['account.analytic.account'] |
|||
for budget_id in budgets: |
|||
res = {} |
|||
budget_lines = [] |
|||
budget_ids = [] |
|||
d_from = form['date_from'] |
|||
d_to = form['date_to'] |
|||
|
|||
for line in budget_id.crossovered_budget_line: |
|||
budget_ids.append(line.id) |
|||
|
|||
if not budget_ids: |
|||
return [] |
|||
|
|||
self.cr.execute('SELECT DISTINCT(analytic_account_id) FROM crossovered_budget_lines ' |
|||
'WHERE id = ANY(%s)', (budget_ids,)) |
|||
an_ids = self.cr.fetchall() |
|||
|
|||
context = {'wizard_date_from': d_from, 'wizard_date_to': d_to} |
|||
for i in range(0, len(an_ids)): |
|||
if not an_ids[i][0]: |
|||
continue |
|||
analytic_name = acc_analytic_obj.browse([an_ids[i][0]]) |
|||
res = { |
|||
'b_id': '-1', |
|||
'a_id': '-1', |
|||
'name': analytic_name[0].name, |
|||
'status': 1, |
|||
'theo': 0.00, |
|||
'pln': 0.00, |
|||
'prac': 0.00, |
|||
'perc': 0.00 |
|||
} |
|||
result.append(res) |
|||
|
|||
line_ids = c_b_lines_obj.search([('id', 'in', budget_ids), ('analytic_account_id', '=', an_ids[i][0]), |
|||
('date_to', '>=', d_from), ('date_from', '<=', d_to)]) |
|||
line_id = line_ids |
|||
tot_theo = tot_pln = tot_prac = tot_perc = 0.00 |
|||
|
|||
done_budget = [] |
|||
for line in line_id: |
|||
if line.id in budget_ids: |
|||
theo = pract = 0.00 |
|||
theo = line.theoritical_amount |
|||
pract = c_b_lines_obj.practical_amount |
|||
if line.general_budget_id.id in done_budget: |
|||
for record in result: |
|||
if record['b_id'] == line.general_budget_id.id and \ |
|||
record['a_id'] == line.analytic_account_id.id: |
|||
record['theo'] += theo |
|||
record['pln'] += line.planned_amount |
|||
record['prac'] += pract |
|||
if record['theo'] <> 0.00: |
|||
perc = (record['prac'] / record['theo']) * 100 |
|||
else: |
|||
perc = 0.00 |
|||
record['perc'] = perc |
|||
tot_theo += theo |
|||
tot_pln += line.planned_amount |
|||
tot_prac += pract |
|||
tot_perc += perc |
|||
else: |
|||
if theo <> 0.00: |
|||
perc = (pract / theo) * 100 |
|||
else: |
|||
perc = 0.00 |
|||
res1 = { |
|||
'a_id': line.analytic_account_id.id, |
|||
'b_id': line.general_budget_id.id, |
|||
'name': line.general_budget_id.name, |
|||
'status': 2, |
|||
'theo': theo, |
|||
'pln': line.planned_amount, |
|||
'prac': pract, |
|||
'perc': perc, |
|||
} |
|||
tot_theo += theo |
|||
tot_pln += line.planned_amount |
|||
tot_prac += pract |
|||
tot_perc += perc |
|||
if form['report'] == 'analytic-full': |
|||
result.append(res1) |
|||
done_budget.append(line.general_budget_id.id) |
|||
else: |
|||
|
|||
if line.general_budget_id.id in done_budget: |
|||
continue |
|||
else: |
|||
res1 = { |
|||
'a_id': line.analytic_account_id.id, |
|||
'b_id': line.general_budget_id.id, |
|||
'name': line.general_budget_id.name, |
|||
'status': 2, |
|||
'theo': 0.00, |
|||
'pln': 0.00, |
|||
'prac': 0.00, |
|||
'perc': 0.00 |
|||
} |
|||
if form['report'] == 'analytic-full': |
|||
result.append(res1) |
|||
done_budget.append(line.general_budget_id.id) |
|||
if tot_theo == 0.00: |
|||
tot_perc = 0.00 |
|||
else: |
|||
tot_perc = float(tot_prac / tot_theo) * 100 |
|||
if form['report'] == 'analytic-full': |
|||
result[-(len(done_budget) + 1)]['theo'] = tot_theo |
|||
tot['theo'] += tot_theo |
|||
result[-(len(done_budget) + 1)]['pln'] = tot_pln |
|||
tot['pln'] += tot_pln |
|||
result[-(len(done_budget) + 1)]['prac'] = tot_prac |
|||
tot['prac'] += tot_prac |
|||
result[-(len(done_budget) + 1)]['perc'] = tot_perc |
|||
else: |
|||
result[-1]['theo'] = tot_theo |
|||
tot['theo'] += tot_theo |
|||
result[-1]['pln'] = tot_pln |
|||
tot['pln'] += tot_pln |
|||
result[-1]['prac'] = tot_prac |
|||
tot['prac'] += tot_prac |
|||
result[-1]['perc'] = tot_perc |
|||
if tot['theo'] == 0.00: |
|||
tot['perc'] = 0.00 |
|||
else: |
|||
tot['perc'] = float(tot['prac'] / tot['theo']) * 100 |
|||
return result |
|||
|
|||
def funct_total(self, form): |
|||
result = [] |
|||
res = { |
|||
'tot_theo': tot['theo'], |
|||
'tot_pln': tot['pln'], |
|||
'tot_prac': tot['prac'], |
|||
'tot_perc': tot['perc'] |
|||
} |
|||
result.append(res) |
|||
return result |
|||
|
|||
|
|||
class ReportCrossOverBudget(osv.AbstractModel): |
|||
_name = 'report.account_budget_report.report_cross_over_budget' |
|||
_inherit = 'report.abstract_report' |
|||
_template = 'account_budget_report.report_cross_over_budget' |
|||
_wrapped_report_class = BudgetReport |
@ -0,0 +1,77 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<template id="report_analytic_account_budget"> |
|||
<t t-call="report.html_container"> |
|||
<t t-foreach="docs" t-as="o"> |
|||
<t t-call="report.internal_layout"> |
|||
<div class="page"> |
|||
<h2>Analytic Budget</h2> |
|||
|
|||
<div class="row mt32"> |
|||
<div class="col-xs-3"> |
|||
<strong>Analysis from</strong> |
|||
<p><span t-esc="formatLang(data['form']['date_from'], date=True)"/> to |
|||
<span t-esc="formatLang(data['form']['date_to'], date=True)"/></p> |
|||
</div> |
|||
<div class="col-xs-3"> |
|||
<strong>Analytic Account</strong> |
|||
<p t-field="o.name"/> |
|||
</div> |
|||
<div class="col-xs-3"> |
|||
<strong>Currency</strong> |
|||
<p t-esc="res_company.currency_id.name"/> |
|||
</div> |
|||
</div> |
|||
|
|||
<table class="table table-condensed"> |
|||
<thead> |
|||
<tr> |
|||
<th>Description</th> |
|||
<th class="text-right">Theoretical Amt</th> |
|||
<th class="text-right">Planned Amt</th> |
|||
<th class="text-right">Practical Amt</th> |
|||
<th class="text-right">Perc(%)</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<t t-foreach="funct(o, data['form'])" t-as="line"> |
|||
<tr t-if="line['status'] == 1"> |
|||
<td><strong t-esc="line['name']"/></td> |
|||
<td class="text-right"><strong t-esc="formatLang(line['theo'], dp='Account', currency_obj=res_company.currency_id)"/></td> |
|||
<td class="text-right"><strong t-esc="formatLang(line['pln'], dp='Account', currency_obj=res_company.currency_id)"/></td> |
|||
<td class="text-right"><strong t-esc="formatLang(line['prac'], dp='Account', currency_obj=res_company.currency_id)"/></td> |
|||
<td class="text-right"><strong t-esc="formatLang(line['perc'], digits=2)"/> %</td> |
|||
</tr> |
|||
<tr t-if="line['status'] != 1"> |
|||
<td><span style="color: white;" t-esc="'.....'*(line['status'] - 1)"/><span t-esc="line['name']"/></td> |
|||
<td class="text-right"><span t-esc="formatLang(line['theo'], dp='Account', currency_obj=res_company.currency_id)"/></td> |
|||
<td class="text-right"><span t-esc="formatLang(line['pln'], dp='Account', currency_obj=res_company.currency_id)"/></td> |
|||
<td class="text-right"><span t-esc="formatLang(line['prac'], dp='Account', currency_obj=res_company.currency_id)"/></td> |
|||
<td class="text-right"><span t-esc="formatLang(line['perc'],digits=2)"/> %</td> |
|||
</tr> |
|||
</t> |
|||
<tr t-foreach="funct_total(data['form'])" t-as="tot"> |
|||
<td><strong>Total:</strong></td> |
|||
<td class="text-right"><strong t-esc="formatLang(tot['tot_theo'], dp='Account', currency_obj=res_company.currency_id)"/></td> |
|||
<td class="text-right"><strong t-esc="formatLang(tot['tot_pln'], dp='Account', currency_obj=res_company.currency_id)"/></td> |
|||
<td class="text-right"><strong t-esc="formatLang(tot['tot_prac'], dp='Account', currency_obj=res_company.currency_id)"/></td> |
|||
<td class="text-right"><strong t-esc="formatLang(tot['tot_perc'], digits=2)"/> %</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
|
|||
<report |
|||
id="action_report_analytic_account_budget" |
|||
model="account.analytic.account" |
|||
string="Budgets" |
|||
report_type="qweb-pdf" |
|||
name="account_budget_report.report_analytic_account_budget" |
|||
file="account_budget_report.report_analytic_account_budget" |
|||
menu="False" |
|||
/> |
|||
</odoo> |
@ -0,0 +1,89 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<template id="report_cross_over_budget"> |
|||
<t t-call="report.html_container"> |
|||
<t t-foreach="docs" t-as="o"> |
|||
<t t-call="report.internal_layout"> |
|||
<div class="page"> |
|||
<h2>Budget</h2> |
|||
|
|||
<div class="row mt32"> |
|||
<div class="col-xs-3"> |
|||
<strong>Analysis from:</strong> |
|||
<p><span t-esc="formatLang(data['form']['date_from'], date=True)"/> to |
|||
<span t-esc="formatLang(data['form']['date_to'], date=True)"/></p> |
|||
</div> |
|||
<div class="col-xs-3"> |
|||
<strong>Budget:</strong> |
|||
<p t-esc="o.name"/> |
|||
</div> |
|||
<div class="col-xs-3"> |
|||
<strong>Currency:</strong> |
|||
<p t-esc="res_company.currency_id.name"/> |
|||
</div> |
|||
</div> |
|||
|
|||
<table class="table table-condensed"> |
|||
<thead> |
|||
<tr> |
|||
<th>Description</th> |
|||
<th class="text-right">Theoretical Amt</th> |
|||
<th class="text-right">Planned Amt</th> |
|||
<th class="text-right">Practical Amt</th> |
|||
<th class="text-center">Perc(%)</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-foreach="funct(o, data['form'])" t-as="line"> |
|||
<td> |
|||
<span style="color: white;" t-esc="'... '*(line['status'] - 1)"/> |
|||
<span t-esc="line['name']"/> |
|||
</td> |
|||
<td class="text-right"> |
|||
<span t-esc="formatLang(line['theo'], dp='Account', currency_obj=res_company.currency_id)"/> |
|||
</td> |
|||
<td class="text-right"> |
|||
<span t-esc="formatLang(line['pln'], dp='Account', currency_obj=res_company.currency_id)"/> |
|||
</td> |
|||
<td class="text-right"> |
|||
<span t-esc="formatLang(line['prac'], dp='Account', currency_obj=res_company.currency_id)"/> |
|||
</td> |
|||
<td class="text-center"> |
|||
<span t-esc="formatLang(line['perc'],digits=2)"/> % |
|||
</td> |
|||
</tr> |
|||
<tr t-foreach="funct_total(data['form'])" t-as="tot"> |
|||
<td> |
|||
<strong>Total:</strong> |
|||
</td> |
|||
<td class="text-right"> |
|||
<strong t-esc="formatLang(tot['tot_theo'], dp='Account', currency_obj=res_company.currency_id)"/> |
|||
</td> |
|||
<td class="text-right"> |
|||
<strong t-esc="formatLang(tot['tot_pln'], dp='Account', currency_obj=res_company.currency_id)"/> |
|||
</td> |
|||
<td class="text-right"> |
|||
<strong t-esc="formatLang(tot['tot_prac'], dp='Account', currency_obj=res_company.currency_id)"/> |
|||
</td> |
|||
<td class="text-center"> |
|||
<strong t-esc="formatLang(tot['tot_perc'], digits=2)"/> % |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
</div> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
|
|||
<report |
|||
id="action_report_cross_over_budget" |
|||
model="crossovered.budget" |
|||
string="Budgets" |
|||
report_type="qweb-pdf" |
|||
name="account_budget_report.report_cross_over_budget" |
|||
file="account_budget_report.report_cross_over_budget" |
|||
menu="False" |
|||
/> |
|||
</odoo> |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 132 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 36 KiB |
@ -0,0 +1,145 @@ |
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h2 class="oe_slogan">Advanced Account Budget Report</h2> |
|||
<h3 class="oe_slogan">Helps You To Analyse Budget Summary</h3> |
|||
<h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a> </h4> |
|||
</div> |
|||
<div class="oe_row oe_spaced" style="padding-left:65px;"> |
|||
<h4>Features:</h4> |
|||
<div> |
|||
<span style="color:green;"> ☑ </span> Option to print budget summary<br/> |
|||
<span style="color:green;"> ☑ </span> Option to print budgets<br/> |
|||
<span style="color:green;"> ☑ </span> Option to print budgets from analytic accounts<br/> |
|||
<span style="color:green;"> ☑ </span> Option to print budgets from budgetary positions<br/> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_picture"> |
|||
<h3 class="oe_slogan">Overview</h3> |
|||
<p class="oe_mt32" style="text-align: center;"> |
|||
In odoo we can manage different budgets for every accounts. But currently there is no any option to take |
|||
budget report. So here we are providing budget analysis through different pdf reports. So we can take |
|||
quick budget analysis. |
|||
</p> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div style="text-align: center"> |
|||
<p> |
|||
<h4>Budget Summary</h4> |
|||
<p> |
|||
</div> |
|||
<div style="text-align: center"> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img style="border:10px solid white;height: 400px;" src="budget_adviser.png"> |
|||
</div> |
|||
<span>Go to Account -> Adviser -> Budgets. Then select one or more budgets. Then click on 'Print' |
|||
menu and choose 'Print Summary'.</span> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img style="border:10px solid white;" src="wizard.png"> |
|||
</div> |
|||
<span>You can choose start date and end date then click on 'Print' button.</span> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img style="border:10px solid white;" src="summary_report.png"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div style="text-align: center"> |
|||
<p> |
|||
<h4>Budgets</h4> |
|||
<p> |
|||
</div> |
|||
<div style="text-align: center"> |
|||
<span>Go to Account -> Adviser -> Budgets. Then select one or more budgets. Then click on 'Print' |
|||
menu and choose 'Print Budgets'.</span> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img style="border:10px solid white;" src="wizard1.png"> |
|||
</div> |
|||
<span>You can choose start date and end date then click on 'Print' button.</span> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img style="border:10px solid white;height: 400px;" src="report2.png"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div style="text-align: center"> |
|||
<p> |
|||
<h4>Analytic Accounts</h4> |
|||
<p> |
|||
</div> |
|||
<div style="text-align: center"> |
|||
<span>Go to Account -> Adviser -> Analytic Accounts. Then select one analytic accounts. Then click on 'Print' |
|||
menu and choose 'Print Budgets'.</span> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img style="border:10px solid white;height: 400px;" src="analytic_budget.png"> |
|||
</div> |
|||
<span>You can choose start date and end date then click on 'Print' button.</span> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img style="border:10px solid white;height: 400px;" src="analytic_budget_report.png"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div style="text-align: center"> |
|||
<p> |
|||
<h4>Budgetary Positions</h4> |
|||
<p> |
|||
</div> |
|||
<div style="text-align: center"> |
|||
<span>Go to Account -> Configuration -> Management -> Budgetary Positions. Then select one budgetary position. |
|||
Then click on 'Print' menu and choose 'Budgets'.</span> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img style="border:10px solid white;height: 400px;" src="budgetry_position.png"> |
|||
</div> |
|||
<span>You can choose start date and end date then click on 'Print' button.</span> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img style="border:10px solid white;height: 400px;" src="budgetry_position_report.png"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2> |
|||
<div class="oe_slogan" style="margin-top:10px !important;"> |
|||
<div> |
|||
<a class="btn btn-primary btn-lg mt8" |
|||
style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com"><i |
|||
class="fa fa-envelope"></i> Email </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="https://www.cybrosys.com/contact/"><i |
|||
class="fa fa-phone"></i> Contact Us </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="https://www.cybrosys.com/odoo-customization-and-installation/"><i |
|||
class="fa fa-check-square"></i> Request Customization </a> |
|||
</div> |
|||
<br> |
|||
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block"> |
|||
<div> |
|||
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td> |
|||
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td> |
|||
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
|
|||
|
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 15 KiB |
@ -0,0 +1,38 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<record id="account_budget_analytic_view" model="ir.ui.view"> |
|||
<field name="name">account.budget.analytic.form</field> |
|||
<field name="model">account.budget.analytic</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Select Dates Period"> |
|||
<group string="This wizard is used to print budget" col="4"> |
|||
<field name="date_from"/> |
|||
<field name="date_to"/> |
|||
</group> |
|||
<footer> |
|||
<button name="check_report" string="Print" type="object" default_focus="1" class="btn-primary"/> |
|||
<button string="Cancel" class="btn-default" special="cancel"/> |
|||
</footer> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_account_budget_analytic" model="ir.actions.act_window"> |
|||
<field name="name">Print Budgets</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">account.budget.analytic</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">form</field> |
|||
<field name="view_id" ref="account_budget_analytic_view"/> |
|||
<field name="target">new</field> |
|||
</record> |
|||
|
|||
<record model="ir.values" id="account_budget_analytic_values"> |
|||
<field name="model_id" ref="analytic.model_account_analytic_account" /> |
|||
<field name="name">Print Budgets</field> |
|||
<field name="key2">client_print_multi</field> |
|||
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_budget_analytic'))" /> |
|||
<field name="key">action</field> |
|||
<field name="model">account.analytic.account</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,37 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<record id="account_budget_cross_over_report_view" model="ir.ui.view"> |
|||
<field name="name">account.budget.cross.over.report.form</field> |
|||
<field name="model">account.budget.cross.over.report</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Select Dates Period"> |
|||
<group string="This wizard is used to print budget" col="4"> |
|||
<field name="date_from"/> |
|||
<field name="date_to"/> |
|||
</group> |
|||
<footer> |
|||
<button name="check_report" string="Print" type="object" default_focus="1" class="btn-primary"/> |
|||
<button string="Cancel" class="btn-default" special="cancel"/> |
|||
</footer> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_account_budget_cross_over_report" model="ir.actions.act_window"> |
|||
<field name="name">Print Budgets</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">account.budget.cross.over.report</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">form</field> |
|||
<field name="view_id" ref="account_budget_cross_over_report_view"/> |
|||
<field name="target">new</field> |
|||
</record> |
|||
<record model="ir.values" id="account_budget_cross_over_report_values"> |
|||
<field name="model_id" ref="account_budget.model_crossovered_budget" /> |
|||
<field name="name">Print Budgets</field> |
|||
<field name="key2">client_print_multi</field> |
|||
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_budget_cross_over_report'))" /> |
|||
<field name="key">action</field> |
|||
<field name="model">crossovered.budget</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,39 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<record id="account_budget_report_view" model="ir.ui.view"> |
|||
<field name="name">account.budget.report.form</field> |
|||
<field name="model">account.budget.report</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Select Dates Period"> |
|||
<group string="This wizard is used to print budget" col="4"> |
|||
<field name="date_from"/> |
|||
<field name="date_to"/> |
|||
</group> |
|||
<footer> |
|||
<button name="check_report" string="Print" type="object" default_focus="1" class="oe_highlight"/> |
|||
or |
|||
<button string="Cancel" class="oe_link" special="cancel"/> |
|||
</footer> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_account_budget_report" model="ir.actions.act_window"> |
|||
<field name="name">Budgets</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">account.budget.report</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">form</field> |
|||
<field name="view_id" ref="account_budget_report_view"/> |
|||
<field name="target">new</field> |
|||
</record> |
|||
|
|||
<record model="ir.values" id="account_budget_report_values"> |
|||
<field name="model_id" ref="account_budget.model_account_budget_post" /> |
|||
<field name="name">Budgets</field> |
|||
<field name="key2">client_print_multi</field> |
|||
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_budget_report'))" /> |
|||
<field name="key">action</field> |
|||
<field name="model">account.budget.post</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,38 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<record id="account_budget_cross_over_summary_report_view" model="ir.ui.view"> |
|||
<field name="name">account.budget.cross.over.summary.report.form</field> |
|||
<field name="model">account.budget.cross.over.summary.report</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Select Dates Period"> |
|||
<group string="This wizard is used to print summary of budgets"> |
|||
<field name="date_from"/> |
|||
<field name="date_to"/> |
|||
</group> |
|||
<footer> |
|||
<button name="check_report" string="Print" type="object" default_focus="1" class="btn-primary"/> |
|||
<button string="Cancel" class="btn-default" special="cancel"/> |
|||
</footer> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_account_budget_cross_over_summary_report" model="ir.actions.act_window"> |
|||
<field name="name">Print Summary</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">account.budget.cross.over.summary.report</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">form</field> |
|||
<field name="view_id" ref="account_budget_cross_over_summary_report_view"/> |
|||
<field name="target">new</field> |
|||
</record> |
|||
|
|||
<record model="ir.values" id="account_budget_cross_over_summary_report_values"> |
|||
<field name="model_id" ref="account_budget.model_crossovered_budget" /> |
|||
<field name="name">Print Summary</field> |
|||
<field name="key2">client_print_multi</field> |
|||
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_budget_cross_over_summary_report'))" /> |
|||
<field name="key">action</field> |
|||
<field name="model">crossovered.budget</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,20 @@ |
|||
======================== |
|||
Account Credit Limit v10 |
|||
======================== |
|||
Account credit limit is a handy plugin for Odoo Accounting module to set a Credit limit for each Account. |
|||
The module will bring new fields total Credit, Debit and Balance in ‘Accounts tree view’ and ‘Account form view’. |
|||
The module also produce a warning message while making journal entries which will exceed the credit limit. |
|||
The features can simplify the credit evaluation |
|||
process of accounts like Customers accounts, Overdraft accounts, Bank accounts etc. |
|||
|
|||
Features |
|||
======== |
|||
* Know Total Debit of an account. |
|||
* Know Total Credit of an account. |
|||
* Know Balance of the account. |
|||
* Set the Credit limit for accounts. |
|||
* Stop an account exceeding the credit limit. |
|||
|
|||
Credits |
|||
======= |
|||
Nikhil Krishnan @ cybrosys, nikhil@cybrosys.in |
@ -0,0 +1,25 @@ |
|||
# -*- coding: utf-8 -*- |
|||
|
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Nikhil krishnan(nikhil@cybrosys.in) |
|||
# 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 <https://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
|
|||
import models |
@ -0,0 +1,45 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Nikhil krishnan(<https://www.cybrosys.com>) |
|||
# 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 <https://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
|
|||
{ |
|||
'name': 'Account Credit Limit', |
|||
'version': '10.0.2.0', |
|||
'summary': """Generate Warning Message When Credit Limit of an Account is Exceed.""", |
|||
'description': """Account credit limit is a handy plugin for Odoo Accounting module to set a Credit limit |
|||
for each Account. The module will bring new fields total Credit, Debit and Balance in ‘Accounts tree view’ and |
|||
‘Account form view’. The module also produce a warning message while making journal entries which will exceed |
|||
the credit limit. The features can simplify the credit evaluation process of accounts like Customers accounts, |
|||
Overdraft accounts, Bank accounts etc.""", |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'website': 'https://www.cybrosys.com', |
|||
'category': 'Accounting', |
|||
'depends': ['account', 'account_accountant'], |
|||
'license': 'LGPL-3', |
|||
'data': ['views/account_credit_limit_view.xml'], |
|||
'demo': [], |
|||
'images': ['static/description/banner.jpg'], |
|||
'installable': True, |
|||
'auto_install': False, |
|||
} |
@ -0,0 +1 @@ |
|||
import account |
@ -0,0 +1,112 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Nikhil krishnan(<https://www.cybrosys.com>) |
|||
# 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 <https://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
|
|||
from odoo import fields, api, _, models |
|||
from odoo.exceptions import Warning |
|||
|
|||
|
|||
class AccountAccount(models.Model): |
|||
_inherit = 'account.account' |
|||
|
|||
@api.multi |
|||
def get_credit_debit_balance(self): |
|||
for obj in self: |
|||
credit = 0 |
|||
debit = 0 |
|||
account_lines = self.env['account.move.line'].search([('account_id', '=', obj.id)]) |
|||
for line in account_lines: |
|||
credit += line.credit |
|||
debit += line.debit |
|||
obj.credit = credit |
|||
obj.debit = debit |
|||
obj.balance = debit - credit |
|||
|
|||
credit = fields.Float(string='Credit', compute='get_credit_debit_balance') |
|||
debit = fields.Float(string='Debit', compute='get_credit_debit_balance') |
|||
balance = fields.Float(string='Balance', compute='get_credit_debit_balance') |
|||
account_credit_limit = fields.Float(string='Credit Limit', Help="Credit Limit for this particular Account.") |
|||
|
|||
|
|||
class AccountMove(models.Model): |
|||
_inherit = "account.move" |
|||
|
|||
@api.model |
|||
def create(self, vals): |
|||
credit = 0 |
|||
debit = 0 |
|||
if "line_ids" in vals.keys(): |
|||
for line in vals['line_ids']: |
|||
if line[2]['credit']: |
|||
account = self.env['account.account'].browse(line[2]['account_id']) |
|||
account_lines = self.env['account.move.line'].search([('account_id', '=', account.id)]) |
|||
for lines in account_lines: |
|||
credit += lines.credit |
|||
debit += lines.debit |
|||
if account.account_credit_limit: |
|||
if (credit+line[2]['credit'] - debit) > account.account_credit_limit: |
|||
raise Warning(_('Limit will Exceed .! \n Making this transaction will exceed the limit ' |
|||
'defined for " %s " account') % account.name) |
|||
result = super(AccountMove, self).create(vals) |
|||
return result |
|||
|
|||
@api.multi |
|||
def write(self, vals): |
|||
if "line_ids" in vals.keys(): |
|||
for line in vals['line_ids']: |
|||
account_lines = self.env['account.move.line'].browse(line[1]) |
|||
if line[2]: |
|||
if 'account_id' in line[2]: |
|||
if line[2]['account_id']: |
|||
account = self.env['account.account'].browse(line[2]['account_id']) |
|||
if account.account_credit_limit: |
|||
if 'debit' in line[2]: |
|||
new_debit = line[2]['debit'] |
|||
else: |
|||
new_debit = account_lines.debit |
|||
if 'credit' in line[2]: |
|||
new_credit = line[2]['credit'] |
|||
else: |
|||
new_credit = account_lines.credit |
|||
if (account.credit + new_credit - new_debit - account.debit) > account.account_credit_limit: |
|||
raise Warning( |
|||
_('Limit will Exceed .! \n Making this transaction will exceed the limit ' |
|||
'defined for " %s " account') % account.name) |
|||
else: |
|||
account = account_lines.account_id |
|||
if account.account_credit_limit: |
|||
if 'debit' in line[2]: |
|||
if line[2]['debit']: |
|||
old_debit = account_lines.debit |
|||
if (account.credit - line[2]['debit'] - account.debit + old_debit) > account.account_credit_limit: |
|||
raise Warning( |
|||
_('Limit will Exceed .! \n Making this transaction will exceed the limit ' |
|||
'defined for " %s " account') % account.name) |
|||
if 'credit' in line[2]: |
|||
if line[2]['credit']: |
|||
old_credit = account_lines.credit |
|||
if (account.credit+line[2]['credit']-account.debit-old_credit) > account.account_credit_limit: |
|||
raise Warning( |
|||
_('Limit will Exceed .! \n Making this transaction will exceed the limit ' |
|||
'defined for " %s " account') % account.name) |
|||
result = super(AccountMove, self).write(vals) |
|||
return result |
@ -0,0 +1,113 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Nikhil krishnan(<https://www.cybrosys.com>) |
|||
# 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 <https://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
|
|||
from odoo import fields, api, _, models |
|||
from odoo.exceptions import Warning |
|||
|
|||
|
|||
class AccountAccount(models.Model): |
|||
_inherit = 'account.account' |
|||
|
|||
@api.multi |
|||
def get_credit_debit_balance(self): |
|||
print "get_credit_debit_balance", self |
|||
for obj in self: |
|||
credit = 0 |
|||
debit = 0 |
|||
account_lines = self.env['account.move.line'].search([('account_id', '=', obj.id)]) |
|||
for line in account_lines: |
|||
credit += line.credit |
|||
debit += line.debit |
|||
obj.credit = credit |
|||
obj.debit = debit |
|||
obj.balance = debit - credit |
|||
|
|||
credit = fields.Float(string='Credit', compute='get_credit_debit_balance') |
|||
debit = fields.Float(string='Debit', compute='get_credit_debit_balance') |
|||
balance = fields.Float(string='Balance', compute='get_credit_debit_balance') |
|||
account_credit_limit = fields.Float(string='Credit Limit', Help="Credit Limit for this particular Account.") |
|||
|
|||
|
|||
class AccountMove(models.Model): |
|||
_inherit = "account.move" |
|||
|
|||
@api.model |
|||
def create(self, vals): |
|||
credit = 0 |
|||
debit = 0 |
|||
if "line_ids" in vals.keys(): |
|||
for line in vals['line_ids']: |
|||
if line[2]['credit']: |
|||
account = self.env['account.account'].browse(line[2]['account_id']) |
|||
account_lines = self.env['account.move.line'].search([('account_id', '=', account.id)]) |
|||
for lines in account_lines: |
|||
credit += lines.credit |
|||
debit += lines.debit |
|||
if account.account_credit_limit: |
|||
if (credit+line[2]['credit'] - debit) > account.account_credit_limit: |
|||
raise Warning(_('Limit will Exceed .! \n Making this transaction will exceed the limit ' |
|||
'defined for " %s " account') % account.name) |
|||
result = super(AccountMove, self).create(vals) |
|||
return result |
|||
|
|||
@api.multi |
|||
def write(self, vals): |
|||
if "line_ids" in vals.keys(): |
|||
for line in vals['line_ids']: |
|||
account_lines = self.env['account.move.line'].browse(line[1]) |
|||
if line[2]: |
|||
if 'account_id' in line[2]: |
|||
if line[2]['account_id']: |
|||
account = self.env['account.account'].browse(line[2]['account_id']) |
|||
if account.account_credit_limit: |
|||
if 'debit' in line[2]: |
|||
new_debit = line[2]['debit'] |
|||
else: |
|||
new_debit = account_lines.debit |
|||
if 'credit' in line[2]: |
|||
new_credit = line[2]['credit'] |
|||
else: |
|||
new_credit = account_lines.credit |
|||
if (account.credit + new_credit - new_debit - account.debit) > account.account_credit_limit: |
|||
raise Warning( |
|||
_('Limit will Exceed .! \n Making this transaction will exceed the limit ' |
|||
'defined for " %s " account') % account.name) |
|||
else: |
|||
account = account_lines.account_id |
|||
if account.account_credit_limit: |
|||
if 'debit' in line[2]: |
|||
if line[2]['debit']: |
|||
old_debit = account_lines.debit |
|||
if (account.credit - line[2]['debit'] - account.debit + old_debit) > account.account_credit_limit: |
|||
raise Warning( |
|||
_('Limit will Exceed .! \n Making this transaction will exceed the limit ' |
|||
'defined for " %s " account') % account.name) |
|||
if 'credit' in line[2]: |
|||
if line[2]['credit']: |
|||
old_credit = account_lines.credit |
|||
if (account.credit+line[2]['credit']-account.debit-old_credit) > account.account_credit_limit: |
|||
raise Warning( |
|||
_('Limit will Exceed .! \n Making this transaction will exceed the limit ' |
|||
'defined for " %s " account') % account.name) |
|||
result = super(AccountMove, self).write(vals) |
|||
return result |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 102 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 35 KiB |
@ -0,0 +1,105 @@ |
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<h2 class="oe_slogan">Account Credit Limit</h2> |
|||
<h3 class="oe_slogan">Get total credit, total debit, balance of each account.</h3> |
|||
<h3 class="oe_slogan">Set credit limits for accounts.</h3> |
|||
<h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a> </h4> |
|||
</div> |
|||
<div class="oe_row oe_spaced"> |
|||
<h4><p style="margin-left: 42px;">Major Features:</p></h4> |
|||
<ul> |
|||
<li style="list-style:none !important;"><span style="color:green;"> ★</span> Know Total Debit of an account.</li> |
|||
<li style="list-style:none !important;"><span style="color:green;"> ★</span> Know Total Credit of an account.</li> |
|||
<li style="list-style:none !important;"><span style="color:green;"> ★</span> Know Balance of the account.</li> |
|||
<li style="list-style:none !important;"><span style="color:green;"> ★</span> Set the Credit limit for accounts.</li> |
|||
<li style="list-style:none !important;"><span style="color:green;"> ★</span> Stop an account exceeding the credit limit.</li> |
|||
</ul> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_picture"> |
|||
<h3 class="oe_slogan">Overview</h3> |
|||
<p class="oe_mt32"> Account credit limit is a handy plugin for Odoo Accounting module to set a Credit limit for each Account. The module will bring new fields total Credit, Debit and Balance in ‘Accounts tree view’ and ‘Account form view’. The module also produce a warning message while making journal entries which will exceed the credit limit. |
|||
The features can simplify the credit evaluation process of accounts like Customers accounts, Overdraft accounts, Bank accounts etc.</p> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<p><h1>Account List/Tree view</h1> </p> |
|||
<p class="oe_mt32"> |
|||
<p>Install the module and open chart of Accounts.</p> |
|||
</p> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img src="Tree view account.png"> |
|||
</div> |
|||
</div> |
|||
<div class="oe_span12"> |
|||
<p class="oe_mt32"> |
|||
<p>You can see that a new tree view is created here which lists Debit, Credit, and Balance of the respective accounts.</p> |
|||
</p> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<p><h1>Account Form view</h1> </p> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img src="Cash.png"> |
|||
</div> |
|||
</div> |
|||
<div class="oe_span12"> |
|||
<p class="oe_mt32"> |
|||
<p>The fields i.e. Debit, Credit, and Balance will be displayed in individual account form also. |
|||
From here you can set the credit limit for the individual account.</p> |
|||
</p> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<p><h1>Warning</h1> </p> |
|||
<p class="oe_mt32"> |
|||
<p>The app will pop up a warning message while you make a journal entry which exceeds the credit limit.</p> |
|||
</p> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img src="Warning.png"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2> |
|||
<div class="oe_slogan" style="margin-top:10px !important;"> |
|||
<div> |
|||
<a class="btn btn-primary btn-lg mt8" |
|||
style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com"><i |
|||
class="fa fa-envelope"></i> Email </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="https://www.cybrosys.com/contact/"><i |
|||
class="fa fa-phone"></i> Contact Us </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="https://www.cybrosys.com/odoo-customization-and-installation/"><i |
|||
class="fa fa-check-square"></i> Request Customization </a> |
|||
</div> |
|||
<br> |
|||
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block"> |
|||
<div> |
|||
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td> |
|||
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td> |
|||
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td> |
|||
</div> |
|||
</div> |
|||
</section> |
@ -0,0 +1,31 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data> |
|||
<record id="view_account_credit_limit_form" model="ir.ui.view"> |
|||
<field name="name">account.account.form</field> |
|||
<field name="model">account.account</field> |
|||
<field name="inherit_id" ref="account.view_account_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//field[@name='deprecated']" position="after"> |
|||
<field name="debit"/> |
|||
<field name="credit"/> |
|||
<field name="balance"/> |
|||
<field name="account_credit_limit"/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="view_account_credit_limit_list" model="ir.ui.view"> |
|||
<field name="name">account.account.list</field> |
|||
<field name="model">account.account</field> |
|||
<field name="inherit_id" ref="account.view_account_list"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//field[@name='name']" position="after"> |
|||
<field name="debit"/> |
|||
<field name="credit"/> |
|||
<field name="balance"/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
@ -0,0 +1,3 @@ |
|||
# -*- coding: utf-8 -*- |
|||
import wizard |
|||
import models |
@ -0,0 +1,41 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Fasluca(<faslu@cybrosys.in>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
{ |
|||
'name': 'Partner Ledger with Partner Filter', |
|||
'version': '10.0.1.0', |
|||
'summary': """Partner Ledger Report with Partner Filter""", |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'website': "https://cybrosys.com/", |
|||
'category': 'Accounting', |
|||
'depends': ['account'], |
|||
'data': [ |
|||
'views/report.xml', |
|||
'wizard/account_report_general_ledger_view.xml' |
|||
], |
|||
'demo': [], |
|||
'images': ['static/description/banner.jpg'], |
|||
'license': 'LGPL-3', |
|||
'installable': True, |
|||
'application': False |
|||
} |
@ -0,0 +1,2 @@ |
|||
# -*- coding: utf-8 -*- |
|||
import account_partner_ledger |
@ -0,0 +1,70 @@ |
|||
# -*- coding: utf-8 -*- |
|||
import time |
|||
import logging |
|||
from odoo import api, models |
|||
|
|||
|
|||
_logger = logging.getLogger(__name__) |
|||
|
|||
|
|||
class ReportPartnerLedger(models.AbstractModel): |
|||
_inherit = 'report.account.report_partnerledger' |
|||
|
|||
@api.model |
|||
def render_html(self, docids, data=None): |
|||
self.model = self.env.context.get('active_model') |
|||
docs = self.env[self.model].browse(self.env.context.get('active_ids', [])).id |
|||
|
|||
data['computed'] = {} |
|||
|
|||
obj_partner = self.env['res.partner'] |
|||
query_get_data = self.env['account.move.line'].with_context(data['form'].get('used_context', {}))._query_get() |
|||
data['computed']['move_state'] = ['draft', 'posted'] |
|||
if data['form'].get('target_move', 'all') == 'posted': |
|||
data['computed']['move_state'] = ['posted'] |
|||
result_selection = data['form'].get('result_selection', 'customer') |
|||
if result_selection == 'supplier': |
|||
data['computed']['ACCOUNT_TYPE'] = ['payable'] |
|||
elif result_selection == 'customer': |
|||
data['computed']['ACCOUNT_TYPE'] = ['receivable'] |
|||
else: |
|||
data['computed']['ACCOUNT_TYPE'] = ['payable', 'receivable'] |
|||
|
|||
self.env.cr.execute(""" |
|||
SELECT a.id |
|||
FROM account_account a |
|||
WHERE a.internal_type IN %s |
|||
AND NOT a.deprecated""", (tuple(data['computed']['ACCOUNT_TYPE']),)) |
|||
data['computed']['account_ids'] = [a for (a,) in self.env.cr.fetchall()] |
|||
params = [tuple(data['computed']['move_state']), tuple(data['computed']['account_ids'])] + query_get_data[2] |
|||
reconcile_clause = "" if data['form']['reconciled'] else ' AND "account_move_line".reconciled = false ' |
|||
query = """ |
|||
SELECT DISTINCT "account_move_line".partner_id |
|||
FROM """ + query_get_data[0] + """, account_account AS account, account_move AS am |
|||
WHERE "account_move_line".partner_id IS NOT NULL |
|||
AND "account_move_line".account_id = account.id |
|||
AND am.id = "account_move_line".move_id |
|||
AND am.state IN %s |
|||
AND "account_move_line".account_id IN %s |
|||
AND NOT account.deprecated |
|||
AND """ + query_get_data[1] + reconcile_clause |
|||
self.env.cr.execute(query, tuple(params)) |
|||
#---------------------Taking only selected partners--------------------------- |
|||
if data['form']['partner_ids']: |
|||
partner_ids = data['form']['partner_ids'] |
|||
else: |
|||
partner_ids = [res['partner_id'] for res in self.env.cr.dictfetchall()] |
|||
#----------------------------------------------------------------------------- |
|||
partners = obj_partner.browse(partner_ids) |
|||
partners = sorted(partners, key=lambda x: (x.ref, x.name)) |
|||
|
|||
docargs = { |
|||
'doc_ids': partner_ids, |
|||
'doc_model': self.env['res.partner'], |
|||
'data': data, |
|||
'docs': partners, |
|||
'time': time, |
|||
'lines': self._lines, |
|||
'sum_partner': self._sum_partner, |
|||
} |
|||
return self.env['report'].render('account.report_partnerledger', docargs) |
After Width: | Height: | Size: 110 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 15 KiB |
@ -0,0 +1,62 @@ |
|||
<section class="oe_container oe_dark"> |
|||
<h2 class="oe_slogan">Partner Ledger report with Partner Filter</h2> |
|||
<h4 class="oe_slogan">Cybrosys Techno Solutions - www.cybrosys.com</h4> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h5 class="oe_slogan"><b>You can generate partner ledger report from partner form and list</b></h5> |
|||
<div class="col-md-12"> |
|||
<div class=" oe_demo oe_picture oe_screenshot"> |
|||
<img src="partner_list.png"> |
|||
<div class="oe_demo_footer oe_centeralign"style="background-color:rgba(162, 70, 137, 0.7);">Partner List View</div> |
|||
</div> |
|||
</div> |
|||
<div class="col-md-12"> |
|||
<div class="oe_row_img oe_demo oe_picture oe_screenshot"> |
|||
<img src="partner_form.png"> |
|||
<div class="oe_demo_footer oe_centeralign"style="background-color:rgba(162, 70, 137, 0.7);">Partner Form View</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h5 class="oe_slogan"><b>This will open partner ledger report wizard with the selected partner. </b></h5> |
|||
<h5 class="oe_slogan"><b>You can add or remove partner from wizard in case of fault selection </b></h5> |
|||
<div class="col-md-12"> |
|||
<div class=" oe_demo oe_picture oe_screenshot"> |
|||
<img src="report_wiz.png"> |
|||
<div class="oe_demo_footer oe_centeralign"style="background-color:rgba(162, 70, 137, 0.7);">Partner Ledger Wizard</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2> |
|||
<div class="oe_slogan" style="margin-top:10px !important;"> |
|||
<div> |
|||
<a class="btn btn-primary btn-lg mt8" |
|||
style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com"><i |
|||
class="fa fa-envelope"></i> Email </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="https://www.cybrosys.com/contact/"><i |
|||
class="fa fa-phone"></i> Contact Us </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="https://www.cybrosys.com/odoo-customization-and-installation/"><i |
|||
class="fa fa-check-square"></i> Request Customization </a> |
|||
</div> |
|||
<br> |
|||
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block"> |
|||
<div> |
|||
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td> |
|||
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td> |
|||
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
@ -0,0 +1,68 @@ |
|||
<section class="oe_container oe_dark"> |
|||
<h2 class="oe_slogan">Partner Ledger report with Partner Filter</h2> |
|||
<h4 class="oe_slogan">Cybrosys Techno Solutions - www.cybrosys.com</h4> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h5 class="oe_slogan"><b>You can generate partner ledger report from partner form and list</b></h5> |
|||
<div class="col-md-12"> |
|||
<div class=" oe_demo oe_picture oe_screenshot"> |
|||
<img src="partner_list.png"> |
|||
<div class="oe_demo_footer oe_centeralign"style="background-color:rgba(162, 70, 137, 0.7);">Partner List View</div> |
|||
</div> |
|||
</div> |
|||
<div class="col-md-12"> |
|||
<div class="oe_row_img oe_demo oe_picture oe_screenshot"> |
|||
<img src="partner_form.png"> |
|||
<div class="oe_demo_footer oe_centeralign"style="background-color:rgba(162, 70, 137, 0.7);">Partner Form View</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_container oe_dark"> |
|||
<div class="row mt32 o_animate o_animate_in_children o_animate_offset_min"> |
|||
|
|||
<div class="oe_span12"> |
|||
<h5 class="oe_slogan"><b>This will open partner ledger report wizard with the selected partner. </b></h5> |
|||
<h5 class="oe_slogan"><b>You can add or remove partner from wizard in case of fault selection </b></h5> |
|||
</div> |
|||
<div class="oe_span12" > |
|||
<div class=" oe_demo oe_picture oe_screenshot"> |
|||
<img src="report_wiz.png"> |
|||
<div class="oe_demo_footer oe_centeralign"style="background-color:rgba(162, 70, 137, 0.7);">Partner Ledger Wizard</div> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2> |
|||
<div class="oe_slogan" style="margin-top:10px !important;"> |
|||
<div> |
|||
<a class="btn btn-primary btn-lg mt8" |
|||
style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com"><i |
|||
class="fa fa-envelope"></i> Email </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="https://www.cybrosys.com/contact/"><i |
|||
class="fa fa-phone"></i> Contact Us </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="https://www.cybrosys.com/odoo-customization-and-installation/"><i |
|||
class="fa fa-check-square"></i> Request Customization </a> |
|||
</div> |
|||
<br> |
|||
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block"> |
|||
<div> |
|||
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td> |
|||
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td> |
|||
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 36 KiB |
@ -0,0 +1,25 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data> |
|||
<!-- QWeb Reports --> |
|||
<record id="action_account_partner_ledger_filter" model="ir.actions.act_window"> |
|||
<field name="name">Partner Ledger</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">account.report.partner.ledger</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">form</field> |
|||
<field name="view_id" ref="account.account_report_partner_ledger_view"/> |
|||
<field name="context">{'default_partner_ids':active_ids}</field> |
|||
<field name="target">new</field> |
|||
</record> |
|||
|
|||
<record id="action_account_partner_ledger_report_filter" model="ir.values"> |
|||
<field name="model_id" ref="account.model_res_partner" /> |
|||
<field name="name">Partner Ledger</field> |
|||
<field name="key2">client_print_multi</field> |
|||
<field name="value" eval="'ir.actions.act_window,' +str(ref('action_account_partner_ledger_filter'))" /> |
|||
<field name="key">action</field> |
|||
<field name="model">res.partner</field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
@ -0,0 +1,2 @@ |
|||
# -*- coding: utf-8 -*- |
|||
import account_report_partner_ledger |
@ -0,0 +1,15 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<record id="account_report_partner_ledger_view" model="ir.ui.view"> |
|||
<field name="name">Partner Ledger</field> |
|||
<field name="model">account.report.partner.ledger</field> |
|||
<field name="inherit_id" ref="account.account_common_report_view"/> |
|||
<field name="arch" type="xml"> |
|||
<data> |
|||
<xpath expr="//field[@name='journal_ids']" position="before"> |
|||
<field name="partner_ids" widget="many2many_tags"/> |
|||
</xpath> |
|||
</data> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,15 @@ |
|||
# -*- coding: utf-8 -*- |
|||
|
|||
from odoo import fields, models |
|||
|
|||
|
|||
class AccountPartnerLedger(models.TransientModel): |
|||
_inherit = "account.report.partner.ledger" |
|||
|
|||
partner_ids = fields.Many2many('res.partner', 'partner_ledger_partner_rel', 'id', 'partner_id', string='Partners') |
|||
|
|||
def _print_report(self, data): |
|||
data = self.pre_print_report(data) |
|||
data['form'].update({'reconciled': self.reconciled, 'amount_currency': self.amount_currency, |
|||
'partner_ids': self.partner_ids.ids}) |
|||
return self.env['report'].get_action(self, 'account.report_partnerledger', data=data) |
@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Cybrosys Technologies(<http://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
import models |
@ -0,0 +1,41 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Cybrosys Technologies(<http://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
{ |
|||
'name': 'PDC Management', |
|||
'version': '10.0.1.0', |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'website': 'http://www.cybrosys.com', |
|||
'category': 'Accounting', |
|||
'summary': 'Extension on Cheques to handle Post Dated Cheques', |
|||
'description': """ Extension on Cheques to handle Post Dated Cheques """, |
|||
'depends': ['account_check_printing'], |
|||
'data': [ |
|||
'data/account_pdc_data.xml', |
|||
'views/account_payment_view.xml', |
|||
], |
|||
'images': ['static/description/pdc_banner.jpg'], |
|||
'license': 'LGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
} |
@ -0,0 +1,19 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data noupdate="1"> |
|||
|
|||
<record id="account_payment_method_pdc_in" model="account.payment.method"> |
|||
<field name="name">PDC</field> |
|||
<field name="code">pdc</field> |
|||
<field name="payment_type">inbound</field> |
|||
</record> |
|||
<record id="account_payment_method_pdc_out" model="account.payment.method"> |
|||
<field name="name">PDC</field> |
|||
<field name="code">pdc</field> |
|||
<field name="payment_type">outbound</field> |
|||
</record> |
|||
|
|||
<!--<function model="account.journal" name="_enable_check_printing_on_bank_journals"/>--> |
|||
|
|||
</data> |
|||
</odoo> |
@ -0,0 +1,25 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Cybrosys Technologies(<http://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
|
|||
import account_journal |
|||
import account_payment |
@ -0,0 +1,49 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Cybrosys Technologies(<http://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
|
|||
from odoo import models, api, _ |
|||
|
|||
|
|||
class AccountJournal(models.Model): |
|||
_inherit = "account.journal" |
|||
|
|||
@api.one |
|||
@api.depends('outbound_payment_method_ids') |
|||
def _compute_check_printing_payment_method_selected(self): |
|||
self.check_printing_payment_method_selected = any( |
|||
pm.code in ['check_printing', 'pdc'] for pm in self.outbound_payment_method_ids) |
|||
|
|||
@api.model |
|||
def _enable_pdc_on_bank_journals(self): |
|||
""" Enables check printing payment method and add a check sequence on bank journals. |
|||
Called upon module installation via data file. |
|||
""" |
|||
pdcin = self.env.ref('account_pdc.account_payment_method_pdc_in') |
|||
pdcout = self.env.ref('account_pdc.account_payment_method_pdc_out') |
|||
bank_journals = self.search([('type', '=', 'bank')]) |
|||
for bank_journal in bank_journals: |
|||
# bank_journal._create_check_sequence() |
|||
bank_journal.write({ |
|||
'inbound_payment_method_ids': [(4, pdcin.id, None)], |
|||
'outbound_payment_method_ids': [(4, pdcout.id, None)], |
|||
}) |
@ -0,0 +1,110 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Cybrosys Technologies(<http://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
|
|||
from odoo import models, fields, api, _ |
|||
from odoo.exceptions import UserError |
|||
|
|||
|
|||
class AccountRegisterPayments(models.TransientModel): |
|||
_inherit = "account.register.payments" |
|||
|
|||
bank_reference = fields.Char(copy=False) |
|||
cheque_reference = fields.Char(copy=False) |
|||
effective_date = fields.Date('Effective Date', help='Effective date of PDC', copy=False, default=False) |
|||
|
|||
def get_payment_vals(self): |
|||
res = super(AccountRegisterPayments, self).get_payment_vals() |
|||
if self.payment_method_id == self.env.ref('account_check_printing.account_payment_method_check'): |
|||
res.update({ |
|||
'check_amount_in_words': self.check_amount_in_words, |
|||
'check_manual_sequencing': self.check_manual_sequencing, |
|||
'effective_date': self.effective_date, |
|||
}) |
|||
return res |
|||
|
|||
|
|||
class AccountPayment(models.Model): |
|||
_inherit = "account.payment" |
|||
|
|||
bank_reference = fields.Char(copy=False) |
|||
cheque_reference = fields.Char(copy=False) |
|||
effective_date = fields.Date('Effective Date', help='Effective date of PDC', copy=False, default=False) |
|||
|
|||
@api.multi |
|||
def print_checks(self): |
|||
""" Check that the recordset is valid, set the payments state to sent and call print_checks() """ |
|||
# Since this method can be called via a client_action_multi, we need to make sure the received records are what we expect |
|||
self = self.filtered(lambda r: r.payment_method_id.code in ['check_printing', 'pdc'] and r.state != 'reconciled') |
|||
|
|||
if len(self) == 0: |
|||
raise UserError(_("Payments to print as a checks must have 'Check' or 'PDC' selected as payment method and " |
|||
"not have already been reconciled")) |
|||
if any(payment.journal_id != self[0].journal_id for payment in self): |
|||
raise UserError(_("In order to print multiple checks at once, they must belong to the same bank journal.")) |
|||
|
|||
if not self[0].journal_id.check_manual_sequencing: |
|||
# The wizard asks for the number printed on the first pre-printed check |
|||
# so payments are attributed the number of the check the'll be printed on. |
|||
last_printed_check = self.search([ |
|||
('journal_id', '=', self[0].journal_id.id), |
|||
('check_number', '!=', 0)], order="check_number desc", limit=1) |
|||
next_check_number = last_printed_check and last_printed_check.check_number + 1 or 1 |
|||
return { |
|||
'name': _('Print Pre-numbered Checks'), |
|||
'type': 'ir.actions.act_window', |
|||
'res_model': 'print.prenumbered.checks', |
|||
'view_type': 'form', |
|||
'view_mode': 'form', |
|||
'target': 'new', |
|||
'context': { |
|||
'payment_ids': self.ids, |
|||
'default_next_check_number': next_check_number, |
|||
} |
|||
} |
|||
else: |
|||
self.filtered(lambda r: r.state == 'draft').post() |
|||
self.write({'state': 'sent'}) |
|||
return self.do_print_checks() |
|||
|
|||
|
|||
def _get_move_vals(self, journal=None): |
|||
""" Return dict to create the payment move |
|||
""" |
|||
journal = journal or self.journal_id |
|||
if not journal.sequence_id: |
|||
raise UserError(_('Configuration Error !'), |
|||
_('The journal %s does not have a sequence, please specify one.') % journal.name) |
|||
if not journal.sequence_id.active: |
|||
raise UserError(_('Configuration Error !'), _('The sequence of journal %s is deactivated.') % journal.name) |
|||
name = self.move_name or journal.with_context(ir_sequence_date=self.payment_date).sequence_id.next_by_id() |
|||
if self.payment_method_code =='pdc': |
|||
date = self.effective_date |
|||
else: |
|||
date = self.payment_date |
|||
return { |
|||
'name': name, |
|||
'date': date, |
|||
'ref': self.communication or '', |
|||
'company_id': self.company_id.id, |
|||
'journal_id': journal.id, |
|||
} |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 8.6 KiB |
@ -0,0 +1,92 @@ |
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<h2 class="oe_slogan">PDC Management</h2> |
|||
<h3 class="oe_slogan">...A simple way to handle Post Dated Cheques...</h3> |
|||
<h4 class="oe_slogan">Cybrosys Techno Solutions, www.cybrosys.com</h4> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<h3 class="oe_slogan">Configuration</h3> |
|||
</div> |
|||
<div class="oe_span8"> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img src="pdc_config.png"> |
|||
</div> |
|||
</div> |
|||
<div class="oe_span4"> |
|||
<p class="oe_mt32"> |
|||
<p><b>Select PDC:</b></p> |
|||
<p>As shown here, You have to select PDC to enable the PDC payment.This is only available with Journal of type 'Bank'</p> |
|||
</p> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<h3 class="oe_slogan">At The Time of Payment You Will Have</h3> |
|||
</div> |
|||
<div class="oe_span6"> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img src="pdc_payment.png"> |
|||
</div> |
|||
</div> |
|||
<div class="oe_span4"> |
|||
<p class="oe_mt32"> |
|||
<p>Payment form have two extra fields to put Bank and Cheque Detail.</p> |
|||
</p> |
|||
</div> |
|||
</div> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span4"> |
|||
<p class="oe_mt32"> |
|||
<p>When you select PDC, You have to put 'effective date' of PDC.</p> |
|||
</p> |
|||
</div> |
|||
<div class="oe_span6"> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img src="pdc_payment_eff.png"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2> |
|||
<div class="oe_slogan" style="margin-top:10px !important;"> |
|||
<div> |
|||
<a class="btn btn-primary btn-lg mt8" |
|||
style="color: #FFFFFF !important;border-radius: 0;" href="http://www.cybrosys.com"><i |
|||
class="fa fa-envelope"></i> Email </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="http://www.cybrosys.com/contact/"><i |
|||
class="fa fa-phone"></i> Contact Us </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="http://www.cybrosys.com/odoo-customization-and-installation/"><i |
|||
class="fa fa-check-square"></i> Request Customization </a> |
|||
</div> |
|||
<br> |
|||
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block"> |
|||
<div> |
|||
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td> |
|||
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td> |
|||
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
After Width: | Height: | Size: 70 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 59 KiB |
@ -0,0 +1,77 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<record id="account_check_printing.view_account_payment_form_inherited" model="ir.ui.view"> |
|||
<field name="name">account.payment.form.inherited</field> |
|||
<field name="model">account.payment</field> |
|||
<field name="inherit_id" ref="account.view_account_payment_form" /> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//button[@name='post']" position="before"> |
|||
<button name="print_checks" class="oe_highlight" attrs="{'invisible': ['|', ('payment_method_code', 'not in', ['check_printing','pdc']), ('state', '!=', 'posted')]}" string="Print Check" type="object"/> |
|||
<button name="unmark_sent" attrs="{'invisible': ['|', ('payment_method_code', 'not in', ['check_printing','pdc']), ('state', '!=', 'sent')]}" string="Unmark Sent" type="object"/> |
|||
</xpath> |
|||
<xpath expr="//div[@name='amount_div']" position="after"> |
|||
<field name="check_amount_in_words" attrs="{'invisible': [('payment_method_code', 'not in', ['check_printing','pdc'])], 'readonly': [('state', '!=', 'draft')]}" groups="base.group_no_one"/> |
|||
</xpath> |
|||
<xpath expr="//field[@name='communication']" position="after"> |
|||
<field name="check_manual_sequencing" invisible="1"/> |
|||
<field name="check_number" attrs="{'invisible': ['|', ('payment_method_code', 'not in', ['check_printing','pdc']), ('check_number', '=', 0)]}"/> |
|||
</xpath> |
|||
<xpath expr="//field[@name='payment_date']" position="after"> |
|||
<field name="effective_date" attrs="{'invisible': [('payment_method_code', '!=', 'pdc')],'required': [('payment_method_code', '=', 'pdc')]}"/> |
|||
<field name="bank_reference" attrs="{'readonly': [('state', '!=', 'draft')]}"/> |
|||
<field name="cheque_reference" attrs="{'readonly': [('state', '!=', 'draft')]}"/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="account_check_printing.view_account_payment_invoice_form_inherited" model="ir.ui.view"> |
|||
<field name="name">account.payment.invoice.form.inherited</field> |
|||
<field name="model">account.payment</field> |
|||
<field name="inherit_id" ref="account.view_account_payment_invoice_form" /> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//div[@name='amount_div']" position="after"> |
|||
<field name="check_amount_in_words" attrs="{'invisible': [('payment_method_code', 'not in', ['check_printing','pdc'])]}" groups="base.group_no_one"/> |
|||
</xpath> |
|||
<xpath expr="//field[@name='communication']" position="after"> |
|||
<field name="check_manual_sequencing" invisible="1"/> |
|||
<field name="check_number" attrs="{'invisible': ['|', ('payment_method_code', 'not in', ['check_printing','pdc']), ('check_manual_sequencing', '=', False)]}"/> |
|||
</xpath> |
|||
<xpath expr="//field[@name='payment_date']" position="after"> |
|||
<field name="effective_date" attrs="{'invisible': [('payment_method_code', '!=', 'pdc')],'required': [('payment_method_code', '=', 'pdc')]}"/> |
|||
<field name="bank_reference" attrs="{'readonly': [('state', '!=', 'draft')]}"/> |
|||
<field name="cheque_reference" attrs="{'readonly': [('state', '!=', 'draft')]}"/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="account_check_printing.view_account_payment_from_invoices_inherited" model="ir.ui.view"> |
|||
<field name="name">account.register.payments.wizard.inherited</field> |
|||
<field name="model">account.register.payments</field> |
|||
<field name="inherit_id" ref="account.view_account_payment_from_invoices" /> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//field[@name='amount']" position="after"> |
|||
<field name="check_amount_in_words" attrs="{'invisible': [('payment_method_code', 'not in', ['check_printing','pdc'])]}" groups="base.group_no_one"/> |
|||
</xpath> |
|||
<xpath expr="//field[@name='communication']" position="after"> |
|||
<field name="check_manual_sequencing" invisible="1"/> |
|||
<field name="check_number" attrs="{'invisible': ['|', ('payment_method_code', 'not in', ['check_printing','pdc']), ('check_manual_sequencing', '=', False)]}"/> |
|||
</xpath> |
|||
<xpath expr="//field[@name='payment_date']" position="after"> |
|||
<field name="effective_date" attrs="{'invisible': [('payment_method_code', '!=', 'pdc')],'required': [('payment_method_code', '=', 'pdc')]}"/> |
|||
<field name="bank_reference" attrs="{'readonly': [('state', '!=', 'draft')]}"/> |
|||
<field name="cheque_reference" attrs="{'readonly': [('state', '!=', 'draft')]}"/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="account_check_printing.view_payment_check_printing_search" model="ir.ui.view"> |
|||
<field name="name">account.payment.check.printing.search</field> |
|||
<field name="model">account.payment</field> |
|||
<field name="inherit_id" ref="account.view_account_payment_search"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//filter[@name='state_sent']" position="before"> |
|||
<filter string="Checks To Print" domain="[('payment_method_id.code', 'in', ['check_printing','pdc']), ('state','=','posted')]" name="checks_to_send"/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,24 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Cybrosys Technologies(<http://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
import wizard |
|||
import report |
@ -0,0 +1,41 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>). |
|||
# Author: Cybrosys Technologies(<http://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
{ |
|||
'name': 'PDC Payments Report', |
|||
'version': '10.0.1.0', |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'website': 'http://www.cybrosys.com', |
|||
'category': 'Accounting', |
|||
'summary': 'Report of Payments with filter for PDC type', |
|||
'description': """ Report of Payments with filter for PDC type """, |
|||
'depends': ['account_check_printing', 'account_pdc'], |
|||
'data': [ |
|||
'views/report_payment.xml', |
|||
'wizard/account_report_payment_view.xml', |
|||
], |
|||
'images': ['static/description/banner.jpg'], |
|||
'license': 'LGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
} |
@ -0,0 +1,3 @@ |
|||
# -*- coding: utf-8 -*- |
|||
import report_payment |
|||
|
@ -0,0 +1,54 @@ |
|||
# -*- coding: utf-8 -*- |
|||
|
|||
import time |
|||
from odoo import api, models |
|||
import logging |
|||
|
|||
_logger = logging.getLogger(__name__) |
|||
|
|||
|
|||
class ReportPayment(models.AbstractModel): |
|||
_name = 'report.account_pdc_payment_report.report_payment_template' |
|||
|
|||
def lines(self, payment_type, journal_ids, pdc_only, data): |
|||
domain = [] |
|||
if isinstance(journal_ids, int): |
|||
journal_ids = [journal_ids] |
|||
domain.append(('journal_id', 'in', journal_ids)) |
|||
if payment_type == 'inbound': |
|||
domain.append(('payment_type', '=', 'inbound')) |
|||
elif payment_type == 'outbound': |
|||
domain.append(('payment_type', '=', 'outbound')) |
|||
if data['form']['date_from']: |
|||
domain.append(('payment_date', '>=', data['form']['date_from'])) |
|||
if data['form']['date_to']: |
|||
domain.append(('payment_date', '<=', data['form']['date_to'])) |
|||
if data['form']['company_id']: |
|||
domain.append(('company_id', '=', data['form']['company_id'][0])) |
|||
if pdc_only: |
|||
domain.append(('payment_method_id.code', '=', 'pdc')) |
|||
if data['form']['effective_date_from']: |
|||
domain.append(('effective_date', '>=', data['form']['effective_date_from'])) |
|||
if data['form']['effective_date_to']: |
|||
domain.append(('effective_date', '<=', data['form']['effective_date_to'])) |
|||
|
|||
|
|||
return self.env['account.payment'].search(domain) |
|||
|
|||
|
|||
@api.model |
|||
def render_html(self, docids, data=None): |
|||
payment_type = data['form']['payment_type'] |
|||
pdc_only = data['form']['pdc_only'] |
|||
res = {} |
|||
for journal in data['form']['journal_ids']: |
|||
res[journal] = self.with_context(data['form'].get('used_context', {})).lines(payment_type, journal, pdc_only, data) |
|||
docargs = { |
|||
'doc_ids': data['form']['journal_ids'], |
|||
'doc_model': self.env['account.journal'], |
|||
'data': data, |
|||
'docs': self.env['account.journal'].browse(data['form']['journal_ids']), |
|||
'time': time, |
|||
'lines': res, |
|||
} |
|||
return self.env['report'].render('account_pdc_payment_report.report_payment_template', docargs) |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 10 KiB |
@ -0,0 +1,53 @@ |
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<h2 class="oe_slogan">Payments Report</h2> |
|||
<h3 class="oe_slogan">...A report of Payments with a filter for PDC...</h3> |
|||
<h4 class="oe_slogan">Cybrosys Techno Solutions, www.cybrosys.com</h4> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div class="oe_span12"> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img src="pdc_report.png"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2> |
|||
<div class="oe_slogan" style="margin-top:10px !important;"> |
|||
<div> |
|||
<a class="btn btn-primary btn-lg mt8" |
|||
style="color: #FFFFFF !important;border-radius: 0;" href="http://www.cybrosys.com"><i |
|||
class="fa fa-envelope"></i> Email </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="http://www.cybrosys.com/contact/"><i |
|||
class="fa fa-phone"></i> Contact Us </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="http://www.cybrosys.com/odoo-customization-and-installation/"><i |
|||
class="fa fa-check-square"></i> Request Customization </a> |
|||
</div> |
|||
<br> |
|||
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block"> |
|||
<div> |
|||
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td> |
|||
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td> |
|||
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|