[FIX] website_sale: some quick fix related to odoo/odoo@1537b475b0
iframe autoclose failed bad label for typo closes odoo/odoo#32740 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
import re
|
||||
|
||||
|
||||
def get_video_embed_url(video_url):
|
||||
def get_video_embed_code(video_url):
|
||||
''' Computes the valid iframe from given URL that can be embedded
|
||||
(or False in case of invalid URL).
|
||||
'''
|
||||
@@ -48,4 +48,4 @@ def get_video_embed_url(video_url):
|
||||
else:
|
||||
# We directly use the provided URL as it is
|
||||
embedUrl = video_url
|
||||
return '<iframe class="embed-responsive-item" src="%s" allowFullScreen="true" frameborder="0"/>' % (embedUrl)
|
||||
return '<iframe class="embed-responsive-item" src="%s" allowFullScreen="true" frameborder="0"></iframe>' % embedUrl
|
||||
|
||||
@@ -214,7 +214,7 @@ class ProductTemplate(models.Model):
|
||||
help="The product will be available in each mentioned e-commerce category. Go to"
|
||||
"Shop > Customize and enable 'E-commerce categories' to view all e-commerce categories.")
|
||||
|
||||
product_template_image_ids = fields.One2many('product.image', 'product_tmpl_id', string="Extra Product Images", copy=True)
|
||||
product_template_image_ids = fields.One2many('product.image', 'product_tmpl_id', string="Extra Product Media", copy=True)
|
||||
|
||||
@api.multi
|
||||
def _has_no_variant_attributes(self):
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
from odoo.addons.website.tools import get_video_embed_url
|
||||
from odoo.addons.website.tools import get_video_embed_code
|
||||
|
||||
|
||||
class ProductImage(models.Model):
|
||||
@@ -27,7 +27,7 @@ class ProductImage(models.Model):
|
||||
@api.depends('video_url')
|
||||
def _compute_embed_code(self):
|
||||
for image in self:
|
||||
image.embed_code = get_video_embed_url(image.video_url)
|
||||
image.embed_code = get_video_embed_code(image.video_url)
|
||||
|
||||
@api.constrains('video_url')
|
||||
def _check_valid_video_url(self):
|
||||
|
||||
@@ -102,8 +102,8 @@
|
||||
<field name="website_style_ids" widget="many2many_tags" groups="base.group_no_one"/>
|
||||
</group>
|
||||
</group>
|
||||
<group name="product_template_images" string="Extra Product Images / Videos">
|
||||
<field name="product_template_image_ids" class="o_website_sale_image_list" context="{'default_name': name}" mode="kanban" options="{'create_text':'Add an Image'}" nolabel="1"/>
|
||||
<group name="product_template_images" string="Extra Product Media">
|
||||
<field name="product_template_image_ids" class="o_website_sale_image_list" context="{'default_name': name}" mode="kanban" options="{'create_text':'Add a Media'}" nolabel="1"/>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
@@ -116,8 +116,8 @@
|
||||
<field name="inherit_id" ref="product.product_variant_easy_edit_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<sheet position="inside">
|
||||
<group name="product_variant_images" string="Extra Variant Images / Videos">
|
||||
<field name="product_variant_image_ids" class="o_website_sale_image_list" context="{'default_name': name}" mode="kanban" options="{'create_text':'Add an Image'}" nolabel="1"/>
|
||||
<group name="product_variant_images" string="Extra Variant Media">
|
||||
<field name="product_variant_image_ids" class="o_website_sale_image_list" context="{'default_name': name}" mode="kanban" options="{'create_text':'Add a Media'}" nolabel="1"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</field>
|
||||
@@ -209,7 +209,7 @@
|
||||
<!-- Unfortunately for now we can't drag and drop kanban o2m, so we have to let the user input the sequence manually. -->
|
||||
<label for="sequence" string="Sequence"/><br/>
|
||||
<field name="sequence"/><br/><br/>
|
||||
<label for="sequence" string="Video URL"/><br/>
|
||||
<label for="video_url" string="Video URL"/><br/>
|
||||
<field name="video_url"/><br/>
|
||||
</div>
|
||||
<div class="col-md-6 col-xl-7 text-center o_website_sale_image_modal_container">
|
||||
|
||||
Reference in New Issue
Block a user