Skip to Content
Menú
This question has been flagged
2 Respostes
4471 Vistes

I would like to programmatically (ie: via ORM) give a value to this field based on a distribution of 100% to a specific Analytic Account. 

What kind of Python code would I need to write in order to supply a value for the new Analytic Distribution field at Odoo 16?

Are there examples of how to use ORM to define a distribution for a single or for multiple Analytic Accounts?


Avatar
Descartar
Best Answer

You can see how we do this via the test framework.

Review https://github.com/odoo/odoo/blob/16.0/addons/account/tests/test_account_analytic.py


When using a dictionary for a new record, supply something like:



Via assignment, do something like:


Avatar
Descartar
Best Answer

@Ray,

What is analytic_account_a and analytic_account_b here. I'm getting the error while using this method that these fields do not exist.

Avatar
Descartar

they are just samples, you need to define your own analytic_account record(s) to be put there instead

Related Posts Respostes Vistes Activitat
0
d’oct. 23
1403
1
de jul. 23
4791
0
de nov. 22
2582
1
de febr. 22
5563
0
de gen. 20
3895