Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
4878 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

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

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

Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
maj 17
9435
0
paź 24
980
2
sty 16
35711
0
mar 15
4682
2
mar 15
5602