Odoo Help


help on adding extra weight in delivery order

on 9/30/13, 1:15 PM 764 views

OpenERP v6.1 on windows. I am trying to add two extra fields in delivery order, one to add extra weight to the gross weight (Weight field) and another to display a new total weight. Can anyone help please thank you in Advance.

 class stock_picking(osv.osv):
  _inherit = 'stock.picking'

def _cal_new_weight(self, cr, uid, ids, wgt, context=None):
    current_weight=weight() #gross weight calculated by the system for delivery products
    val = {
                            'weight_total': total_new_weight,

    return {'value': val}

_columns = {
    'weight_total': fields.function(_cal_new_weight, type='float', 'Total Weight'),
    'weight_added': fields.float('Extra Weight',select=True, readonly= False),

stock_picking() this code give me no error but the field weight total is not adding up any help please.

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 platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 9/30/13, 1:15 PM
Seen: 764 times
Last updated: 3/16/15, 8:10 AM