Browse Source

Initial Commit

pull/29/head
SHEREEF PT 8 years ago
parent
commit
d5687b3a6b
  1. 20
      login_user_detail/README.rst
  2. 23
      login_user_detail/__init__.py
  3. 33
      login_user_detail/__manifest__.py
  4. 23
      login_user_detail/models/__init__.py
  5. 54
      login_user_detail/models/login_user_details.py
  6. BIN
      login_user_detail/static/description/banner.png
  7. BIN
      login_user_detail/static/description/cybro_logo.png
  8. BIN
      login_user_detail/static/description/icon.png
  9. 49
      login_user_detail/static/description/index.html
  10. BIN
      login_user_detail/static/description/login.png
  11. 42
      login_user_detail/views/login_user_views.xml
  12. 23
      partner_geo_map_location/__init__.py
  13. 40
      partner_geo_map_location/__manifest__.py
  14. 23
      partner_geo_map_location/models/__init__.py
  15. 52
      partner_geo_map_location/models/partner_map.py
  16. BIN
      partner_geo_map_location/static/description/banner.jpg
  17. BIN
      partner_geo_map_location/static/description/cybro_logo.png
  18. BIN
      partner_geo_map_location/static/description/icon.png
  19. 86
      partner_geo_map_location/static/description/index.html
  20. BIN
      partner_geo_map_location/static/description/partner_map1.png
  21. BIN
      partner_geo_map_location/static/description/partner_map2.png
  22. 17
      partner_geo_map_location/views/partner_map.xml

20
login_user_detail/README.rst

@ -0,0 +1,20 @@
User Log Details v10
====================
This module developed to record login details of user.
Installation
============
Just select it from available modules to install it, there is no need to extra installations.
Configuration
=============
Nothing to configure.
Credits
=======
Developer: Saritha @ cybrosys

