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

fonction serach for filter many2one

By
lallouch
on 12/18/13, 1:18 PM 1,384 views

hi,

    class printshop2_support(osv.osv):
    _name = 'printshop2.support'
    _description = 'PRINTSHOP2 Support'

    _columns = {
            'name':fields.char('Designation', size=64, required=True, readonly=False),
            'gr':fields.char('grammage', size=32, required=False, readonly=False),
            'line_ids':fields.one2many('printshop2.support.line', 'support_id', 'Variantes supports',required=True),       }

printshop2_support() 

    class printshop2_support_line(osv.osv):
        _name = 'printshop2.support.line'
        _description = 'PRINTSHOP Support line'

        _columns = {
                'product_id':fields.many2one('product.product', 'Produit', required=True, domain="[('marque_support2', '=',printshop2.support.name)]"),
                'largeur_support': fields.related('product_id','longueur_calcul',type='float', relation="product.product", string="Largeur support", store=False),
                'longueur_support': fields.related('product_id','largeur_calcul',type='float', relation="product.product", string="Longueur support", store=False),
                'prix_support': fields.related('product_id','prix_interne',type='float', relation="product.product", string="prix Support à la feuille", store=False),
                'gr_support': fields.related('product_id','epaisseur_calcul',type='char', relation="product.product", string="grammage feuille", store=False),
                }
printshop2_support_line()

i want to have in line_ids all products that (printshop2.support.name = printshop2.support.line.gr_support) and update it automatiquelly

please how can i do that

thanks

You want search lines details in header ? or lines values want to save in header records?

Prakash
on 12/19/13, 1:14 AM

hi, i want line details thanks

lallouch
on 12/20/13, 11:45 AM
0

Prakash

--Prakash--
3173
| 5 4 7
Bikaner, India
--Prakash--

OpenERP Devloper at SunARC Technology

Prakash
On 1/2/14, 3:00 AM

In printshop2.support table add the below related fields

'product_id' : fields.related('line_ids', 'product_id', type="many2one", relation="product.product", string="Product"),

And xml file search view objects printshop2.support add:-

  <field name="product_id"/>

After updated the modules you can filter line details

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: 12/18/13, 1:18 PM
Seen: 1384 times
Last updated: 3/16/15, 8:10 AM