payment_term_line_ids
Sixteen lines of code to fix one annoyance: a new payment term line vanishing because the user clicked somewhere else before typing anything.
| Technical name | payment_term_line_ids |
|---|---|
| Field types | one2many, many2many |
| Views | form, with an embedded list |
| Module | account, present wherever Invoicing or Accounting is installed |
| Used in core | 1 occurrence, the installment lines on the payment terms form in account |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0 |
| No-code setup | No. It is a view XML widget with a single behavioral change |
| Alternatives | one2many, many2many, section_one2many, handle |
What the payment term lines does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
editable | string (list attribute) | Set on the embedded <list> element. The core payment terms form uses bottom so new installment lines are typed at the end. |
create | boolean (list attribute) | Set on the embedded <list> element. Turning it off removes the add link, which also removes the situation this widget exists for.(default: true) |
delete | boolean (list attribute) | Set on the embedded <list> element. Rows kept alive by this widget still have to be deletable on purpose.(default: true) |
The behavior is not configurable. Marking new rows as modified is hardcoded, with no option to switch it off. If you want the standard abandon behavior on a list, use the plain one2many widget.
Working examples
Why an empty update is not a no-op
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. Byte-identical to Odoo 19 on the development branch. |
| Odoo 19.0 | Verified | Verified against the shipped source. Unchanged in substance since Odoo 17. |
| Odoo 18.0 | Verified | Identical behavior. |
| Odoo 17.0 | Verified | First version. |
| Odoo 16.0 | Not available | Widget does not exist. The payment terms form used a plain relational field. |
Upgrade note. Nothing to do. The widget appeared in Odoo 17 and the file is unchanged in substance through Odoo 19, differing only by the module marker comment that Odoo 19 dropped everywhere. Databases on Odoo 16 used a plain relational field on the payment terms form, so the behavior arrives with the standard views on upgrade.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| New rows still disappear | The field is not actually using this widget, most often because an inherited view replaced it. Check the effective view for widget="payment_term_line_ids" on the field. |
| Empty rows accumulate | Expected consequence. Rows are no longer discarded automatically, so unwanted ones must be deleted. Delete the row explicitly, or use the plain one2many widget if the abandon rule suits that list better. |
| The form is dirty as soon as I add a line | Intended. The empty update marks the record as modified, which is what keeps it alive. |
| Validation errors on save about empty lines | A row was created and never filled, and it is now saved along with the rest. Delete the unwanted row before saving. |
| Missing widget error | The accounting module is not installed in that database. Install Invoicing or Accounting, or use the plain one2many widget. |
Payment term lines vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
payment_term_line_ids | Editable lists whose new rows are already useful as created | Marks every new inline row as modified so Odoo does not discard it when focus moves away |
| one2many | Most embedded lists | Keeps the standard rule that an untouched new row is abandoned |
| many2many | Linking existing records rather than creating them | Adds and removes links, so the abandon question does not arise |
| section_one2many | Lists that need section rows | Structural rendering rather than record lifecycle |
| handle | Reordering rows | A single column widget, unrelated to creation |
Frequently asked questions
What problem does payment_term_line_ids solve?+
How does it keep the row?+
Does it save the row?+
Can I use it on my own list?+
Does it support options?+
Payment terms that match how you actually get paid
Installments, early payment discounts and the reminders around them decide how long your cash sits with customers. We configure Odoo payment terms and the follow-up flow that goes with them, on versions 16 through 19.
Book a free consultation