diff --git a/deltatech_sale_xls/__manifest__.py b/deltatech_sale_xls/__manifest__.py index 79791b7b6b..2c625867f8 100644 --- a/deltatech_sale_xls/__manifest__.py +++ b/deltatech_sale_xls/__manifest__.py @@ -6,7 +6,7 @@ "name": "Deltatech Sale XLS", "summary": "Import/export sale line from/to Excel", "author": "Terrabit, Voicu Stefan", - "version": "19.0.1.0.0", + "version": "19.0.1.0.1", "license": "OPL-1", "website": "https://www.terrabit.ro", "category": "Sales", diff --git a/deltatech_sale_xls/models/sale_order.py b/deltatech_sale_xls/models/sale_order.py index de8443f54a..73f7d94fe3 100644 --- a/deltatech_sale_xls/models/sale_order.py +++ b/deltatech_sale_xls/models/sale_order.py @@ -59,8 +59,8 @@ def load(self, fields, data): order = self.env["sale.order"].browse(order_id) if not order: - order_index = fields.index.get("order_id", False) - if order_index: + order_index = fields.index("order_id") if "order_id" in fields else False + if order_index is not False: order_id = data[0][order_index] order = self.env["sale.order"].browse(order_id) @@ -73,7 +73,7 @@ def load(self, fields, data): record.append("") if product_index != -1: - for record in data: + for record in list(data): product_name = record[product_index] product = self.env["product.product"] # extrage codul din numele produsului care este intre paranteze [] diff --git a/deltatech_sale_xls/readme/HISTORY.md b/deltatech_sale_xls/readme/HISTORY.md new file mode 100644 index 0000000000..56ab33ffb6 --- /dev/null +++ b/deltatech_sale_xls/readme/HISTORY.md @@ -0,0 +1,8 @@ +## 19.0.1.0.1 + +- [FIX] `sale.order.line.load()` raised `AttributeError` when importing + without `default_order_id`/`active_id` in context (`fields.index` is a + list method, not a dict) +- [FIX] iterating over `data` while calling `data.remove(record)` skipped + the record right after a removed one, so some unmatched lines silently + passed validation