mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[IMP] delivery_ups_hibou: multi-rating backports from 14.0
This commit is contained in:
@@ -1 +1,3 @@
|
|||||||
|
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||||
|
|
||||||
from . import models
|
from . import models
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
'name': 'Hibou UPS Shipping',
|
'name': 'Hibou UPS Shipping',
|
||||||
'version': '12.0.1.0.0',
|
'version': '12.0.1.1.0',
|
||||||
'category': 'Stock',
|
'category': 'Stock',
|
||||||
'author': "Hibou Corp.",
|
'author': "Hibou Corp.",
|
||||||
'license': 'AGPL-3',
|
'license': 'OPL-1',
|
||||||
'website': 'https://hibou.io/',
|
'website': 'https://hibou.io/',
|
||||||
'depends': [
|
'depends': [
|
||||||
'delivery_ups',
|
'delivery_ups',
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
|
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||||
|
|
||||||
from . import delivery_ups
|
from . import delivery_ups
|
||||||
from . import ups_request_patch
|
from . import ups_request_patch
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||||
|
|
||||||
from odoo import api, fields, models, _
|
from odoo import api, fields, models, _
|
||||||
from odoo.exceptions import UserError, ValidationError
|
from odoo.exceptions import UserError, ValidationError
|
||||||
from odoo.addons.delivery_ups.models.ups_request import UPSRequest, Package
|
from odoo.addons.delivery_ups.models.ups_request import UPSRequest, Package
|
||||||
@@ -219,7 +221,17 @@ class ProviderUPS(models.Model):
|
|||||||
res = res + [shipping_data]
|
res = res + [shipping_data]
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def ups_rate_shipment_multi(self, order=None, picking=None):
|
def ups_rate_shipment_multi(self, order=None, picking=None, packages=None):
|
||||||
|
if not packages:
|
||||||
|
return self._ups_rate_shipment_multi_package(order=order, picking=picking)
|
||||||
|
else:
|
||||||
|
rates = []
|
||||||
|
for package in packages:
|
||||||
|
rates += self._ups_rate_shipment_multi_package(order=order, picking=picking, package=package)
|
||||||
|
return rates
|
||||||
|
|
||||||
|
def _ups_rate_shipment_multi_package(self, order=None, picking=None, package=None):
|
||||||
|
# TODO package here is ignored, it should not be (UPS is not multi-rating capable until we can get rates for a single package)
|
||||||
superself = self.sudo()
|
superself = self.sudo()
|
||||||
srm = UPSRequest(self.log_xml, superself.ups_username, superself.ups_passwd, superself.ups_shipper_number, superself.ups_access_number, self.prod_environment)
|
srm = UPSRequest(self.log_xml, superself.ups_username, superself.ups_passwd, superself.ups_shipper_number, superself.ups_access_number, self.prod_environment)
|
||||||
ResCurrency = self.env['res.currency']
|
ResCurrency = self.env['res.currency']
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# Part of Hibou Suite Professional. See LICENSE_PROFESSIONAL file for full copyright and licensing details.
|
||||||
|
|
||||||
import suds
|
import suds
|
||||||
from odoo.addons.delivery_ups.models.ups_request import UPSRequest
|
from odoo.addons.delivery_ups.models.ups_request import UPSRequest
|
||||||
import logging
|
import logging
|
||||||
|
|||||||
Reference in New Issue
Block a user