تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
1429 أدوات العرض

Morning, it has been a long weekend and I'm probably just missing something obvious but I would appreciate the assistance.

I'm attempting to override the method _prepare_invoice_line to change the generated description for subscription recurring invoices. To do this, I've tried to import SaleOrderLine from sale_order_line.py in the subscription module using the method described in  Override and Change the middle of a function | Odoo

and in  Override an inherited function | Odoo but for some reason I just can't get the inherit to work.

In my custom module I have the line

from sale_subscription.models.sale_order_line import SaleOrderLine as OriginalSaleOrderLine

but when I try to build I receive the error

File "/home/odoo/src/user/external_reality/models/custom_subscriptions.py", line 8, in

from sale_subscription.models.sale_order_line import SaleOrderLine as OriginalSaleOrderLine

ModuleNotFoundError: No module named 'sale_subscription' 


What am I missing here? I'm certain it's something straightforward, but I just can't figure it out.


Many thanks,

Richard

الصورة الرمزية
إهمال
أفضل إجابة

Hi,
can you ensure the sale_subscription is added in the depends of your module.
Thanks

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
نوفمبر 24
750
1
أكتوبر 24
591
0
أكتوبر 24
829
0
ديسمبر 23
1225
4
مايو 25
2533