mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[FIX] delivery_hibou: context on button inside tree view for cancel, price can be Decimal
This commit is contained in:
@@ -12,7 +12,12 @@ class StockQuantPackage(models.Model):
|
||||
picking_id = self._context.get('active_id')
|
||||
picking_model = self._context.get('active_model')
|
||||
if not picking_id or picking_model != 'stock.picking':
|
||||
raise UserError('Cannot cancel package other than through shipment/picking.')
|
||||
params = self._context.get('params')
|
||||
if params:
|
||||
picking_id = params.get('id')
|
||||
picking_model = params.get('model')
|
||||
if not picking_id or picking_model != 'stock.picking':
|
||||
raise UserError('Cannot cancel package other than through shipment/picking.')
|
||||
return self.env['stock.picking'].browse(picking_id)
|
||||
|
||||
def send_to_shipper(self):
|
||||
@@ -116,7 +121,7 @@ class StockPicking(models.Model):
|
||||
res = res[0]
|
||||
if carrier.free_over and self.sale_id and self.sale_id._compute_amount_total_without_delivery() >= carrier.amount:
|
||||
res['exact_price'] = 0.0
|
||||
carrier_price = res['exact_price'] * (1.0 + (self.carrier_id.margin / 100.0))
|
||||
carrier_price = float(res['exact_price']) * (1.0 + (self.carrier_id.margin / 100.0))
|
||||
carrier_prices.append(carrier_price)
|
||||
tracking_number = ''
|
||||
if res['tracking_number']:
|
||||
|
||||
Reference in New Issue
Block a user