mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[IMP] Improved Code.
This commit is contained in:
committed by
ahenriquez
parent
b60a0241d0
commit
37abae957e
@@ -14,10 +14,10 @@ class ProcurementOrder(models.Model):
|
||||
)
|
||||
|
||||
@api.model
|
||||
def _run_move_create(self, procurement):
|
||||
res = super(ProcurementOrder, self)._run_move_create(procurement)
|
||||
if procurement.rma_line_id:
|
||||
line = procurement.rma_line_id
|
||||
def _get_stock_move_values(self):
|
||||
res = super(ProcurementOrder, self)._get_stock_move_values()
|
||||
if self.rma_line_id:
|
||||
line = self.rma_line_id
|
||||
res['rma_line_id'] = line.id
|
||||
if line.delivery_address_id:
|
||||
res['partner_id'] = line.delivery_address_id.id
|
||||
|
||||
@@ -275,6 +275,9 @@ class TestRma(common.TransactionCase):
|
||||
'active_id': 1
|
||||
}).default_get({})
|
||||
procurements = wizard._create_picking()
|
||||
for proc in procurements:
|
||||
proc._get_stock_move_values()
|
||||
|
||||
group_ids = set([proc.group_id.id for proc in procurements if
|
||||
proc.group_id])
|
||||
domain = [('group_id', 'in', list(group_ids))]
|
||||
|
||||
Reference in New Issue
Block a user