Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Report one2many and many2one fields with aeroo

By
Francisco Castro
on 2/27/14, 11:48 AM 1,296 views
 _name = 'gs.pet'

_columns= {

           'pet_id': fields.char('Código', size=20, required='True'),
           'name': fields.char('Nome', size=60, required='True'),
           'owner_id':fields.many2one('gs.owner','ID_owner'),
           'register_data': fields.date('Data de Registo', required='True'),
           'gender':fields.selection([('male','Male'),('female','Female')],'Gender',required='True'),
           'born_date':fields.date('Data de Nascimento',required='True'),
           'imagemPet': fields.binary('Imagem'),
            'active': fields.boolean('Activo'),
            'status':fields.selection([('registado','Registado'),('validado','Validado'),('morto','Morto')],'status',required='True')
           }

_name = 'gs.owner'

_columns= {

           'owner_id': fields.one2many('gs.pet', 'owner_id','Pets'),
           'name': fields.char('Name', size=60, required='True'),
           'street':fields.char('Adress',size=60, required='True'),
           'phone':fields.char('Phone',size=15, required='True'),
           'imagemOwner': fields.binary('Imagem'),
           'active': fields.boolean('Activo')
           }

How can I report:

1- The pets of wich owner

2-The owner of wich pet

I use the libreoffice and I see this on openerp forum but cant put the code alright:

     <for each="line in o.one2many field in res.partner table">

      <line.fieldname in="" one2many="" field.columnname="">

       </for>
0
Rjay Lopez
On 4/14/14, 1:01 AM

Try this code,

<for each='o in objects'>
<for each='line in o.one2manyline'>
<line.many2one.owner> | <line.petowner>
</for>
</for>

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 2/27/14, 11:48 AM
Seen: 1296 times
Last updated: 3/16/15, 8:10 AM