In my odoo app there is customer model. I need to create three new fields to hold the information about social media. I need three char fields (Facebook, LinkedIn Twitter), but each one should be shown with the corresponding icon. How do I do that?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Projekt
- MRP
To pytanie dostało ostrzeżenie
Hello Ernesto Ruiz,
You can do it by creating a new char field widget i.e,
py file: facebook_url = fields.Char()
xml file:
To do so, You have to write a javascript code something like as below,
var ImageCharField = FieldChar.extend({
init: function () {
this._super.apply(this, arguments);
this.image_src = this.nodeOptions.image_src;
},
_renderImage: function() {
// place position as per your need {after/before}
this.$el.prepend(` height='20'/>`);
},
_renderEdit: function () {
this._renderImage();
return this._super.apply(this, arguments);
},
_render: function () {
this._renderImage();
this._super.apply(this, arguments);
},
});
field_registry.add('imagechar', ImageCharField);
Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj się| Powiązane posty | Odpowiedzi | Widoki | Czynność | |
|---|---|---|---|---|
|
|
2
maj 25
|
17 | ||
|
Inherit from inherited view
Rozwiązane
|
|
5
cze 20
|
7877 | |
|
|
1
kwi 16
|
5908 | ||
|
|
2
mar 15
|
7422 | ||
|
|
1
maj 24
|
4113 |