[FIX] delivery: only update not yet processed pickings based on the n…
…ew carrier closes odoo/odoo#74419 X-original-commit: 3dce2fdea0060b1bc13bb35610b7fe01c71ef054 Signed-off-by: pimodoo <pimodoo@users.noreply.github.com> Signed-off-by: Wolfgang Taferner <wtaferner@users.noreply.github.com>
This commit is contained in:
committed by
Andrea Grazioso (agr-odoo)
parent
c157fb7474
commit
2cb678d4a1
@@ -994,6 +994,16 @@ msgstr ""
|
||||
msgid "Weight unit of measure label"
|
||||
msgstr ""
|
||||
|
||||
#. module: delivery
|
||||
#: code:addons/delivery/models/sale_order.py:0
|
||||
#, python-format
|
||||
msgid ""
|
||||
"You can not update the shipping costs on an order where it was already invoiced!\n"
|
||||
"\n"
|
||||
"The following delivery lines (product, invoiced quantity and price) have already been processed:\n"
|
||||
"\n"
|
||||
msgstr ""
|
||||
|
||||
#. module: delivery
|
||||
#: model_terms:ir.ui.view,arch_db:delivery.delivery_tracking_url_warning_form
|
||||
msgid "You have multiple tracker links, they are available in the chatter."
|
||||
|
||||
@@ -37,7 +37,16 @@ class SaleOrder(models.Model):
|
||||
self.recompute_delivery_price = True
|
||||
|
||||
def _remove_delivery_line(self):
|
||||
self.env['sale.order.line'].search([('order_id', 'in', self.ids), ('is_delivery', '=', True)]).unlink()
|
||||
delivery_lines = self.env['sale.order.line'].search([('order_id', 'in', self.ids), ('is_delivery', '=', True)])
|
||||
if not delivery_lines:
|
||||
return
|
||||
to_delete = delivery_lines.filtered(lambda x: x.qty_invoiced == 0)
|
||||
if not to_delete:
|
||||
raise UserError(
|
||||
_('You can not update the shipping costs on an order where it was already invoiced!\n\nThe following delivery lines (product, invoiced quantity and price) have already been processed:\n\n')
|
||||
+ '\n'.join(['- %s: %s x %s' % (line.product_id.with_context(display_default_code=False).display_name, line.qty_invoiced, line.price_unit) for line in delivery_lines])
|
||||
)
|
||||
to_delete.unlink()
|
||||
|
||||
def set_delivery_line(self, carrier, amount):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user