diff options
| author | wan <wan@odoo.com> | 2020-01-03 15:45:16 +0000 |
|---|---|---|
| committer | wan <wan@odoo.com> | 2020-01-21 15:30:44 +0000 |
| commit | 59619987e9d8e989cc7efdb543b321c30e283258 (patch) | |
| tree | d2856c1e5982eec2a058c1408e8e1c215847c10d | |
| parent | 16bb5795d805e9bba9d9d6e2c7453210ffcacb74 (diff) | |
[FIX] account: multi-post order compare bool and str
The `ref` field on `account.move` is not required and can yield a falsy
value. This produces a TypeError while doing the comparison in sorted().
closes #42434
closes odoo/odoo#43674
X-original-commit: 3bb4c0c99b29bb85916af95361b86e9dc3287546
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
| -rw-r--r-- | addons/account/wizard/account_validate_account_move.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account/wizard/account_validate_account_move.py b/addons/account/wizard/account_validate_account_move.py index 23ff062a021..922f5685a18 100644 --- a/addons/account/wizard/account_validate_account_move.py +++ b/addons/account/wizard/account_validate_account_move.py @@ -9,7 +9,7 @@ class ValidateAccountMove(models.TransientModel): def validate_move(self): context = dict(self._context or {}) moves = self.env['account.move'].browse(context.get('active_ids')) - move_to_post = moves.filtered(lambda m: m.state == 'draft').sorted(lambda m: (m.date, m.ref, m.id)) + move_to_post = moves.filtered(lambda m: m.state == 'draft').sorted(lambda m: (m.date, m.ref or '', m.id)) if not move_to_post: raise UserError(_('There are no journal items in the draft state to post.')) move_to_post.post() |
