diff options
| author | Simon Lejeune <sle@openerp.com> | 2019-09-12 15:51:28 +0000 |
|---|---|---|
| committer | Simon Lejeune <sle@openerp.com> | 2019-09-13 10:08:48 +0000 |
| commit | 3f0ed7d04553c1eeec9eaad4455ff053ddcebf55 (patch) | |
| tree | 971163315bc01a01340a560af50663354bfeacc0 /addons/purchase_stock/tests/test_purchase_order.py | |
| parent | 4c9624db9d4656457f4100ee2e848f0f81d264a9 (diff) | |
[FIX] product: _select_seller
With the new ORM, x2m records are not ordered by default.
The _select_sellers implementation requires to loop on the supplier info
records ordered by their _order. We fix that by sorting with a lambda
with the same order set on the model. Simply using .sorted() isn't
enough since it does a sort in sql, so newId records are completely
removed from the resulting recordset.
This is related to task 1947351 and PR 34049.
We move the tests into purchase_stock and actually implement the tests
proposed in the task.
Diffstat (limited to 'addons/purchase_stock/tests/test_purchase_order.py')
| -rw-r--r-- | addons/purchase_stock/tests/test_purchase_order.py | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/addons/purchase_stock/tests/test_purchase_order.py b/addons/purchase_stock/tests/test_purchase_order.py index 155a71f11a0..75eaefac587 100644 --- a/addons/purchase_stock/tests/test_purchase_order.py +++ b/addons/purchase_stock/tests/test_purchase_order.py @@ -42,9 +42,7 @@ class TestPurchaseOrder(AccountingTestCase): })], } - def test_00_purchase_order_flow(self): - # Ensure product_id_2 doesn't have res_partner_1 as supplier if self.partner_id in self.product_id_2.seller_ids.mapped('name'): id_to_remove = self.product_id_2.seller_ids.filtered(lambda r: r.name == self.partner_id).ids[0] if self.product_id_2.seller_ids.filtered(lambda r: r.name == self.partner_id) else False |
