diff --git a/addons/delivery/stock.py b/addons/delivery/stock.py index 4e0071e066d..f26b44d02c5 100644 --- a/addons/delivery/stock.py +++ b/addons/delivery/stock.py @@ -34,8 +34,9 @@ class stock_picking(osv.osv): total_weight = total_weight_net = 0.00 for move in picking.move_lines: - total_weight += move.weight - total_weight_net += move.weight_net + if move.state != 'cancel': + total_weight += move.weight + total_weight_net += move.weight_net res[picking.id] = { 'weight': total_weight, @@ -57,12 +58,12 @@ class stock_picking(osv.osv): 'weight': fields.function(_cal_weight, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight', store={ 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 40), - 'stock.move': (_get_picking_line, ['picking_id', 'product_id','product_uom_qty','product_uom'], 40), + 'stock.move': (_get_picking_line, ['state', 'picking_id', 'product_id','product_uom_qty','product_uom'], 40), }), 'weight_net': fields.function(_cal_weight, type='float', string='Net Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight', store={ 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 40), - 'stock.move': (_get_picking_line, ['picking_id', 'product_id','product_uom_qty','product_uom'], 40), + 'stock.move': (_get_picking_line, ['state', 'picking_id', 'product_id','product_uom_qty','product_uom'], 40), }), 'carrier_tracking_ref': fields.char('Carrier Tracking Ref', copy=False), 'number_of_packages': fields.integer('Number of Packages', copy=False), diff --git a/addons/mrp_operations/mrp_operations.py b/addons/mrp_operations/mrp_operations.py index b41dc63c517..3c3e2c92268 100644 --- a/addons/mrp_operations/mrp_operations.py +++ b/addons/mrp_operations/mrp_operations.py @@ -219,7 +219,7 @@ class mrp_production(osv.osv): workcenter_line.signal_workflow('button_done') return super(mrp_production,self).action_production_end(cr, uid, ids, context=context) - def action_in_production(self, cr, uid, ids): + def action_in_production(self, cr, uid, ids, context=None): """ Changes state to In Production and writes starting date. @return: True """ @@ -227,7 +227,7 @@ class mrp_production(osv.osv): for prod in self.browse(cr, uid, ids): if prod.workcenter_lines: workcenter_pool.signal_workflow(cr, uid, [prod.workcenter_lines[0].id], 'button_start_working') - return super(mrp_production,self).action_in_production(cr, uid, ids) + return super(mrp_production,self).action_in_production(cr, uid, ids, context=context) def action_cancel(self, cr, uid, ids, context=None): """ Cancels work order if production order is canceled. diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py index 731a326010e..e04833ca6f6 100644 --- a/addons/sale/report/sale_report.py +++ b/addons/sale/report/sale_report.py @@ -44,6 +44,7 @@ class sale_report(osv.osv): 'nbr': fields.integer('# of Lines', readonly=True), # TDE FIXME master: rename into nbr_lines 'state': fields.selection([ ('draft', 'Quotation'), + ('sent', 'Quotation Sent'), ('waiting_date', 'Waiting Schedule'), ('manual', 'Manual In Progress'), ('progress', 'In Progress'), diff --git a/addons/sale_margin/sale_margin.py b/addons/sale_margin/sale_margin.py index ec1bd83dd50..094a9b2ba6f 100644 --- a/addons/sale_margin/sale_margin.py +++ b/addons/sale_margin/sale_margin.py @@ -37,7 +37,7 @@ class sale_order_line(osv.osv): to_cur = self.pool.get('product.pricelist').browse(cr, uid, [pricelist])[0].currency_id.id if product: product = self.pool['product.product'].browse(cr, uid, product, context=context) - purchase_price = product.standard_price + purchase_price = product.price_get(ptype='standard_price', context=dict(context, currency_id=to_cur))[product.id] to_uom = res.get('product_uom', uom) if to_uom != product.uom_id.id: purchase_price = self.pool['product.uom']._compute_price(cr, uid, product.uom_id.id, purchase_price, to_uom) diff --git a/addons/sale_stock/report/sale_report.py b/addons/sale_stock/report/sale_report.py index 2d126fcdb2a..8cdaa48b406 100644 --- a/addons/sale_stock/report/sale_report.py +++ b/addons/sale_stock/report/sale_report.py @@ -30,6 +30,7 @@ class sale_report(osv.osv): 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse',readonly=True), 'state': fields.selection([ ('draft', 'Quotation'), + ('sent', 'Quotation Sent'), ('waiting_date', 'Waiting Schedule'), ('manual', 'Manual In Progress'), ('progress', 'In Progress'),