加拿大的航运公司整合:
提前抱歉如果我在这篇文章中犯了任何错误,因为这是我的第一次。
我最初要做的是:
那么,在我的FedEx模块中我应该更改哪些内容和哪里可以获取多个费率?
def get_fedexrule_schema(self):
fedex_search = self.env['delivery.carrier'].search([('delivery_type','=','fedex'),('name','=','Fedex US')])
picking = self.env['stock.picking']
cache_interval = int(time.time() / (4 * 3600))
print('fffffffff',fedex_search)
# self, environment, account_number, meter_number, droppoff_type, service_type,
# package_code, weight_unit, fedex_saturday_delivery, order_name, currency_name,
# shipper_company, shipper_warehouse, recipient, weight, max_weight,
# current_fed = fedex_search.id
# , , meter_number, droppoff_type, service_type,
# package_code, weight_unit, fedex_saturday_delivery, order_name, currency_name,
# shipper_company, shipper_warehouse, recipient, weight, max_weight
# print('>>>>>>>>>>>>>>>>>',current_fed.environment)
fedex_developer_key =fedex_search.fedex_developer_key
fedex_developer_password =fedex_search.fedex_developer_password
fedex_account_number =fedex_search.fedex_account_number
fedex_meter_number =fedex_search.fedex_meter_number
fedex_droppoff_type =fedex_search.fedex_droppoff_type
fedex_default_packaging_id =fedex_search.fedex_default_packaging_id
fedex_service_type =fedex_search.fedex_service_type
fedex_weight_unit =fedex_search.fedex_weight_unit
fedex_label_stock_type =fedex_search.fedex_label_stock_type
fedex_label_file_type =fedex_search.fedex_label_file_type
fedex_saturday_delivery =fedex_search.fedex_saturday_delivery
order_name= self.sale_id.name
currency_name= self.sale_id.currency_id.name
# fed_ =fedex_search.order_name)
# print('>>>>>>>>>>>>>>>>>',fedex_search.currency_name)
shipper_company=(self.company_id.partner_id.id,self.company_id.partner_id['__last_update'])
shipper_warehouse = (self.picking_type_id.warehouse_id.partner_id.id,self.picking_type_id.warehouse_id.partner_id['__last_update'])
recipient = (self.partner_id.id,self.partner_id['__last_update'])
fedex_rate= self.env['delivery.carrier']._fedex_get_rate('test', fedex_account_number, fedex_meter_number, fedex_droppoff_type,fedex_default_packaging_id.id,fedex_service_type,
fedex_weight_unit, True, order_name, currency_name,shipper_company, shipper_warehouse, recipient, 10,20,cache_interval)
print("fedex_rate>>>>>>>>",fedex_rate)