23
login_user_detail/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2016-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Saritha Sahadevan(<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 . import models

33
login_user_detail/__manifest__.py

@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2016-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Saritha Sahadevan(<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': "User Log Details",
'version': '10.0.1.0.0',
'summary': """Login User Details""",
'description': """This module records login information of user""",
'author': "Cybrosys Techno Solutions ",
'website': "https://www.cybrosys.com",
'category': 'Tools',
'depends': ['base'],
'data': ['views/login_user_views.xml'],
}

23
login_user_detail/models/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2016-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Saritha Sahadevan(<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 . import login_user_details

54
login_user_detail/models/login_user_details.py

@ -0,0 +1,54 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2016-TODAY Cybrosys Technologies(<https://www.cybrosys.com>).
# Author: Saritha Sahadevan(<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/>.
#
##############################################################################
import logging
from itertools import chain
from datetime import datetime
from odoo.http import request
from odoo import models, fields, api
_logger = logging.getLogger(__name__)
USER_PRIVATE_FIELDS = ['password']
concat = chain.from_iterable
class LoginUserDetail(models.Model):
_inherit = 'res.users'
@api.model
def check_credentials(self, password):
result = super(LoginUserDetail, self).check_credentials(password)
ip_address = request.httprequest.environ['REMOTE_ADDR']
vals = {'name': self.name,
'ip_address': ip_address
}
self.env['login.detail'].sudo().create(vals)
return result
class LoginUpdate(models.Model):
_name = 'login.detail'
name = fields.Char(string="User Name")
date_time = fields.Datetime(string="Login Date And Time", default=datetime.now())
ip_address = fields.Char(string="IP Address")

BIN
login_user_detail/static/description/banner.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

BIN
login_user_detail/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
login_user_detail/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

49
login_user_detail/static/description/index.html

@ -0,0 +1,49 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">User Log Details</h2>
<h3 class="oe_slogan">Records User Log Details</h3>
<h4 class="oe_slogan">Cybrosys Technologies , www.cybrosys.com</h4>
</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 oe_centered">
User Log Details, Record login date,IP Address of login user.
</p>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Login Details</h3>
<div class="oe_span12">
<div class="oe_demo oe_picture oe_screenshot">
<img src="login.png">
</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;">
<a class="btn btn-primary btn-lg mt8"
style="color: #FFFFFF !important;" 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;"
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;"
href="http://www.cybrosys.com/odoo-customization-and-installation/"><i
class="fa fa-check-square"></i> Request Customization </a>
</div>
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block">
</section>

BIN
login_user_detail/static/description/login.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

42
login_user_detail/views/login_user_views.xml

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record model="ir.ui.view" id="login_user_detail_form_view">
<field name="name">Login User Details</field>
<field name="model">login.detail</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="name"/>
<field name="date_time"/>
<field name="ip_address"/>
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="login_user_detail_tree_view">
<field name="name">Login User Details</field>
<field name="model">login.detail</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="date_time"/>
<field name="ip_address"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="login_user_detail_action_window">
<field name="name">Login User Details</field>
<field name="res_model">login.detail</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Login Details" id="login_user_detail.menu_1_list" parent="base.menu_users"
action="login_user_detail_action_window"/>
</data>
</odoo>

23
partner_geo_map_location/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2016-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Cybrosys Technologies(<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

40
partner_geo_map_location/__manifest__.py

@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2016-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Cybrosys Technologies(<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': 'Partners Location Map',
'summary': """Partners geo location can view in the Google Map""",
'version': '10.0.1.0.0',
'author': 'Cybrosys Techno Solutions',
'website': "https://www.cybrosys.com",
'company': 'Cybrosys Techno Solutions',
"category": "Sales",
'depends': ['crm', 'web_map'],
'data': ['views/partner_map.xml',
],
'demo': [
],
'images': ['static/description/banner.jpg'],
'license': 'LGPL-3',
'installable': True,
'application': False,
}

23
partner_geo_map_location/models/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2016-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Cybrosys Technologies(<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 partner_map

52
partner_geo_map_location/models/partner_map.py

@ -0,0 +1,52 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2016-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Cybrosys Technologies(<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 json
from odoo.addons.base_geolocalize.models.res_partner import geo_find, geo_query_address
from odoo import models, fields, api
class PartnerGeoLocation(models.Model):
_inherit = 'res.partner'
google_map_partner = fields.Char(string="Map")
@api.onchange('zip', 'street', 'city', 'state_id', 'country_id')
def map_location_setter(self):
result = geo_find(geo_query_address(street=self.street,
zip=self.zip,
city=self.city,
state=self.state_id.name,
country=self.country_id.name))
if result:
if not self.google_map_partner:
maps_loc = {u'position': {u'lat': 20.593684, u'lng': 78.96288}, u'zoom': 3}
json_map = json.dumps(maps_loc)
self.google_map_partner = json_map
if self.google_map_partner:
map_loc = self.google_map_partner
maps_loc = json.loads(map_loc)
maps_loc['position']['lat'] = result[0]
maps_loc['position']['lng'] = result[1]
maps_loc['zoom'] = 3
json_map = json.dumps(maps_loc)
self.google_map_partner = json_map

BIN
partner_geo_map_location/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

BIN
partner_geo_map_location/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
partner_geo_map_location/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

86
partner_geo_map_location/static/description/index.html

@ -0,0 +1,86 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">Partners Location Map</h2>
<h3 class="oe_slogan">Partners Location Map Created According To Their Address</h3>
<h4 class="oe_slogan">Author : Cybrosys Techno Solutions , www.cybrosys.com</h4>
<div>
<h4><p>Features:</p></h4>
<ul>
<li style="list-style:none !important;"><span style="color:green;"> &#9745;</span>&nbsp;&nbsp; Automatically creates Map.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9745;</span>&nbsp;&nbsp; Every field of Address is evaluated.</li>
</ul>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Overview</h3>
<div class="oe_row oe_spaced">
<div class="oe_span12">
<p>This module is an extension of CRM module in odoo.
It is dependent to web_map module developed by CodUP.
The Map is loaded automatically according to the address we give.
Every field of address is evaluated (eg:zip, country etc).The Map is
created when you create a partner along with an address.
</p>
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Address</h3>
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img style="border:10px solid white;" class="oe_picture oe_screenshot" src="partner_map1.png">
</div>
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Map Tab</h3>
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img style="border:10px solid white;" class="oe_picture oe_screenshot" src="partner_map2.png">
</div>
</div>
<div class="oe_span12">
<p>This is the Map Tab. The Map is created according to the address you
give. </p>
</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>

BIN
partner_geo_map_location/static/description/partner_map1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
partner_geo_map_location/static/description/partner_map2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 KiB

17
partner_geo_map_location/views/partner_map.xml

@ -0,0 +1,17 @@
<?xml version="1.0"?>
<odoo>
<data>
<record id="partner_google_map_form_view" model="ir.ui.view">
<field name="name">partner_google_map_form_view.page</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//notebook" position="inside">
<page string="Map" name="partner_geo_map">
<field name="google_map_partner" widget="map" nolabel="1"/>
</page>
</xpath>
</field>
</record>
</data>
</odoo>
Loading…
Cancel
Save