[IMP]add rma lines to invoices as it is done with PO

This commit is contained in:
aaron
2018-05-25 18:25:54 +02:00
committed by ahenriquez
parent 2ce2939196
commit 29e4f2953b
3 changed files with 100 additions and 0 deletions

View File

@@ -218,3 +218,16 @@ class RmaOrderLine(models.Model):
result['views'] = [(res and res.id or False, 'form')]
result['res_id'] = invoice_ids[0]
return result
@api.multi
def name_get(self):
res = []
if self.env.context.get('rma'):
for rma in self:
res.append((rma.id, "%s %s qty:%s" % (
rma.name,
rma.product_id.name,
rma.product_qty)))
return res
else:
return super(RmaOrderLine, self).name_get()