Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ

Hello,

In Odoo 18 I have created new Account Payable (510000) and Account Receivable (420000) in the Chart of Accounts. However, whenever I create a new contact, under the Accounting Entries section in the Accounting tab of the contact card, the system automatically assigns which have already been deprecated:

  • Account Receivable: 121000 (default)
  • Account Payable: 211000 (default)

I would like to prevent this and ensure that my newly created accounts (510000 for AP and 420000 for AR) are set as the default for new contacts.

Does anyone know how to change these default accounts or prevent Odoo from using the old (deprecated) ones?

Thank you.

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

You can achieve this in Odoo 18 by setting up an Automated Action to assign your newly created default accounts when a new contact is created. Follow these steps:

Click Create and set the following parameters:

  • Action Name: Default Accounts on Contacts
  • Model: Contacts (res.partner)
  • Active: ✅ (Check this)
  • Trigger: On Creation
  • Apply On: Match all records
  • Action To Do: Python Code
record['property_account_payable_id'] = env['account.account'].search([('code', '=', '510000')], limit=1).id
record['property_account_receivable_id'] = env['account.account'].search([('code', '=', '420000')], limit=1).id


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

Hey Zuhair,

You can set default account directly from odoo default set feature for that you just need to enable debug mode and set your prefered accounts accordingly. 

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

We have use this solution and it is working. Thank you Nikul

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

Simple solution will be rename the default Receivable and Payables COA and add your new code. If entries already posted then go for the option shared 

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

Thank you Abhay I will try this solution.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 8 16
3949
4
thg 1 23
9149
0
thg 8 23
2012
3
thg 5 25
1505
2
thg 4 25
981