Odoo Help


help on adding extra weight in delivery order

on 9/30/13, 1:15 PM 1,007 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.

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: 1007 times
Last updated: 3/16/15, 8:10 AM