[IMP]name get when filling form purchase order lines

This commit is contained in:
aaron
2018-05-25 16:53:56 +02:00
committed by Aaron Henriquez
parent 0cdff9ee3e
commit 346200e903

View File

@@ -32,9 +32,14 @@ class PurchaseOrderLine(models.Model):
res = []
if self.env.context.get('rma'):
for purchase in self:
invoices = self.env['account.invoice.line'].search(
[('purchase_line_id', '=', purchase.id)])
if purchase.order_id.name:
res.append((purchase.id, "%s %s qty:%s" % (
res.append((purchase.id, "%s %s %s qty:%s" % (
purchase.order_id.name,
" ".join(str(x) for x in [
inv.number for inv in invoices.mapped(
'invoice_id')]),
purchase.product_id.name, purchase.product_qty)))
else:
res.append(