Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
1326 Lượt xem

I need to make a module to modify the data that is sent to dhl, then I need to inherit from the class:


class DHLProvider():


It is not a normal and ordinary model, so the way I did to inherit from it is by inheriting the class, but I cannot find the path of the module which is located in the enterprise folder


This is what I have tried:


from odoo.enterprise.delivery_dhl.dhl_request import DHLProvider

from odoo.addons.enterprise.delivery_dhl.dhl_request import DHLProvider

from odoo.delivery_dhl.dhl_request import DHLProvider

from enterprise.delivery_dhl.dhl_request import DHLProvider

from delivery_dhl.dhl_request import DHLProvider


class CustomDHLProvider(DHLProvider):

But I couldn't find it.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,
You can try as follows:

from odoo.addons.delivery_dhl.dhl_request import DHLProvider


Thanks

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

can you give more details pls

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

The route worked, thank you very much. Now how could I inherit from this class.

from .dhl_request import DHLProvider

from odoo.tools.zeep.helpers import serialize_object

from odoo import api, models, fields, _

from odoo.exceptions import UserError

from odoo.tools import float_repr

from odoo.tools.safe_eval import const_eval


class Providerdhl(models.Model):

    _inherit = 'delivery.carrier'


    def dhl_send_shipping(self, pickings):

I tried this.

from .dhl_request import CustomDHLProviderfrom odoo import models, fields, _

class Providerdhl(models.Model): 

    _inherit = 'provider.dhl'

    def dhl_send_shipping(self, pickings):

but since it is not a model I cannot inherit with _inherit

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 10 24
885
0
thg 10 24
1039
1
thg 3 15
6723
4
thg 5 16
7920
3
thg 5 16
4366