Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
1657 Lượt xem

Hello,

In odoo one2many lines have 'Add a note' button click it collapse all the column and and add text i need to change type text to HTML.


Thanks

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Hi community,

above issue is resolve,

odoo.define('sale_o2m_add_note_to_html.section_and_note_backend', function (require) {
    "use strict";

    var FieldChar = require('web.basic_fields').FieldChar;
    var fieldRegistry = require('web.field_registry');
    var ListFieldText = require('web.basic_fields').ListFieldText;
    var FieldHtml = require('web_editor.field.html');

// This is a merge between a FieldText and a FieldChar.
// We want a FieldChar for section,
// and a FieldText for the rest (product and note).
    var SectionAndNoteFieldText = function (parent, name, record, options) {
        var isSection = record.data.display_type === 'line_section';
        var isNote = record.data.display_type === 'line_note';
        var Constructor = false
         if (isSection) {
            Constructor = FieldChar;
        } else if (isNote) {
            Constructor = FieldHtml;
        } else {
           Constructor = ListFieldText;
        }
        return new Constructor(parent, name, record, options);
    };

    fieldRegistry.add('section_and_note_text', SectionAndNoteFieldText);
});
  • This way complete add and working fine in odoo15.
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 25
4068
0
thg 2 23
2212
1
thg 6 22
2389
1
thg 6 22
1522
3
thg 2 25
14051