mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
[FIX] rma_sale: fix wrong values for RMA creation
Lesser fix for creating RMA from website. Current values will break any custom behaviour because Many2one fields are set using strings instead of integer (IDs).
This commit is contained in:
committed by
Pedro M. Baeza
parent
773a443e80
commit
f4bca10480
@@ -25,11 +25,16 @@ class CustomerPortal(CustomerPortal):
|
||||
return request.redirect("/my")
|
||||
order_obj = request.env["sale.order"]
|
||||
wizard_obj = request.env["sale.order.rma.wizard"]
|
||||
wizard_line_field_types = {
|
||||
f: d["type"] for f, d in wizard_obj.line_ids.fields_get().items()
|
||||
}
|
||||
# Set wizard line vals
|
||||
mapped_vals = {}
|
||||
partner_shipping_id = post.pop("partner_shipping_id", False)
|
||||
for name, value in post.items():
|
||||
row, field_name = name.split("-", 1)
|
||||
if wizard_line_field_types.get(field_name) == "many2one":
|
||||
value = int(value) if value else False
|
||||
mapped_vals.setdefault(row, {}).update({field_name: value})
|
||||
# If no operation is filled, no RMA will be created
|
||||
line_vals = [
|
||||
|
||||
Reference in New Issue
Block a user