This is my original view:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_mymodule_tree" model="ir.ui.view">
<field name="name">mymodule.test.tree</field>
<field name="model">mymodule.test</field>
<field name="arch" type="xml">
<tree string="mymodule">
<field name="name"/>
<field name="surname"/>
</tree>
</field>
</record>
</data>
</openerp>
and this is my model:
# -*- encoding: utf-8 -*-
from openerp.osv import fields, osv
from openerp import models
lass mymodule_test(osv.osv):
_name = 'mymodule.test'
_description = 'mymodule
columns = {
'name': fields.char('Name', size=128, help="Insert your name", required=True),
'surname': fields.char('Surname', size=128, required=True),
So, I have only one table (mymodule_test) with the attribure name and surname.
Now I want to add this class:
class mymodule_2db(osv.osv):
_name = 'mymodule.2module'
_description = 'mymodule'
_columns = {
'select': fields.boolean('Select?', default=True),
}
and I have updated my view:
<record id="view_mymodule_add" model="ir.ui.view">
<field name="name">mymodule.2module</field>
<field name="model">mymodule.2module</field>
<field name="arch" type="xml">
<form string="Address">
<sheet>
<group name="group_top">
<group name="group_left">
<field name="select" />
</group>
</group>
</sheet>
</form>
</field>
</record>
So I'm able to create anothe table (mymodule_2module) with the attribute 'select'.
I would like to have only one form (in the same page) where user can input 'name', 'surname' and could select 'select': 'name' and 'surname' must be writter in the table 'mymodule_test'; 'select' in the table 'mymodule_2module', using a foreign key.
Please give proper example of what exactly you want to do.