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

[IMP] partner_invoicing_mode_at_shipping: Add grouping option per picking #1628

Merged

Conversation

rousseldenis
Copy link
Contributor

@rousseldenis rousseldenis force-pushed the 16.0-imp-account_invoicing_mode_at_shipping-dro branch from 6411388 to 3a09f2a Compare December 18, 2023 14:10
Comment on lines 17 to 18
help="Check this if you want to create one invoice per picking using the"
" partner invoicing mode that should be different than 'At Shipping'."

Choose a reason for hiding this comment

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

Suggested change
help="Check this if you want to create one invoice per picking using the"
" partner invoicing mode that should be different than 'At Shipping'."
help="Check this if you want to create one invoice per delivery. The invoice will be generated at shipping"
" but will remain draft. The automatic validation can then be managed by the invoicing mode."

Comment on lines 21 to 30
@api.constrains(
"invoicing_mode", "one_invoice_per_picking", "one_invoice_per_order"
)

Choose a reason for hiding this comment

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

Why not making one_invoice_per_shipping computed store=True and set it False when invoicing_mode is "At shipping" or one_invoice_per_order is set ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that could be an improvement yes

Comment on lines 27 to 30
sales_to_validate_invoices = self.filtered(
lambda sale: sale.one_invoice_per_shipping
and any(invoice.state == "draft" for invoice in self.invoice_ids)
)

Choose a reason for hiding this comment

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

@rousseldenis But if the invoice is already created and in draft, then the sale is not anymore in status "to invoice" and will be excluded from self with _get_generate_invoices_state_domain.

How can you enter this method? I think you won't even have a job for such sales

Choose a reason for hiding this comment

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

The validation of those is already tackled by your _validate_per_shipping_generated_invoices, then I don't get why you need this hook ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I check this. It was part of the former implementation.

@rousseldenis rousseldenis force-pushed the 16.0-imp-account_invoicing_mode_at_shipping-dro branch from cfd6d90 to d1b8048 Compare December 22, 2023 13:54
False,
)
]
openupgrade.add_fields(env, field_spec)

Choose a reason for hiding this comment

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

requires openupgradelib >= 3.5.1

@jbaudoux
Copy link

@rousseldenis dependency has been merged. Can you drop test-requirements.txt commit ?

@rousseldenis rousseldenis force-pushed the 16.0-imp-account_invoicing_mode_at_shipping-dro branch from d0388b1 to 4ecfde4 Compare May 28, 2024 08:20
@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@jbaudoux
Copy link

jbaudoux commented Jun 4, 2024

@OCA/accounting-maintainers Could you merge this PR?

@rousseldenis
Copy link
Contributor Author

@OCA/accounting-maintainers Gentle reminder

…ing_validation function and add option auto validate invoice on partner
@rousseldenis rousseldenis force-pushed the 16.0-imp-account_invoicing_mode_at_shipping-dro branch from 6a7de6c to 4fab9f8 Compare June 14, 2024 07:41
@cyrilmanuel
Copy link

Hello @pedrobaeza, @sbidoul, one of you can merge this pr ?

@pedrobaeza
Copy link
Member

I don't use these modules, but merging it following current reviews:

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-1628-by-pedrobaeza-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 792091f into OCA:16.0 Jun 27, 2024
11 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 67b4b53. Thanks a lot for contributing to OCA. ❤️

@sbidoul sbidoul deleted the 16.0-imp-account_invoicing_mode_at_shipping-dro branch June 27, 2024 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants