Browse Source

[ADD] Initial Commit

pull/79/merge
Sreejith P 7 years ago
parent
commit
743765d7f5
  1. 21
      developer_mode/README.rst
  2. 23
      developer_mode/__init__.py
  3. 42
      developer_mode/__manifest__.py
  4. 23
      developer_mode/controllers/__init__.py
  5. 62
      developer_mode/controllers/main.py
  6. 47
      developer_mode/data/cybro_developer_data.xml
  7. 12
      developer_mode/security/security_data.xml
  8. BIN
      developer_mode/static/description/apps_view1.gif
  9. BIN
      developer_mode/static/description/apps_view2.gif
  10. BIN
      developer_mode/static/description/banner.jpg
  11. BIN
      developer_mode/static/description/cybro.jpg
  12. BIN
      developer_mode/static/description/cybro_logo.png
  13. BIN
      developer_mode/static/description/dev.jpg
  14. BIN
      developer_mode/static/description/icon.png
  15. BIN
      developer_mode/static/description/im_login.jpg
  16. 127
      developer_mode/static/description/index.html
  17. BIN
      developer_mode/static/description/recent_updates.png
  18. BIN
      developer_mode/static/description/settings.png
  19. 48
      developer_mode/views/developer_mode_view.xml
  20. 16
      developer_mode/views/ir_rule_view.xml

21
developer_mode/README.rst

@ -0,0 +1,21 @@
================================
Automatic Developer Mode v11
================================
Odoo Developers, Keep smiling for the below reasons:
* Automatically Trigger Developer Mode.
* Separate Group for 'Odoo Developers'.
* Showing Running DB On Left Top.
* Upgrade Modules Easily.
* Recently Upgraded Filter.
Credits
-------
* `Niyas Raphy < niyas@cybsosys.in >`__
* `Saritha S < saritha@cybsosys.in >`__
Further information
===================
HTML Description: `<static/description/index.html>`__

