[IMP] point_of_sale: create one account move by session
Main goal of this task is to create single accounting entry (AE) when closing a pos.session instead of individual AE for each order in the session. This significantly minimizes the number of created journal entries by point_of_sale which also results to faster closing of session when there is large numbers (order of thousands) of orders. It also eases the reconciliation of payments because on one hand, cash payments are automatically reconciled and on the other, other payments are combine in a receivable line based on the payment method. **Important points to note** 1. Two new models (pos.payment.method and pos.payment) are introduced replacing the functionalities of account.journal (and account.bank.statement) and account.bank.statement.line, which served before as payment methods and payments. 2. The creation of single AE relies on the receivable_account_id defined in each pos.payment.method. This receivable_account_id is supposed to be different from the account module's receivable account, thus, a new receivable account for pos is introduced in each localization. 3. A simple example below can illustrate this change. Given the following orders: +---------+----------+----------+-----+-------+-------+ | order | payments | product | qty | price | total | +---------+----------+----------+-----+-------+-------+ | order 1 | cash | product1 | 10 | 10 | 100 | | | | product2 | 5 | 20 | 100 | +---------+----------+----------+-----+-------+-------+ | order 2 | bank | product2 | 7 | 20 | 140 | | | | product3 | 1 | 30 | 30 | +---------+----------+----------+-----+-------+-------+ | order 3 | bank | product1 | 1 | 10 | 10 | | | | product2 | 3 | 20 | 60 | | | | product3 | 5 | 30 | 150 | +---------+----------+----------+-----+-------+-------+ Instead of generating 3 accounting entries, a single accounting entry (linked to the pos.session) will be created. This accounting entry will have the following lines: +---------------------+---------+------------+ | account | balance | reconciled | +---------------------+---------+------------+ | sale | -590 | - | | pos receivable cash | 200 | yes | | pos receivable bank | 390 | no | +---------------------+---------+------------+ | Total balance | 0.0 | | +---------------------+---------+------------+ Note that the cash receivable line is already reconciled because it can assumed that the payment is already received. The unreconciled receivable line can be reconciled manually using the reconciliation widget. More examples can be seen in the tests. TASK-ID: 1862388
Showing
- addons/l10n_fr_pos_cert/models/account_bank_statement.py 2 additions, 2 deletionsaddons/l10n_fr_pos_cert/models/account_bank_statement.py
- addons/point_of_sale/__manifest__.py 2 additions, 1 deletionaddons/point_of_sale/__manifest__.py
- addons/point_of_sale/models/__init__.py 2 additions, 0 deletionsaddons/point_of_sale/models/__init__.py
- addons/point_of_sale/models/account_journal.py 1 addition, 16 deletionsaddons/point_of_sale/models/account_journal.py
- addons/point_of_sale/models/pos_config.py 33 additions, 18 deletionsaddons/point_of_sale/models/pos_config.py
- addons/point_of_sale/models/pos_order.py 44 additions, 452 deletionsaddons/point_of_sale/models/pos_order.py
- addons/point_of_sale/models/pos_payment.py 25 additions, 0 deletionsaddons/point_of_sale/models/pos_payment.py
- addons/point_of_sale/models/pos_payment_method.py 58 additions, 0 deletionsaddons/point_of_sale/models/pos_payment_method.py
- addons/point_of_sale/models/pos_session.py 544 additions, 70 deletionsaddons/point_of_sale/models/pos_session.py
- addons/point_of_sale/models/res_company.py 1 addition, 1 deletionaddons/point_of_sale/models/res_company.py
- addons/point_of_sale/security/ir.model.access.csv 3 additions, 0 deletionsaddons/point_of_sale/security/ir.model.access.csv
- addons/point_of_sale/security/point_of_sale_security.xml 12 additions, 0 deletionsaddons/point_of_sale/security/point_of_sale_security.xml
- addons/point_of_sale/static/src/js/models.js 30 additions, 63 deletionsaddons/point_of_sale/static/src/js/models.js
- addons/point_of_sale/static/src/js/screens.js 5 additions, 11 deletionsaddons/point_of_sale/static/src/js/screens.js
- addons/point_of_sale/static/src/xml/pos.xml 3 additions, 4 deletionsaddons/point_of_sale/static/src/xml/pos.xml
- addons/point_of_sale/views/account_journal_view.xml 0 additions, 42 deletionsaddons/point_of_sale/views/account_journal_view.xml
- addons/point_of_sale/views/account_statement_view.xml 0 additions, 3 deletionsaddons/point_of_sale/views/account_statement_view.xml
- addons/point_of_sale/views/point_of_sale_view.xml 1 addition, 1 deletionaddons/point_of_sale/views/point_of_sale_view.xml
- addons/point_of_sale/views/pos_config_view.xml 3 additions, 7 deletionsaddons/point_of_sale/views/pos_config_view.xml
- addons/point_of_sale/views/pos_order_view.xml 22 additions, 17 deletionsaddons/point_of_sale/views/pos_order_view.xml
Loading
Please register or sign in to comment