Skip to content

Commit

Permalink
Merge pull request #1 from ursais/12.0-add-account_invoice_refund_reason
Browse files Browse the repository at this point in the history
[IMP] account_invoice_refund_reason
  • Loading branch information
Chanakya-SerpentCS authored Dec 10, 2019
2 parents 0dcd84f + cbf4973 commit 8ea5473
Show file tree
Hide file tree
Showing 56 changed files with 1,932 additions and 41 deletions.
1 change: 0 additions & 1 deletion account_invoice_refund_reason/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright (C) 2019 Open Source Integrators
# Copyright (C) 2019 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
from . import wizard
22 changes: 12 additions & 10 deletions account_invoice_refund_reason/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@
'version': '12.0.1.0.0',
"summary": "Account Invoice Refund Reason.",
'category': 'Accounting',
'author': "Open Source Integrators, "
"Odoo Community Association (OCA), ",
"Serpent CS, "
'website': 'https://github.com/OCA/account-invoicing.git',
'data': ['security/ir.model.access.csv',
'data/account.invoice.refund.reason.csv',
'views/account_invoice_view.xml',
'views/account_invoice_refund_reason_view.xml',
'wizard/account_invoice_refund_view.xml'],
'author':
"Open Source Integrators, "
"Serpent CS, "
"Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/account-invoicing',
'data': [
'security/ir.model.access.csv',
'data/account.invoice.refund.reason.csv',
'views/account_invoice_view.xml',
'views/account_invoice_refund_reason_view.xml',
'wizard/account_invoice_refund_view.xml'],
'depends': ['account'],
'license': 'AGPL-3',
'development_status': 'Beta',
'maintainers': ['max3903']
'maintainers': ['max3903'],
}
7 changes: 4 additions & 3 deletions account_invoice_refund_reason/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (C) 2019 Open Source Integrators
# Copyright (C) 2019 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import account_invoice_refund_reason
from . import account_invoice
from . import (
account_invoice_refund_reason,
account_invoice,
)
1 change: 0 additions & 1 deletion account_invoice_refund_reason/models/account_invoice.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright (C) 2019 Open Source Integrators
# Copyright (C) 2019 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright (C) 2019 Open Source Integrators
# Copyright (C) 2019 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


Expand Down
2 changes: 2 additions & 0 deletions account_invoice_refund_reason/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Go to *Accounting > Configuration > Management > Refund Reasons*
* Review the list of predefined reasons to update them or add new ones
7 changes: 7 additions & 0 deletions account_invoice_refund_reason/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
* Open Source Integrators <http://www.opensourceintegrators.com>

* Maxime Chambreuil <[email protected]>

* Serpent Consulting Services Pvt. Ltd. <[email protected]>

* Chanakya Soni <[email protected]>
2 changes: 2 additions & 0 deletions account_invoice_refund_reason/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module allows you to define a list of reasons to create a credit note from
a customer invoice or vendor bill and report on them.
5 changes: 5 additions & 0 deletions account_invoice_refund_reason/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* Go to *Accounting > Customers > Invoices* (or *Accounting > Vendors > Bills*)
* Select an open invoice
* Click on "Add Credit Note"
* In the wizard, select the reason and add the credit note
* In the pivot view, group customer invoices by Reason
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</form>
</field>
</record>

