From b251dd480d1c5b1bea995e10d2011aad521dbc17 Mon Sep 17 00:00:00 2001 From: Ernesto Tejeda Date: Sat, 12 Dec 2020 10:18:13 -0500 Subject: [PATCH 1/3] [IMP] *rma*: Avoid RMAs of kits until rma_mrp is installed --- rma_sale/views/sale_portal_template.xml | 12 +++++------- website_rma/controllers/main.py | 13 +++++++++++-- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/rma_sale/views/sale_portal_template.xml b/rma_sale/views/sale_portal_template.xml index 3e75f659..f33c9de0 100644 --- a/rma_sale/views/sale_portal_template.xml +++ b/rma_sale/views/sale_portal_template.xml @@ -67,7 +67,7 @@ - + @@ -92,12 +92,10 @@ - - - - + + +
diff --git a/rma_sale/wizard/sale_order_rma_wizard.py b/rma_sale/wizard/sale_order_rma_wizard.py index baeb0319..d6ca3ad0 100644 --- a/rma_sale/wizard/sale_order_rma_wizard.py +++ b/rma_sale/wizard/sale_order_rma_wizard.py @@ -134,6 +134,9 @@ class SaleOrderLineRmaWizard(models.TransientModel): comodel_name='rma.operation', string='Requested operation', ) + sale_line_id = fields.Many2one( + comodel_name="sale.order.line", + ) description = fields.Text() @api.onchange('product_id') @@ -146,8 +149,10 @@ class SaleOrderLineRmaWizard(models.TransientModel): for record in self: if record.picking_id: record.move_id = record.picking_id.move_lines.filtered( - lambda r: (r.sale_line_id.product_id == record.product_id - and r.sale_line_id.order_id == record.order_id)) + lambda r: ( + r.sale_line_id == record.sale_line_id and + r.sale_line_id.product_id == record.product_id + and r.sale_line_id.order_id == record.order_id)) @api.depends('order_id') def _compute_allowed_product_ids(self):