0 votes

ERROR IN VIEW (TREE) Odoo 11

It does not show me in the tree view the fields last name, security num. Just the name. I add models and views:

 class centromedico_pacientes(models.Model): #rw by secretaria users, r doctores/enfermeros
_name = 'centromedico.pacientes'

name = fields.Char(string="Nombre", required=True)
apellidos = fields.Char(string="Apellidos", required=True)
numserguridad = fields.Integer(string="Número seguridad social", required=True)
cita = fields.One2many("centromedico.citas","cpaciente",string="Libros")

class centromedico_citas (models.Model): #rw by secretaria users, r doctors _name = 'centroomedico.citas'

 fconsulta = fields.Datetime(string="Fecha consulta", required=True)
cpaciente = fields.Many2one('centromedico.pacientes', string="Paciente")

And this would be the view for the centromedico_citas model, which is where the tree does not show me well:

 <record model="ir.ui.view" id="centromedico.citas_tree"> 
  <field name="name">centromedico.citas.tree</field>
  <field name="model">centromedico.citas</field> 
  <field name="arch" type="xml">
    <tree>
      <field name="fconsulta"/>
      <field name="cpaciente">
        <field name="name"/>
        <field name="apellidos"/>
      </field>
    </tree>
  </field>
</record>

<record model="ir.ui.view" id="centromedico.citas_form">
  <field name="name">centromedico.citas.form</field>
  <field name="model">centromedico.citas</field> 
  <field name="arch" type="xml">
    <form>
      <group> 
        <field name="fconsulta"/>
        <field name="cpaciente">
          <tree>
            <field name="name"/>
            <field name="apellidos"/>
            <field name="numserguridad"/>
          </tree>
        </field>
      </group>
    </form>
  </field>
</record>

0voto

Sergio Gonzalez Points 101

I think the error is that you are putting a tree view in a form view, that should give you an XML error, now if you want to add some tabs the label is notebook and then pages.

HolaDevs.com

HolaDevs is an online community of programmers and software lovers.
You can check other people responses or create a new question if you don't find a solution

Powered by:

X