コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
4870 ビュー

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

アバター
破棄
最善の回答

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
9429
0
10月 24
978
2
1月 16
35707
0
3月 15
4680
2
3月 15
5600