-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[14.0][ADD] sale_line_service_qty_delivered: Set qty_delivered of service lines #2717
base: 14.0
Are you sure you want to change the base?
[14.0][ADD] sale_line_service_qty_delivered: Set qty_delivered of service lines #2717
Conversation
9b3ae8c
to
77d707a
Compare
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.
AFAIS
https://github.com/OCA/delivery-carrier/blob/14.0/delivery_auto_refresh/models/stock_picking.py
solves the similar issue of the delivery update on outgoing picking done
Not really. |
@mt-software-de What's the status of this ? |
205db9c
to
3382d99
Compare
…ines As soon as a sale.order.line is delivered the qty_delivered of the siblings service lines is set to its max qty
3382d99
to
bddf437
Compare
bddf437
to
867cbc9
Compare
I checked the failing tests, they were coming from Also check the code of the new addon. @vuwnevska @jbaudoux @rousseldenis |
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.
It looks to me that you do what is in standard (at least in v16).
If you configure the delivery service as invoiced at order, then it will be invoiced as soon as there is a stock line delivered.
def _get_invoice_status(self): | ||
super()._get_invoice_status() | ||
to_invoice_state = "to invoice" | ||
for order in self: | ||
if order.state not in ("sale", "done"): | ||
continue | ||
if order.invoice_status != "no": | ||
continue | ||
if any( | ||
line._is_delivered_method_delivery() | ||
and line.invoice_status == to_invoice_state | ||
for line in order.order_line | ||
): | ||
order.invoice_status = to_invoice_state |
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.
This has nothing to do with the module purpose ??
In standard, a SO is not to invoice
if only the delivery line is to invoice. This should not be changed. You need at least another line to invoice to be able to invoice the SO
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.
For lines which are is_delivery and invoice_policy == 'delivery' and type == 'service' they should only be invoice when something is shipped.
But for Service Products which are not added via deliver costs so is_delivery == False and invoice_policy == 'delivery' and type == 'service' it should be possible to invoice if there are no other sale.order.lines.
I will extend it.
def _is_delivered_method_delivery(self): | ||
self.ensure_one() | ||
return ( | ||
self.product_id.type == "service" |
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.
All service lines?
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.
no not all, only if the invoice_policy
of the product is delivery
As soon as a sale.order.line is delivered
the qty_delivered of the siblings service lines
is set to its max qty