mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[FIX] rma_scrap: various fixes
This commit is contained in:
committed by
SergiCForgeFlow
parent
70289bdadd
commit
0f59a8048f
@@ -21,3 +21,21 @@ class StockScrap(models.Model):
|
||||
if self.is_rma_scrap:
|
||||
self.move_id.is_rma_scrap = True
|
||||
self.rma_line_id.move_ids |= self.move_id
|
||||
|
||||
def _prepare_move_values(self):
|
||||
res = super(StockScrap, self)._prepare_move_values()
|
||||
res["rma_line_id"] = self.rma_line_id.id
|
||||
return res
|
||||
|
||||
def action_view_rma_line(self):
|
||||
if self.rma_line_id.type == "customer":
|
||||
action = self.env.ref("rma.action_rma_customer_lines")
|
||||
res = self.env.ref("rma.view_rma_line_form", False)
|
||||
else:
|
||||
action = self.env.ref("rma.action_rma_supplier_lines")
|
||||
res = self.env.ref("rma.view_rma_line_supplier_form", False)
|
||||
result = action.sudo().read()[0]
|
||||
# choose the view_mode accordingly
|
||||
result["views"] = [(res and res.id or False, "form")]
|
||||
result["res_id"] = self.rma_line_id.id
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user