In the Invoicing / Accounting app there is an option to view sales invoices.
The path is: Invoicing (or Accounting) / Accounting / Sales
This has two filters:
- Posted transactions
- Sales transactions
Note that filters can be removed, so it’s possible to see all transactions. But you might want to limit it to sales transactions so that users with access to this menu option can’t see other journals (e.g. bank, purchase).
The easiest way to find out what domain to use is by creating a filter. This is very easy to do.
In this case, there is already a standard filter, so we can use that.
This is now shown at the top of the screen (if you had created a filter the details would be shown, but in this case we used a standard filter):
Next we need to save this search
Give it a name and click on Save
It’s shown under “Favorites”
For more information you can enable “developer mode“, navigate to Technical / User-defined Filters and view the filter you created.
Click on the “Sales” filter
Click on “Edit”
Now we can see the domain:
The next step is to add this domain to the Windows Action.
You can click on the “bug” icon and “Edit Action”
or you can select from Settings / Technical / Windows Actions:
Both methods will take you to the Windows Action
Note that there is already a domain:
[('display_type', 'not in', ('line_section', 'line_note'))]
But it does NOT limit the type of transaction, so we can add the domain from the Filter we created above.
After making this change, the user cannot select any other types of journal from this menu option.
However, they may be able to view these other types from another menu option. So a Record Rule may be a more complete solution, but it also needs more testing because it affects the whole of Odoo. You can use the same domain.
This is the Context for the Windows Action:
Question: what is
'journal_type':'sales' supposed to do?