Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8552e60
[ADD] sale_advance_payment: Register payments in advance
omar7r Mar 25, 2021
9e02796
[MIG] sale_advance_payment: Migration to 14.0
MateuGForgeFlow Mar 25, 2021
993fef1
add field 'advance_payment_status' and improve the payment wizard for…
JordiBForgeFlow Apr 12, 2021
11ecce9
Readme Usage and Tests
MateuGForgeFlow Apr 13, 2021
d95d635
Currency fix and float_compare
MateuGForgeFlow Apr 22, 2021
338db82
Added translation using Weblate (French)
remi-filament Sep 20, 2021
94a9ce1
[imp][sale_advance_payment] various improvements
JordiBForgeFlow Dec 30, 2021
80c7902
[14.0][imp][sale_advance_payment] small fixes
MateuGForgeFlow Dec 31, 2021
d21f5cd
[MIG] sale_advance_payment: Migration to 15.0
JasminSForgeFlow Jan 20, 2022
8f8890d
[14.0][FIX] sale_advance_payment: Fix residual amount not being zero…
JasminSForgeFlow Feb 7, 2022
ef82e3b
[UPD] README.rst
OCA-git-bot Feb 17, 2022
0b90221
[IMP] Improved code
Nikul-OSI Jun 8, 2022
bb2f28e
[FIX]sale_advance_payment: Properly check outbound advance payments
manuelregidor May 19, 2023
4194a6c
Update translation files
weblate May 19, 2023
bb79411
[FIX] sale_advance_payment: fix currency rate test setup
JordiMForgeFlow Jun 7, 2023
4428071
Added translation using Weblate (Spanish)
Ivorra78 Jul 23, 2023
b2b1f43
[MIG] sale_advance_payment: Migration to 16.0
JordiMForgeFlow Nov 20, 2023
7b7e0e1
Update translation files
weblate Dec 1, 2023
2e37358
[IMP] sale_advance_payment: pre-commit auto fixes
yankinmax Jul 23, 2024
55e76f7
[17.0][MIG] sale_advance_payment: Migration to 17.0
Abranes May 27, 2024
40774f6
Update translation files
weblate Jul 23, 2024
1cd4536
Translated using Weblate (French)
Oct 29, 2024
7111fbb
[FIX] sale_advance_payment: Use signed amount when computing residuals
etobella Jan 3, 2025
bd92ab5
[FIX]sale_advance_payment: Amount residual with signed invoice amount
manuelregidor Jan 23, 2025
fa6937c
[REF] sale_advance_payment: remove widget dependency
ljsalvatierra-factorlibre Jul 8, 2025
77ddb75
[REF] sale_advance_payment: performance improvement proposed by @rous…
ljsalvatierra-factorlibre Jul 11, 2025
9ff42c3
[MIG] sale_advance_payment: Migration to 18.0
bizzappdev Jul 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions sale_advance_payment/README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

