-
-
Notifications
You must be signed in to change notification settings - Fork 700
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
[IMP] partner_invoicing_mode_at_shipping: Add grouping option per picking #1628
Conversation
6411388
to
3a09f2a
Compare
help="Check this if you want to create one invoice per picking using the" | ||
" partner invoicing mode that should be different than 'At Shipping'." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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." |
@api.constrains( | ||
"invoicing_mode", "one_invoice_per_picking", "one_invoice_per_order" | ||
) |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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
f9d0bce
to
2a59133
Compare
sales_to_validate_invoices = self.filtered( | ||
lambda sale: sale.one_invoice_per_shipping | ||
and any(invoice.state == "draft" for invoice in self.invoice_ids) | ||
) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
cfd6d90
to
d1b8048
Compare
False, | ||
) | ||
] | ||
openupgrade.add_fields(env, field_spec) |
There was a problem hiding this comment.
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
@rousseldenis dependency has been merged. Can you drop test-requirements.txt commit ? |
…cking' instead of related
…o 'shipping' instead of 'picking'
…ne_invoice_per_shipping' fill in / Use draft invoices.
…ng' option on res_partner view
…g to commercial_fields
d0388b1
to
4ecfde4
Compare
This PR has the |
@OCA/accounting-maintainers Could you merge this PR? |
@OCA/accounting-maintainers Gentle reminder |
…ing_validation function and add option auto validate invoice on partner
6a7de6c
to
4fab9f8
Compare
Hello @pedrobaeza, @sbidoul, one of you can merge this pr ? |
I don't use these modules, but merging it following current reviews: /ocabot merge minor |
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at 67b4b53. Thanks a lot for contributing to OCA. ❤️ |
Depends on :