Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] sale_advance_payment #7

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions sale_advance_payment/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
====================
Sale Advance Payment
====================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/sale-workflow/tree/15.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-15-0/sale-workflow-15-0-sale_advance_payment
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/167/15.0
:alt: Try me on Runbot

|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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_advance_payment%0Aversion:%2015.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 <[email protected]>
* Daniel Reis <[email protected]>
* Nikul Chaudhary <[email protected]>
* Urvisha Desai <[email protected]>

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/15.0/sale_advance_payment>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions sale_advance_payment/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizard
19 changes: 19 additions & 0 deletions sale_advance_payment/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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.0.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,
}
251 changes: 251 additions & 0 deletions sale_advance_payment/i18n/lt.po
Original file line number Diff line number Diff line change
@@ -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+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-27 06:52+0000\n"
"PO-Revision-Date: 2023-06-27 06:52+0000\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 "Avansinis mokėjimas"

#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__advance_payment_status
msgid "Advance Payment Status"
msgstr "Avansinio mokėjimo būsena"

#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_total
msgid "Amount Total"
msgstr "Bendra suma"

#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__amount_advance
msgid "Amount advanced"
msgstr "Avansinio mokėjimo suma"

#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Amount in Order Currency"
msgstr "Suma užsakymo valiuta"

#. 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 "Avanso suma turi būti teigiama."

#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Cancel"
msgstr "Atšaukti"

#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_uid
msgid "Created by"
msgstr "Sukūrė"

#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__create_date
msgid "Created on"
msgstr "Sukurta"

#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__currency_amount
msgid "Curr. amount"
msgstr "Valiutos suma"

#. 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 "Valiuta"

#. 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 "Rodomas pavadinimas"

#. 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 "Įeinantys"

#. 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 "Įeinančio avanso suma yra didesnė nei likutinė pardavimo suma"

#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_id
msgid "Journal"
msgstr "Žurnalas"

#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__journal_currency_id
msgid "Journal Currency"
msgstr "Žurnalo valiuta"

#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_account_move
msgid "Journal Entry"
msgstr "Žurnalo įrašas"

#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard____last_update
msgid "Last Modified on"
msgstr "Paskutinį kartą keista"

#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_uid
msgid "Last Updated by"
msgstr "Paskutinį kartą atnaujino"

#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__write_date
msgid "Last Updated on"
msgstr "Paskutinį kartą atnaujinta"

#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Make advance payment"
msgstr "Užregistruoti mokėjimą"

#. 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 "Neapmokėta"

#. 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 "Užsakymas"

#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Order Currency"
msgstr "Užsakymo valiuta"

#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Order Due Amount"
msgstr "Užsakymo mokėjimo suma"

#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__account_voucher_wizard__payment_type__outbound
msgid "Outbound"
msgstr "Išeinantys"

#. 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 "Išeinančio avanso suma yra didesnė nei iš anksto sumokėta suma"

#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__paid
msgid "Paid"
msgstr "Apmokėta"

#. module: sale_advance_payment
#: model:ir.model.fields.selection,name:sale_advance_payment.selection__sale_order__advance_payment_status__partial
msgid "Partially Paid"
msgstr "Dalinai apmokėta"

#. 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 "Sukurti mokėjimą"

#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_account_voucher_wizard
msgid "Payment Method"
msgstr "Mokėjimo būdas"

#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_type
msgid "Payment Type"
msgstr "Mokėjimo tipas"

#. module: sale_advance_payment
#: model_terms:ir.ui.view,arch_db:sale_advance_payment.view_order_form
msgid "Payment advances"
msgstr "Mokėjimo avansiniai mokėjimai"

#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__payment_line_ids
msgid "Payment move lines"
msgstr "Mokėjimo perkėlimo eilutės"

#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_account_payment
msgid "Payments"
msgstr "Mokėjimai"

#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_voucher_wizard__payment_ref
msgid "Ref."
msgstr "Nr."

#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_sale_order__amount_residual
msgid "Residual amount"
msgstr "Likutis"

#. module: sale_advance_payment
#: model:ir.model.fields,field_description:sale_advance_payment.field_account_payment__sale_id
msgid "Sale"
msgstr "Pardavimas"

#. module: sale_advance_payment
#: model:ir.model,name:sale_advance_payment.model_sale_order
msgid "Sales Order"
msgstr "Pardavimo užsakymas"

#. 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 ""
"Avanso suma visada turi būti teigiama. Naudokite mokėjimo tipą, kad nurodytumėte,
" ar tai yra įeinantis, ar išeinantis mokėjimas."
3 changes: 3 additions & 0 deletions sale_advance_payment/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import payment
from . import sale
from . import account_move
21 changes: 21 additions & 0 deletions sale_advance_payment/models/account_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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 action_post(self):
# Automatic reconciliation of payment when invoice confirmed.
res = super(AccountMove, self).action_post()
sale_order = self.mapped("line_ids.sale_line_ids.order_id")
if sale_order and self.invoice_outstanding_credits_debits_widget is not False:
json_invoice_outstanding_data = (
self.invoice_outstanding_credits_debits_widget.get("content", [])
)
for data in json_invoice_outstanding_data:
if data.get("move_id") in sale_order.account_payment_ids.move_id.ids:
self.js_assign_outstanding_line(line_id=data.get("id"))
return res
Loading