Odoo19银行对账页面的按钮函数 - xiaohao0576/odoo-doc GitHub Wiki
Odoo19的银行对账页面进行了完全的重写,对账页面上有的功能按钮,在下面的js文件中定义
odoo/addons/account_accountant/static/src/components/bank_reconciliation/button_list/button_list.js
export class BankRecButtonList extends Component
/**
* Opens a dialog to search and select journal items to reconcile with the current bank statement line.
*/
reconcileOnReconcileLine() {
比如说,reconcile按钮,会调用js的reconcileOnReconcileLine方法,最后调用了后端的set_line_bank_statement_linepython方法
odoo/addons/account_accountant/models/account_bank_statement.py
def set_line_bank_statement_line(self, move_lines_ids):
""" Sets the specified move lines to the bank statement line and performs reconciliation.
:param move_lines_ids: A list of IDs for the move lines to be added to the bank statement line.
"""
有一个辅助方法,是在银行对账分录中区分出不同类型的account.move.line的,方法的名字是_seek_for_lines
一般会像这样调用
liquidity_lines, suspense_lines, other_lines = self._seek_for_lines()
set_account_bank_statement_line 方法就是简单把未对账的bank_suspense_account的会计科目,修改成需要对账的科目。但这个方法会智能添加对账模型,方便下一次自动对账