Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

DB table relating Partner and its Payment term

By
Bhavik
on 8/31/13, 7:21 AM 2,733 views

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

2

Ray Carnes

--Ray Carnes--
15677
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

Ray Carnes
On 8/31/13, 3:07 PM

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

1

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
1
cd
On 8/31/13, 10:04 AM

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

-1

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 8/31/13, 7:21 AM
Seen: 2733 times
Last updated: 4/29/15, 4:19 PM