Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
4010 มุมมอง

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
1167
1
ก.ค. 23
4350
0
พ.ย. 22
2366
1
ก.พ. 22
5400
0
ม.ค. 20
3688