odoo 11企业联邦快递获得多种运费

时间:2018-01-03 09:40:53

标签: web-services enterprise shipping fedex odoo-11

加拿大的航运公司整合:

enter image description here

提前抱歉如果我在这篇文章中犯了任何错误,因为这是我的第一次。

我最初要做的是:

  1. 已为加拿大邮政,Purolator和FedEx创建了3个模块,其中有One2many的选股表格视图,并点击当前发货的获取费率(包装部分未完成,请忽略。请检查图像为Purolator部分)< / LI>
  2. 使用odoo 11企业版的默认delivery_fedex模块并修改其_fedex_get_rate()方法,以便获得所有服务的费率(使用gst,hst等)
  3. 对于FedEx,公司地址来自加拿大,客户来自美国/国际地址。
  4. 那么,在我的FedEx模块中我应该更改哪些内容和哪里可以获取多个费率?

    方法我试图写入stock.picking以获得按钮上的费率:

    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)
    

0 个答案:

没有答案