[FIX] Point_Of_Sale : Discount was not linked to the invoice made from returned picking of POS.

lp bug: https://launchpad.net/bugs/501386 fixed

bzr revid: jvo@tinyerp.com-20100111113046-qg0igbrerhnin815
This commit is contained in:
GPA(OpenERP) 2010-01-11 17:00:46 +05:30 committed by Jay (Open ERP)
parent 806ce08ecb
commit 63bfb6b28d
2 changed files with 18 additions and 0 deletions

View File

@ -361,6 +361,7 @@ class pos_order(osv.osv):
'product_uos_qty': abs(line.qty),
'product_qty': abs(line.qty),
'tracking_id': False,
'pos_line_id': line.id,
'state': 'waiting',
'location_id': location_id,
'location_dest_id': stock_dest_id,

View File

@ -23,6 +23,17 @@ from osv import osv, fields
import time
import netsvc
class stock_move(osv.osv):
_inherit = 'stock.move'
_columns = {
'pos_line_id': fields.many2one('pos.order.line',
'Pos Order Line', ondelete='set null', select=True,
readonly=True),
}
stock_move()
class stock_picking(osv.osv):
@ -30,6 +41,12 @@ class stock_picking(osv.osv):
_columns = {
'pos_order': fields.many2one('pos.order', 'Pos order'),
}
def _get_discount_invoice(self, cursor, user, move_line):
if move_line.pos_line_id:
return move_line.pos_line_id.discount
return super(stock_picking, self)._get_discount_invoice(cursor, user,
move_line)
stock_picking()