Permalink
Browse files
fixup! [REF] delivery: new delivery carrier wizard
Loading branch information...
@@ -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)
Toggle all file notes
0 comments on commit
d8eaa21