Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][MIG] account_invoice_validation_queued #1694

Open
wants to merge 24 commits into
base: 16.0
Choose a base branch
from

Conversation

Saran440
Copy link
Member

@Saran440 Saran440 commented Mar 28, 2024

Standard MIgrated and Update readme

@Saran440 Saran440 force-pushed the 16.0-mig-account_invoice_validation_queued branch 2 times, most recently from 0f64db6 to cbd1239 Compare March 28, 2024 06:41
Copy link
Member

@hbrunn hbrunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ocabot migration account_invoice_validation_queued

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Mar 28, 2024
@OCA-git-bot OCA-git-bot mentioned this pull request Mar 28, 2024
62 tasks
@francesco-ooops
Copy link
Contributor

francesco-ooops commented Apr 8, 2024

@Saran440 (and @pedrobaeza as module author): do you know if there is a specific reason why it's not possible to validate 2 invoices with a different value in field "date"?

If this is done to preserve invoicing sequence from job queue completion order, seems to me the check could be done on invoice_date field. Is there something I'm missing?

@pedrobaeza
Copy link
Member

I can't say, as I'm not using this module in newer versions (the speed improvements done on core have been enough for our customers).

@Saran440
Copy link
Member Author

Saran440 commented Apr 9, 2024

@francesco-ooops That's a good question. I'm not sure myself. I migrated from standard.
However, In my project I inherit this module for delete code validation too.

Should we delete it in this module because job queue processes tasks one by one?
@pedrobaeza

@francesco-ooops
Copy link
Contributor

@Saran440 I think the only thing we must make sure is not to validate together invoices with different invoice date as to preserve sequence

currently this check is done on field "date" which is not a visible field in the form and AFAIU is = creation date (not sure what is the purpose of this field)

@Saran440 Saran440 force-pushed the 16.0-mig-account_invoice_validation_queued branch from cbd1239 to fe70d72 Compare May 13, 2024 07:03
@adriapalleja
Copy link

@Saran440 @hbrunn How is the migration of this module going? Could we help somehow in this migration? Thanks!

@Saran440
Copy link
Member Author

@adriapalleja Could you please review and approve this PR if it works?
We can merge once 2 reviewers approve.

@adriapalleja
Copy link

adriapalleja commented Aug 19, 2024

@Saran440 I've just reviewed and tested the module. Everything is working fine on my side, except from this topic in "Usage":

  • If any of the invoices is already enqueued, there will be a message saying so and avoiding to perform the process

The process is working as expected, but I would remove "there will be a message saying so" from the Usage Readme.

Copy link

@adriapalleja adriapalleja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looking good! Only a minor change requested in the "Usage" Readme.

@adriapalleja
Copy link

Hi @Saran440 ! Could you apply the minor changes suggested in order to move forward with this PR? Thanks!

pedrobaeza and others added 15 commits September 23, 2024 16:39
…dation

This module allows to enqueue in several jobs the account validation process
to be executed in paralell on background, which is normally done serially and
on foreground.

Each invoice creates a job for performing the validation, but you will only be
able to enqueue invoices for the same date.

Installation
============

This module depends on *queue_job* module that is hosted on
https://github.com/OCA/queue.

Configuration
=============

Jobs are enqueued in the channel ``root.account_invoice_validation_queued``,
so you must adjust your
`Odoo configuration <https://github.com/OCA/queue/tree/11.0/queue_job#configuration>`_
according this.

If you want to see queued jobs, you need "Job Queue / Job Queue Manager"
permission in your user.

Usage
=====

* Go to *Invoicing > Sales > Documents > Customer Invoices* or
  *Invoicing > Purchases > Documents > Vendor Bills*.
* Mark at least one check on the left part of one draft invoice line in the
  list view.
* Click on *Action > Confirm Draft Invoice*.
* On the dialog popup that appears, click on "Enqueue Validation".
* If any of the selected invoices are not in draft state, you will receive
  an error.
* If any of the invoices is already enqueued, there will be a message saying
  so and avoiding to perform the process.
* Once enqueued, and having the "Job Queue Manager" permission, you can go to
  the invoice, and see the tab "Validation Jobs". A list with all the jobs
  related to that invoice can be found there.

Known issues / Roadmap
======================

* Allow to enqueue for validating invoices of different date.
* There's a chance that if you perform several enqueues of invoice validations
  from different dates, the order of the validated invoices, and thus, the
  number given for it, will result disordered.
* Standard procedure
* README updated
* Promoted to Production/Stable
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-invoicing-13.0/account-invoicing-13.0-account_invoice_validation_queued
Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-13-0/account-invoicing-13-0-account_invoice_validation_queued/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-invoicing-13.0/account-invoicing-13.0-account_invoice_validation_queued
Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-13-0/account-invoicing-13-0-account_invoice_validation_queued/
Having other m2m pointing to queue.job will make them to share the same table and
get akward results.

We avoid it specifying a table. It includes migration script for moving data from
one table to the other.
Currently translated at 100.0% (7 of 7 strings)

Translation: account-invoicing-13.0/account-invoicing-13.0-account_invoice_validation_queued
Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-13-0/account-invoicing-13-0-account_invoice_validation_queued/es/
@Saran440 Saran440 force-pushed the 16.0-mig-account_invoice_validation_queued branch from 44f652c to ce473b1 Compare September 23, 2024 09:39
@francesco-ooops
Copy link
Contributor

For the record, we edited this module internally by implementing the error message "You can't enqueue invoices with different dates." (seems to appear only in translation files at the moment) and forcing the user to validate invoices grouped by date (from older to newer in order to preserve sequence)

If date is not set in invoice, then "today" is used

@Saran440
Copy link
Member Author

@francesco-ooops I tested and I think this version can use invoice with multiple dates. if you find any bugs, please explain and provide the steps to reproduce the error, and we will fix it.

For this module, it runs 1 queue per document, so the sequence will function correctly.
I have removed the validation error in this module because I couldn't find a reason for check.

@adriapalleja I updated readme, please recheck.

@Saran440 Saran440 force-pushed the 16.0-mig-account_invoice_validation_queued branch from ce473b1 to e61d7ed Compare September 23, 2024 10:18
@francesco-ooops
Copy link
Contributor

@Saran440 if you're positive that enqueuing invoices with different dates results in invoice numbers following sequence correctly, then it's good for me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.