Salve a tutti
Scusatemi l'ignoranza ma sto uscendo pazzo!
!..Questo è il mio codice:
from openerp.osv import fields, osv
class students(osv.osv):
_name = "students"
_description = "Studenti"
_columns = {
'name': fields.char('Nome', size=128, required=True),
'vote': fields.float('Voto',required=True),
'esame': fields.selection([
('soai', 'SOAI'),
('ric_op', 'Ricerca Operativa'),
('multi', 'Multivariabili'),
], 'Esame', required=True),
'field_lines':fields.one2many('other_fields','dimension_id','Campi'),
}
students()
class students_fields(osv.osv):
_name="other_fields"
_description="Altri campi"
_columns = {
'dimension_id': fields.many2one('students','Etichetta',select=True),
'description': fields.char('Descrizione', size=100, help="Semplice descrizione mnemonica del campo"),
'x': fields.integer('Origine X', help="X coordinata"),
'y': fields.integer('Origine Y', help="Y coordinata"),
}
students_fields()
e questo è il file xml:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Main Menu Related Info -->
<menuitem name="Esami"
id="base.students_root"
sequence="60"/>
<!-- Sub Menu Related Info -->
<menuitem id="menu_students_root" name="Riepilogo esami"
parent="base.students_root" sequence="1" />
<!--New Module Related info-->
<!--New Module List View-->
<!-- Tree views, also called list views, display records in a tabular form. -->
<record id="view_students_tree" model="ir.ui.view">
<field name="name">students.tree</field>
<field name="model">students</field>
<field name="arch" type="xml">
<!-- this will be our title of list/tree view -->
<tree string="Studentz">
<!-- these will automatically map table headers for our list view -->
<field name="name"/>
<field name="vote"/>
<field name="esame"/>
</tree>
</field>
</record>
<record id="view_students_form" model="ir.ui.view">
<field name="name">students.form.view</field>
<field name="model">students</field>
<field name="arch" type="xml">
<form string="Studentz" version="7.0">
<group>
<field name="name"/>
<field name="vote"/>
<field name="esame"/>
</group>
<notebook>
<page string="Campi">
<field name="field_lines" nolabel="1" widget="one2many_list" colspan="4" >
<form string="Campi Etichetta">
<group col="6" colspan="4">
<field name="description"/>
<field name="x"/>
<field name="y"/>
</group>
</form>
<tree string="Campi etichetta">
<field name="description"/>
<field name="x"/>
<field name="y"/>
</tree>
</field>
</page>
<page string="Pagina 2">
</page>
</notebook>
</form>
</field>
</record>
<record id="action_students" model="ir.actions.act_window">
<field name="name">Action</field>
<field name="res_model">students</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" eval="False"/>
<field name="context">{}</field>
<field name="help">Action</field>
</record>
<menuitem action="action_students"
id="menu_students_transaction"
parent="menu_students_root"/>
</data>
</openerp>
A parte il senso dei campi (che non c'è XD) vorrei "sempicemente" poter inserire una one2many_list per poter inserire più "field_lines"...mi aspetterei una vista tipo quella in allegato
..eppure mi da "Invalid XML for View Architecture!". Sono disperato!!!
Vi ringrazio per la pazienza..perchè mi rendo conto che mi sto perdendo in un bicchiere d'acqua ma ho davvero bisogno di aiuto!!
(se qualcuno mi desse la possibilità di contattarlo in privato per me sarebbe l'ideale!)