class stock_picking(osv.osv):
_inherit = 'stock.picking'
-
- def _get_partner_to_invoice(self, cr, uid, picking, context=None):
- """ Inherit the original function of the 'stock' module
- We select the partner of the purchase order as the partner of the invoice
- """
- if picking.move_lines and picking.move_lines[0] and picking.move_lines[0].purchase_line_id:
- return picking.move_lines[0].purchase_line_id.order_id.partner_id and picking.move_lines[0].purchase_line_id.order_id.partner_id.id
- return super(stock_picking, self)._get_partner_to_invoice(cr, uid, picking, context=context)
def _get_to_invoice(self, cr, uid, ids, name, args, context=None):
res = {}