Skip to content

Commit

Permalink
[9.0][ADD] account_payment_show_invoice
Browse files Browse the repository at this point in the history
  • Loading branch information
LoisRForgeFlow committed Apr 12, 2017
1 parent 1027710 commit b655db1
Show file tree
Hide file tree
Showing 8 changed files with 147 additions and 0 deletions.
63 changes: 63 additions & 0 deletions account_payment_show_invoice/README.rst
@@ -0,0 +1,63 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

============================
Account Payment Show Invoice
============================

This module extends the tree view of payments to show the paid invoices
related to the payments using the vendor reference by default.

.. image:: account_payment_show_invoice/static/description/payments_view.png
:alt: payment view
:width: 600 px

Usage
=====

To use this module, you need to:

#. Go to 'Invoicing > Purchases > Payments' or to 'Invoicing > Sales >
Payments'
#. There you can see a new column *Invoices*.

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/96/9.0

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/account-payment/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.

Credits
=======

Images
------

* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

Contributors
------------

* Lois Rilo <lois.rilo@eficent.com>

Maintainer
----------

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

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.

To contribute to this module, please visit https://odoo-community.org.
5 changes: 5 additions & 0 deletions account_payment_show_invoice/__init__.py
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Eficent Business and IT Consulting Services, S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
19 changes: 19 additions & 0 deletions account_payment_show_invoice/__openerp__.py
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Eficent Business and IT Consulting Services, S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Account Payment Show Invoice",
"summary": "Extends the tree view of payments to show the paid invoices "
"related to the payments using the vendor reference by default",
"version": "9.0.1.0.0",
"category": "Account-payment",
"website": "https://odoo-community.org/",
"author": "Eficent, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["account"],
"data": [
"views/account_payment_view.xml",
],
}
5 changes: 5 additions & 0 deletions account_payment_show_invoice/models/__init__.py
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Eficent Business and IT Consulting Services, S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import account_payment
25 changes: 25 additions & 0 deletions account_payment_show_invoice/models/account_payment.py
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Eficent Business and IT Consulting Services, S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openerp import api, fields, models


class ModelName(models.Model):
_inherit = "account.payment"

@api.one
def _compute_invoice_vendor_references(self):
references = ''
for invoice in self.invoice_ids:
if references:
references += ', '
if invoice.reference:
references += invoice.reference
else:
references += invoice.number
self.invoice_vendor_references = references

invoice_vendor_references = fields.Char(
string='Invoices',
compute=_compute_invoice_vendor_references)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions account_payment_show_invoice/views/account_payment_view.xml
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2017 Eficent
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<odoo>

<record id="view_account_supplier_payment_tree" model="ir.ui.view">
<field name="name">account.supplier.payment.tree - show invoice</field>
<field name="model">account.payment</field>
<field name="inherit_id"
ref="account.view_account_supplier_payment_tree"/>
<field name="arch" type="xml">
<field name="partner_id" position="after">
<field name="invoice_vendor_references"/>
</field>
</field>
</record>

<record id="view_account_payment_tree" model="ir.ui.view">
<field name="name">account.supplier.payment.tree - show invoice</field>
<field name="model">account.payment</field>
<field name="inherit_id" ref="account.view_account_payment_tree"/>
<field name="arch" type="xml">
<field name="partner_id" position="after">
<field name="invoice_ids"/>
</field>
</field>
</record>

</odoo>

0 comments on commit b655db1

Please sign in to comment.