1067d0ea1b
Under some weird scenarios where some modules are involved, several invoices are posted at the same time, and no invoice exists, we could get to the case when `one.date` or `one.name` were `False`.
Here I provide a default value to avoid comparing `str` to `bool` in those cases.
Tried a lot but couldn't reproduce the test case in code, sorry 😕. However, the traceback was clear:
```
File "/opt/odoo/auto/addons/account_journal_general_sequence/models/account_move.py", line 64, in _compute_entry_number
for move in chosen.sorted(lambda one: (one.date, one.name, one.id)):
File "/opt/odoo/custom/src/odoo/odoo/models.py", line 5583, in sorted
ids = tuple(item.id for item in sorted(self, key=key, reverse=reverse))
TypeError: '<' not supported between instances of 'str' and 'bool'
```
@moduon MT-5559
|
||
---|---|---|
.. | ||
i18n | ||
migrations/16.0.2.0.0 | ||
models | ||
readme | ||
security | ||
static/description | ||
tests | ||
views | ||
wizards | ||
__init__.py | ||
__manifest__.py | ||
README.rst |
==================================== General sequence in account journals ==================================== .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:a605b6ea5d6c7a699f28ac3d02cc53789b40b01ef47be934e46c5c6f6305e240 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status :alt: Beta .. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :alt: License: LGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github :target: https://github.com/OCA/account-financial-tools/tree/16.0/account_journal_general_sequence :alt: OCA/account-financial-tools .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png :target: https://translation.odoo-community.org/projects/account-financial-tools-16-0/account-financial-tools-16-0-account_journal_general_sequence :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png :target: https://runboat.odoo-community.org/builds?repo=OCA/account-financial-tools&target_branch=16.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| This module extends the functionality of account to support sequenced entry numbers and to allow you to renumber them if needed, on demand. It adds a new field called *Entry number*. This is independent from the *Number* that Odoo adds by default, and has different purpose. **Table of contents** .. contents:: :local: Installation ============ After installing this module, no entry numbers will be generated because that could have a very negative impact in installations that already had a lot of account moves. If you need to add numbers to preexisting account moves, please use the renumbering wizard as explained in the *Usage* section. Configuration ============= To configure journal sequences: #. Have full accounting permissions. #. Go to *Invoicing > Configuration > Accounting > Journals*. #. Select or create the journal you want to configure. #. Use *Account entry number sequence* to configure a sequence. Note that: * Various journals can share the same sequence. * All journals get a shared default sequence, per company. * Entry numbers must be unique per company. So, if you use different sequences per journal, make sure they don't produce colliding results. Usage ===== To see journal entry numbers: #. Go to *Invoicing > Accounting > Miscellaneous > Journal Entries*. #. Notice the new field *Entry Number*. Only posted moves get an entry number. Note that: * You can use that new field in quick searches. * You can see it also in *Invoicing > Accounting > Miscellaneous > Journal Items*. To renumber journal entries: #. Have full accounting permissions. #. Have *Accounting / Invoicing / Billing Administrator* permissions. #. Go to *Invoicing > Accounting > Actions > Renumber journal entries*. #. Configure those parameters. #. Click on *Renumber*. Note that: * You will only be able to select sequences related to journals. * A sequence usually affects various journals, if not all. Bug Tracker =========== Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-financial-tools/issues>`_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed `feedback <https://github.com/OCA/account-financial-tools/issues/new?body=module:%20account_journal_general_sequence%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. Do not contact contributors directly about support or help with technical issues. Credits ======= Authors ~~~~~~~ * Moduon Contributors ~~~~~~~~~~~~ * Jairo Llopis (`Moduon <https://www.moduon.team/>`__) * Rafael Blasco (`Moduon <https://www.moduon.team/>`__) Maintainers ~~~~~~~~~~~ This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. .. |maintainer-yajo| image:: https://github.com/yajo.png?size=40px :target: https://github.com/yajo :alt: yajo Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: |maintainer-yajo| This module is part of the `OCA/account-financial-tools <https://github.com/OCA/account-financial-tools/tree/16.0/account_journal_general_sequence>`_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.