diff --git a/rma_sale/wizard/sale_order_rma_wizard.py b/rma_sale/wizard/sale_order_rma_wizard.py index 96410bd8..baeb0319 100644 --- a/rma_sale/wizard/sale_order_rma_wizard.py +++ b/rma_sale/wizard/sale_order_rma_wizard.py @@ -62,6 +62,8 @@ class SaleOrderRmaWizard(models.TransientModel): def create_and_open_rma(self): self.ensure_one() rma = self.create_rma() + if not rma: + return for rec in rma: rec.action_confirm() action = self.env.ref('rma.rma_action').read()[0] @@ -137,6 +139,7 @@ class SaleOrderLineRmaWizard(models.TransientModel): @api.onchange('product_id') def onchange_product_id(self): self.picking_id = False + self.uom_id = self.product_id.uom_id @api.depends('picking_id') def _compute_move_id(self): diff --git a/website_rma/controllers/main.py b/website_rma/controllers/main.py index 67447f50..bf365282 100644 --- a/website_rma/controllers/main.py +++ b/website_rma/controllers/main.py @@ -11,6 +11,7 @@ class WebsiteForm(WebsiteForm): def insert_record(self, request, model, values, custom, meta=None): if model.model == 'rma': values['partner_id'] = request.env.user.partner_id.id + values['origin'] = 'Website form' res = super(WebsiteForm, self).insert_record( request, model, values, custom, meta) # Add the customer to the followers, the same as when creating