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

Help load data listview when click button

By
lam a bao
on 12/4/13, 11:52 PM 662 views

hi everyone :

 class cvs_quotations(osv.osv):

  _name = "cvs.quotations"

 def _calc_seller(self, cr, uid, ids, fields, arg, context=None):

     result = {}

    for product in self.browse(cr, uid, ids, context=context):

          oj=self.pool.get('cvs.quotations.cutproduct')
          oj_search=oj.search(cr,uid,[])
          oj_data=oj.read(cr,uid,oj_search,[],context)

          result[product.id] = {
                'codeproduct': oj_data[0]['codeproduct'],
                'weight': oj_data[0]['weight'],
                 'quantity': oj_data[0]['quantity'],
                'prices': oj_data[0]['prices'],
               'position': oj_data[0]['position']
       }

return result

 _columns = {
     "saleordercode": fields.char("Sale order Code", translate=True),
    "payment_ids":fields.function(_calc_seller,relation='cvs.quotations.cutproduct', type="many2many",string='Payments'),

 }

    class cvs_quotations_cutproduct(osv.osv):
    _name="cvs.quotations.cutproduct"
   _columns={
                    "codeproduct":fields.char("Mã Vật Tư",translate=True),
                   "weight":fields.char("Kích Thước",translate=True),
                  "quantity":fields.integer("Số Lượng",translate=True),
                    "prices":fields.float("Giá Vật Tư",translate=True),
                 "position":fields.char("Vị Trí",translate=True),
               "saleordercode":fields.char("Code Order",translate=True),
    }
  cvs_quotations_cutproduct()

when I click button,listview will load data

Can you help me ?

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/4/13, 11:52 PM
Seen: 662 times
Last updated: 3/16/15, 8:10 AM