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:
- 客户关系管理
- e-Commerce
- 会计
- 库存
- PoS
- Project
- MRP
此问题已终结
2
回复
4863
查看
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.
相关帖文 | 回复 | 查看 | 活动 | |
---|---|---|---|---|
|
2
5月 17
|
9424 | ||
|
0
10月 24
|
977 | ||
|
2
1月 16
|
35706 | ||
|
0
3月 15
|
4679 | ||
|
2
3月 15
|
5600 |