This commit makes some major changes in the Point of Sale module
when posting journal entries which allowed the following new features:
1. Show that the invoice generated is paid unlike before where invoice
doesn't appear to be paid (both in the pdf and in the backend).
2. User can create a 'Pay Later' payment method (created by default as
'Customer Account') to allow the customers to make credit in their
purchases.
3. An extension possibility where POS can settle customers dues.
The above is accomplished by doing the following:
1. Invoices are now reconciled to created account moves by POS using
the pos payments registered to the pos order. And this is done
right after the order is synced to the backend.
2. A new type of pos payment called 'pay_later' is introduced.
- When an order is invoiced and is paid with 'pay_later' payment,
the customer in the invoice will have `due` in his account which is
immediately reflected when the order is synced.
- When an order is not invoiced and is paid with 'pay_later' payment,
the customer's 'due' reflects when the session is closed.
3. When the session is closed, POS payments from cash payment methods
are moved to the default account of the cash journal specified in the
payment method via creation of `account.bank.statement.line`s. (This is
already the case but it is mentioned this is for the purpose of
transparency.)
4. As for the bank pos payments, `account.payment` records are created
to move the payments to the specified `outstanding_account_id` in the
pos payment method. The `account.payment` records are written the bank
journal specified in the payment method.
5. As for the `pay_later` payments, we keep the behavior when no
journal is specified in the payment method where payments become
receivables to the customer who made the payments.
Other notable changes:
- The default POSS journal is changed to have 'general' type in order
to able to view the journal entries written in it.
- `pos.payment.method` can now be categorized as 'cash', 'bank' or 'pay_later'.
- `account_default_pos_receivable_account_id` can now be configured from
the Point of Sale general settings.
- `pos_invoice_report` is removed in favor of `account.account_invoices`
- disallow creating new payment method from `pos.config` form
- 'Journal Items' button in the `pos.session` form are now always visible.
- This allows seeing the list of invoices (and their payment moves)
to be accessible thru this button.
See test cases from the following spreadsheet:
https://docs.google.com/spreadsheets/d/1mt2jRSDU7OONPBFjwyTcnhRjITQI8rGMLLQA5K3fAjo/edit?usp=sharing
Part-of: odoo/odoo#74870
11 lines
411 B
XML
11 lines
411 B
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<template id="point_of_sale.report_invoice_document" inherit_id="account.report_invoice_document">
|
|
<xpath expr="//i[hasclass('oe_payment_label')]" position="inside">
|
|
<t t-if="payment_vals.get('pos_payment_name')">
|
|
using <t t-esc="payment_vals['pos_payment_name']" />
|
|
</t>
|
|
</xpath>
|
|
</template>
|
|
</odoo>
|