İçereği Atla
Menü
Bu soru işaretlendi
2829 Görünümler

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):      
        no=no+1                   
        res[record.id]={                 
            '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.

Avatar
Vazgeç

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

Üretici

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