An analytic entry can be created manually or automatically. Most of the time, it is preferable to create an entry automatically. Analytic entry can be set on the invoice automatically if the invoice is created from the sales order, or if you have to set it manually on the invoice lines when the invoice is being created manually. It will be difficult to choose an analytic account from the list of accounts available when you have to choose an account based on the customer or product on the invoice line.
The Account Analytic Defaults module allows you to set the default analytic account on the invoice line based on the product, customer, user, company, or time period, and based on the date range. Install the Account Analytic Defaults module from Odoo Apps. On successful installation of the application, the Analytic Defaults menu can be found by going to Configuration | Settings in the Accounting application.
Click on the CREATE button to create a new rule. Let's create a rule to choose Plant A as an analytic account when an invoice will be created for the Material product. Look at the following screenshot for the rule:
Save the rule and let's create an invoice. Choose the customer, and choose the Material as a product on the invoice line. The Plant A analytic account should be selected automatically on that invoice line:
If multiple analytic accounts get selected based on the rules, the sequence field will be used to select one account to apply.