forked from OCA/account-invoicing
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ursais/12.0-add-account_invoice_refund_reason
[IMP] account_invoice_refund_reason
- Loading branch information
Showing
56 changed files
with
1,932 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
account_invoice_refund_reason/models/account_invoice_refund_reason.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
19
account_invoice_refund_reason/wizard/account_invoice_refund.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
partner-contact | ||
product-attribute | ||
purchase-workflow | ||
queue | ||
brand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
35 changes: 35 additions & 0 deletions
35
product_supplierinfo_for_customer_invoice/i18n/product_supplierinfo_for_customer_invoice.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.