Odoo Help


one2many not being displayed (odoo 8)

on 12/23/14, 5:04 PM 484 views

sorry for bothering you guys! just started using odoo a couple of days ago and am facing kinda a silly thing so forgive my newbie question!

created a one2many relation btw my model and account.invoice

onchange method i get invoices of a specific res.partner

after debugging i can see that i got the invoices list but i cant display then on GUI

here you are my code:



class account_invoice(models.Model):
    _inherit = 'account.invoice'
    mtoField = fields.Many2one('mynamespace', ondelete='cascade',required=True, string = 'Field Name')


class CustomModel(models.Model):
    invoices= fields.One2many('account.invoice','mtqField',string='Invoices',readonly=True)

     client = fields.Many2one('res.partner', string ='Client', required=True)



      def _OnDataChanged(self):

              foundInvoices = self.env['account.invoice'].search([['partner_id', '=', self.client.id]])
               for inv in foundInvoices:
               return{'value' : {'invoices' : ids}}





<record model="ir.ui.view" id="view_mymodel_form">
            <field name="name">mymodel.form</field>
            <field name="model">mynamespace</field>
            <field name="arch" type="xml">
                            <group string ="Invoice List">
                                <field name="invoices">
                                    <tree string = "Invoices List in Date Range">



On 12/24/14, 2:50 AM

problem solved .. thanks guys!

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 platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 12/23/14, 5:04 PM
Seen: 484 times
Last updated: 3/16/15, 8:10 AM