diff --git a/partner_image_url/__init__.py b/partner_image_url/__init__.py index f0c1cf4f4..bfe70901e 100644 --- a/partner_image_url/__init__.py +++ b/partner_image_url/__init__.py @@ -1,23 +1,23 @@ # -*- coding: utf-8 -*- -############################################################################## +################################################################################### # # Cybrosys Technologies Pvt. Ltd. # Copyright (C) 2017-TODAY Cybrosys Technologies(). # Author: Nilmar Shereef() -# 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 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# GNU Affero General Public License 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 . +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . # -############################################################################## +################################################################################### import models + diff --git a/partner_image_url/__init__.py~ b/partner_image_url/__init__.py~ deleted file mode 100644 index f0c1cf4f4..000000000 --- a/partner_image_url/__init__.py~ +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Cybrosys Technologies Pvt. Ltd. -# Copyright (C) 2017-TODAY Cybrosys Technologies(). -# Author: Nilmar Shereef() -# you can modify it under the terms of the GNU LESSER -# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. -# -# It is forbidden to publish, distribute, sublicense, or sell copies -# of the Software or modified copies of the Software. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. -# -# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE -# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. -# If not, see . -# -############################################################################## -import models diff --git a/partner_image_url/__manifest__.py b/partner_image_url/__manifest__.py index 8c16fd36a..e650757d8 100644 --- a/partner_image_url/__manifest__.py +++ b/partner_image_url/__manifest__.py @@ -1,29 +1,28 @@ # -*- coding: utf-8 -*- -############################################################################## +################################################################################### # # Cybrosys Technologies Pvt. Ltd. # Copyright (C) 2017-TODAY Cybrosys Technologies(). # Author: Nilmar Shereef() -# 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 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# GNU Affero General Public License 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 . +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . # -############################################################################## +################################################################################### { 'name': 'Partner Image from URL', 'version': '10.0.1.0', - 'summary': """Customer/Vendor Images from Web URL""", + 'summary': """Customer/Vendor Images from Internet""", 'description': """Customer/Vendor Images from Web URL""", 'category': 'Sales', 'author': 'Cybrosys Techno Solutions', @@ -42,3 +41,4 @@ 'application': False, } + diff --git a/partner_image_url/__manifest__.py~ b/partner_image_url/__manifest__.py~ deleted file mode 100644 index e9bd1ad18..000000000 --- a/partner_image_url/__manifest__.py~ +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Cybrosys Technologies Pvt. Ltd. -# Copyright (C) 2017-TODAY Cybrosys Technologies(). -# Author: Nilmar Shereef() -# you can modify it under the terms of the GNU LESSER -# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. -# -# It is forbidden to publish, distribute, sublicense, or sell copies -# of the Software or modified copies of the Software. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. -# -# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE -# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. -# If not, see . -# -############################################################################## -{ - 'name': 'Partner Image Url', - 'version': '10.0.1.0', - 'summary': """Customer/Vendor Images from Web URL""", - 'description': """Customer/Vendor Images from Web URL""", - 'category': 'Sales', - 'author': 'Cybrosys Techno Solutions', - 'company': 'Cybrosys Techno Solutions', - 'maintainer': 'Cybrosys Techno Solutions', - 'website': "https://www.cybrosys.com", - 'depends': ['base'], - 'data': [ - 'views/partner_inherit_view.xml', - ], - 'demo': [], - 'images': ['static/description/banner.jpg'], - 'license': 'AGPL-3', - 'installable': True, - 'auto_install': False, - 'application': False, -} - diff --git a/partner_image_url/models/__init__.py b/partner_image_url/models/__init__.py index e544217de..24bc92bc7 100644 --- a/partner_image_url/models/__init__.py +++ b/partner_image_url/models/__init__.py @@ -1,24 +1,24 @@ # -*- coding: utf-8 -*- -############################################################################## +################################################################################### # # Cybrosys Technologies Pvt. Ltd. # Copyright (C) 2017-TODAY Cybrosys Technologies(). # Author: Nilmar Shereef() -# 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 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# GNU Affero General Public License 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 . +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . # -############################################################################## +################################################################################### import res_partner_inherit + diff --git a/partner_image_url/models/__init__.py~ b/partner_image_url/models/__init__.py~ deleted file mode 100644 index e544217de..000000000 --- a/partner_image_url/models/__init__.py~ +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Cybrosys Technologies Pvt. Ltd. -# Copyright (C) 2017-TODAY Cybrosys Technologies(). -# Author: Nilmar Shereef() -# you can modify it under the terms of the GNU LESSER -# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. -# -# It is forbidden to publish, distribute, sublicense, or sell copies -# of the Software or modified copies of the Software. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. -# -# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE -# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. -# If not, see . -# -############################################################################## -import res_partner_inherit - diff --git a/partner_image_url/models/res_partner_inherit.py b/partner_image_url/models/res_partner_inherit.py index f24df2e55..a61837e26 100644 --- a/partner_image_url/models/res_partner_inherit.py +++ b/partner_image_url/models/res_partner_inherit.py @@ -1,25 +1,24 @@ # -*- coding: utf-8 -*- -############################################################################## +################################################################################### # # Cybrosys Technologies Pvt. Ltd. # Copyright (C) 2017-TODAY Cybrosys Technologies(). # Author: Nilmar Shereef() -# 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 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# GNU Affero General Public License 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 . +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . # -############################################################################## +################################################################################### import base64 import urllib2 import requests @@ -49,3 +48,4 @@ class HrEmployeeDocument(models.Model): except: raise Warning("Please provide correct URL or check your image size.!") + diff --git a/partner_image_url/models/res_partner_inherit.py~ b/partner_image_url/models/res_partner_inherit.py~ deleted file mode 100644 index 878491188..000000000 --- a/partner_image_url/models/res_partner_inherit.py~ +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Cybrosys Technologies Pvt. Ltd. -# Copyright (C) 2017-TODAY Cybrosys Technologies(). -# Author: Nilmar Shereef() -# you can modify it under the terms of the GNU LESSER -# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. -# -# It is forbidden to publish, distribute, sublicense, or sell copies -# of the Software or modified copies of the Software. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. -# -# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE -# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. -# If not, see . -# -############################################################################## -import base64 -import urllib2 -import requests -from PIL import Image -from StringIO import StringIO -from odoo import models, fields, api, _ -from odoo.exceptions import Warning - - -class HrEmployeeDocument(models.Model): - _inherit = 'res.partner' - - web_url = fields.Char(string='Image URL', help='Automatically sanitized HTML contents', copy=False) - - @api.onchange('web_url') - def onchange_image(self): - link = self.web_url - try: - if link: - r = requests.get(link) - Image.open(StringIO(r.content)) - profile_image = base64.encodestring(urllib2.urlopen(link).read()) - val = { - 'image': profile_image, - } - return {'value': val} - except: - raise Warning("Please provide correct URL or check your image size.!") - diff --git a/partner_image_url/static/description/image_from_url_2.png b/partner_image_url/static/description/image_from_url_2.png deleted file mode 100644 index c4e31419b..000000000 Binary files a/partner_image_url/static/description/image_from_url_2.png and /dev/null differ diff --git a/partner_image_url/static/description/image_from_url_3.png b/partner_image_url/static/description/image_from_url_3.png index 0b157af24..04ed06c33 100644 Binary files a/partner_image_url/static/description/image_from_url_3.png and b/partner_image_url/static/description/image_from_url_3.png differ diff --git a/partner_image_url/static/description/image_url_1.png b/partner_image_url/static/description/image_url_1.png index caf0f6ccc..9e104e8a3 100644 Binary files a/partner_image_url/static/description/image_url_1.png and b/partner_image_url/static/description/image_url_1.png differ diff --git a/partner_image_url/static/description/index.html b/partner_image_url/static/description/index.html index f03879f34..8d9ff5fad 100644 --- a/partner_image_url/static/description/index.html +++ b/partner_image_url/static/description/index.html @@ -38,14 +38,6 @@ -
- Or -
-
-
- -
-
@@ -57,6 +49,7 @@

+ Copy this URL to 'Image URL' field
diff --git a/partner_image_url/static/description/partner_form.png b/partner_image_url/static/description/partner_form.png index d99c3b236..f5f32b2bd 100644 Binary files a/partner_image_url/static/description/partner_form.png and b/partner_image_url/static/description/partner_form.png differ