This community is for professionals and enthusiasts of our products and services.
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.


How to add a Yes or No field to invoice form


In our country, we have to print invoices and stamp on them for legal reasons. But that's not always the case so I want to have a field in form of yes or no to mark the invoice for filtering purpose.
Could you please help?

1 Answer
David Tran
Best Answer

You can follow the steps below:

Modifying the invoice model (aka account.invoice as the technical name)

- Navigate to Settings > Technical > Database Structure > Models
- Search for account.invoice model and click to open it
- Press edit button on the top left side of the document
- Add a field to the model by clicking "Add an item" (see the 1st attachment) to see the creating field form (see attachment 2), where:

  1. Name is the technical name of the field which must be unique and started with x_. This could be x_legal_printed for your case.
  2. Field Label: the label of the field. This could be "Legal Printed" for your case
  3. Field Type: The type of the field. This should be boolean since you want a Yes or No field.
  4. Leave other fields as default and then press Save button

- Press Save button for the model.

Modifying the invoice view (aka account.invoice as the technical name)

- Navigate to Settings > Technical > User Interface > Views

- Search for account.invoice.form model and click to open it for edit

- In Architecture tab, add after (see attachment 3)

- Save the form and you are done.

invoice form

invoice form

invoice form

1 Comment

Thanks, David! I got it. I didn't think it's so easy.

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!