diff --git a/purchase_unreconciled/__manifest__.py b/purchase_unreconciled/__manifest__.py index 9d4e84a21..9b6e21097 100644 --- a/purchase_unreconciled/__manifest__.py +++ b/purchase_unreconciled/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Purchase Unreconciled", - "version": "16.0.1.0.0", + "version": "17.0.1.0.0", "author": "ForgeFlow S.L., Odoo Community Association (OCA)", "website": "https://github.com/OCA/account-financial-tools", "category": "Purchases", diff --git a/purchase_unreconciled/models/account_move_line.py b/purchase_unreconciled/models/account_move_line.py index 3c67f3af8..6c58a9969 100644 --- a/purchase_unreconciled/models/account_move_line.py +++ b/purchase_unreconciled/models/account_move_line.py @@ -86,5 +86,5 @@ class AccountMoveLine(models.Model): ) move.action_post() return move.line_ids.filtered( - lambda l: l.account_id.id == counterpart_account.id + lambda line: line.account_id.id == counterpart_account.id ) diff --git a/purchase_unreconciled/models/purchase_order.py b/purchase_unreconciled/models/purchase_order.py index 4f566500f..4e3fb7e1e 100644 --- a/purchase_unreconciled/models/purchase_order.py +++ b/purchase_unreconciled/models/purchase_order.py @@ -130,8 +130,9 @@ class PurchaseOrder(models.Model): group["purchase_line_id"][0] if group["purchase_line_id"] else False ) unreconciled_items_group = unreconciled_items.filtered( - lambda l: ( - l.account_id.id == account_id and l.product_id.id == product_id + lambda line, account_id=account_id, product_id=product_id: ( + line.account_id.id == account_id + and line.product_id.id == product_id ) ) # Check which type of force reconciling we are doing: @@ -139,8 +140,9 @@ class PurchaseOrder(models.Model): # - Force reconciling amount_residual_currency amount_residual_currency_reconcile = any( unreconciled_items_group.filtered( - lambda l: l.amount_residual_currency != 0.0 - and l.account_id.id == account_id + lambda item_group, + account_id=account_id: item_group.amount_residual_currency != 0.0 + and item_group.account_id.id == account_id ) ) if amount_residual_currency_reconcile: @@ -165,7 +167,9 @@ class PurchaseOrder(models.Model): # Check if reconciliation is total or needs an exchange rate entry to be # created if moves_to_reconcile: - moves_to_reconcile.filtered(lambda l: not l.reconciled).reconcile() + moves_to_reconcile.filtered( + lambda move: not move.reconciled + ).reconcile() reconciled_ids = unreconciled_items | all_writeoffs res = { "name": _("Reconciled journal items"), diff --git a/purchase_unreconciled/tests/test_purchase_unreconciled.py b/purchase_unreconciled/tests/test_purchase_unreconciled.py index 54ce36dcc..c244b7dfc 100644 --- a/purchase_unreconciled/tests/test_purchase_unreconciled.py +++ b/purchase_unreconciled/tests/test_purchase_unreconciled.py @@ -194,10 +194,11 @@ class TestPurchaseUnreconciled(SingleTransactionCase): def _do_picking(self, picking, date): """Do picking with only one move on the given date.""" picking.action_confirm() + picking.action_assign() for move in picking.move_ids: - move.quantity_done = move.product_uom_qty + move.quantity = move.product_uom_qty move.date = date - picking._action_done() + picking.button_validate() def test_01_nothing_to_reconcile(self): po = self.po diff --git a/purchase_unreconciled/views/purchase_order_view.xml b/purchase_unreconciled/views/purchase_order_view.xml index efeb4bf8e..efb689062 100644 --- a/purchase_unreconciled/views/purchase_order_view.xml +++ b/purchase_unreconciled/views/purchase_order_view.xml @@ -16,7 +16,7 @@ groups="account.group_account_manager" class="oe_stat_button" icon="fa-gears" - attrs="{'invisible':[('unreconciled', '=', False)]}" + invisible="not unreconciled" > diff --git a/purchase_unreconciled/views/res_config_settings_view.xml b/purchase_unreconciled/views/res_config_settings_view.xml index 0bac85b58..ab534659c 100644 --- a/purchase_unreconciled/views/res_config_settings_view.xml +++ b/purchase_unreconciled/views/res_config_settings_view.xml @@ -5,61 +5,25 @@ res.config.settings - -

Purchase Reconciling

-
-
+ + - -
-
- -
-
-
-
-
-
-
-
-
+ + + + + + + + + + + +