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

[MIG] account invoicing mode: Migration to 14.0 #844

Closed
wants to merge 16 commits into from

Conversation

phuctranfxvn
Copy link
Contributor

This PR includes migration of 3 modules from this PR #755:

  • account_invoice_base_invoicing_mode
  • account_invoice_mode_at_shipping
  • account_invoice_mode_monthly

TDu and others added 16 commits January 10, 2021 19:20
Add three modules helping on automatically invoicing customers.

The base module `account_invoice_base_invoicing_mode` does not actually
do anything but adds a selection field on partner to allow assigning an
invoicing mode to a customer. And a checkbox to choose regrouping
invoices.

The two other modules add specific invoicing mode.

The module `account_invoice_mode_monthly` creates monthly invoices for
customer on a specific day (configuration is in Accounting Settings)

The module `account_invoice_mode_at_shipping` creates invoices on the
shipping of the goods.

Those modules use queue_job to generate and validate invoices.
Add few changes from reviews.
Use sudo to post the invoice.
Add three modules helping on automatically invoicing customers.

The base module `account_invoice_base_invoicing_mode` does not actually
do anything but adds a selection field on partner to allow assigning an
invoicing mode to a customer. And a checkbox to choose regrouping
invoices.

The two other modules add specific invoicing mode.

The module `account_invoice_mode_monthly` creates monthly invoices for
customer on a specific day (configuration is in Accounting Settings)

The module `account_invoice_mode_at_shipping` creates invoices on the
shipping of the goods.

Those modules use queue_job to generate and validate invoices.
Sales order with different payment term are not grouped into the
same invoice anymore.
This grouping can be easily changed by overriding the coresponding
method.

During this change the parameter of the job generating the invoices
has changes and is now the sale_order_ids to process.
Add few changes from reviews.
Use sudo to post the invoice.
Add three modules helping on automatically invoicing customers.

The base module `account_invoice_base_invoicing_mode` does not actually
do anything but adds a selection field on partner to allow assigning an
invoicing mode to a customer. And a checkbox to choose regrouping
invoices.

The two other modules add specific invoicing mode.

The module `account_invoice_mode_monthly` creates monthly invoices for
customer on a specific day (configuration is in Accounting Settings)

The module `account_invoice_mode_at_shipping` creates invoices on the
shipping of the goods.

Those modules use queue_job to generate and validate invoices.
If we group several sales in the same procurement group, we'll invoice
only one sale order. Tracing back to the sales through the stock moves
ensure we invoice all of them.
Add few changes from reviews.
Use sudo to post the invoice.
@phuctranfxvn phuctranfxvn force-pushed the 14.0-mig-invoicing-mode branch from 7587dd8 to 932053f Compare January 11, 2021 14:24
@fshah-initos
Copy link

Hi @phuctranerp
Please create seperate PR for other modules we use only one module in a PR.

@tarbib
Copy link

tarbib commented Jun 9, 2021

Hello @TDu could you please review the PR? cc @jgrandguillaume

for picking in self:
if picking._invoice_at_shipping():
picking.with_delay()._invoicing_at_shipping()
return res

def _invoice_at_shipping(self):
"""Check if picking must be invoiced at shipping."""
"""Check if picking must be invoiced at shippin`g."""
Copy link
Member

Choose a reason for hiding this comment

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

"""Check if picking must be invoiced at shipping."""

Copy link
Member

@TDu TDu left a comment

Choose a reason for hiding this comment

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

LG, thanks for the migration.

@TDu
Copy link
Member

TDu commented Jun 16, 2021

Hi @phuctranerp
Please create seperate PR for other modules we use only one module in a PR.

I think it is good like this in one PR, because they are tightly related.
And this is how they have been proposed for v13, where they have not been merged.

@tarbib
Copy link

tarbib commented Jun 23, 2021

@TDu Hello, I just tested it on v14 but there's an issue :
Commercial partner : Company A => invoicing mode : at shipping
Contact : Company A, Contact 1 => accounting tab says that configuration is done on the parent.
If the partner_invoice_id from the SO is a contact then we do not have automatic invoicing at shipping.
The contact should inherit the value from the commercial partner.
Can you please take this case into consideration? cc @jcoux

@TDu
Copy link
Member

TDu commented Jun 24, 2021

@tarbib Indeed the fields should be added to the commercial_fields of the res.partner
Something like this on the res.partner model

@api.model
def _commercial_fields(self):
         return super()._commercial_fields() + [
             "invoicing_mode",
             "one_invoice_per_order",
         ]                  

That would be a good addition to those modules

Copy link
Contributor

@simahawk simahawk left a comment

Choose a reason for hiding this comment

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

please rebase (well, replay all commits) on v13.0 as @TDu squashed commits.

@simahawk
Copy link
Contributor

simahawk commented Aug 3, 2021

@phuctranerp if you preferer we can merge 13.0 version in 14.0 and make it uninstallable as we've done for postlogistics PR 😉

@simahawk
Copy link
Contributor

simahawk commented Aug 3, 2021

#983

@simahawk simahawk closed this Aug 3, 2021
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.

6 participants