Skip to content

Commit

Permalink
[FIX] delivery: description of the delivery method on SO line
Browse files Browse the repository at this point in the history
In this way the description of the delivery method can be used on a SO
line. If the description wasn't set, the name of the delivery method
will be used.

opw-1958029
  • Loading branch information
jpp-odoo committed Apr 10, 2019
1 parent 62f98e3 commit 610b813
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion addons/delivery/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,15 @@ def _create_delivery_line(self, carrier, price_unit):
taxes_ids = self.fiscal_position_id.map_tax(taxes, carrier.product_id, self.partner_id).ids

# Create the sales order line
carrier_with_partner_lang = carrier.with_context(lang=self.partner_id.lang)
if carrier_with_partner_lang.product_id.description_sale:
so_description = '%s: %s' % (carrier_with_partner_lang.name,
carrier_with_partner_lang.product_id.description_sale)
else:
so_description = carrier_with_partner_lang.name
values = {
'order_id': self.id,
'name': carrier.with_context(lang=self.partner_id.lang).name,
'name': so_description,
'product_uom_qty': 1,
'product_uom': carrier.product_id.uom_id.id,
'product_id': carrier.product_id.id,
Expand Down

0 comments on commit 610b813

Please sign in to comment.