summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
Diffstat (limited to 'addons')
-rw-r--r--addons/website_sale/models/product.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/addons/website_sale/models/product.py b/addons/website_sale/models/product.py
index 6112982e4bf..caecf35012f 100644
--- a/addons/website_sale/models/product.py
+++ b/addons/website_sale/models/product.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from odoo import api, fields, models, _
+from odoo import api, fields, models, tools, _
from odoo.exceptions import ValidationError, UserError
from odoo.addons.http_routing.models.ir_http import slug
from odoo.addons.website.models import ir_http
@@ -13,7 +13,10 @@ class ProductRibbon(models.Model):
_name = "product.ribbon"
_description = 'Product ribbon'
- html = fields.Char(string='Ribbon html', required=True)
+ def name_get(self):
+ return [(ribbon.id, '%s (#%d)' % (tools.html2plaintext(ribbon.html), ribbon.id)) for ribbon in self]
+
+ html = fields.Char(string='Ribbon html', required=True, translate=True)
bg_color = fields.Char(string='Ribbon background color', required=False)
text_color = fields.Char(string='Ribbon text color', required=False)
html_class = fields.Char(string='Ribbon class', required=True, default='')