Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
5510 Visualizzazioni

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

Avatar
Abbandona
Risposta migliore

Hi,

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

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

Avatar
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
mag 17
10041
0
ott 24
1477
2
gen 16
36483
0
mar 15
5212
2
mar 15
6144