Skip to content

Commit

Permalink
Merge 792d380 into 930bf86
Browse files Browse the repository at this point in the history
  • Loading branch information
jcarlosmontoya committed May 31, 2017
2 parents 930bf86 + 792d380 commit 54322f4
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 1 deletion.
3 changes: 3 additions & 0 deletions connector_prestashop_catalog_manager/__init__.py
Expand Up @@ -8,3 +8,6 @@
from . import product_combination
from . import wizard
from . import product_image
from . import models


2 changes: 2 additions & 0 deletions connector_prestashop_catalog_manager/__openerp__.py
Expand Up @@ -26,6 +26,8 @@
'wizard/sync_products_view.xml',
'wizard/active_deactive_products_view.xml',
'views/product_image_view.xml',
'views/prestashop_backend_view.xml',

],
"installable": True,
}
4 changes: 4 additions & 0 deletions connector_prestashop_catalog_manager/models/__init__.py
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import prestashop_backend
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import common
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openerp import fields, models


class PrestashopBackend(models.Model):
_inherit = 'prestashop.backend'

prestashop_image_to_url = fields.Boolean(
string="PrestaShop Image Storage Url",
help="If this field is checked, PrestaShop images are loaded by url"
"instead Database",
default=True
)
3 changes: 2 additions & 1 deletion connector_prestashop_catalog_manager/product_image.py
Expand Up @@ -115,7 +115,8 @@ def _run(self, fields=None):
self._validate_data(record)
self.prestashop_id = self._create(record)
self._after_export()
self._link_image_to_url()
if self.backend_record.prestashop_image_to_url:
self._link_image_to_url()
message = _('Record exported with ID %s on Prestashop.')
return message % self.prestashop_id

Expand Down
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_prestashop_backend_form_inherit" model="ir.ui.view">
<field name="name">prestashop.backend.form.inherit</field>
<field name="model">prestashop.backend</field>
<field name="inherit_id" ref="connector_prestashop.view_prestashop_backend_form"/>
<field name="arch" type="xml">
<field name="shipping_product_id" position="after">
<field name="prestashop_image_to_url"/>
</field>
</field>
</record>
</data>
</openerp>

0 comments on commit 54322f4

Please sign in to comment.