Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
4924 Weergaven

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

Avatar
Annuleer
Beste antwoord

Hi,

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

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

Avatar
Annuleer
Beste antwoord

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.

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
mei 17
9459
0
okt. 24
993
2
jan. 16
35722
0
mrt. 15
4705
2
mrt. 15
5621