The changes made in create and write of inherited res_partner should affect only the customer and not the supplier and user.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilità
- Magazzino
- PoS
- Project
- MRP
La domanda è stata contrassegnata
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.
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
RegistratiPost correlati | Risposte | Visualizzazioni | Attività | |
---|---|---|---|---|
|
2
mag 17
|
9422 | ||
|
0
ott 24
|
976 | ||
update fields on write() method
Risolto
|
|
2
gen 16
|
35705 | |
|
0
mar 15
|
4678 | ||
|
2
mar 15
|
5600 |