diff options
| author | jev <jev@odoo.com> | 2021-01-15 10:58:39 +0000 |
|---|---|---|
| committer | jev <jev@odoo.com> | 2021-01-18 09:58:10 +0000 |
| commit | 34e89b23345a707d762a2c56d5b708ce006ffa0d (patch) | |
| tree | b00c0d9c47a8763695e0c9d85879f2e347e34ced | |
| parent | f94d560b9193242eadd5e1dc1af94af7c97a9a25 (diff) | |
[FIX] point_of_sale: already reconciled stock_account_move_line
When the customer use Anglo-Saxon stock valuation and have already
reconciled some `account.move.line` related to an open `pos.session`,
closing the session will fail.
(You are trying to reconcile some entries that are already reconciled)
Now, the reconciled lines are ignored.
The inventory valuation is still correct as these lines were already
reconciled.
opws:
2374559
2376187
2377958
2391395
2425197
closes odoo/odoo#64659
X-original-commit: 3f939af62df65dcb9c8cdd2ecc3ac3d4c2983a2f
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
| -rw-r--r-- | addons/point_of_sale/models/pos_session.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/point_of_sale/models/pos_session.py b/addons/point_of_sale/models/pos_session.py index 2c0e64986bb..e7feb929024 100644 --- a/addons/point_of_sale/models/pos_session.py +++ b/addons/point_of_sale/models/pos_session.py @@ -729,9 +729,9 @@ class PosSession(models.Model): stock_moves = self.env['stock.move'].search([('picking_id', 'in', pickings.ids)]) stock_account_move_lines = self.env['account.move'].search([('stock_move_id', 'in', stock_moves.ids)]).mapped('line_ids') for account_id in stock_output_lines: - ( stock_output_lines[account_id].filtered(lambda aml: not aml.reconciled) + ( stock_output_lines[account_id] | stock_account_move_lines.filtered(lambda aml: aml.account_id == account_id) - ).reconcile() + ).filtered(lambda aml: not aml.reconciled).reconcile() return data def _prepare_line(self, order_line): |
