Permalink
Browse files

fixup! [REF] delivery: new delivery carrier wizard

  • Loading branch information...
Whenrow committed Feb 11, 2019
1 parent c0e64d7 commit d8eaa21a13945525773d1c25a128c3df8bd67cfd
Showing with 4 additions and 2 deletions.
  1. +2 −2 addons/delivery/models/sale_order.py
  2. +2 −0 addons/website_sale_delivery/models/sale_order.py
@@ -11,7 +11,7 @@ class SaleOrder(models.Model):

carrier_id = fields.Many2one('delivery.carrier', string="Delivery Method", help="Fill this field if you plan to invoice the shipping based on picking.")
delivery_message = fields.Char(readonly=True, copy=False)
delivery_rating_success = fields.Boolean(copy=False, default=True)
delivery_rating_success = fields.Boolean(copy=False)
invoice_shipping_on_delivery = fields.Boolean(string="Invoice Shipping on Delivery", copy=False)
delivery_set = fields.Boolean(compute='_compute_delivery_state')
recompute_delivery_price = fields.Boolean('Delivery cost should be recomputed')
@@ -54,7 +54,7 @@ def set_delivery_line(self, carrier, amount):
if order.state not in ('draft', 'sent'):
raise UserError(_('You can add delivery price only on unconfirmed quotations.'))
else:
order._create_delivery_line(carrier, amount)
order._create_delivery_line(carrier, amount, price_unit_in_description=self.carrier_id.invoice_policy == 'Real')
return True

def action_open_delivery_wizard(self):
@@ -70,6 +70,8 @@ def _check_carrier_quotation(self, force_carrier_id=None):
res = carrier.rate_shipment(self)
if res['success']:
self.set_delivery_line(carrier, res['price'])
else:
self.delivery_rating_success = False

return bool(carrier)

0 comments on commit d8eaa21

Please sign in to comment.