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
- Accounting
- Inventory
- PoS
- Project
- MRP
This question has been flagged
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.
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
2
May 17
|
9416 | ||
|
0
Oct 24
|
976 | ||
|
2
Jan 16
|
35703 | ||
|
0
Mar 15
|
4676 | ||
|
2
Mar 15
|
5598 |