Skip to Content
Menu
This question has been flagged
2 Replies
1839 Views

Coming from v13 community to v17 enterprise. Wondering why there is no payment method field included in the invoices.


There are many ways in which a client can pay an invoice, one is where the company needs to start the process (SEPA debit). When preparing the batch payment, how would I filter those invoices I need to include if there is no payment method in the invoice itself!


Avatar
Discard
Best Answer

In Odoo 17 Enterprise, the payment method field isn't displayed by default on invoices because the system assumes that payment processing is managed via journal entries and bank reconciliation workflows. However, it is possible to customize this behavior to match your needs, especially for tasks like preparing SEPA debit payments.

Below are solutions to enable the payment method on invoices and filter invoices for batch payments:

1. Enable Payment Method on Invoices

Option 1: Use the Payment Journal as an Indicator

In Odoo, the Payment Journal field on the invoice represents where payments are processed. You can leverage this to specify payment methods indirectly.

Option 2: Add a Payment Method Field

You can add a custom field for Payment Method directly on the invoice form using either Odoo Studio or a custom module.

Using Odoo Studio:
  1. Go to Invoicing > Customers > Invoices.
  2. Open Odoo Studio.
  3. Drag and drop a Selection Field into the invoice form.
  4. Define the selection options for your payment methods:
    • SEPA Debit
    • Bank Transfer
    • Credit Card
    • Cash, etc.
  5. Save and apply your changes.
Using a Custom Module:

If you prefer coding, here’s how to add a payment_method field to the invoice (account.move) model:

pythonCopy codefrom odoo import models, fields

class AccountMove(models.Model):
    _inherit = 'account.move'

    payment_method = fields.Selection([
        ('sepa_debit', 'SEPA Debit'),
        ('bank_transfer', 'Bank Transfer'),
        ('credit_card', 'Credit Card'),
        ('cash', 'Cash'),
    ], string="Payment Method")

Add the field to the invoice form view:

xmlCopy code<record id="view_move_form_payment_method" model="ir.ui.view">
    <field name="name">account.move.form.payment.method</field>
    <field name="model">account.move</field>
    <field name="inherit_id" ref="account.view_move_form" />
    <field name="arch" type="xml">
        <xpath expr="//field[@name='partner_id']" position="after">
            <field name="payment_method" />
        </xpath>
    </field>
</record>

2. Use Payment Method for Filtering in Batch Payments

Scenario: Preparing SEPA Direct Debits

  1. SEPA Debit Management in Odoo:
    • Odoo handles SEPA payments via Batch Payments in journals configured for SEPA Direct Debit. These can be managed in the Payments menu.
    • Invoices need to be marked with SEPA as the payment method, either via a custom field or by linking them to a SEPA journal.
  2. Filter Invoices by Payment Method:
    • Use the new payment_method field to filter invoices.
    • Example: Add a filter in the Invoices view:
      xmlCopy code<record id="view_move_tree_payment_method_filter" model="ir.ui.view">
          <field name="name">account.move.tree.payment.method.filter</field>
          <field name="model">account.move</field>
          <field name="inherit_id" ref="account.view_invoice_tree" />
          <field name="arch" type="xml">
              <xpath expr="//filter[@name='unpaid']" position="after">
                  <filter string="SEPA Debit" domain="[('payment_method', '=', 'sepa_debit')]" />
              </xpath>
          </field>
      </record>
      

Filter in Batch Payments Preparation

When preparing batch payments (e.g., SEPA Direct Debit), Odoo will look for invoices linked to a journal supporting SEPA. With a payment_method field, you can:

  • Pre-filter invoices with payment_method = 'sepa_debit'.
  • Use automation to restrict batch payments to matching invoices.

3. Configure SEPA Journals for Automated Payments

  1. Go to Accounting > Configuration > Payment Journals.
  2. Create or configure a journal for SEPA payments:
    • Set Payment Method Type to SEPA Direct Debit.
    • Define Bank Account for the journal.
  3. Link invoices to the SEPA journal:
    • Set the SEPA journal in the invoice payment journal field.
    • Use batch payments to generate SEPA XML files.

4. Automate Payment Method Assignment

If certain customers always use a specific payment method:

  1. Add a payment_method field to the customer (res.partner):
    pythonCopy codeclass ResPartner(models.Model):
        _inherit = 'res.partner'
    
        default_payment_method = fields.Selection([
            ('sepa_debit', 'SEPA Debit'),
            ('bank_transfer', 'Bank Transfer'),
            ('credit_card', 'Credit Card'),
            ('cash', 'Cash'),
        ], string="Default Payment Method")
    
  2. Auto-populate the payment_method field in invoices based on the customer:
    pythonCopy codefrom odoo import models, api
    
    class AccountMove(models.Model):
        _inherit = 'account.move'
    
        @api.onchange('partner_id')
        def _onchange_partner_id(self):
            if self.partner_id:
                self.payment_method = self.partner_id.default_payment_method
    

5. Summary Workflow

  1. Add a Payment Method field to invoices (using Odoo Studio or custom code).
  2. Configure SEPA and other journals for different payment types.
  3. Use the payment_method field to filter and manage invoices for batch payments.
  4. (Optional) Automate payment method assignment for customers.

Avatar
Discard
Author Best Answer

Thank you Joseph,

Not sure why Odoo would make such an assumption as most small to medium companies work in this manner (at least in Spain) not only with customer invoices but also with vendor invoices. By not having a payment method in these latter ones you run the risk of paying invoices twice i.e. vendor sends SEPA direct debit and until you reconcile the bank, you make a wire transfer.

Anyways, will move forward with including the custom field but will probably link it to the account.payment_method table for it to be dynamic.


Avatar
Discard
Related Posts Replies Views Activity
0
Oct 24
412
3
Sep 24
1378
2
Jul 24
4953
2
Mar 25
412
1
Feb 25
477