Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
11520 มุมมอง

Would like to know which table shows relation between partner and its payment term.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Using Developer Mode you can hover over any field to see the business object (model) details:

image description

This tells you the Customer Payment Term field is called property_payment_term and that it is a many2one field that relates the res.partner model (the model that holds the basic Customer information) with the account.payment.term model.

Property fields like this are stored in the ir_property model.

More about these kinds of fields at https://doc.openerp.com/trunk/server/03_module_dev_02/#property-fields

อวตาร
ละทิ้ง

Arrrrrrr! 1hour later .... "Property fields like this are stored in the ir_property model." ...cheers

คำตอบที่ดีที่สุด

Use this SQL


SELECT RP.NAME PARTNER, PT.NAME PAYMENT_TERM FROM IR_PROPERTY IP, RES_PARTNER RP, ACCOUNT_PAYMENT_TERM PT WHERE IP.NAME LIKE '%payment_term' AND CONCAT('res.partner,',RP.ID) = IP.RES_ID AND CONCAT('account.payment.term,',PT.ID) = IP.VALUE_REFERENCE
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

ACCOUNT_PAYMENT_TERM

id (ex 1)
name (ex 'Immediate payment')

RES_PARTNER

id = the ide of the partner

IR_PROPERTY

name="property payment term"
value_reference="account.payment.term," + the id of the account_payment__term (ex 1)
res_id = "res_partner," + the id the partner

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
มี.ค. 15
12852
0
ก.ค. 25
1609
2
พ.ย. 24
6761
2
ต.ค. 24
3661
2
ส.ค. 24
2092