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

The changes made in create and write of inherited res_partner should affect only the customer and not the supplier and user.

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

Hi,

There is only one object "res.partner" which manage customer and supplier.

Email : info@acespritech.com
Skype : acespritech
Blog : acespritechblog.wordpress.com

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

Customer, supplier and user (and maybe other 'persons') use the same model 'res.partner'. In order for your model to only do something different for customer, you should ask in your write and your create, if the res.partner you are in, is a customer.

Some quick and dirty code:

def create(.....):
    partner = pool.get(id)
    if partner.is_customer and not partner.supplier:
        do your code here
    else:
        res = super(self, res.partner).create(.....)

The same goes for write.

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
مايو 17
9422
0
أكتوبر 24
976
2
يناير 16
35705
0
مارس 15
4678
2
مارس 15
5600