У меня есть данные результата пришедших из WSDL-файла, и я хочу, чтобы поместить эти данные в TreeView моего odoo модуля:Как добавить строки в список в оду?
Это моя модульная архитектура: init.py (где я импортировать module.py) OpenERP .py (зависимости: Base) _module.py (где у меня есть основной код, и все работает отлично) templates.xml (Главное представление идет с основным кодом, без проблем)
Файл .xml :
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<menuitem name="Document_Binov" id="Doc_Bin" sequence="30" />
<menuitem name="Documents" id="menu_list_doc" parent="Doc_Bin" sequence="10" />
<!-- Form example -->
<record model="ir.ui.view" id="document_form">
<field name="name">document.form</field>
<field name="model">document_binov.document_binov</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Documents">
<sheet>
<group>
<label string="Titre"/>
<field name="titre"/>
<label string="Description"/>
<field name="description"/>
<label string="Type"/>
<field name="type"/>
</group>
</sheet>
</form>
</field>
</record>
<!--Tree view example -->
<record model="ir.ui.view" id="document_tree_view">
<field name="name">document.tree.view</field>
<field name="model">document_binov.document_binov</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Documents">
<field name="titre"/>
<field name="description"/>
<field name="type" />
</tree>
</field>
</record>
<!-- déclaration d'action -->
<record model="ir.actions.act_window" id="action_document_work">
<field name="name">Liste des documents</field>
<field name="res_model">document_binov.document_binov</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<!-- <field name="help" type="html"/> -->
<field name="document_tree_view" ref="document_form"></field>
</record>
<!--déclaration menu -->
<!-- <menuitem id="document" name="Documents" /> -->
<!-- déclaration de menu principale niveau 1-->
<!-- déclaration de menu niveai 1.1(sans action=non cliquable) -->
<menuitem id="document_menu" name="Liste des documents" parent="menu_list_doc" action="action_document_work" sequence="10"/>
</data>
</openerp>
И есть .py файл:
class document_binov(models.Model):
_name = 'document_binov.document_binov'
_description = 'visualise les documents'
titre = fields.Char(default='a')
description = fields.Char('Description')
type = fields.Char('Type')
Пожалуйста, помогите мне поставить мои данные результата в TreeView. Заранее благодарен
В чем вопрос? –
Спасибо за ваш ответ, я снова редактирую свой вопрос с большим количеством объяснений. –