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
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:
- 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.
- Field Label: the label of the field. This could be "Legal Printed" for your case
- Field Type: The type of the field. This should be boolean since you want a Yes or No field.
- 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.