====================
Sale Advance Payment
====================
Expand All @@ -17,17 +13,17 @@ Sale Advance Payment
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/sale-workflow/tree/17.0/sale_advance_payment
:target: https://github.com/OCA/sale-workflow/tree/18.0/sale_advance_payment
:alt: OCA/sale-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/sale-workflow-17-0/sale-workflow-17-0-sale_advance_payment
:target: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_advance_payment
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=17.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -66,7 +62,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_advance_payment%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_advance_payment%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand Down Expand Up @@ -100,6 +96,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/17.0/sale_advance_payment>`_ project on GitHub.
This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/18.0/sale_advance_payment>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion sale_advance_payment/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Sale Advance Payment",
"version": "17.0.1.0.2",
"version": "18.0.1.0.0",
"author": "Comunitea, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/sale-workflow",
"category": "Sales",
Expand Down
3 changes: 2 additions & 1 deletion sale_advance_payment/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def action_post(self):
continue

payment_lines = all_payment_lines.filtered(
lambda x: x.move_id.id in payment_move_ids
lambda x, payment_move_ids=payment_move_ids: x.move_id.id
in payment_move_ids
)

for line in payment_lines:
Expand Down
32 changes: 13 additions & 19 deletions sale_advance_payment/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>README.rst</title>
<title>Sale Advance Payment</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,21 +360,16 @@
</style>
</head>
<body>
<div class="document">
<div class="document" id="sale-advance-payment">
<h1 class="title">Sale Advance Payment</h1>


<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="sale-advance-payment">
<h1>Sale Advance Payment</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8f58e9a9d4ac89881c50d697a6be3fbc91954986999689702f04c3f91c43cf5b
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/sale-workflow/tree/17.0/sale_advance_payment"><img alt="OCA/sale-workflow" src="https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/sale-workflow-17-0/sale-workflow-17-0-sale_advance_payment"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/sale-workflow/tree/18.0/sale_advance_payment"><img alt="OCA/sale-workflow" src="https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_advance_payment"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>The module allows to add advance payments on sales and then use them on
invoices.</p>
<p><strong>Table of contents</strong></p>
Expand All @@ -392,7 +387,7 @@ <h1>Sale Advance Payment</h1>
</ul>
</div>
<div class="section" id="usage">
<h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<p>To use this module, you need to:</p>
<ul class="simple">
<li>Go to a sale order.</li>
Expand All @@ -404,29 +399,29 @@ <h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
select those you want to add to the invoice.</p>
</div>
<div class="section" id="known-issues-roadmap">
<h2><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h2>
<h1><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h1>
<p>Split several computed values in separate fields (mls, advance_amount,
amount_residual). This allows a better comprehension of logic, and a
better inheritance possibility.</p>
</div>
<div class="section" id="bug-tracker">
<h2><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h2>
<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/sale-workflow/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_advance_payment%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_advance_payment%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h2><a class="toc-backref" href="#toc-entry-4">Credits</a></h2>
<h1><a class="toc-backref" href="#toc-entry-4">Credits</a></h1>
<div class="section" id="authors">
<h3><a class="toc-backref" href="#toc-entry-5">Authors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2>
<ul class="simple">
<li>Comunitea</li>
</ul>
</div>
<div class="section" id="contributors">
<h3><a class="toc-backref" href="#toc-entry-6">Contributors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<ul class="simple">
<li>Omar Castiñeira Saaevdra &lt;<a class="reference external" href="mailto:omar&#64;comunitea.com">omar&#64;comunitea.com</a>&gt;</li>
<li>Daniel Reis &lt;<a class="reference external" href="mailto:dreis&#64;opensourceintegrators.com">dreis&#64;opensourceintegrators.com</a>&gt;</li>
Expand All @@ -436,19 +431,18 @@ <h3><a class="toc-backref" href="#toc-entry-6">Contributors</a></h3>
</ul>
</div>
<div class="section" id="maintainers">
<h3><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h3>
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/17.0/sale_advance_payment">OCA/sale-workflow</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/18.0/sale_advance_payment">OCA/sale-workflow</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</div>
</body>
</html>
5 changes: 3 additions & 2 deletions sale_advance_payment/tests/test_sale_advance_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

from odoo import fields
from odoo.exceptions import ValidationError
from odoo.tests import common

from odoo.addons.base.tests.common import BaseCommon

class TestSaleAdvancePayment(common.TransactionCase):

class TestSaleAdvancePayment(BaseCommon):
@classmethod
def setUpClass(cls):
super().setUpClass()
Expand Down
18 changes: 9 additions & 9 deletions sale_advance_payment/views/sale_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
</page>
</notebook>
<field name="tax_totals" position="after">
<div class="oe_subtotal_footer_separator oe_inline o_td_label">
<div class="oe_subtotal_footer_separator o_td_label">
<label for="amount_residual" />
<field
name="amount_residual"
nolabel="1"
readonly="True"
class="oe_inline"
widget="monetary"
options="{'currency_field': 'currency_id'}"
/>
</div>
<field
name="amount_residual"
nolabel="1"
readonly="True"
class="oe_subtotal_footer_separator"
widget="monetary"
options="{'currency_field': 'currency_id'}"
/>
</field>
<field name="tag_ids" position="after">
<field name="advance_payment_status" readonly="True" />
Expand Down
2 changes: 1 addition & 1 deletion sale_advance_payment/wizard/sale_advance_payment_wzd.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def _prepare_payment_vals(self, sale):
"amount": self.amount_advance,
"payment_type": self.payment_type,
"partner_type": "customer",
"ref": self.payment_ref or sale.name,
"memo": self.payment_ref or sale.name,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

@bizzappdev bizzappdev Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review!
Basically, the payment_reference field was also in 17 https://github.com/odoo/odoo/blob/17.0/addons/account/models/account_payment.py#L82
While in View of 17 the ref field string is memo.
Assuming the new field memo is the replacement of ref field.
FYI, in openupgrde also they have copied all ref field value to memo field
https://github.com/OCA/OpenUpgrade/blob/18.0/openupgrade_scripts/scripts/account/18.0.1.3/pre-migration.py#L154

"journal_id": self.journal_id.id,
"currency_id": self.journal_currency_id.id,
"partner_id": partner_id,
Expand Down