Initial commit: OCA Workflow Process packages (456 packages)

This commit is contained in:
Ernad Husremovic 2025-08-29 15:43:00 +02:00
commit d366e42934
18799 changed files with 1284507 additions and 0 deletions

View file

@ -0,0 +1,46 @@
# Sale Advance Payment
Odoo addon: sale_advance_payment
## Installation
```bash
pip install odoo-bringout-oca-sale-workflow-sale_advance_payment
```
## Dependencies
This addon depends on:
- sale
## Manifest Information
- **Name**: Sale Advance Payment
- **Version**: 16.0.1.1.0
- **Category**: Sales
- **License**: AGPL-3
- **Installable**: True
## Source
Based on [OCA/sale-workflow](https://github.com/OCA/sale-workflow) branch 16.0, addon `sale_advance_payment`.
## License
This package maintains the original AGPL-3 license from the upstream Odoo project.
## Documentation
- Overview: doc/OVERVIEW.md
- Architecture: doc/ARCHITECTURE.md
- Models: doc/MODELS.md
- Controllers: doc/CONTROLLERS.md
- Wizards: doc/WIZARDS.md
- Reports: doc/REPORTS.md
- Security: doc/SECURITY.md
- Install: doc/INSTALL.md
- Usage: doc/USAGE.md
- Configuration: doc/CONFIGURATION.md
- Dependencies: doc/DEPENDENCIES.md
- Troubleshooting: doc/TROUBLESHOOTING.md
- FAQ: doc/FAQ.md

View file

@ -0,0 +1,32 @@
# Architecture
```mermaid
flowchart TD
U[Users] -->|HTTP| V[Views and QWeb Templates]
V --> C[Controllers]
V --> W[Wizards Transient Models]
C --> M[Models and ORM]
W --> M
M --> R[Reports]
DX[Data XML] --> M
S[Security ACLs and Groups] -. enforces .-> M
subgraph Sale_advance_payment Module - sale_advance_payment
direction LR
M:::layer
W:::layer
C:::layer
V:::layer
R:::layer
S:::layer
DX:::layer
end
classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px
```
Notes
- Views include tree/form/kanban templates and report templates.
- Controllers provide website/portal routes when present.
- Wizards are UI flows implemented with `models.TransientModel`.
- Data XML loads data/demo records; Security defines groups and access.

View file

@ -0,0 +1,3 @@
# Configuration
Refer to Odoo settings for sale_advance_payment. Configure related models, access rights, and options as needed.

View file

@ -0,0 +1,3 @@
# Controllers
This module does not define custom HTTP controllers.

View file

@ -0,0 +1,5 @@
# Dependencies
This addon depends on:
- [sale](../../odoo-bringout-oca-ocb-sale)

View file

@ -0,0 +1,4 @@
# FAQ
- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged).
- Q: How to enable? A: Start server with --addon sale_advance_payment or install in UI.

View file

@ -0,0 +1,7 @@
# Install
```bash
pip install odoo-bringout-oca-sale-workflow-sale_advance_payment"
# or
uv pip install odoo-bringout-oca-sale-workflow-sale_advance_payment"
```

View file

@ -0,0 +1,14 @@
# Models
Detected core models and extensions in sale_advance_payment.
```mermaid
classDiagram
class account_move
class account_payment
class sale_order
```
Notes
- Classes show model technical names; fields omitted for brevity.
- Items listed under _inherit are extensions of existing models.

View file

@ -0,0 +1,6 @@
# Overview
Packaged Odoo addon: sale_advance_payment. Provides features documented in upstream Odoo 16 under this addon.
- Source: OCA/OCB 16.0, addon sale_advance_payment
- License: LGPL-3

View file

@ -0,0 +1,3 @@
# Reports
This module does not define custom reports.

View file

@ -0,0 +1,34 @@
# Security
Access control and security definitions in sale_advance_payment.
## Access Control Lists (ACLs)
Model access permissions defined in:
- **[ir.model.access.csv](../sale_advance_payment/security/ir.model.access.csv)**
- 3 model access rules
## Record Rules
Row-level security rules defined in:
```mermaid
graph TB
subgraph "Security Layers"
A[Users] --> B[Groups]
B --> C[Access Control Lists]
C --> D[Models]
B --> E[Record Rules]
E --> F[Individual Records]
end
```
Security files overview:
- **[ir.model.access.csv](../sale_advance_payment/security/ir.model.access.csv)**
- Model access permissions (CRUD rights)
Notes
- Access Control Lists define which groups can access which models
- Record Rules provide row-level security (filter records by user/group)
- Security groups organize users and define permission sets
- All security is enforced at the ORM level by Odoo

View file

@ -0,0 +1,5 @@
# Troubleshooting
- Ensure Python and Odoo environment matches repo guidance.
- Check database connectivity and logs if startup fails.
- Validate that dependent addons listed in DEPENDENCIES.md are installed.

View file

@ -0,0 +1,7 @@
# Usage
Start Odoo including this addon (from repo root):
```bash
python3 scripts/nix_odoo_web_server.py --db-name mydb --addon sale_advance_payment
```

View file

@ -0,0 +1,8 @@
# Wizards
Transient models exposed as UI wizards in sale_advance_payment.
```mermaid
classDiagram
class AccountVoucherWizard
```

View file

@ -0,0 +1,42 @@
[project]
name = "odoo-bringout-oca-sale-workflow-sale_advance_payment"
version = "16.0.0"
description = "Sale Advance Payment - Allow to add advance payments on sales and then use them on invoices"
authors = [
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
]
dependencies = [
"odoo-bringout-oca-ocb-sale>=16.0.0",
"requests>=2.25.1"
]
readme = "README.md"
requires-python = ">= 3.11"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Office/Business",
]
[project.urls]
homepage = "https://github.com/bringout/0"
repository = "https://github.com/bringout/0"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["sale_advance_payment"]
[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.4.1",
]

View file

@ -0,0 +1,103 @@
.. 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
====================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8dd45c68379f9d5fe62aa489297a9e895162f62c0c31e4765978d3aebcdaf3e6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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
: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/16.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-16-0/sale-workflow-16-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=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
The module allows to add advance payments on sales and then use them on invoices.
**Table of contents**
.. contents::
:local:
Usage
=====
To use this module, you need to:
* Go to a sale order.
* Click on "Pay Sale Advance".
* Select the Journal and specify the amount of the advanced payment.
* "Make Advance Payment".
When generating the invoice, the system displays the advanced payments, select those you want to add to the invoice.
Known issues / Roadmap
======================
Split several computed values in separate fields (mls, advance_amount, amount_residual).
This allows a better comprehension of logic, and a better inheritance possibility.
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:%2016.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.
Credits
=======
Authors
~~~~~~~
* Comunitea
Contributors
~~~~~~~~~~~~
* Omar Castiñeira Saaevdra <omar@comunitea.com>
* Daniel Reis <dreis@opensourceintegrators.com>
* Nikul Chaudhary <nchaudhary@opensourceintegrators.com>
* Manuel Regidor <manuel.regidor@sygel.es>
* Urvisha Desai <udesai@opensourceintegrators.com>
Maintainers
~~~~~~~~~~~
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
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/16.0/sale_advance_payment>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View file

@ -0,0 +1,2 @@
from . import models
from . import wizard

View file

@ -0,0 +1,19 @@
# Copyright 2015 Omar Castiñeira, Comunitea Servicios Tecnológicos S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Sale Advance Payment",
"version": "16.0.1.1.0",
"author": "Comunitea, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/sale-workflow",
"category": "Sales",
"license": "AGPL-3",
"summary": "Allow to add advance payments on sales and then use them on invoices",
"depends": ["sale"],
"data": [
"wizard/sale_advance_payment_wzd_view.xml",
"views/sale_view.xml",
"security/ir.model.access.csv",
],
"installable": True,
}

View file

@ -0,0 +1,247 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_advance_payment
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_account_voucher_wizard
msgid "Account Voucher Wizard"
msgstr "Čarobnjak računa voucher-a"
#. module: sale_advance_payment
#: model:ir.actions.act_window,name:sale_advance_payment.action_view_account_voucher_wizard
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Advance Payment"
msgstr "Avansno plaćanje"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__advance_payment_status
msgid "Advance Payment Status"
msgstr "Status avansnog plaćanja"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_total
msgid "Amount Total"
msgstr "Ukupni iznos"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_advance
msgid "Amount advanced"
msgstr "Iznos avansa"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Amount in Order Currency"
msgstr "Iznos u valuti naloga"
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid "Amount of advance must be positive."
msgstr "Iznos avansa mora biti pozitivan."
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Cancel"
msgstr "Ova opcija uvodi dodatna polja u prodajnu narudžbu za lako planiranje dostave proizvoda: očekivani datum, datum obaveze, efikasni datum."
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_uid
msgid "Created by"
msgstr "Kreirao"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_date
msgid "Created on"
msgstr "Kreirano"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_amount
msgid "Curr. amount"
msgstr "Iznos u valuti"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_id
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Currency"
msgstr "Valuta"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__date
msgid "Date"
msgstr "Datum"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__display_name
msgid "Display Name"
msgstr "Prikazani naziv"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__id
msgid "ID"
msgstr "ID"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__inbound
msgid "Inbound"
msgstr "Ulazno"
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid "Inbound amount of advance is greater than residual amount on sale"
msgstr "Ulazni iznos avansa je veći od dospjelog iznosa prodaje"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_id
msgid "Journal"
msgstr "Dnevnik"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_currency_id
msgid "Journal Currency"
msgstr "Valuta dnevnika"
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_account_move
msgid "Journal Entry"
msgstr "Zapis dnevnika"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard____last_update
msgid "Last Modified on"
msgstr "Zadnje modificirano"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_uid
msgid "Last Updated by"
msgstr "Zadnje ažurirao"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_date
msgid "Last Updated on"
msgstr "Zadnje ažurirano"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Make advance payment"
msgstr "Upravljaj datumima dostave iz prodajnih narudžbi."
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__not_paid
msgid "Not Paid"
msgstr "Nije plaćeno"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Operation"
msgstr "Operacija"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__order_id
msgid "Order"
msgstr "Ponuda"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Order Currency"
msgstr "Valuta ponude"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Order Due Amount"
msgstr "Dospjeli iznos ponude"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__outbound
msgid "Outbound"
msgstr "Izlazno"
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid "Outbound amount of advance is greater than the advanced paid amount"
msgstr "Izlazni iznos avansa je veći od avansno plaćenog iznosa"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__paid
msgid "Paid"
msgstr "Plaćeno"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__partial
msgid "Partially Paid"
msgstr "Djelomično plaćeno"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__account_payment_ids
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form
msgid "Pay sale advanced"
msgstr "Avansno plaćanje ponude"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Payment Method"
msgstr "Metoda plaćanja"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_type
msgid "Payment Type"
msgstr "Vrsta plaćanja"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form
msgid "Payment advances"
msgstr "Avans plaćanja"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__payment_line_ids
msgid "Payment move lines"
msgstr "Linije kretanja plaćanja"
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_account_payment
msgid "Payments"
msgstr "Plaćanja"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_ref
msgid "Ref."
msgstr "Ref."
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__amount_residual
msgid "Residual amount"
msgstr "Dospjeli iznos"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_payment__sale_id
msgid "Sale"
msgstr "Prodaja"
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_sale_order
msgid "Sales Order"
msgstr "Prodajni nalog"
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid ""
"The amount to advance must always be positive. Please use the payment type "
"to indicate if this is an inbound or an outbound payment."
msgstr ""

View file

@ -0,0 +1,256 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_advance_payment
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-07-23 11:13+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_account_voucher_wizard
msgid "Account Voucher Wizard"
msgstr "Asistente de comprobación de cuentas"
#. module: sale_advance_payment
#: model:ir.actions.act_window,name:sale_advance_payment.action_view_account_voucher_wizard
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Advance Payment"
msgstr "Pago por Adelantado"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__advance_payment_status
msgid "Advance Payment Status"
msgstr "Estado del pago anticipado"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_total
msgid "Amount Total"
msgstr "Importe Total"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_advance
msgid "Amount advanced"
msgstr "Importe anticipado"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Amount in Order Currency"
msgstr "Importe en la divisa del pedido"
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid "Amount of advance must be positive."
msgstr "El importe del anticipo debe de ser positivo."
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Cancel"
msgstr "Cancelar"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_uid
msgid "Created by"
msgstr "Creado por"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_date
msgid "Created on"
msgstr "creado el"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_amount
msgid "Curr. amount"
msgstr "divisa del importe"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_id
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Currency"
msgstr "Divisa"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__date
msgid "Date"
msgstr "fecha"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__display_name
msgid "Display Name"
msgstr "nombre para mostrar"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__id
msgid "ID"
msgstr "ID (identificación)"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__inbound
msgid "Inbound"
msgstr "Entrante"
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid "Inbound amount of advance is greater than residual amount on sale"
msgstr ""
"El importe de entrada del anticipo es superior al importe residual de la "
"venta"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_id
msgid "Journal"
msgstr "Dario"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_currency_id
msgid "Journal Currency"
msgstr "Divisa del diario"
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_account_move
msgid "Journal Entry"
msgstr "Entrada diaria"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard____last_update
msgid "Last Modified on"
msgstr "modificado por última vez el"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_uid
msgid "Last Updated by"
msgstr "Última actualización por"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_date
msgid "Last Updated on"
msgstr "Última Actualización el"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Make advance payment"
msgstr "Pagar por adelantado"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__not_paid
msgid "Not Paid"
msgstr "No pagado"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Operation"
msgstr "Operación"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__order_id
msgid "Order"
msgstr "Orden"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Order Currency"
msgstr "Divisa del pedido"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Order Due Amount"
msgstr "Importe pendiente del pedido"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__outbound
msgid "Outbound"
msgstr "Saliente"
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid "Outbound amount of advance is greater than the advanced paid amount"
msgstr ""
"El importe de salida del anticipo es superior al importe pagado por "
"anticipado"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__paid
msgid "Paid"
msgstr "Pagado"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__partial
msgid "Partially Paid"
msgstr "Pagado parcialmente"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__account_payment_ids
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form
msgid "Pay sale advanced"
msgstr "Pago anticipado"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Payment Method"
msgstr "Método de Pago"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_type
msgid "Payment Type"
msgstr "Tipo de pago"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form
msgid "Payment advances"
msgstr "Anticipos de pago"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__payment_line_ids
msgid "Payment move lines"
msgstr "Líneas de movimiento de pagos"
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_account_payment
msgid "Payments"
msgstr "pagos"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_ref
msgid "Ref."
msgstr "Referencia"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__amount_residual
msgid "Residual amount"
msgstr "Importe pendiente"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_payment__sale_id
msgid "Sale"
msgstr "Ventas"
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_sale_order
msgid "Sales Order"
msgstr "Órdenes de Venta"
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid ""
"The amount to advance must always be positive. Please use the payment type "
"to indicate if this is an inbound or an outbound payment."
msgstr ""
"El importe a anticipar debe ser siempre positivo. Utilice el tipo de pago "
"para indicar si se trata de un pago entrante o saliente."

View file

@ -0,0 +1,259 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_advance_payment
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-09-20 12:19+0000\n"
"Last-Translator: Rémi <remi@le-filament.com>\n"
"Language-Team: none\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 4.3.2\n"
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_account_voucher_wizard
msgid "Account Voucher Wizard"
msgstr "Assistant de Configuration Paiement d'Avance"
#. module: sale_advance_payment
#: model:ir.actions.act_window,name:sale_advance_payment.action_view_account_voucher_wizard
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Advance Payment"
msgstr "Paiement d'Avance"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__advance_payment_status
msgid "Advance Payment Status"
msgstr "Statut du Paiement d'Avance"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_total
msgid "Amount Total"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_advance
msgid "Amount advanced"
msgstr "Montant avancé"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Amount in Order Currency"
msgstr "Montant dans la Devise de la Commande"
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid "Amount of advance must be positive."
msgstr "Le montant de l'avance doit être positif."
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Cancel"
msgstr "Annuler"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_uid
msgid "Created by"
msgstr "Créé par"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_date
msgid "Created on"
msgstr "Créé le"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_amount
msgid "Curr. amount"
msgstr "Montant en devise"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_id
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Currency"
msgstr "Devise"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__date
msgid "Date"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__display_name
msgid "Display Name"
msgstr "Nom affiché"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__id
msgid "ID"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__inbound
msgid "Inbound"
msgstr ""
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid "Inbound amount of advance is greater than residual amount on sale"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_id
msgid "Journal"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_currency_id
msgid "Journal Currency"
msgstr "Devise du Journal"
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_account_move
msgid "Journal Entry"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard____last_update
msgid "Last Modified on"
msgstr "Dernière modification le"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_uid
msgid "Last Updated by"
msgstr "Dernière modification par"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_date
msgid "Last Updated on"
msgstr "Dernière modification le"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Make advance payment"
msgstr "Enregistrer un paiement d'avance"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__not_paid
msgid "Not Paid"
msgstr "Non Payé"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Operation"
msgstr "Opération"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__order_id
msgid "Order"
msgstr "Commande"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Order Currency"
msgstr "Devise de la Commande"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Order Due Amount"
msgstr "Montant dû de la Commande"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__outbound
msgid "Outbound"
msgstr ""
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid "Outbound amount of advance is greater than the advanced paid amount"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__paid
msgid "Paid"
msgstr "Payé"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__partial
msgid "Partially Paid"
msgstr "Partiellement Payé"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__account_payment_ids
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form
msgid "Pay sale advanced"
msgstr "Enregistrer un paiement d'avance"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Payment Method"
msgstr "Méthode de paiement"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_type
msgid "Payment Type"
msgstr ""
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form
msgid "Payment advances"
msgstr "Avances de paiement"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__payment_line_ids
msgid "Payment move lines"
msgstr "Écritures comptables de paiement"
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_account_payment
msgid "Payments"
msgstr "Paiements"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_ref
msgid "Ref."
msgstr "Réf."
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__amount_residual
msgid "Residual amount"
msgstr "Montant restant"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_payment__sale_id
msgid "Sale"
msgstr "Vente"
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_sale_order
msgid "Sales Order"
msgstr "Commandes"
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid ""
"The amount to advance must always be positive. Please use the payment type "
"to indicate if this is an inbound or an outbound payment."
msgstr ""
#, python-format
#~ msgid "Amount of advance is greater than residual amount on sale"
#~ msgstr ""
#~ "Le montant de l'avance est supérieur au montant restant à payer sur la "
#~ "vente"
#~ msgid "Amount total"
#~ msgstr "Montant total"

View file

@ -0,0 +1,251 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_advance_payment
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-06-21 12:16+0000\n"
"Last-Translator: Bole <bole@dajmi5.com>\n"
"Language-Team: none\n"
"Language: hr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 4.17\n"
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_account_voucher_wizard
msgid "Account Voucher Wizard"
msgstr ""
#. module: sale_advance_payment
#: model:ir.actions.act_window,name:sale_advance_payment.action_view_account_voucher_wizard
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Advance Payment"
msgstr "Avansno plaćanje"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__advance_payment_status
msgid "Advance Payment Status"
msgstr "Status avansnog plaćanja"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_total
msgid "Amount Total"
msgstr "Ukupni iznos"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_advance
msgid "Amount advanced"
msgstr "Iznos avansa"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Amount in Order Currency"
msgstr "Iznos u valuti naloga"
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid "Amount of advance must be positive."
msgstr "Iznos avansa mora biti pozitivan."
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Cancel"
msgstr "Otkaži"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_uid
msgid "Created by"
msgstr "Kreirao"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_date
msgid "Created on"
msgstr "Kreirano"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_amount
msgid "Curr. amount"
msgstr "Iznos u valuti"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_id
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Currency"
msgstr "Valuta"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__date
msgid "Date"
msgstr "Datum"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__display_name
msgid "Display Name"
msgstr "Prikazani naziv"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__id
msgid "ID"
msgstr "ID"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__inbound
msgid "Inbound"
msgstr "Ulazno"
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid "Inbound amount of advance is greater than residual amount on sale"
msgstr "Ulazni iznos avansa je veći od dospjelog iznosa prodaje"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_id
msgid "Journal"
msgstr "Dnevnik"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_currency_id
msgid "Journal Currency"
msgstr "Valuta dnevnika"
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_account_move
msgid "Journal Entry"
msgstr "Zapis dnevnika"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard____last_update
msgid "Last Modified on"
msgstr "Zadnje modificirano"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_uid
msgid "Last Updated by"
msgstr "Zadnje ažurirao"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_date
msgid "Last Updated on"
msgstr "Zadnje ažurirano"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Make advance payment"
msgstr "Napravi avansno plaćanje"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__not_paid
msgid "Not Paid"
msgstr "Nije plaćeno"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Operation"
msgstr "Operacija"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__order_id
msgid "Order"
msgstr "Ponuda"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Order Currency"
msgstr "Valuta ponude"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Order Due Amount"
msgstr "Dospjeli iznos ponude"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__outbound
msgid "Outbound"
msgstr "Izlazno"
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid "Outbound amount of advance is greater than the advanced paid amount"
msgstr "Izlazni iznos avansa je veći od avansno plaćenog iznosa"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__paid
msgid "Paid"
msgstr "Plaćeno"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__partial
msgid "Partially Paid"
msgstr "Djelomično plaćeno"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__account_payment_ids
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form
msgid "Pay sale advanced"
msgstr "Avansno plaćanje ponude"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Payment Method"
msgstr "Metoda plaćanja"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_type
msgid "Payment Type"
msgstr "Vrsta plaćanja"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form
msgid "Payment advances"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__payment_line_ids
msgid "Payment move lines"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_account_payment
msgid "Payments"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_ref
msgid "Ref."
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__amount_residual
msgid "Residual amount"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_payment__sale_id
msgid "Sale"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_sale_order
msgid "Sales Order"
msgstr ""
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid ""
"The amount to advance must always be positive. Please use the payment type "
"to indicate if this is an inbound or an outbound payment."
msgstr ""

View file

@ -0,0 +1,255 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_advance_payment
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-02-05 09:41+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_account_voucher_wizard
msgid "Account Voucher Wizard"
msgstr "Procedura per ricevuta contabile"
#. module: sale_advance_payment
#: model:ir.actions.act_window,name:sale_advance_payment.action_view_account_voucher_wizard
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Advance Payment"
msgstr "Pagamento anticipato"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__advance_payment_status
msgid "Advance Payment Status"
msgstr "Stato pagamento anticipato"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_total
msgid "Amount Total"
msgstr "Importo totale"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_advance
msgid "Amount advanced"
msgstr "Importo anticipato"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Amount in Order Currency"
msgstr "Importo nella valuta dell'ordine"
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid "Amount of advance must be positive."
msgstr "L'importo dell'anticipo deve essere positivo."
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Cancel"
msgstr "Annulla"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_uid
msgid "Created by"
msgstr "Creato da"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_date
msgid "Created on"
msgstr "Creato il"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_amount
msgid "Curr. amount"
msgstr "Importo valuta"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_id
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Currency"
msgstr "Valuta"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__date
msgid "Date"
msgstr "Data"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__display_name
msgid "Display Name"
msgstr "Nome visualizzato"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__id
msgid "ID"
msgstr "ID"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__inbound
msgid "Inbound"
msgstr "In entrata"
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid "Inbound amount of advance is greater than residual amount on sale"
msgstr ""
"L'importo dell'anticipo in entrata è superiore all'importo residuo in vendita"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_id
msgid "Journal"
msgstr "Registro"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_currency_id
msgid "Journal Currency"
msgstr "Valuta registro"
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_account_move
msgid "Journal Entry"
msgstr "Registrazione contabile"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_uid
msgid "Last Updated by"
msgstr "Ultimo aggiornamento di"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_date
msgid "Last Updated on"
msgstr "Ultimo aggiornamento il"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Make advance payment"
msgstr "Effettua il pagamento anticipato"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__not_paid
msgid "Not Paid"
msgstr "Non pagato"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Operation"
msgstr "Operazione"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__order_id
msgid "Order"
msgstr "Ordine"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Order Currency"
msgstr "Valuta ordine"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Order Due Amount"
msgstr "Importo dovuto dell'ordine"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__outbound
msgid "Outbound"
msgstr "In uscita"
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid "Outbound amount of advance is greater than the advanced paid amount"
msgstr ""
"L'importo dell'anticipo in uscita è superiore all'importo dell'anticipo "
"pagato"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__paid
msgid "Paid"
msgstr "Pagato"
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__partial
msgid "Partially Paid"
msgstr "Pagato parzialmente"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__account_payment_ids
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form
msgid "Pay sale advanced"
msgstr "Paga anticipo vendita"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Payment Method"
msgstr "Metodo di pagamento"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_type
msgid "Payment Type"
msgstr "Tipo pagamento"
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form
msgid "Payment advances"
msgstr "Pagamenti anticipati"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__payment_line_ids
msgid "Payment move lines"
msgstr "Righe movimento pagamento"
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_account_payment
msgid "Payments"
msgstr "Pagamenti"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_ref
msgid "Ref."
msgstr "Rif."
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__amount_residual
msgid "Residual amount"
msgstr "Importo residuo"
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_payment__sale_id
msgid "Sale"
msgstr "Vendita"
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_sale_order
msgid "Sales Order"
msgstr "Ordine di vendita"
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid ""
"The amount to advance must always be positive. Please use the payment type "
"to indicate if this is an inbound or an outbound payment."
msgstr ""
"L'importo da anticipare deve essere sempre positivo. Utilizzare il tipo di "
"pagamento per indicare se si tratta di un pagamento in entrata o in uscita."

View file

@ -0,0 +1,247 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_advance_payment
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_account_voucher_wizard
msgid "Account Voucher Wizard"
msgstr ""
#. module: sale_advance_payment
#: model:ir.actions.act_window,name:sale_advance_payment.action_view_account_voucher_wizard
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Advance Payment"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__advance_payment_status
msgid "Advance Payment Status"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_total
msgid "Amount Total"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_advance
msgid "Amount advanced"
msgstr ""
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Amount in Order Currency"
msgstr ""
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid "Amount of advance must be positive."
msgstr ""
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Cancel"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_uid
msgid "Created by"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_date
msgid "Created on"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_amount
msgid "Curr. amount"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_id
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Currency"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__date
msgid "Date"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__display_name
msgid "Display Name"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__id
msgid "ID"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__inbound
msgid "Inbound"
msgstr ""
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid "Inbound amount of advance is greater than residual amount on sale"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_id
msgid "Journal"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_currency_id
msgid "Journal Currency"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_account_move
msgid "Journal Entry"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard____last_update
msgid "Last Modified on"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_uid
msgid "Last Updated by"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_date
msgid "Last Updated on"
msgstr ""
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Make advance payment"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__not_paid
msgid "Not Paid"
msgstr ""
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Operation"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__order_id
msgid "Order"
msgstr ""
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Order Currency"
msgstr ""
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Order Due Amount"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__outbound
msgid "Outbound"
msgstr ""
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid "Outbound amount of advance is greater than the advanced paid amount"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__paid
msgid "Paid"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__partial
msgid "Partially Paid"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__account_payment_ids
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form
msgid "Pay sale advanced"
msgstr ""
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Payment Method"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_type
msgid "Payment Type"
msgstr ""
#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form
msgid "Payment advances"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__payment_line_ids
msgid "Payment move lines"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_account_payment
msgid "Payments"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_ref
msgid "Ref."
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__amount_residual
msgid "Residual amount"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_payment__sale_id
msgid "Sale"
msgstr ""
#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_sale_order
msgid "Sales Order"
msgstr ""
#. module: sale_advance_payment
#. odoo-python
#: code:addons/sale_advance_payment/wizard/sale_advance_payment_wzd.py:0
#, python-format
msgid ""
"The amount to advance must always be positive. Please use the payment type "
"to indicate if this is an inbound or an outbound payment."
msgstr ""

View file

@ -0,0 +1,3 @@
from . import payment
from . import sale
from . import account_move

View file

@ -0,0 +1,42 @@
# Copyright 2022 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
class AccountMove(models.Model):
_inherit = "account.move"
def _post(self, soft=True):
# Automatic reconciliation of payment when invoice confirmed.
res = super()._post(soft=soft)
sale_orders = self.mapped("line_ids.sale_line_ids.order_id")
all_payment_move_ids = sale_orders.mapped("account_payment_ids.move_id").ids
all_payment_lines = self.env["account.move.line"].search(
[
("move_id", "in", all_payment_move_ids),
(
"account_id.account_type",
"in",
("asset_receivable", "liability_payable"),
),
("reconciled", "=", False),
("parent_state", "=", "posted"),
]
)
for move in self:
sale_order = move.mapped("line_ids.sale_line_ids.order_id")
if not sale_order:
continue
payment_move_ids = sale_order.account_payment_ids.move_id.ids
if not payment_move_ids:
continue
payment_lines = all_payment_lines.filtered(
lambda x: x.move_id.id in payment_move_ids
)
for line in payment_lines:
move.js_assign_outstanding_line(line_id=line.id)
return res

View file

@ -0,0 +1,13 @@
# Copyright 2017 Omar Castiñeira, Comunitea Servicios Tecnológicos S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AccountPayment(models.Model):
_inherit = "account.payment"
sale_id = fields.Many2one(
"sale.order", "Sale", readonly=True, states={"draft": [("readonly", False)]}
)

View file

@ -0,0 +1,100 @@
# Copyright 2017 Omar Castiñeira, Comunitea Servicios Tecnológicos S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
from odoo.tools import float_compare
class SaleOrder(models.Model):
_inherit = "sale.order"
account_payment_ids = fields.One2many(
"account.payment", "sale_id", string="Pay sale advanced", readonly=True
)
amount_residual = fields.Float(
"Residual amount",
readonly=True,
compute="_compute_advance_payment",
store=True,
)
payment_line_ids = fields.Many2many(
"account.move.line",
string="Payment move lines",
compute="_compute_advance_payment",
store=True,
)
advance_payment_status = fields.Selection(
selection=[
("not_paid", "Not Paid"),
("paid", "Paid"),
("partial", "Partially Paid"),
],
store=True,
readonly=True,
copy=False,
tracking=True,
compute="_compute_advance_payment",
)
@api.depends(
"currency_id",
"company_id",
"amount_total",
"account_payment_ids",
"account_payment_ids.state",
"account_payment_ids.move_id",
"account_payment_ids.move_id.line_ids",
"account_payment_ids.move_id.line_ids.date",
"account_payment_ids.move_id.line_ids.debit",
"account_payment_ids.move_id.line_ids.credit",
"account_payment_ids.move_id.line_ids.currency_id",
"account_payment_ids.move_id.line_ids.amount_currency",
"invoice_ids.amount_residual",
)
def _compute_advance_payment(self):
for order in self:
mls = order.account_payment_ids.mapped("move_id.line_ids").filtered(
lambda x: x.account_id.account_type == "asset_receivable"
and x.parent_state == "posted"
)
advance_amount = 0.0
for line in mls:
line_currency = line.currency_id or line.company_id.currency_id
# Exclude reconciled pre-payments amount because once reconciled
# the pre-payment will reduce invoice residual amount like any
# other payment.
line_amount = (
line.amount_residual_currency
if line.currency_id
else line.amount_residual
)
line_amount *= -1
if line_currency != order.currency_id:
advance_amount += line.currency_id._convert(
line_amount,
order.currency_id,
order.company_id,
line.date or fields.Date.today(),
)
else:
advance_amount += line_amount
# Consider payments in related invoices.
invoice_paid_amount = 0.0
for inv in order.invoice_ids:
invoice_paid_amount += (
inv.amount_total_signed - inv.amount_residual_signed
)
amount_residual = order.amount_total - advance_amount - invoice_paid_amount
payment_state = "not_paid"
if mls:
has_due_amount = float_compare(
amount_residual, 0.0, precision_rounding=order.currency_id.rounding
)
if has_due_amount <= 0:
payment_state = "paid"
elif has_due_amount > 0:
payment_state = "partial"
order.payment_line_ids = mls
order.amount_residual = amount_residual
order.advance_payment_status = payment_state

View file

@ -0,0 +1,5 @@
* Omar Castiñeira Saaevdra <omar@comunitea.com>
* Daniel Reis <dreis@opensourceintegrators.com>
* Nikul Chaudhary <nchaudhary@opensourceintegrators.com>
* Manuel Regidor <manuel.regidor@sygel.es>
* Urvisha Desai <udesai@opensourceintegrators.com>

View file

@ -0,0 +1 @@
The module allows to add advance payments on sales and then use them on invoices.

View file

@ -0,0 +1,2 @@
Split several computed values in separate fields (mls, advance_amount, amount_residual).
This allows a better comprehension of logic, and a better inheritance possibility.

View file

@ -0,0 +1,9 @@
To use this module, you need to:
* Go to a sale order.
* Click on "Pay Sale Advance".
* Select the Journal and specify the amount of the advanced payment.
* "Make Advance Payment".
When generating the invoice, the system displays the advanced payments, select those you want to add to the invoice.

View file

@ -0,0 +1,4 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_account_payment_salesman,account.payment salesman,account.model_account_payment,sales_team.group_sale_salesman,1,1,1,0
access_account_payment_method_salesman,account.payment.method salesman,account.model_account_payment_method,sales_team.group_sale_salesman,1,0,0,0
access_account_voucher_wizard_salesman,access_account_voucher_wizard_salesman,model_account_voucher_wizard,sales_team.group_sale_salesman,1,1,1,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_account_payment_salesman account.payment salesman account.model_account_payment sales_team.group_sale_salesman 1 1 1 0
3 access_account_payment_method_salesman account.payment.method salesman account.model_account_payment_method sales_team.group_sale_salesman 1 0 0 0
4 access_account_voucher_wizard_salesman access_account_voucher_wizard_salesman model_account_voucher_wizard sales_team.group_sale_salesman 1 1 1 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View file

@ -0,0 +1,451 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<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>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic, pre.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document">
<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:8dd45c68379f9d5fe62aa489297a9e895162f62c0c31e4765978d3aebcdaf3e6
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/16.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-16-0/sale-workflow-16-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=16.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>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#usage" id="toc-entry-1">Usage</a></li>
<li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-2">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-3">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-4">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-5">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-6">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="usage">
<h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
<p>To use this module, you need to:</p>
<ul class="simple">
<li>Go to a sale order.</li>
<li>Click on “Pay Sale Advance”.</li>
<li>Select the Journal and specify the amount of the advanced payment.</li>
<li>“Make Advance Payment”.</li>
</ul>
<p>When generating the invoice, the system displays the advanced payments, 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>
<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>
<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:%2016.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>
<div class="section" id="authors">
<h3><a class="toc-backref" href="#toc-entry-5">Authors</a></h3>
<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>
<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>
<li>Nikul Chaudhary &lt;<a class="reference external" href="mailto:nchaudhary&#64;opensourceintegrators.com">nchaudhary&#64;opensourceintegrators.com</a>&gt;</li>
<li>Manuel Regidor &lt;<a class="reference external" href="mailto:manuel.regidor&#64;sygel.es">manuel.regidor&#64;sygel.es</a>&gt;</li>
<li>Urvisha Desai &lt;<a class="reference external" href="mailto:udesai&#64;opensourceintegrators.com">udesai&#64;opensourceintegrators.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h3><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h3>
<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/16.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>

View file

@ -0,0 +1 @@
from . import test_sale_advance_payment

View file

@ -0,0 +1,558 @@
# Copyright (C) 2021 ForgeFlow S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
from odoo import fields
from odoo.exceptions import ValidationError
from odoo.tests import common
class TestSaleAdvancePayment(common.TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
# Partners
cls.res_partner_1 = cls.env["res.partner"].create({"name": "Wood Corner"})
cls.res_partner_address_1 = cls.env["res.partner"].create(
{"name": "Willie Burke", "parent_id": cls.res_partner_1.id}
)
cls.res_partner_2 = cls.env["res.partner"].create({"name": "Partner 12"})
# Products
cls.product_1 = cls.env["product.product"].create(
{"name": "Desk Combination", "invoice_policy": "order"}
)
cls.product_2 = cls.env["product.product"].create(
{"name": "Conference Chair", "invoice_policy": "order"}
)
cls.product_3 = cls.env["product.product"].create(
{"name": "Repair Services", "invoice_policy": "order"}
)
cls.tax = cls.env["account.tax"].create(
{
"name": "Tax 15",
"type_tax_use": "sale",
"amount": 20,
}
)
# Sale Order
cls.sale_order_1 = cls.env["sale.order"].create(
{"partner_id": cls.res_partner_1.id}
)
cls.order_line_1 = cls.env["sale.order.line"].create(
{
"order_id": cls.sale_order_1.id,
"product_id": cls.product_1.id,
"product_uom": cls.product_1.uom_id.id,
"product_uom_qty": 10.0,
"price_unit": 100.0,
"tax_id": cls.tax,
}
)
cls.order_line_2 = cls.env["sale.order.line"].create(
{
"order_id": cls.sale_order_1.id,
"product_id": cls.product_2.id,
"product_uom": cls.product_2.uom_id.id,
"product_uom_qty": 25.0,
"price_unit": 40.0,
"tax_id": cls.tax,
}
)
cls.order_line_3 = cls.env["sale.order.line"].create(
{
"order_id": cls.sale_order_1.id,
"product_id": cls.product_3.id,
"product_uom": cls.product_3.uom_id.id,
"product_uom_qty": 20.0,
"price_unit": 50.0,
"tax_id": cls.tax,
}
)
cls.active_euro = False
cls.currency_euro = (
cls.env["res.currency"]
.with_context(active_test=False)
.search([("name", "=", "EUR")])
)
# active euro currency if inactive for test
if not cls.currency_euro.active:
cls.currency_euro.active = True
cls.active_euro = True
cls.currency_usd = cls.env["res.currency"].search([("name", "=", "USD")])
cls.currency_rate = cls.env["res.currency.rate"].search(
[
("currency_id", "=", cls.currency_usd.id),
("name", "=", fields.Date.today()),
]
)
if cls.currency_rate:
cls.currency_rate.write({"rate": 1.20})
else:
cls.currency_rate = cls.env["res.currency.rate"].create(
{
"rate": 1.20,
"currency_id": cls.currency_usd.id,
"name": fields.Date.today(),
}
)
cls.journal_eur_bank = cls.env["account.journal"].create(
{
"name": "Journal Euro Bank",
"type": "bank",
"code": "111",
"currency_id": cls.currency_euro.id,
}
)
cls.journal_usd_bank = cls.env["account.journal"].create(
{
"name": "Journal USD Bank",
"type": "bank",
"code": "222",
"currency_id": cls.currency_usd.id,
}
)
cls.journal_eur_cash = cls.env["account.journal"].create(
{
"name": "Journal Euro Cash",
"type": "cash",
"code": "333",
"currency_id": cls.currency_euro.id,
}
)
cls.journal_usd_cash = cls.env["account.journal"].create(
{
"name": "Journal USD Cash",
"type": "cash",
"code": "444",
"currency_id": cls.currency_usd.id,
}
)
def test_01_sale_advance_payment(self):
self.assertEqual(
self.sale_order_1.amount_residual,
3600,
)
self.assertEqual(
self.sale_order_1.amount_residual,
self.sale_order_1.amount_total,
"Amounts should match",
)
context_payment = {
"active_ids": [self.sale_order_1.id],
"active_id": self.sale_order_1.id,
}
# Check residual > advance payment and the comparison takes
# into account the currency. 3001*1.2 > 3600
with self.assertRaises(ValidationError):
advance_payment_0 = (
self.env["account.voucher.wizard"]
.with_context(**context_payment)
.create(
{
"journal_id": self.journal_eur_bank.id,
"payment_type": "inbound",
"amount_advance": 3001,
"order_id": self.sale_order_1.id,
}
)
)
advance_payment_0.make_advance_payment()
# Create Advance Payment 1 - EUR - bank
advance_payment_1 = (
self.env["account.voucher.wizard"]
.with_context(**context_payment)
.create(
{
"journal_id": self.journal_eur_bank.id,
"payment_type": "inbound",
"amount_advance": 100,
"order_id": self.sale_order_1.id,
}
)
)
advance_payment_1.make_advance_payment()
self.assertEqual(self.sale_order_1.amount_residual, 3480)
# Create Advance Payment 2 - USD - cash
advance_payment_2 = (
self.env["account.voucher.wizard"]
.with_context(**context_payment)
.create(
{
"journal_id": self.journal_usd_cash.id,
"payment_type": "inbound",
"amount_advance": 200,
"order_id": self.sale_order_1.id,
}
)
)
advance_payment_2.make_advance_payment()
self.assertEqual(self.sale_order_1.amount_residual, 3280)
# Confirm Sale Order
self.sale_order_1.action_confirm()
# Create Advance Payment 3 - EUR - cash
advance_payment_3 = (
self.env["account.voucher.wizard"]
.with_context(**context_payment)
.create(
{
"journal_id": self.journal_eur_cash.id,
"payment_type": "inbound",
"amount_advance": 250,
"order_id": self.sale_order_1.id,
}
)
)
advance_payment_3.make_advance_payment()
self.assertEqual(self.sale_order_1.amount_residual, 2980)
# Create Advance Payment 4 - USD - bank
advance_payment_4 = (
self.env["account.voucher.wizard"]
.with_context(**context_payment)
.create(
{
"journal_id": self.journal_usd_bank.id,
"payment_type": "inbound",
"amount_advance": 400,
"order_id": self.sale_order_1.id,
}
)
)
advance_payment_4.make_advance_payment()
self.assertEqual(self.sale_order_1.amount_residual, 2580)
# Check that the outbound amount is not greated than the
# amount paid in advanced (in EUR)
with self.assertRaises(ValidationError):
advance_payment_5 = (
self.env["account.voucher.wizard"]
.with_context(**context_payment)
.create(
{
"journal_id": self.journal_eur_bank.id,
"payment_type": "outbound",
"amount_advance": 850.01,
"order_id": self.sale_order_1.id,
}
)
)
advance_payment_5.make_advance_payment()
# Confirm Sale Order
self.sale_order_1.action_confirm()
# Create Invoice
invoice = self.sale_order_1._create_invoices()
invoice.action_post()
# Verify that advance payments are reconciled with the invoice
rate = self.currency_rate.rate
expected_payment_amounts = [100 * rate, 200, 250 * rate, 400]
# Get all payment lines that should have been reconciled
payment_lines = self.env["account.move.line"].search(
[
("move_id", "in", self.sale_order_1.account_payment_ids.move_id.ids),
(
"account_id.account_type",
"in",
("asset_receivable", "liability_payable"),
),
("parent_state", "=", "posted"),
]
)
# Check that all payments are reconciled
self.assertTrue(all(line.reconciled for line in payment_lines))
# Verify the payment amounts match
actual_payment_amounts = []
for line in payment_lines:
actual_payment_amounts.append(abs(line.balance))
actual_payment_amounts_sorted = sorted(actual_payment_amounts)
expected_payment_amounts_sorted = sorted(expected_payment_amounts)
self.assertEqual(actual_payment_amounts_sorted, expected_payment_amounts_sorted)
def test_02_residual_amount_with_invoice(self):
self.assertEqual(
self.sale_order_1.amount_residual,
3600,
)
self.assertEqual(
self.sale_order_1.amount_residual,
self.sale_order_1.amount_total,
)
# Create Advance Payment 1 - EUR - bank
context_payment = {
"active_ids": [self.sale_order_1.id],
"active_id": self.sale_order_1.id,
}
# Create Advance Payment 2 - USD - cash
advance_payment_2 = (
self.env["account.voucher.wizard"]
.with_context(**context_payment)
.create(
{
"journal_id": self.journal_usd_cash.id,
"payment_type": "inbound",
"amount_advance": 200,
"order_id": self.sale_order_1.id,
}
)
)
advance_payment_2.make_advance_payment()
pre_payment = self.sale_order_1.account_payment_ids
self.assertEqual(len(pre_payment), 1)
self.assertEqual(self.sale_order_1.amount_residual, 3400)
# generate invoice, pay invoice, check amount residual.
self.sale_order_1.action_confirm()
self.assertEqual(self.sale_order_1.invoice_status, "to invoice")
self.sale_order_1._create_invoices()
self.assertEqual(self.sale_order_1.invoice_status, "invoiced")
self.assertEqual(self.sale_order_1.amount_residual, 3400)
invoice = self.sale_order_1.invoice_ids
invoice.invoice_date = fields.Date.today()
invoice.action_post()
active_ids = invoice.ids
self.env["account.payment.register"].with_context(
active_model="account.move", active_ids=active_ids
).create(
{
"amount": 1200.0,
"group_payment": True,
"payment_difference_handling": "open",
}
)._create_payments()
self.assertEqual(self.sale_order_1.amount_residual, 2200)
def test_03_residual_amount_big_pre_payment(self):
self.assertEqual(
self.sale_order_1.amount_residual,
3600,
)
self.assertEqual(
self.sale_order_1.amount_residual,
self.sale_order_1.amount_total,
)
# Create Advance Payment 1 - EUR - bank
context_payment = {
"active_ids": [self.sale_order_1.id],
"active_id": self.sale_order_1.id,
}
# Create Advance Payment 2 - USD - cash
advance_payment_2 = (
self.env["account.voucher.wizard"]
.with_context(**context_payment)
.create(
{
"journal_id": self.journal_usd_cash.id,
"payment_type": "inbound",
"amount_advance": 2000,
"order_id": self.sale_order_1.id,
}
)
)
advance_payment_2.make_advance_payment()
pre_payment = self.sale_order_1.account_payment_ids
self.assertEqual(len(pre_payment), 1)
self.assertEqual(self.sale_order_1.amount_residual, 1600)
# generate a partial invoice, reconcile with pre payment, check amount residual.
self.sale_order_1.action_confirm()
self.assertEqual(self.sale_order_1.invoice_status, "to invoice")
# Adjust invoice_policy method to then do a partial invoice with a total amount
# smaller than the pre-payment.
self.product_1.invoice_policy = "delivery"
self.order_line_1.qty_delivered = 10.0
self.assertEqual(self.order_line_1.qty_to_invoice, 10.0)
self.product_2.invoice_policy = "delivery"
self.order_line_2.qty_delivered = 0.0
self.assertEqual(self.order_line_2.qty_to_invoice, 0.0)
self.product_3.invoice_policy = "delivery"
self.order_line_3.qty_delivered = 0.0
self.assertEqual(self.order_line_3.qty_to_invoice, 0.0)
self.sale_order_1._create_invoices()
self.assertEqual(self.sale_order_1.invoice_status, "no")
self.assertEqual(self.sale_order_1.amount_residual, 1600)
invoice = self.sale_order_1.invoice_ids
invoice.invoice_date = fields.Date.today()
invoice.action_post()
self.assertEqual(invoice.amount_total, 1200)
self.assertEqual(invoice.amount_residual, 0.0)
self.assertEqual(self.sale_order_1.amount_residual, 1600)
self.assertEqual(invoice.amount_residual, 0)
def test_04_sale_advance_payment_multi_inv_validate_wiz(self):
self.assertEqual(
self.sale_order_1.amount_residual,
3600,
)
self.assertEqual(
self.sale_order_1.amount_residual,
self.sale_order_1.amount_total,
"Amounts should match",
)
context_payment = {
"active_ids": [self.sale_order_1.id],
"active_id": self.sale_order_1.id,
}
# Create Advance Payment 1 - EUR - bank
advance_payment_1 = (
self.env["account.voucher.wizard"]
.with_context(**context_payment)
.create(
{
"journal_id": self.journal_eur_bank.id,
"payment_type": "inbound",
"amount_advance": 100,
"order_id": self.sale_order_1.id,
}
)
)
advance_payment_1.make_advance_payment()
self.assertEqual(self.sale_order_1.amount_residual, 3480)
# Create Advance Payment 2 - USD - cash
advance_payment_2 = (
self.env["account.voucher.wizard"]
.with_context(**context_payment)
.create(
{
"journal_id": self.journal_usd_cash.id,
"payment_type": "inbound",
"amount_advance": 200,
"order_id": self.sale_order_1.id,
}
)
)
advance_payment_2.make_advance_payment()
self.assertEqual(self.sale_order_1.amount_residual, 3280)
# Confirm Sale Order
self.sale_order_1.action_confirm()
# Create Advance Payment 3 - EUR - cash
advance_payment_3 = (
self.env["account.voucher.wizard"]
.with_context(**context_payment)
.create(
{
"journal_id": self.journal_eur_cash.id,
"payment_type": "inbound",
"amount_advance": 250,
"order_id": self.sale_order_1.id,
}
)
)
advance_payment_3.make_advance_payment()
self.assertEqual(self.sale_order_1.amount_residual, 2980)
# Create Advance Payment 4 - USD - bank
advance_payment_4 = (
self.env["account.voucher.wizard"]
.with_context(**context_payment)
.create(
{
"journal_id": self.journal_usd_bank.id,
"payment_type": "inbound",
"amount_advance": 400,
"order_id": self.sale_order_1.id,
}
)
)
advance_payment_4.make_advance_payment()
self.assertEqual(self.sale_order_1.amount_residual, 2580)
# Confirm Sale Order
self.sale_order_1.action_confirm()
# Create Invoice
invoice = self.sale_order_1._create_invoices()
self.assertEqual(invoice.state, "draft")
validate_wiz = (
self.env["validate.account.move"]
.with_context(active_model="account.move", active_ids=invoice.ids)
.create({})
)
validate_wiz.validate_move()
self.assertEqual(invoice.state, "posted")
self.assertEqual(invoice.payment_state, "partial")
# Verify that advance payments are reconciled with the invoice
rate = self.currency_rate.rate
expected_payment_amounts = [100 * rate, 200, 250 * rate, 400]
# Get all payment lines that should have been reconciled
payment_lines = self.env["account.move.line"].search(
[
("move_id", "in", self.sale_order_1.account_payment_ids.move_id.ids),
(
"account_id.account_type",
"in",
("asset_receivable", "liability_payable"),
),
("parent_state", "=", "posted"),
]
)
# Check that all payments are reconciled
self.assertTrue(all(line.reconciled for line in payment_lines))
# Verify the payment amounts match
actual_payment_amounts = []
for line in payment_lines:
actual_payment_amounts.append(abs(line.balance))
actual_payment_amounts_sorted = sorted(actual_payment_amounts)
expected_payment_amounts_sorted = sorted(expected_payment_amounts)
self.assertEqual(actual_payment_amounts_sorted, expected_payment_amounts_sorted)
def test_05_residual_amount_credit_note(self):
self.sale_order_1.action_confirm()
self.sale_order_1._create_invoices()
invoice = self.sale_order_1.invoice_ids[0]
invoice.invoice_date = fields.Date.today()
invoice.action_post()
self.env["account.payment.register"].with_context(
active_model="account.move", active_ids=invoice.ids
).create(
{
"amount": 3600.0,
"group_payment": True,
"payment_difference_handling": "open",
}
)._create_payments()
self.assertEqual(self.sale_order_1.amount_residual, 0)
credit_note = invoice._reverse_moves()
credit_note.invoice_date = fields.Date.today()
credit_note.action_post()
self.env["account.payment.register"].with_context(
active_model="account.move", active_ids=credit_note.ids
).create(
{
"amount": 3600.0,
"group_payment": True,
"payment_difference_handling": "open",
}
)._create_payments()
self.assertEqual(self.sale_order_1.amount_residual, 3600)

View file

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_order_form" model="ir.ui.view">
<field name="name">sale.order.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
<button name="action_draft" position="after">
<button
name="%(action_view_account_voucher_wizard)d"
string="Pay sale advanced"
type="action"
groups="account.group_account_invoice"
attrs="{'invisible': [('state', 'in', ['done','cancel'])]}"
/>
</button>
<notebook position="inside">
<page string="Payment advances" groups="account.group_account_invoice">
<field
name="account_payment_ids"
nolabel="1"
colspan="4"
context="{'form_view_ref': 'account.view_account_payment_form','tree_view_ref': 'account.view_account_payment_tree'}"
/>
</page>
</notebook>
<field name="tax_totals" position="after">
<div class="oe_subtotal_footer_separator oe_inline o_td_label">
<label for="amount_residual" />
</div>
<field
name="amount_residual"
nolabel="1"
class="oe_subtotal_footer_separator"
widget="monetary"
options="{'currency_field': 'currency_id'}"
/>
</field>
<field name="tag_ids" position="after">
<field name="advance_payment_status" />
</field>
</field>
</record>
<record id="view_order_tree" model="ir.ui.view">
<field name="name">sale.order.tree</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_tree" />
<field name="arch" type="xml">
<field name="invoice_status" position="before">
<field
name="advance_payment_status"
decoration-success="advance_payment_status == 'paid'"
decoration-info="advance_payment_status == 'partial'"
decoration-warning="advance_payment_status == 'not_paid'"
widget="badge"
optional="hide"
/>
</field>
<field name="amount_total" position="after">
<field
name="amount_residual"
widget="monetary"
decoration-bf="1"
optional="hide"
/>
</field>
</field>
</record>
<record id="view_quotation_tree" model="ir.ui.view">
<field name="name">sale.order.tree</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_quotation_tree" />
<field name="arch" type="xml">
<field name="invoice_status" position="before">
<field
name="advance_payment_status"
decoration-success="advance_payment_status == 'paid'"
decoration-info="advance_payment_status == 'partial'"
decoration-warning="advance_payment_status == 'not_paid'"
widget="badge"
optional="hide"
/>
</field>
<field name="amount_total" position="after">
<field
name="amount_residual"
widget="monetary"
decoration-bf="1"
optional="hide"
/>
</field>
</field>
</record>
</odoo>

View file

@ -0,0 +1 @@
from . import sale_advance_payment_wzd

View file

@ -0,0 +1,162 @@
# Copyright 2017 Omar Castiñeira, Comunitea Servicios Tecnológicos S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import _, api, exceptions, fields, models
from odoo.exceptions import UserError
from odoo.tools import float_compare
class AccountVoucherWizard(models.TransientModel):
_name = "account.voucher.wizard"
_description = "Account Voucher Wizard"
order_id = fields.Many2one("sale.order", required=True)
journal_id = fields.Many2one(
"account.journal",
"Journal",
required=True,
domain=[("type", "in", ("bank", "cash"))],
)
journal_currency_id = fields.Many2one(
"res.currency",
"Journal Currency",
store=True,
readonly=False,
compute="_compute_get_journal_currency",
)
currency_id = fields.Many2one("res.currency", "Currency", readonly=True)
amount_total = fields.Monetary(readonly=True)
amount_advance = fields.Monetary(
"Amount advanced", required=True, currency_field="journal_currency_id"
)
date = fields.Date(required=True, default=fields.Date.context_today)
currency_amount = fields.Monetary(
"Curr. amount", readonly=True, currency_field="currency_id"
)
payment_ref = fields.Char("Ref.")
payment_type = fields.Selection(
[("inbound", "Inbound"), ("outbound", "Outbound")],
default="inbound",
required=True,
)
@api.depends("journal_id")
def _compute_get_journal_currency(self):
for wzd in self:
wzd.journal_currency_id = (
wzd.journal_id.currency_id.id
or wzd.journal_id.company_id.currency_id.id
)
@api.constrains("amount_advance")
def check_amount(self):
if self.amount_advance <= 0:
raise exceptions.ValidationError(_("Amount of advance must be positive."))
if self.env.context.get("active_id", False):
self.onchange_date()
if self.payment_type == "inbound":
if (
float_compare(
self.currency_amount,
self.order_id.amount_residual,
precision_digits=2,
)
> 0
):
raise exceptions.ValidationError(
_(
"Inbound amount of advance is greater than residual amount on sale"
)
)
else:
paid_in_advanced = self.order_id.amount_total - self.amount_total
if (
float_compare(
self.currency_amount,
paid_in_advanced,
precision_digits=2,
)
> 0
):
raise exceptions.ValidationError(
_(
"Outbound amount of advance is greater than the "
"advanced paid amount"
)
)
@api.model
def default_get(self, fields_list):
res = super().default_get(fields_list)
sale_ids = self.env.context.get("active_ids", [])
if not sale_ids:
return res
sale_id = fields.first(sale_ids)
sale = self.env["sale.order"].browse(sale_id)
if "amount_total" in fields_list:
res.update(
{
"order_id": sale.id,
"amount_total": sale.amount_residual,
"currency_id": sale.pricelist_id.currency_id.id,
}
)
return res
@api.onchange("journal_id", "date", "amount_advance")
def onchange_date(self):
if self.journal_currency_id != self.currency_id:
amount_advance = self.journal_currency_id._convert(
self.amount_advance,
self.currency_id,
self.order_id.company_id,
self.date or fields.Date.today(),
)
else:
amount_advance = self.amount_advance
self.currency_amount = amount_advance
def _prepare_payment_vals(self, sale):
partner_id = sale.partner_invoice_id.commercial_partner_id.id
if self.amount_advance < 0.0:
raise UserError(
_(
"The amount to advance must always be positive. "
"Please use the payment type to indicate if this "
"is an inbound or an outbound payment."
)
)
return {
"date": self.date,
"amount": self.amount_advance,
"payment_type": self.payment_type,
"partner_type": "customer",
"ref": self.payment_ref or sale.name,
"journal_id": self.journal_id.id,
"currency_id": self.journal_currency_id.id,
"partner_id": partner_id,
"payment_method_id": self.env.ref(
"account.account_payment_method_manual_in"
).id,
}
def make_advance_payment(self):
"""Create customer paylines and validates the payment"""
self.ensure_one()
payment_obj = self.env["account.payment"]
sale_obj = self.env["sale.order"]
sale_ids = self.env.context.get("active_ids", [])
if sale_ids:
sale_id = fields.first(sale_ids)
sale = sale_obj.browse(sale_id)
payment_vals = self._prepare_payment_vals(sale)
payment = payment_obj.create(payment_vals)
sale.account_payment_ids |= payment
payment.action_post()
return {
"type": "ir.actions.act_window_close",
}

View file

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_account_voucher_wizard" model="ir.ui.view">
<field name="name">Advance Payment</field>
<field name="model">account.voucher.wizard</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Advance Payment">
<group>
<field name="order_id" invisible="1" />
<group colspan="4" col="4">
<field
name="journal_id"
domain="[('type','in',['bank', 'cash'])]"
widget="selection"
select="1"
string="Payment Method"
/>
<field name="payment_type" />
<field name="journal_currency_id" string="Currency" />
<field name="payment_ref" />
<field name="date" />
<field name="amount_total" string="Order Due Amount" />
</group>
<separator string="Operation" colspan="4" />
<group colspan="4" col="4">
<field name="amount_advance" />
<field name="currency_id" string="Order Currency" />
<field
name="currency_amount"
string="Amount in Order Currency"
/>
</group>
</group>
<footer>
<button
name="make_advance_payment"
string="Make advance payment"
type="object"
class="btn-primary"
/>
<button special="cancel" string="Cancel" class="btn-default" />
</footer>
</form>
</field>
</record>
<record id="action_view_account_voucher_wizard" model="ir.actions.act_window">
<field name="name">Advance Payment</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.voucher.wizard</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
</odoo>