<record id="view_account_invoice_refund_reason_tree" model="ir.ui.view">
<field name="name">account.invoice.refund.reason.tree</field>
<field name="model">account.invoice.refund.reason</field>
Expand Down
8 changes: 4 additions & 4 deletions account_invoice_refund_reason/views/account_invoice_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='reference']" position="after">
<field name="reason_id" attrs="{'invisible': [('reason_id', '=', False)]}" readonly="1"/>
<field name="reason_id" attrs="{'invisible': [('reason_id', '=', False)]}" readonly="1"/>
</xpath>
<xpath expr="//page[@name='other_info']/group/group[1]/field[@name='name']" position="attributes">
<attribute name="attrs">{'invisible': [('reason_id','!=', False)]}</attribute>
<attribute name="attrs">{'invisible': [('type','in', ['in_refund', 'out_refund'])]}</attribute>
</xpath>
</field>
</record>
Expand All @@ -19,10 +19,10 @@
<field name="inherit_id" ref="account.invoice_supplier_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='other_info']/group/group[1]/field[@name='name']" position="attributes">
<attribute name="attrs">{'invisible': [('reason_id','!=', False)]}</attribute>
<attribute name="attrs">{'invisible': [('type', 'in', ['in_refund', 'out_refund'])]}</attribute>
</xpath>
<xpath expr="//field[@name='date']" position="after">
<field name="reason_id" attrs="{'invisible': [('reason_id', '=', False)]}" readonly="1"/>
<field name="reason_id" attrs="{'invisible': [('reason_id', '=', False)]}" readonly="1"/>
</xpath>
</field>
</record>
Expand Down
1 change: 0 additions & 1 deletion account_invoice_refund_reason/wizard/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Copyright (C) 2019 Open Source Integrators
# Copyright (C) 2019 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import account_invoice_refund
19 changes: 7 additions & 12 deletions account_invoice_refund_reason/wizard/account_invoice_refund.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
# Copyright (C) 2019 Open Source Integrators
# Copyright (C) 2019 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class AccountInvoiceRefund(models.TransientModel):
_inherit = 'account.invoice.refund'

reason_id = fields.Many2one('account.invoice.refund.reason',
string="Refund Reason ")
string="Reason to credit")

@api.onchange('reason_id')
def _onchange_reason_id(self):
if self.reason_id:
self.description = self.reason_id.name

@api.multi
def invoice_refund(self):
res = super(AccountInvoiceRefund, self).invoice_refund()
data_refund = self.read(['filter_refund'])[0]['filter_refund']
if data_refund == 'modify':
inv_id = res.get('res_id')
else:
inv_id = res.get('domain')[1][2][0]
if inv_id:
invoice = self.env['account.invoice'].browse(inv_id)
invoice.reason_id = self.reason_id
def compute_refund(self, mode='refund'):
res = super().compute_refund(mode)
context = dict(self._context or {})
inv_obj = self.env['account.invoice']
for inv in inv_obj.browse(context.get('active_ids')):
inv.reason_id = self.reason_id.id
return res
12 changes: 6 additions & 6 deletions account_invoice_validation_queued/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ msgstr ""
"Plural-Forms: \n"

#. module: account_invoice_validation_queued
#: model:ir.ui.view,arch_db:account_invoice_validation_queued.view_queue_job_account_invoice_validation
#: model_terms:ir.ui.view,arch_db:account_invoice_validation_queued.view_queue_job_account_invoice_validation
msgid "Cancel"
msgstr "Cancelar"

Expand All @@ -27,7 +27,7 @@ msgid "Confirm the selected invoices"
msgstr "Confirmar las facturas seleccionadas"

#. module: account_invoice_validation_queued
#: model:ir.ui.view,arch_db:account_invoice_validation_queued.account_invoice_confirm_view
#: model_terms:ir.ui.view,arch_db:account_invoice_validation_queued.account_invoice_confirm_view
msgid "Enqueue Validation"
msgstr "Encolar validación"

Expand All @@ -37,14 +37,14 @@ msgid "Invoice"
msgstr "Factura"

#. module: account_invoice_validation_queued
#: model:ir.ui.view,arch_db:account_invoice_validation_queued.view_queue_job_account_invoice_validation
#: model_terms:ir.ui.view,arch_db:account_invoice_validation_queued.view_queue_job_account_invoice_validation
msgid "Requeue"
msgstr "Volver a poner en cola"

#. module: account_invoice_validation_queued
#: model:ir.model.fields,field_description:account_invoice_validation_queued.field_account_invoice_validation_job_ids
#: model:ir.ui.view,arch_db:account_invoice_validation_queued.invoice_form
#: model:ir.ui.view,arch_db:account_invoice_validation_queued.invoice_supplier_form
#: model:ir.model.fields,field_description:account_invoice_validation_queued.field_account_invoice__validation_job_ids
#: model_terms:ir.ui.view,arch_db:account_invoice_validation_queued.invoice_form
#: model_terms:ir.ui.view,arch_db:account_invoice_validation_queued.invoice_supplier_form
msgid "Validation Jobs"
msgstr "Trabajos de validación"

