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

[16.0][MIG] sale_transaction_form_link: Migration to 16.0 #3341

Merged
merged 10 commits into from
Oct 2, 2024
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
96 changes: 96 additions & 0 deletions sale_transaction_form_link/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
==========================
Sale Transaction Form Link
==========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:eef924cb9222cf85856ffa5669609f15be9c49ba827dc1d0f964ea10302dea60
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/16.0/sale_transaction_form_link
: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_transaction_form_link
: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|

* This module adds a button on Sale Order Form in order to see all the payment
transactions related to that Sale Order.

.. image:: https://user-images.githubusercontent.com/19529533/129061695-62739c7a-2d35-4764-b922-d5ea6dc0102d.png

**Table of contents**

.. contents::
:local:

Usage
=====

* Go to Sales > Orders > Orders and pick one.
* On Sale Order form, you have a button to go to the payment transaction if
some exist.

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_transaction_form_link%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
~~~~~~~

* ACSONE SA/NV

Contributors
~~~~~~~~~~~~

* Denis Roussel <[email protected]>
* `Binhex <https://binhex.cloud>`_:
* Zuzanna Elzbieta Szalaty Szalaty <[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.

.. |maintainer-rousseldenis| image:: https://github.com/rousseldenis.png?size=40px
:target: https://github.com/rousseldenis
:alt: rousseldenis

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-rousseldenis|

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions sale_transaction_form_link/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
23 changes: 23 additions & 0 deletions sale_transaction_form_link/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2020 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Sale Transaction Form Link",
"summary": """
Allows to display a link to payment transactions on Sale Order form view.""",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/sale-workflow",
"maintainers": ["rousseldenis"],
"depends": [
"payment",
"sale",
],
"data": [
"views/sale_order.xml",
],
"demo": [
"demo/payment_transaction.xml",
],
}
17 changes: 17 additions & 0 deletions sale_transaction_form_link/demo/payment_transaction.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2021 ACSONE SA/NV
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo noupdate="1">
<record id="transaction_sale_6" model="payment.transaction">
<field name="provider_id" ref="payment.payment_provider_adyen" />
<field name="amount">750.0</field>
<field name="partner_id" ref="base.res_partner_18" />
<field name="state">draft</field>
<field name="sale_order_ids" eval="[(6, 0, [ref('sale.sale_order_6')])]" />
<field
name="currency_id"
eval="obj().env.ref('sale.sale_order_6').currency_id"
model="sale.order"
/>
</record>
</odoo>
47 changes: 47 additions & 0 deletions sale_transaction_form_link/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_transaction_form_link
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-01-17 00:04+0000\n"
"Last-Translator: Ivorra78 <[email protected]>\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_transaction_form_link
#: model:ir.model.fields,field_description:sale_transaction_form_link.field_sale_order__display_name
msgid "Display Name"
msgstr "Mostrar Nombre"

#. module: sale_transaction_form_link
#: model:ir.model.fields,field_description:sale_transaction_form_link.field_sale_order__id
msgid "ID"
msgstr "ID"

#. module: sale_transaction_form_link
#: model:ir.model.fields,field_description:sale_transaction_form_link.field_sale_order____last_update
msgid "Last Modified on"
msgstr "Última Modificación el"

#. module: sale_transaction_form_link
#: model:ir.model.fields,field_description:sale_transaction_form_link.field_sale_order__payment_transaction_count
msgid "Number of payment transactions"
msgstr "Número de transacciones de pago"

#. module: sale_transaction_form_link
#: model:ir.model,name:sale_transaction_form_link.model_sale_order
msgid "Sales Order"
msgstr "Orden de Ventas"

#. module: sale_transaction_form_link
#: model_terms:ir.ui.view,arch_db:sale_transaction_form_link.sale_order_form_view
msgid "Transactions"
msgstr "Transacciones"
44 changes: 44 additions & 0 deletions sale_transaction_form_link/i18n/sale_transaction_form_link.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_transaction_form_link
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.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_transaction_form_link
#: model:ir.model.fields,field_description:sale_transaction_form_link.field_sale_order__display_name
msgid "Display Name"
msgstr ""

#. module: sale_transaction_form_link
#: model:ir.model.fields,field_description:sale_transaction_form_link.field_sale_order__id
msgid "ID"
msgstr ""

#. module: sale_transaction_form_link
#: model:ir.model.fields,field_description:sale_transaction_form_link.field_sale_order____last_update
msgid "Last Modified on"
msgstr ""

#. module: sale_transaction_form_link
#: model:ir.model.fields,field_description:sale_transaction_form_link.field_sale_order__payment_transaction_count
msgid "Number of payment transactions"
msgstr ""

#. module: sale_transaction_form_link
#: model:ir.model,name:sale_transaction_form_link.model_sale_order
msgid "Sales Order"
msgstr ""

#. module: sale_transaction_form_link
#: model_terms:ir.ui.view,arch_db:sale_transaction_form_link.sale_order_form_view
msgid "Transactions"
msgstr ""
1 change: 1 addition & 0 deletions sale_transaction_form_link/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import sale_order
36 changes: 36 additions & 0 deletions sale_transaction_form_link/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2020 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class SaleOrder(models.Model):

_inherit = "sale.order"

payment_transaction_count = fields.Integer(
string="Number of payment transactions",
compute="_compute_payment_transaction_count",
)

@api.depends("transaction_ids")
def _compute_payment_transaction_count(self):
for rec in self:
rec.payment_transaction_count = len(rec.transaction_ids)

def action_view_transaction(self):
action = {
"type": "ir.actions.act_window",
"name": "Payment Transactions",
"res_model": "payment.transaction",
}
if self.payment_transaction_count == 1:
action.update({"res_id": self.transaction_ids.id, "view_mode": "form"})
else:
action.update(
{
"view_mode": "tree,form",
"domain": [("id", "in", self.transaction_ids.ids)],
}
)
return action
3 changes: 3 additions & 0 deletions sale_transaction_form_link/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Denis Roussel <[email protected]>
* `Binhex <https://binhex.cloud>`_:
* Zuzanna Elzbieta Szalaty Szalaty <[email protected]>
4 changes: 4 additions & 0 deletions sale_transaction_form_link/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* This module adds a button on Sale Order Form in order to see all the payment
transactions related to that Sale Order.

.. image:: https://user-images.githubusercontent.com/19529533/129061695-62739c7a-2d35-4764-b922-d5ea6dc0102d.png
3 changes: 3 additions & 0 deletions sale_transaction_form_link/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Go to Sales > Orders > Orders and pick one.
* On Sale Order form, you have a button to go to the payment transaction if
some exist.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading