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 on adding extra weight in delivery order

By
kaynis
on 9/30/13, 1:15 PM 707 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
    weight_addition=weight_added(wgt)
    total_new_weight=current_weight+weight_addition
    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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

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