-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Добавлена тема клиента, YA Market, исправлен CountDown
- Loading branch information
VbossEkat
committed
May 10, 2016
1 parent
286b15c
commit 1d8f4f4
Showing
28 changed files
with
459 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
import models | ||
#import import_product_images |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# -*- coding: utf-8 -*- | ||
{ | ||
'name': "Import Product Images From URL", | ||
'summary': """ | ||
Get product images from url""", | ||
'description': """ | ||
This module offers a way to import product images from urls. | ||
Simply import the url of the product image in the Image Url field. | ||
Then select the images and download images. This supports batch processing. | ||
""", | ||
'author': "Explore Data Systems", | ||
'website': "http://www.exploredatasystems.com", | ||
'category': 'Extra Tools', | ||
#Change the version every release for apps. | ||
'version': '0.1', | ||
#the cost of the module in EUR | ||
'price' : 20, | ||
'currency': 'EUR', | ||
# any module necessary for this one to work correctly | ||
'depends': [ | ||
'product', | ||
], | ||
# always loaded | ||
'data': [ | ||
'views/product_view.xml', | ||
'views/product_actions.xml', | ||
], | ||
# only loaded in demonstration mode | ||
'demo': [ | ||
#'demo/demo.xml', | ||
], | ||
# only loaded in test | ||
'test': [ | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# -*- coding: utf-8 -*- | ||
import product |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# | ||
############################################################################## | ||
import base64#file encode | ||
import urllib2 #file download from url | ||
import httplib | ||
|
||
from openerp.osv import fields, osv | ||
import openerp.addons.decimal_precision as dp | ||
import logging | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
class product_template(osv.osv): | ||
_inherit = "product.template" | ||
_columns = { | ||
'web':fields.char('Image url', help='Automatically sanitized HTML contents'), | ||
} | ||
def onchange_image(self,cr,uid,ids,web,context=None): | ||
link=web | ||
if link and link!='': | ||
try: | ||
photo = base64.encodestring(urllib2.urlopen(link, timeout=10).read()) | ||
val={ | ||
'image_medium':photo, | ||
} | ||
return {'value': val} | ||
except urllib2.HTTPError, e: | ||
_logger.error('HTTPError = ' + str(e.code)+' when processing this request') | ||
except urllib2.URLError, e: | ||
_logger.error('URLError = ' + str(e.reason)+' when processing this request') | ||
except httplib.HTTPException, e: | ||
_logger.error('HTTPException'+' when processing product id this request') | ||
except Exception: | ||
import traceback | ||
_logger.error('generic exception: ' + traceback.format_exc()+' when processing this request') | ||
return True | ||
|
||
def download_product_image(self,cr,uid,ids,context=None): | ||
for product in self.browse(cr, uid, ids, context=context): | ||
link = product.web | ||
if link and link!='': | ||
try: | ||
photo = base64.encodestring(urllib2.urlopen(link, timeout=10).read()) | ||
val={ | ||
'image_medium':photo, | ||
} | ||
product.write(val) | ||
except urllib2.HTTPError, e: | ||
_logger.error('HTTPError = ' + str(e.code)+' when processing product id: '+str(product.id)) | ||
continue | ||
except urllib2.URLError, e: | ||
_logger.error('URLError = ' + str(e.reason)+' when processing product id: '+str(product.id)) | ||
continue | ||
except httplib.HTTPException, e: | ||
_logger.error('HTTPException'+' when processing product id: '+str(product.id)) | ||
continue | ||
except Exception: | ||
import traceback | ||
_logger.error('generic exception: ' + traceback.format_exc()+' when processing product id: '+str(product.id)) | ||
continue | ||
return True | ||
|
||
product_template() |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<section class="oe_container"> | ||
<div class="oe_row oe_spaced"> | ||
<div class="oe_span12"> | ||
<h2 class="oe_slogan">Import Product Images From URL</h2> | ||
<h3 class="oe_slogan">download and import product images from url</h3> | ||
</div> | ||
<div class="oe_span6"> | ||
<div class="oe_demo oe_picture oe_screenshot"> | ||
<img src="screenshot1.png"> | ||
<div class="oe_demo_footer oe_centeralign">Select Images, More> Download Image</div> | ||
</div> | ||
</div> | ||
<div class="oe_span6"> | ||
<p class="oe_mt32"> | ||
Many times you will want to import products from other systems using the odoo import feature. Odoo however does | ||
not offer an out-of-the-box feature to import image urls in url. | ||
Using this module you can import the image urls of your products and then download them in batch. | ||
Simply | ||
<ol class="simple"> | ||
<li>Add 'Image URL' column in your csv/excel import file</li> | ||
<li>Import your products</li> | ||
<li>Select all products in products list view</li> | ||
<li>Click on More>Download Images</li> | ||
</ol> | ||
</p> | ||
<div class="oe_centeralign oe_websiteonly"> | ||
Feel Free to <a href="mailto:[email protected]" class="oe_button oe_big oe_tacky">Contact Us</a> for support. | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<openerp> | ||
<data> | ||
|
||
<record model="ir.ui.menu" id="menu_database_cleanup"> | ||
<field name="name">Database cleanup</field> | ||
<field name="sequence" eval="10" /> | ||
<!-- attach to Settings -> Technical --> | ||
<field name="parent_id" ref="base.menu_custom"/> | ||
</record> | ||
|
||
<record model="ir.ui.menu" id="menu_purge_modules"> | ||
<field name="name">Purge obsolete modules</field> | ||
<field name="sequence" eval="10" /> | ||
<field name="action" ref="action_purge_modules" /> | ||
<field name="parent_id" ref="menu_database_cleanup"/> | ||
</record> | ||
|
||
<record model="ir.ui.menu" id="menu_purge_models"> | ||
<field name="name">Purge obsolete models</field> | ||
<field name="sequence" eval="20" /> | ||
<field name="action" ref="action_purge_models" /> | ||
<field name="parent_id" ref="menu_database_cleanup"/> | ||
</record> | ||
|
||
<record model="ir.ui.menu" id="menu_purge_columns"> | ||
<field name="name">Purge obsolete columns</field> | ||
<field name="sequence" eval="30" /> | ||
<field name="action" ref="action_purge_columns" /> | ||
<field name="parent_id" ref="menu_database_cleanup"/> | ||
</record> | ||
|
||
<record model="ir.ui.menu" id="menu_purge_tables"> | ||
<field name="name">Purge obsolete tables</field> | ||
<field name="sequence" eval="40" /> | ||
<field name="action" ref="action_purge_tables" /> | ||
<field name="parent_id" ref="menu_database_cleanup"/> | ||
</record> | ||
|
||
<record model="ir.ui.menu" id="menu_purge_data"> | ||
<field name="name">Purge obsolete data entries</field> | ||
<field name="sequence" eval="50" /> | ||
<field name="action" ref="action_purge_data" /> | ||
<field name="parent_id" ref="menu_database_cleanup"/> | ||
</record> | ||
|
||
</data> | ||
</openerp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<openerp> | ||
<data> | ||
|
||
<record id="action_download_product_image" model="ir.actions.server"> | ||
<field name="name">Download Image</field> | ||
<field name="model_id" ref="product.model_product_template"/> | ||
<field name="state">code</field> | ||
<field name="code"> | ||
if context.get('active_model') == 'product.template' and context.get('active_ids'): | ||
self.download_product_image(cr,uid,context.get('active_ids', []), context=context) | ||
</field> | ||
</record> | ||
|
||
<record id="ir_download_product_image" model="ir.values"> | ||
<field eval="'client_action_multi'" name="key2"/> | ||
<field eval="'product.template'" name="model"/> | ||
<field name="name">Download Image</field> | ||
<field eval="'ir.actions.server,%d'%action_download_product_image" name="value"/> | ||
</record> | ||
|
||
</data> | ||
</openerp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<openerp> | ||
<data> | ||
|
||
<!-- Product view modification --> | ||
<record model="ir.ui.view" id="product_template_url_field"> | ||
<field name="name">product.template.url</field> | ||
<field name="model">product.template</field> | ||
<field name="inherit_id" ref="product.product_template_form_view" /> | ||
<field name="arch" type="xml"> | ||
<field name="list_price" position="after"> | ||
<field name="web" widget="url" on_change="onchange_image(web,context)"/> | ||
</field> | ||
</field> | ||
</record> | ||
|
||
|
||
</data> | ||
</openerp> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# OpenERP, Open Source Management Solution | ||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License 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 <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
|
||
from . import models |
Binary file not shown.
Oops, something went wrong.