Odoo Help


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.


Openerp 7: field.function

on 1/30/14, 2:19 AM 547 views

I have a function field

's_no':fields.function(_get_no,string='Serial No',type='integer', multi="lineno"),

 def _get_line_no(self, cr, uid, ids, line_no,  arg, context=None):
    res = {}
     no =0
    for record in self.browse(cr, uid, ids, context=context):      
            's_no': no,
    return res

so 's_no' it would be

 PO0001      PO0002    PO0003  
  s_no     s_no     s_no
  1          1        1
  2          2        2
  3                   3

I want to assign this field value into another field and it must be a Database column

's_line_no':fields.integer('serial Line No', store=True),   
 s_line_no  = s_no

s_no    s_line_no (database)
 1       1
 2       2
 3       3

Any advice will be helpful.

Why don't you add store=True to your function?

GH Mediacloud, Grover Menacho
on 1/30/14, 5:04 PM

If i used store=true i cant get the output structure as i expected.

on 1/30/14, 11:51 PM

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)


Asked: 1/30/14, 2:19 AM
Seen: 547 times
Last updated: 3/16/15, 8:10 AM