OCA / account-financial-tools

Odoo Accountant Financial Tools and Utils
GNU Affero General Public License v3.0
298 stars 739 forks source link

[IMP] account_invoice_constraint_chronology: Prevent Invoice Creation Blockage #1890

Open zuher83 opened 1 month ago

zuher83 commented 1 month ago

Is your feature request related to a problem?

Yes, the problem is related to the conformity and accuracy of invoice creation. For example, in France, it is illegal to cancel or delete an invoice once it has been created. If an accountant mistakenly creates an invoice on May 27, 2024 with a future date, for example October 20, 2024, and validates it, this will prevent the creation of invoices dated before October 20, 2024. This problem can seriously disrupt the invoicing process between the 2 periods, as the error will prevent journal invoicing until October 20.

Describe the solution you'd like

I propose two potential solutions:

  1. Disallow the creation of invoices with dates after the current date.
  2. Add an integer field in the accounting journal to allow some flexibility. This field would specify the number of days (e.g., 3, 5, or 10 days) beyond the current date within which an invoice can be created, based on the administrator's configuration.

Describe alternatives you've considered

An alternative solution would be to create a new module that inherits from account_invoice_constraint_chronology and implements this important change. This would allow us to address the issue without altering the existing module.

Additional context

In the migration to version 17.0 #1889 , I did not implement any changes to address this issue. If you agree, I can implement the proposed changes directly in the account_invoice_constraint_chronology module.

I look forward to your feedback on this matter.