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

[9.0][sale_automatic_workflow]Add possibility to invoice service automatically on delivery #342

Conversation

florian-dacosta
Copy link
Contributor

The case is when I want to automatically invoice my sale orders at delivery.
Product service must be marked as shipped manually, but when we use sale automatic workflow, we do not want to make manual actions.

So I propose to add an option to automatically fill delivered quantity on sale order line if the product is a service. It will be automatically filled during the first invoice creation.
One comon use case is the shipping fee, we want to invoice it together with the other products.

@guewen

@atchuthan
Copy link
Member

Runbot tested 👍

@pedrobaeza pedrobaeza merged commit 2168195 into OCA:9.0 Oct 12, 2016
if not order.workflow_process_id.invoice_service_delivery:
continue
for line in order.order_line:
if line.qty_delivered_updateable and not line.qty_delivered:
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't be a check on the type of product being service?

Copy link
Member

@StefanRijnhart StefanRijnhart Oct 12, 2016

Choose a reason for hiding this comment

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

This is implicit in the definition of qty_delivered_updateable: it is only true for service products which are invoiced manually (so not through tasks).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed the computation of the field check it already :
https://github.com/OCA/OCB/blob/9.0/addons/sale_stock/sale_stock.py#L123

So I think there is no need to double check it here, but I am not especially against if you think it may be usefull.

Copy link
Member

Choose a reason for hiding this comment

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

I should have checked what was qty_delivered_updateable (name is not self-explanatory). Sorry for the trouble.

Copy link
Member

Choose a reason for hiding this comment

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

No, it's a valid question. I had to look it up as well during the review, so I could have mentioned this observation in my review, or maybe a code comment would have been helpful. Next time!

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.

None yet

5 participants