Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
6 Trả lời
5843 Lượt xem

We want to control income and expense account by default only from Product Categories.  But I am not able to avoid that when you create a new product, the fields for Income account and Expense account are filled.  And user must remember to delete the value. If they forget, we get postings to wrong account.


V12 EE on SAAS

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

I think it's possible to use Automated Actions, but not quite in the way I originally expected.

The full details are here: Use Automated Actions to set income and expense accounts

This is the Python code

for record in records: 
    record['property_account_income_id'] = record.categ_id.property_account_income_categ_id 
    record['property_account_expense_id'] = record.categ_id.property_account_expense_categ_id
It would be better to set these to blank, but when I try that nothing happens.
Ảnh đại diện
Huỷ bỏ
Tác giả

You described the problem correct: " As standard, Odoo leaves them blank so this should not be required." And that is my issue: I do not understand why these fields are filled by default. I think I will report it as an official issue.

Be interesting to know how to recreate it!

Câu trả lời hay nhất

Hi Lars:

These fields don't have defaults defined out of the box. Someone may have defined default values for the accounts. 

Activate developer mode. Go to ​Settings > Technical > Actions > User Defined Defaults  and check if there are defaults defined for these fields. 

Ảnh đại diện
Huỷ bỏ
Tác giả

Already checked. No default defined. And it is not possible to set a blank default. Thanks anyway.

You could use Automated Actions to set these to blank.

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 6 25
26118
0
thg 5 24
1521
2
thg 3 24
2723
0
thg 8 23
2793
2
thg 6 23
9294