The changes made in create and write of inherited res_partner should affect only the customer and not the supplier and user.
Această întrebare a fost marcată
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.
Îți place discuția? Nu doar citi, alătură-te!
Creează-ți un cont astăzi pentru a beneficia de funcții exclusive și a interacționa cu minunata noastră comunitate!
Înscrie-te| Postări similare | Răspunsuri | Vizualizări | Activitate | |
|---|---|---|---|---|
|
|
2
mai 17
|
11581 | ||
|
|
1
oct. 25
|
2925 | ||
|
update fields on write() method
Rezolvat
|
|
2
ian. 16
|
38655 | |
|
|
0
mar. 15
|
6568 | ||
|
|
2
mar. 15
|
7315 |