añadido css para el excerpt de la lista. Añadidos campos autor, editor y genero a la lista de productos antes de la descripción.
This commit is contained in:
parent
815dab2224
commit
7aa800adc4
6 changed files with 25 additions and 7 deletions
|
@ -2,7 +2,7 @@
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
color: #333;
|
color: #333;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
padding: 10px;
|
padding: 15px;
|
||||||
background-color: #f9f9f9;
|
background-color: #f9f9f9;
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<div id="product_description" class="oe_structure oe_empty mt16 custom_website_description"
|
<div id="product_description" class="oe_structure oe_empty mt16 custom_website_description"
|
||||||
data-oe-type="html" data-oe-expressioni="product.website_description"
|
data-oe-type="html" data-oe-expressioni="product.website_description"
|
||||||
>
|
>
|
||||||
<t t-esc="product.website_description"/>
|
<t t-out="product.website_description"/>
|
||||||
</div>
|
</div>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -8,4 +8,9 @@
|
||||||
"installable": True,
|
"installable": True,
|
||||||
"depends": ["website_sale"],
|
"depends": ["website_sale"],
|
||||||
"data": ["data/snippet_filter_data.xml", "views/website_sale_views.xml"],
|
"data": ["data/snippet_filter_data.xml", "views/website_sale_views.xml"],
|
||||||
|
'assets': {
|
||||||
|
'web.assets_frontend': [
|
||||||
|
'website_sale_product_description_displayed/static/src/scss/custom.scss',
|
||||||
|
],
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ from odoo import models, fields, api
|
||||||
class ProductTemplate(models.Model):
|
class ProductTemplate(models.Model):
|
||||||
_inherit = 'product.template'
|
_inherit = 'product.template'
|
||||||
|
|
||||||
website_description_limited = fields.Text(
|
website_description_limited = fields.Html(
|
||||||
compute='_compute_website_description_limited',
|
compute='_compute_website_description_limited',
|
||||||
string='Website Description Limited'
|
string='Website Description Limited'
|
||||||
)
|
)
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
.custom_website_description_excerpt {
|
||||||
|
font-size: 15px;
|
||||||
|
color: #333;
|
||||||
|
line-height: 1.5;
|
||||||
|
padding: 4px;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-radius: 12px;
|
||||||
|
}
|
|
@ -7,10 +7,14 @@
|
||||||
customize_show="True"
|
customize_show="True"
|
||||||
>
|
>
|
||||||
<xpath expr="//a[@t-field='product.name']" position="after">
|
<xpath expr="//a[@t-field='product.name']" position="after">
|
||||||
<div t-if="product.website_description_limited" class="product-website-description">
|
<div class="product-desription custom_website_description_excerpt" >
|
||||||
<t t-out="product.website_description_limited"/>
|
<b><div t-if="product.autor">Autor: <t t-out="product.autor" /></div>
|
||||||
</div>
|
<div t-if="product.editorial">Editora: <t t-out="product.editorial" /></div>
|
||||||
|
<div t-if="product.genero"><t t-out="product.genero" /></div></b>
|
||||||
|
<div t-if="product.website_description_limited" class="oe_structure oe_empty custom_website_description_excerpt" data-oe-type="html" data-oe-expressioni="product.website_description">
|
||||||
|
<p><t t-out="product.website_description_limited"/></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|
Loading…
Add table
Reference in a new issue