Expand Down
1 change: 1 addition & 0 deletions oca_dependencies.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
partner-contact
product-attribute
purchase-workflow
queue
brand
75 changes: 75 additions & 0 deletions product_supplierinfo_for_customer_invoice/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
=========================================
Product Customer code for account invoice
=========================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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%2Faccount--invoicing-lightgray.png?logo=github
:target: https://github.com/OCA/account-invoicing/tree/12.0/product_supplierinfo_for_customer_invoice
:alt: OCA/account-invoicing
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-invoicing-12-0/account-invoicing-12-0-product_supplierinfo_for_customer_invoice
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/95/12.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

Based on product_supplierinfo_for_customer, this module loads in every account invoice the
customer code defined in the product.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-invoicing/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/account-invoicing/issues/new?body=module:%20product_supplierinfo_for_customer_invoice%0Aversion:%2012.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
~~~~~~~

* Agile Business Group

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

* Nicola Malcontenti <[email protected]>
* Serpent Consulting Services Pvt. Ltd. <[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/account-invoicing <https://github.com/OCA/account-invoicing/tree/12.0/product_supplierinfo_for_customer_invoice>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions product_supplierinfo_for_customer_invoice/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
22 changes: 22 additions & 0 deletions product_supplierinfo_for_customer_invoice/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2013-2017 Agile Business Group sagl
# (<http://www.agilebg.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Product Customer code for account invoice",
"summary": """Based on product_customer_code, this module loads in every
account invoice the customer code defined in the product""",
"version": "12.0.1.0.0",
"author": "Agile Business Group,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-invoicing",
"category": "Account",
"license": "AGPL-3",
"depends": [
"account",
"product_supplierinfo_for_customer",
],
"data": [
"views/account_invoice_view.xml",
],
"installable": True,
}
43 changes: 43 additions & 0 deletions product_supplierinfo_for_customer_invoice/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * product_customer_code_invoice
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-01-15 14:23+0000\n"
"PO-Revision-Date: 2014-06-21 01:02+0000\n"
"Last-Translator: Raphaël Valyi - http://www.akretion.com <Unknown>\n"
"Language-Team: \n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-06-22 05:58+0000\n"
"X-Generator: Launchpad (build 17058)\n"

#. module: product_supplierinfo_for_customer_invoice
#: model:ir.model.fields,help:product_supplierinfo_for_customer_invoice.field_account_invoice_line__partner_is_customer
msgid ""
"Check this box if this contact is a customer. It can be selected in sales "
"orders."
msgstr ""

#. module: product_supplierinfo_for_customer_invoice
#: model:ir.model,name:product_supplierinfo_for_customer_invoice.model_account_invoice_line
msgid "Invoice Line"
msgstr "Righe Fattura"

#. module: product_supplierinfo_for_customer_invoice
#: model:ir.model.fields,field_description:product_supplierinfo_for_customer_invoice.field_account_invoice_line__partner_is_customer
msgid "Is a Customer"
msgstr ""

#. module: product_supplierinfo_for_customer_invoice
#: model:ir.model.fields,field_description:product_supplierinfo_for_customer_invoice.field_account_invoice_line__product_customer_code
msgid "Product Customer Code"
msgstr "Codice Prodotto Cliente"

#~ msgid "Invoice"
#~ msgstr "Fattura"
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_supplierinfo_for_customer_invoice
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.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: product_supplierinfo_for_customer_invoice
#: model:ir.model.fields,help:product_supplierinfo_for_customer_invoice.field_account_invoice_line__partner_is_customer
msgid "Check this box if this contact is a customer. It can be selected in sales orders."
msgstr ""

#. module: product_supplierinfo_for_customer_invoice
#: model:ir.model,name:product_supplierinfo_for_customer_invoice.model_account_invoice_line
msgid "Invoice Line"
msgstr ""

#. module: product_supplierinfo_for_customer_invoice
#: model:ir.model.fields,field_description:product_supplierinfo_for_customer_invoice.field_account_invoice_line__partner_is_customer
msgid "Is a Customer"
msgstr ""

#. module: product_supplierinfo_for_customer_invoice
#: model:ir.model.fields,field_description:product_supplierinfo_for_customer_invoice.field_account_invoice_line__product_customer_code
msgid "Product Customer Code"
msgstr ""

3 changes: 3 additions & 0 deletions product_supplierinfo_for_customer_invoice/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import account_invoice
Loading

0 comments on commit 8ea5473

Please sign in to comment.