I'm migrating to odoo 16. I have a widget MediaButton.
But for some reason odoo can't mount it properly.
I see an error message in the debugger console:
Missing widget: media_button for field of type boolean
What could be the reason?
odoo.define('media-button.main', function (require) {
const AbstractField = require('web.AbstractField');
const registry = require('web.field_registry');
const STATE_SHOW_PLAY = 'play';
const STATE_SHOW_PAUSE = 'pause';
const STATE_SHOW_STOP = 'stop';
const MediaButton = AbstractField.extend({
});
registry.add('media_button', MediaButton);
});
some view contains this widget...Console error<div class="mb-4">
<field name="on_off" widget="media_button" nolabel="1" force_save="1"/>
</div>
...
Missing widget: media_button for field of type boolean
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Dự án
- MRP
Câu hỏi này đã bị gắn cờ
Hello Ne Akulov,
Please refer below example to add custom widget for ‘Odoo 16.
Find Example in comment.
I hope this will help you.
Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari
Ex:
/* @odoo-module */
const {xml, Component} = owl;
import { standardFieldProps } from "@web/views/fields/standard_field_props";
import {registry} from "@web/core/registry";
const STATE_SHOW_PLAY = 'play';
const STATE_SHOW_PAUSE = 'pause';
const STATE_SHOW_STOP = 'stop';
export class MediaButton extends Component {
setup() {
super.setup();
}
}
MediaButton.template = "your_template";
MediaButton.props = standardFieldProps;
// Add the field to the correct category
registry.category("fields").add("media_button", MediaButton);
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký| Bài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
|---|---|---|---|---|
|
|
5
thg 9 25
|
25514 | ||
|
|
3
thg 8 25
|
3886 | ||
|
|
1
thg 5 25
|
3785 | ||
|
|
1
thg 4 25
|
4626 | ||
|
|
1
thg 4 25
|
5443 |
Hi do you resolve the problem ?