how can i write xml content (an external address ) in a python file in odoo.
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
- Project
- MRP
Câu hỏi này đã bị gắn cờ
1
Trả lời
4839
Lượt xem
Hi,
For accessing view from python we can use like this:
return { 'type': 'ir.actions.act_window', 'name': _('Tasks from Tickets'), 'res_model': 'project.task', 'res_id': new_task.id, 'view_mode': 'form', 'view_id': self.env.ref('project.view_task_form2').id, 'context': { 'fsm_mode': True, } }type refers to the type of the view ( in here a window action). name refers to be shown on view, res model: the model of view, res_id, the id to be viewed in the view, view_mode: form, tree, ..., view_id: id of the view..
if we want to create a new view, we can code like below
self.env["ir.ui.view"].create({ "name": "Add separate label for decimal_places", "model": "res.currency", "inherit_id": self.env.ref("base.view_currency_form").id, "arch": """ < data> < field name="decimal_places" position="attributes"> < attribute name="nolabel">1 < /field> < field name="decimal_places" position="before"> < label for="decimal_places"/> < /field> < /data> """, })Hope it helps
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 | |
---|---|---|---|---|
|
2
thg 2 24
|
3220 | ||
|
1
thg 3 18
|
6856 | ||
|
2
thg 7 24
|
14093 | ||
|
2
thg 12 23
|
12682 | ||
|
3
thg 7 22
|
23032 |