Odoo Help

0

help on adding extra weight in delivery order

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

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.

Register

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)

Stats

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