Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
4035 Переглядів

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?


Аватар
Відмінити
Найкраща відповідь

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:


Аватар
Відмінити
Найкраща відповідь

@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.

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
0
жовт. 23
1173
1
лип. 23
4368
0
лист. 22
2372
1
лют. 22
5403
0
січ. 20
3701