Odoo Help

1

Default payment terms

By
Tor Asbjørn
on 5/7/13, 10:36 AM 7,324 views

Where can I set the default payment term to use, insted of blank?

4
Jignesh Mehta
On 10/23/15, 5:30 AM

Hello Tor,


If you want same payment term in all the customers by default, you have to add following code in your python file.


class res_partner(osv.Model):

     _inherit = "res.partner"


     _defaults = {

        'property_payment_term' : '15 Days'

     }


Its for 15 Days, you can set another one as of your choice.


Thanks,

Good point, but coding in this case is not needed, thanks to the flexibility of Odoo. Dealing with default parameters from the interface (or XML records) is more maintainable than dealing with code that overrides base models (plus, you are using old API).

Raffaele
on 10/23/15, 5:33 AM

Yes, i agree with you. but in this you have to do the same for all databases manually so isn't code is more flexible than this.

Jignesh Mehta
on 10/23/15, 5:43 AM
2
Raffaele
On 10/23/15, 5:26 AM

Late reply, but the question is still valid.

In Odoo 8, for setting the default customer payment term to the "30 Days Net" value, for every company, for any customer:

From web client: Settings > Technical > Parameters > Company Properties

Create new

Name: property_payment_term
Field: (choose) Customer Payment Term
Resource: [leave empty]
Value: account.payment.term,3
Company: [leave empty]

Via data file:

<record id="payment_term_default_30" model="ir.property">
<field name="name">property_payment_term</field>
<field name="fields_id" search="[('model','=','res.partner'),('name','=','property_payment_term')]" />
<field name="value">account.payment.term,3</field>
</record>

As previously pointed out by Priyesh Solanki (pso), leaving blank the resource and the company makes the value in "Value" field as default for any instance ("document" in Odoo lexicon) of the model that the field ("Customer Payment Term", in this case) is referred to (res.partner, in this case). 

2

I am assuming that you want to set default payment term in Partner form. In Partner, You will find Customer Payment Term and Supplier Payment Term.

If it is, Go to Settings --> Technical --> Parameters --> Configuration Parameters. For Customer Payment Term, create a new record with this name 'property_payment_term' and set related field, company, object and value, you want to show as default in that field. For Supplier Payment Term, create a new record with this name 'property_supplier_payment_term' and set related field, company, object and value, you want to show as default in that field.

Make sure You are not selecting any resource (Partner/Product) otherwise it will be come for that particular resource value.

Thanks, Priyesh Solanki

How its work??

Ashish Singh
on 11/15/14, 12:47 AM
0
Mike
On 7/28/17, 6:16 PM

You need to have the Accounting module installed and have developer mode enabled. Then go to Accounting > Configuration > Management > Payment Terms. Here you can edit existing terms or create new ones. 

0
Alberto Lozano
On 11/23/15, 12:21 PM

Default sales order payment term Odoo 9.0

This will set a default payment term for any customer that does not have a default payment term on they properties:

1. Edit sale.py SaleOrder class at def onchange_partner_id(self) section, where you find the following line:

'payment_term_id': self.partner_id.property_payment_term_id and self.partner_id.property_payment_term_id.id or False

and replace False for 1 so it will look like:

'payment_term_id': self.partner_id.property_payment_term_id and self.partner_id.property_payment_term_id.id or 1

This will make default the first option defined as payment term in Accounting - Configuration - Management - Payment terms if there is no default payment term assigned for that customer. You can also replace False for 'whatever you want as payment term'

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 5/7/13, 10:36 AM
Seen: 7324 times
Last updated: 7/28/17, 6:16 PM