23
developer_mode/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Niyas Raphy (<https://www.cybrosys.com>)
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
from . import controllers

42
developer_mode/__manifest__.py

@ -0,0 +1,42 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Niyas Raphy (<https://www.cybrosys.com>)
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
{
'name': "Automatic Developer Mode",
'summary': """Automatically Activate Developer Mode & Running DB Name on Left Top""",
'version': '11.0.1.0.0',
'author': 'Cybrosys Techno Solutions',
'website': "https://www.cybrosys.com",
'company': 'Cybrosys Techno Solutions',
'category': 'Extra Tools',
'depends': ['base', 'web', 'base_setup'],
'data': [
'security/security_data.xml',
'views/developer_mode_view.xml',
'views/ir_rule_view.xml',
'data/cybro_developer_data.xml',
],
'images': ['static/description/banner.jpg'],
'license': 'AGPL-3',
'installable': True,
'auto_install': False,
}

23
developer_mode/controllers/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Niyas Raphy (<https://www.cybrosys.com>)
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
from . import main

62
developer_mode/controllers/main.py

@ -0,0 +1,62 @@
# -*- coding: utf-8 -*-
###################################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2018-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Niyas Raphy (<https://www.cybrosys.com>)
#
# This program is free software: you can modify
# it under the terms of the GNU Affero General Public License (AGPL) as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
###################################################################################
import odoo
from odoo import http, _
from odoo.http import request
from odoo.addons.web.controllers.main import Home, ensure_db
class AutoDeveloperMode(Home):
@http.route('/web/login', type='http', auth="none")
def web_login(self, redirect=None, **kw):
""" Controller functions overrides for redirecting to developer mode if the logging user is admin or
'Odoo Developer' group member """
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
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:
odoo_technician = request.env.user.has_group('developer_mode.odoo_developer_group')
if odoo_technician or request.uid == 1:
redirect = '/web?debug'
else:
redirect = '/web'
return http.redirect_with_hash(redirect)
request.uid = old_uid
values['error'] = _("Wrong login/password")
return request.render('web.login', values)

47
developer_mode/data/cybro_developer_data.xml

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="odooveloper_model" model="ir.model.data">
<field name="res_id" search="[('model','=','res.partner'),('name','=','Cybrodeveloper')]" model="ir.model.data"/>
<field name="model">res.partner</field>
<field name="name">cybro_partner_developer_mode</field>
<field name="noupdate">True</field>
</record>
<record model="res.partner" id="cybro_partner_developer_mode">
<field name="name">Cybro Developer</field>
<field name="comment">
******************************************************
Your Odoo ERP Consultant!
******************************************************
Cybrosys provides tremendous scope of Odoo customization where all kinds of business needs can be satisfied and could further enhance later if required with ease. Talk to us!
</field>
<field name="country_id" ref="base.in"/>
<field name="supplier" eval="True"/>
<field name="customer" eval="True"/>
<field name="street">Kinfra Techno Park </field>
<field name="street2">Neospace</field>
<field name="city">Kakkancherry</field>
<field name="zip">673635</field>
<field name="is_company">1</field>
<field name="phone">+91 (0) 4943015006</field>
<field name="mobile">+91 (0) 4943015007</field>
<field name="email">info@cybrsys.com</field>
<field name="website">https://www.cybrosys.com</field>
<field name="image" type="base64" file="developer_mode/static/description/cybro.jpg"/>
</record>
</data>
</odoo>

12
developer_mode/security/security_data.xml

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="odoo_developer_group" model="res.groups">
<field name="name">Odoo Developer</field>
<field name="implied_ids" eval="[(4, ref('base.group_system')),(4, ref('base.group_no_one'))]"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>
</data>
</odoo>

BIN
developer_mode/static/description/apps_view1.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

BIN
developer_mode/static/description/apps_view2.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

BIN
developer_mode/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

BIN
developer_mode/static/description/cybro.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

BIN
developer_mode/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
developer_mode/static/description/dev.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
developer_mode/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
developer_mode/static/description/im_login.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

127
developer_mode/static/description/index.html

@ -0,0 +1,127 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Automatic Developer Mode</h2>
<h3 class="oe_slogan">Developers, Keep up your smile!</h3>
<h4 class="oe_slogan"><a href="https://www.cybrosys.com/">Author: Cybrosys Technologies</a></h4>
</div>
<div class="oe_row oe_spaced">
<h4><p style="margin-left: 41px;">Keep smiling for the below reasons:</p></h4>
<ul>
<li style="list-style:none !important;"><span style="color:green;"> &#9786;</span>&nbsp;&nbsp; Automatically Trigger Developer Mode.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9786;</span>&nbsp;&nbsp; Separate Group for 'Odoo Developers'.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9786;</span>&nbsp;&nbsp; Showing Running DB On Left Top.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9786;</span>&nbsp;&nbsp; Upgrade Modules Easily.</li>
</ul>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="dev.jpg">
</div>
</div>
<div class="oe_span6">
<p class="oe_mt32">
<p>This module makes you free from activating developer mode operations repeatedly.
When you login, It will trigger the DEVELOPER MODE automatically.</p>
</p>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">Configuration</h2>
<div class="oe_span6">
<p class="oe_mt32">
Important Notes: You have to enable 'Odoo Developer' group for respective users (Except Admin)in settings &
YOU HAVE TO RE-LOGIN AFTER THE MODULE INSTALLATION.
</p>
</div>
<div class="oe_span6">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="settings.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span6">
<p class="oe_mt32">
As shown here, Simply automate the developer mode. It helps developer in several perspective.
</p>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="im_login.jpg">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Running DB on left Top</h2>
<h3 class="oe_slogan">The developer can identify running DB easily.</h3>
</div>
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img src="apps_view1.gif">
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Simplify Your Clicks</h2>
<h3 class="oe_slogan">Easily upgrade any module without going the module form.</h3>
</div>
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img src="apps_view2.gif">
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Recent Upgrades History</h2>
<h3 class="oe_slogan">Recent upgraded filter view in Apps.</h3>
</div>
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img src="recent_updates.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/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>
<a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="https://apps.odoo.com/apps/modules/browse?author=Cybrosys%20Techno%20Solutions"><i
class="fa fa-suitcase"></i> Other Cybro Apps</a>
</div>
<br>
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block">
</div>
</section>

BIN
developer_mode/static/description/recent_updates.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

BIN
developer_mode/static/description/settings.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

48
developer_mode/views/developer_mode_view.xml

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_module_filter" model="ir.ui.view">
<field name="name">ir.module.module.list.select</field>
<field name="inherit_id" ref="base.view_module_filter"/>
<field name="model">ir.module.module</field>
<field name="arch" type="xml">
<xpath expr="//filter[@name='installed']" position="before">
<filter string="Recently updated"
domain="[('state','=','installed')]"
groups="developer_mode.odoo_developer_group"/>
</xpath>
<xpath expr="//filter[last()]" position="after">
<filter string="Latest update"
groups="developer_mode.odoo_developer_group"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="developer_mode_module_view_kanban">
<field name="name">Modules Kanban</field>
<field name="inherit_id" ref="base.module_view_kanban"/>
<field name="model">ir.module.module</field>
<field name="arch" type="xml">
<xpath expr="//div[hasclass('oe_module_action')]/span" position="replace">
</xpath>
<xpath expr="//button[@name='button_immediate_install']" position="after">
<button type="object" class="btn btn-primary pull-right" name="button_immediate_upgrade" states="installed"
groups="developer_mode.odoo_developer_group">Update</button>
</xpath>
</field>
</record>
<template id="contact" inherit_id="web.menu_secondary">
<xpath expr="//span[@class='oe_logo_edit']" position="before">
<t t-if="True" groups="developer_mode.odoo_developer_group">
<div style="height:20px;text-align:center;background-color:#800070b3;color:#ffffff;">
<t t-esc="request.session.db"/>
</div>
</t>
</xpath>
</template>
</data>
</odoo>

16
developer_mode/views/ir_rule_view.xml

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_rule_tree" model="ir.ui.view">
<field name="model">ir.rule</field>
<field name="inherit_id" ref="base.view_rule_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='global']" position="replace">
<field name="groups"/>
</xpath>
</field>
</record>
</data>
</odoo>
Loading…
Cancel
Save