[11.0] MIG: RMA module

This commit is contained in:
Bhavesh Odedra
2018-02-09 21:56:28 +05:30
committed by Mateu Griful
parent 37821a55c8
commit c8c497aadc
40 changed files with 640 additions and 781 deletions

9
rma/models/stock.py Normal file → Executable file
View File

@@ -30,9 +30,8 @@ class StockMove(models.Model):
@api.model
def create(self, vals):
if vals.get('procurement_id'):
procurement = self.env['procurement.order'].browse(
vals['procurement_id'])
if procurement.rma_line_id:
vals['rma_line_id'] = procurement.rma_line_id.id
if vals.get('group_id'):
group = self.env['procurement.group'].browse(vals['group_id'])
if group.rma_line_id:
vals['rma_line_id'] = group.rma_line_id.id
return super(StockMove, self).create(vals)