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.


Openerpv7: fields.function

on 2/1/14, 4:15 AM 530 views

I'm using OpenERP v7 and requesting this below output in Purchase order line window

PO0001      PO0002    PO0003  
  Line      Line      Line
  10          10        10
  20          20        20
  30                    30

My code:

'line_no':fields.function(_get_line_no,string='Line No',type='integer', multi="lineno",store=True),
'next_line_no':fields.function(_get_line_no,string='Next Line No',type='integer', multi="lineno", store=True),
_defaults = {
def _get_line_no(self, cr, uid, ids, name, arg, context=None):
  res = {}
  nextno =0
  total =0
  for record in self.browse(cr, uid, ids, context=context):                             
    no = record.next_line_no        
    next_no = nextno + no
    total += next_no
              'line_no': total,                                 
  return res

But im getting this kind of output . Any advice would be greatful.

PO0001      PO0002    PO0003  
  Line      Line      Line
  10          40        60
  20          50        70
  30                    80

Anyone could help me to achive the required output.

The same requirement used in the different way in the link http://stackoverflow.com/questions/21375392/openerp-v7-sequence-number

on 2/1/14, 4:58 AM

That output also what im getting now.Im not requesting that.

on 2/1/14, 5:13 AM

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: 2/1/14, 4:15 AM
Seen: 530 times
Last updated: 3/16/15, 8:10 AM