From 033038cac09ae33ef6e8e01b4829c70653c3a7b4 Mon Sep 17 00:00:00 2001 From: Kitti U Date: Tue, 2 Jul 2019 12:16:27 +0700 Subject: [PATCH 01/20] [12.0][ADD] account_menu_invoice_refund --- account_menu_invoice_refund/__init__.py | 4 + account_menu_invoice_refund/__manifest__.py | 23 +++++ account_menu_invoice_refund/hooks.py | 75 +++++++++++++++ .../readme/CONTRIBUTORS.rst | 1 + .../readme/DESCRIPTION.rst | 13 +++ account_menu_invoice_refund/readme/USAGE.rst | 4 + .../static/description/icon.png | Bin 0 -> 9455 bytes account_menu_invoice_refund/tests/__init__.py | 2 + .../tests/test_pay_net_invoice_refund.py | 91 ++++++++++++++++++ .../views/account_invoice_view.xml | 75 +++++++++++++++ 10 files changed, 288 insertions(+) create mode 100644 account_menu_invoice_refund/__init__.py create mode 100644 account_menu_invoice_refund/__manifest__.py create mode 100644 account_menu_invoice_refund/hooks.py create mode 100644 account_menu_invoice_refund/readme/CONTRIBUTORS.rst create mode 100644 account_menu_invoice_refund/readme/DESCRIPTION.rst create mode 100644 account_menu_invoice_refund/readme/USAGE.rst create mode 100644 account_menu_invoice_refund/static/description/icon.png create mode 100644 account_menu_invoice_refund/tests/__init__.py create mode 100644 account_menu_invoice_refund/tests/test_pay_net_invoice_refund.py create mode 100644 account_menu_invoice_refund/views/account_invoice_view.xml diff --git a/account_menu_invoice_refund/__init__.py b/account_menu_invoice_refund/__init__.py new file mode 100644 index 00000000000..1993e078aa8 --- /dev/null +++ b/account_menu_invoice_refund/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) + +from .hooks import post_load_hook diff --git a/account_menu_invoice_refund/__manifest__.py b/account_menu_invoice_refund/__manifest__.py new file mode 100644 index 00000000000..abb0353019b --- /dev/null +++ b/account_menu_invoice_refund/__manifest__.py @@ -0,0 +1,23 @@ +# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) + +{ + 'name': 'Accunt Menu - Invoice & Refund', + 'version': '12.0.1.0.0', + 'summary': 'New invoice menu that combine invoices and refunds', + 'category': 'Accounting & Finance', + 'author': 'Ecosoft, ' + 'Odoo Community Association (OCA)', + 'license': 'AGPL-3', + 'website': 'https://github.com/OCA/account-invoicing/', + 'depends': [ + 'account', + ], + 'data': [ + 'views/account_invoice_view.xml', + ], + 'installable': True, + 'development_status': 'beta', + 'maintainers': ['kittiu'], + 'post_load': 'post_load_hook', +} diff --git a/account_menu_invoice_refund/hooks.py b/account_menu_invoice_refund/hooks.py new file mode 100644 index 00000000000..738b1f6ce75 --- /dev/null +++ b/account_menu_invoice_refund/hooks.py @@ -0,0 +1,75 @@ +# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) + +from odoo import api, _ +from odoo.exceptions import UserError +from odoo.addons.account.models.account_payment import account_abstract_payment + +MAP_INVOICE_TYPE_PARTNER_TYPE = { + 'out_invoice': 'customer', + 'out_refund': 'customer', + 'in_invoice': 'supplier', + 'in_refund': 'supplier', +} + + +def post_load_hook(): + + @api.model + def new_default_get(self, fields): + """ Removed condition that disallow mixing invoice and refund """ + rec = super(account_abstract_payment, self).default_get(fields) + active_ids = self._context.get('active_ids') + active_model = self._context.get('active_model') + + # Check for selected invoices ids + if not active_ids or active_model != 'account.invoice': + return rec + + invoices = self.env['account.invoice'].browse(active_ids) + + # Check all invoices are open + if any(invoice.state != 'open' for invoice in invoices): + raise UserError( + _("You can only register payments for open invoices")) + # Check all invoices have the same currency + if any(inv.currency_id != invoices[0].currency_id for inv in invoices): + raise UserError(_("In order to pay multiple invoices " + "at once, they must use the same currency.")) + + # Look if we are mixin multiple commercial_partner + # or customer invoices with vendor bills + multi = any(inv.commercial_partner_id != + invoices[0].commercial_partner_id + or MAP_INVOICE_TYPE_PARTNER_TYPE[inv.type] != + MAP_INVOICE_TYPE_PARTNER_TYPE[invoices[0].type] + or inv.account_id != invoices[0].account_id + or inv.partner_bank_id != invoices[0].partner_bank_id + for inv in invoices) + + currency = invoices[0].currency_id + + total_amount = self._compute_payment_amount(invoices=invoices, + currency=currency) + + rec.update({ + 'amount': abs(total_amount), + 'currency_id': currency.id, + 'payment_type': total_amount > 0 and 'inbound' or 'outbound', + 'partner_id': (False if multi else + invoices[0].commercial_partner_id.id), + 'partner_type': (False if multi else + MAP_INVOICE_TYPE_PARTNER_TYPE[invoices[0].type]), + 'communication': ' '.join( + [ref for ref in invoices.mapped('reference') if ref])[:2000], + 'invoice_ids': [(6, 0, invoices.ids)], + 'multi': multi, + }) + return rec + + if not hasattr(account_abstract_payment, + 'default_get_original'): + account_abstract_payment.default_get_original = \ + account_abstract_payment.default_get + + account_abstract_payment.default_get = new_default_get diff --git a/account_menu_invoice_refund/readme/CONTRIBUTORS.rst b/account_menu_invoice_refund/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..033e67f43c1 --- /dev/null +++ b/account_menu_invoice_refund/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Kitti Upariphutthiphong diff --git a/account_menu_invoice_refund/readme/DESCRIPTION.rst b/account_menu_invoice_refund/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..2bc8dfb8d71 --- /dev/null +++ b/account_menu_invoice_refund/readme/DESCRIPTION.rst @@ -0,0 +1,13 @@ +By Odoo standard, Invoices and Refunds are in different menu, +and can't be mixed upon payment. + +This module add 2 new menus, + +1. Invoicing > Customers > Invoices / Credit Notes +2. Invoicing > Vendors > Bills / Refunds + +Additionally it allow register net payment by selecting both invoice and refund. + +**Note:** +This is accomplished by simply remove the condition that disallow +mixing invoice and refund in account.payment's default_get() diff --git a/account_menu_invoice_refund/readme/USAGE.rst b/account_menu_invoice_refund/readme/USAGE.rst new file mode 100644 index 00000000000..fd58915ba5c --- /dev/null +++ b/account_menu_invoice_refund/readme/USAGE.rst @@ -0,0 +1,4 @@ +To make payment that net invoice and refund, + +* Got to new menu, "Invoices / Credit Notes" or "Bills / Refunds" +* Make payment as normal, you will see the payment amount will be invoice amount minus refund amount diff --git a/account_menu_invoice_refund/static/description/icon.png b/account_menu_invoice_refund/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~! zVpnB`o+K7|Al`Q_U;eD$B zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__ zc+blN2UAB0=617@>_u;MPHN;P;N#YoE=)R#i$k_`UAA>WWCcEVMh~L_ zj--gtp&|K1#58Yz*AHCTMziU1Jzt_jG0I@qAOHsk$2}yTmVkBp_eHuY$A9)>P6o~I z%aQ?!(GqeQ-Y+b0I(m9pwgi(IIZZzsbMv+9w{PFtd_<_(LA~0H(xz{=FhLB@(1&qHA5EJw1>>=%q2f&^X>IQ{!GJ4e9U z&KlB)z(84HmNgm2hg2C0>WM{E(DdPr+EeU_N@57;PC2&DmGFW_9kP&%?X4}+xWi)( z;)z%wI5>D4a*5XwD)P--sPkoY(a~WBw;E~AW`Yue4kFa^LM3X`8x|}ZUeMnqr}>kH zG%WWW>3ml$Yez?i%)2pbKPI7?5o?hydokgQyZsNEr{a|mLdt;X2TX(#B1j35xPnPW z*bMSSOauW>o;*=kO8ojw91VX!qoOQb)zHJ!odWB}d+*K?#sY_jqPdg{Sm2HdYzdEx zOGVPhVRTGPtv0o}RfVP;Nd(|CB)I;*t&QO8h zFfekr30S!-LH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8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/account_menu_invoice_refund/tests/__init__.py b/account_menu_invoice_refund/tests/__init__.py new file mode 100644 index 00000000000..74292cd7790 --- /dev/null +++ b/account_menu_invoice_refund/tests/__init__.py @@ -0,0 +1,2 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import test_pay_net_invoice_refund diff --git a/account_menu_invoice_refund/tests/test_pay_net_invoice_refund.py b/account_menu_invoice_refund/tests/test_pay_net_invoice_refund.py new file mode 100644 index 00000000000..284100348ae --- /dev/null +++ b/account_menu_invoice_refund/tests/test_pay_net_invoice_refund.py @@ -0,0 +1,91 @@ +# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo.tests.common import TransactionCase, Form +from odoo.exceptions import UserError + + +class TestAccountMenuInvoiceRefund(TransactionCase): + + def test_pay_net_invoice_refund(self): + """By selecting 1 invoice and 1 refund document, + I expect to net pay all document in one go.""" + invoice_line1_vals = [ + (0, 0, { + 'product_id': self.env.ref('product.product_product_2').id, + 'quantity': 1.0, + 'account_id': self.env['account.account'].search( + [('user_type_id', '=', self.env.ref( + 'account.data_account_type_revenue').id)], + limit=1).id, + 'name': 'Product A', + 'price_unit': 450.00 + }) + ] + invoice_line2_vals = [ + (0, 0, { + 'product_id': self.env.ref('product.product_product_3').id, + 'quantity': 1.0, + 'account_id': self.env['account.account'].search( + [('user_type_id', '=', self.env.ref( + 'account.data_account_type_revenue').id)], + limit=1).id, + 'name': 'Product B', + 'price_unit': 200.00 + }) + ] + # 2 products = 650 + invoice = self.env['account.invoice'].create({ + 'name': 'Test Customer Invoice', + 'type': 'out_invoice', + 'journal_id': self.env['account.journal'].search( + [('type', '=', 'sale')], limit=1).id, + 'partner_id': self.env.ref('base.res_partner_12').id, + 'account_id': self.env['account.account'].search( + [('user_type_id', '=', self.env.ref( + 'account.data_account_type_receivable').id)], + limit=1).id, + 'invoice_line_ids': invoice_line1_vals + invoice_line2_vals, + }) + # refund 1 product = 200 + refund = self.env['account.invoice'].create({ + 'name': "Test Customer Refund", + 'type': 'out_refund', + 'journal_id': self.env['account.journal'].search( + [('type', '=', 'sale')], limit=1).id, + 'partner_id': self.env.ref('base.res_partner_12').id, + 'account_id': self.env['account.account'].search( + [('user_type_id', '=', self.env.ref( + 'account.data_account_type_receivable').id)], + limit=1).id, + 'invoice_line_ids': invoice_line2_vals, + }) + invoice.action_invoice_open() + ctx = {'active_ids': [invoice.id, refund.id], + 'active_model': 'account.invoice'} + # Make payment with net amount = 450, both invoice/refund is paid + PaymentWizard = self.env['account.register.payments'] + view_id = ('account.view_account_payment_from_invoices') + + # Test exception case, when refund currency is different + wrong_currency = self.env['res.currency'].search([ + ('id', '!=', invoice.currency_id.id)], limit=1) + wrong_refund = refund.copy({'currency_id': wrong_currency.id}) + wrong_refund.action_invoice_open() + ctx = {'active_ids': [invoice.id, wrong_refund.id], + 'active_model': 'account.invoice'} + with self.assertRaises(UserError): # Test wrong currency + Form(PaymentWizard.with_context(ctx), view=view_id) + + # Switch back to the valid refund, and try to make payment + ctx = {'active_ids': [invoice.id, refund.id], + 'active_model': 'account.invoice'} + with self.assertRaises(UserError): # Test doc status exception + Form(PaymentWizard.with_context(ctx), view=view_id) + refund.action_invoice_open() + # Finally, do the payment + with Form(PaymentWizard.with_context(ctx), view=view_id) as f: + f.amount = 450.0 + payment = f.save() + payment.create_payments() + self.assertEqual(invoice.state, 'paid') + self.assertEqual(refund.state, 'paid') diff --git a/account_menu_invoice_refund/views/account_invoice_view.xml b/account_menu_invoice_refund/views/account_invoice_view.xml new file mode 100644 index 00000000000..0a040507c98 --- /dev/null +++ b/account_menu_invoice_refund/views/account_invoice_view.xml @@ -0,0 +1,75 @@ + + + + + + Invoices / Credit Notes + account.invoice + form + tree,form + + [('type', 'in', ('out_invoice', 'out_refund'))] + {'type':'out_invoice', 'journal_type': 'sale'} + + +

+ Create a customer invoice +

+ Create invoices, register payments and keep track of the discussions with your customers. +

+
+
+ + + + tree + + + + + + + form + + + + + + + + + Bills / Refunds + account.invoice + form + tree,form + + [('type', 'in', ('in_invoice', 'in_refund'))] + {'type':'in_invoice', 'journal_type': 'purchase'} + + +

+ Create a vendor bill +

+ Create vendor bills, register payments and keep track of the discussions with your customers. +

+
+
+ + + + tree + + + + + + + form + + + + + + +
From e04c7d8afdbb7fb649d3c599bd4051f68d90e060 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Wed, 14 Aug 2019 15:16:36 +0000 Subject: [PATCH 02/20] [UPD] Update account_menu_invoice_refund.pot --- .../i18n/account_menu_invoice_refund.pot | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 account_menu_invoice_refund/i18n/account_menu_invoice_refund.pot diff --git a/account_menu_invoice_refund/i18n/account_menu_invoice_refund.pot b/account_menu_invoice_refund/i18n/account_menu_invoice_refund.pot new file mode 100644 index 00000000000..436ca1c2659 --- /dev/null +++ b/account_menu_invoice_refund/i18n/account_menu_invoice_refund.pot @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_menu_invoice_refund +# +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: account_menu_invoice_refund +#: model:ir.actions.act_window,name:account_menu_invoice_refund.action_invoice_in_tree +#: model:ir.ui.menu,name:account_menu_invoice_refund.menu_action_invoice_in_tree +msgid "Bills / Refunds" +msgstr "" + +#. module: account_menu_invoice_refund +#: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_out_tree +msgid "Create a customer invoice" +msgstr "" + +#. module: account_menu_invoice_refund +#: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_in_tree +msgid "Create a vendor bill" +msgstr "" + +#. module: account_menu_invoice_refund +#: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_out_tree +msgid "Create invoices, register payments and keep track of the discussions with your customers." +msgstr "" + +#. module: account_menu_invoice_refund +#: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_in_tree +msgid "Create vendor bills, register payments and keep track of the discussions with your customers." +msgstr "" + +#. module: account_menu_invoice_refund +#: model:ir.actions.act_window,name:account_menu_invoice_refund.action_invoice_out_tree +#: model:ir.ui.menu,name:account_menu_invoice_refund.menu_action_invoice_out_tree +msgid "Invoices / Credit Notes" +msgstr "" + From accc77b68d4acc51ff92aaf55692542bbdad4cec Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Wed, 14 Aug 2019 15:30:14 +0000 Subject: [PATCH 03/20] [UPD] README.rst --- account_menu_invoice_refund/README.rst | 86 ++++ .../static/description/index.html | 426 ++++++++++++++++++ 2 files changed, 512 insertions(+) create mode 100644 account_menu_invoice_refund/README.rst create mode 100644 account_menu_invoice_refund/static/description/index.html diff --git a/account_menu_invoice_refund/README.rst b/account_menu_invoice_refund/README.rst new file mode 100644 index 00000000000..4fa840b5e72 --- /dev/null +++ b/account_menu_invoice_refund/README.rst @@ -0,0 +1,86 @@ +============================== +Accunt Menu - Invoice & Refund +============================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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/account_menu_invoice_refund + :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-account_menu_invoice_refund + :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| + +By Odoo standard, Invoices and Refunds are in different menu, + +This module simply adds 2 new menus, + +1. Invoicing > Customers > Invoices / Credit Notes +2. Invoicing > Vendors > Bills / Refunds + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Ecosoft + +Contributors +~~~~~~~~~~~~ + +* Kitti Upariphutthiphong + +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-kittiu| image:: https://github.com/kittiu.png?size=40px + :target: https://github.com/kittiu + :alt: kittiu + +Current `maintainer `__: + +|maintainer-kittiu| + +This module is part of the `OCA/account-invoicing `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_menu_invoice_refund/static/description/index.html b/account_menu_invoice_refund/static/description/index.html new file mode 100644 index 00000000000..02c7566d5f1 --- /dev/null +++ b/account_menu_invoice_refund/static/description/index.html @@ -0,0 +1,426 @@ + + + + + + +Accunt Menu - Invoice & Refund + + + +
+

Accunt Menu - Invoice & Refund

+ + +

Beta License: AGPL-3 OCA/account-invoicing Translate me on Weblate Try me on Runbot

+

By Odoo standard, Invoices and Refunds are in different menu,

+

This module simply adds 2 new menus,

+
    +
  1. Invoicing > Customers > Invoices / Credit Notes
  2. +
  3. Invoicing > Vendors > Bills / Refunds
  4. +
+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Ecosoft
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

Current maintainer:

+

kittiu

+

This module is part of the OCA/account-invoicing project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + From 4fc02bbd46bfc0e22e3a7c1a39e85221bf250648 Mon Sep 17 00:00:00 2001 From: Pedro Castro Silva Date: Thu, 6 Feb 2020 09:34:00 +0000 Subject: [PATCH 04/20] Added translation using Weblate (Portuguese) --- account_menu_invoice_refund/i18n/pt.po | 59 ++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 account_menu_invoice_refund/i18n/pt.po diff --git a/account_menu_invoice_refund/i18n/pt.po b/account_menu_invoice_refund/i18n/pt.po new file mode 100644 index 00000000000..e431d7a08fc --- /dev/null +++ b/account_menu_invoice_refund/i18n/pt.po @@ -0,0 +1,59 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_menu_invoice_refund +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: pt\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" + +#. module: account_menu_invoice_refund +#: model:ir.actions.act_window,name:account_menu_invoice_refund.action_invoice_in_tree +#: model:ir.ui.menu,name:account_menu_invoice_refund.menu_action_invoice_in_tree +msgid "Bills / Refunds" +msgstr "" + +#. module: account_menu_invoice_refund +#: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_out_tree +msgid "Create a customer invoice" +msgstr "" + +#. module: account_menu_invoice_refund +#: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_in_tree +msgid "Create a vendor bill" +msgstr "" + +#. module: account_menu_invoice_refund +#: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_out_tree +msgid "Create invoices, register payments and keep track of the discussions with your customers." +msgstr "" + +#. module: account_menu_invoice_refund +#: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_in_tree +msgid "Create vendor bills, register payments and keep track of the discussions with your customers." +msgstr "" + +#. module: account_menu_invoice_refund +#: code:addons/account_menu_invoice_refund/hooks.py:37 +#, python-format +msgid "In order to pay multiple invoices at once, they must use the same currency." +msgstr "" + +#. module: account_menu_invoice_refund +#: model:ir.actions.act_window,name:account_menu_invoice_refund.action_invoice_out_tree +#: model:ir.ui.menu,name:account_menu_invoice_refund.menu_action_invoice_out_tree +msgid "Invoices / Credit Notes" +msgstr "" + +#. module: account_menu_invoice_refund +#: code:addons/account_menu_invoice_refund/hooks.py:34 +#, python-format +msgid "You can only register payments for open invoices" +msgstr "" From ad2c100cb027a1b9ed4d2f65a4b57c28ed3b7fc6 Mon Sep 17 00:00:00 2001 From: Pedro Castro Silva Date: Thu, 6 Feb 2020 09:35:05 +0000 Subject: [PATCH 05/20] Translated using Weblate (Portuguese) Currently translated at 100.0% (8 of 8 strings) Translation: account-invoicing-12.0/account-invoicing-12.0-account_menu_invoice_refund Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-12-0/account-invoicing-12-0-account_menu_invoice_refund/pt/ --- account_menu_invoice_refund/i18n/pt.po | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/account_menu_invoice_refund/i18n/pt.po b/account_menu_invoice_refund/i18n/pt.po index e431d7a08fc..f086b02f6c3 100644 --- a/account_menu_invoice_refund/i18n/pt.po +++ b/account_menu_invoice_refund/i18n/pt.po @@ -6,54 +6,62 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2020-02-06 12:13+0000\n" +"Last-Translator: Pedro Castro Silva \n" "Language-Team: none\n" "Language: pt\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 3.10\n" #. module: account_menu_invoice_refund #: model:ir.actions.act_window,name:account_menu_invoice_refund.action_invoice_in_tree #: model:ir.ui.menu,name:account_menu_invoice_refund.menu_action_invoice_in_tree msgid "Bills / Refunds" -msgstr "" +msgstr "Faturas / Créditos" #. module: account_menu_invoice_refund #: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_out_tree msgid "Create a customer invoice" -msgstr "" +msgstr "Criar uma fatura a cliente" #. module: account_menu_invoice_refund #: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_in_tree msgid "Create a vendor bill" -msgstr "" +msgstr "Criar uma fatura de fornecedor" #. module: account_menu_invoice_refund #: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_out_tree msgid "Create invoices, register payments and keep track of the discussions with your customers." msgstr "" +"Crie faturas, registe pagamentos e mantenha um registo das conversações com " +"os seus clientes." #. module: account_menu_invoice_refund #: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_in_tree msgid "Create vendor bills, register payments and keep track of the discussions with your customers." msgstr "" +"Crie faturas de fornecedores, registe pagamentos e mantenha um registo das " +"conversações com os seus clientes." #. module: account_menu_invoice_refund #: code:addons/account_menu_invoice_refund/hooks.py:37 #, python-format msgid "In order to pay multiple invoices at once, they must use the same currency." msgstr "" +"Para pagar simultaneamente múltiplas faturas, estas têm que ter a mesma " +"moeda." #. module: account_menu_invoice_refund #: model:ir.actions.act_window,name:account_menu_invoice_refund.action_invoice_out_tree #: model:ir.ui.menu,name:account_menu_invoice_refund.menu_action_invoice_out_tree msgid "Invoices / Credit Notes" -msgstr "" +msgstr "Faturas / Créditos" #. module: account_menu_invoice_refund #: code:addons/account_menu_invoice_refund/hooks.py:34 #, python-format msgid "You can only register payments for open invoices" -msgstr "" +msgstr "Só pode registar pagamentos para faturas em aberto" From 3d291becc51beb86c62e8d0afd986cc573862561 Mon Sep 17 00:00:00 2001 From: Bole Date: Thu, 5 Mar 2020 14:20:24 +0000 Subject: [PATCH 06/20] Added translation using Weblate (Croatian) --- account_menu_invoice_refund/i18n/hr.po | 60 ++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 account_menu_invoice_refund/i18n/hr.po diff --git a/account_menu_invoice_refund/i18n/hr.po b/account_menu_invoice_refund/i18n/hr.po new file mode 100644 index 00000000000..9b201d4fd47 --- /dev/null +++ b/account_menu_invoice_refund/i18n/hr.po @@ -0,0 +1,60 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_menu_invoice_refund +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=" +"4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: account_menu_invoice_refund +#: model:ir.actions.act_window,name:account_menu_invoice_refund.action_invoice_in_tree +#: model:ir.ui.menu,name:account_menu_invoice_refund.menu_action_invoice_in_tree +msgid "Bills / Refunds" +msgstr "" + +#. module: account_menu_invoice_refund +#: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_out_tree +msgid "Create a customer invoice" +msgstr "" + +#. module: account_menu_invoice_refund +#: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_in_tree +msgid "Create a vendor bill" +msgstr "" + +#. module: account_menu_invoice_refund +#: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_out_tree +msgid "Create invoices, register payments and keep track of the discussions with your customers." +msgstr "" + +#. module: account_menu_invoice_refund +#: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_in_tree +msgid "Create vendor bills, register payments and keep track of the discussions with your customers." +msgstr "" + +#. module: account_menu_invoice_refund +#: code:addons/account_menu_invoice_refund/hooks.py:37 +#, python-format +msgid "In order to pay multiple invoices at once, they must use the same currency." +msgstr "" + +#. module: account_menu_invoice_refund +#: model:ir.actions.act_window,name:account_menu_invoice_refund.action_invoice_out_tree +#: model:ir.ui.menu,name:account_menu_invoice_refund.menu_action_invoice_out_tree +msgid "Invoices / Credit Notes" +msgstr "" + +#. module: account_menu_invoice_refund +#: code:addons/account_menu_invoice_refund/hooks.py:34 +#, python-format +msgid "You can only register payments for open invoices" +msgstr "" From 9249f6afb94fe0e2e59fb2bc0d2f948345c56671 Mon Sep 17 00:00:00 2001 From: Bole Date: Thu, 5 Mar 2020 14:20:40 +0000 Subject: [PATCH 07/20] Translated using Weblate (Croatian) Currently translated at 37.5% (3 of 8 strings) Translation: account-invoicing-12.0/account-invoicing-12.0-account_menu_invoice_refund Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-12-0/account-invoicing-12-0-account_menu_invoice_refund/hr/ --- account_menu_invoice_refund/i18n/hr.po | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/account_menu_invoice_refund/i18n/hr.po b/account_menu_invoice_refund/i18n/hr.po index 9b201d4fd47..cd7895aa352 100644 --- a/account_menu_invoice_refund/i18n/hr.po +++ b/account_menu_invoice_refund/i18n/hr.po @@ -6,7 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2020-03-05 16:13+0000\n" +"Last-Translator: Bole \n" "Language-Team: none\n" "Language: hr\n" "MIME-Version: 1.0\n" @@ -14,22 +15,23 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=" "4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 3.10\n" #. module: account_menu_invoice_refund #: model:ir.actions.act_window,name:account_menu_invoice_refund.action_invoice_in_tree #: model:ir.ui.menu,name:account_menu_invoice_refund.menu_action_invoice_in_tree msgid "Bills / Refunds" -msgstr "" +msgstr "Računi / Povrati" #. module: account_menu_invoice_refund #: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_out_tree msgid "Create a customer invoice" -msgstr "" +msgstr "Kreiraj račun" #. module: account_menu_invoice_refund #: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_in_tree msgid "Create a vendor bill" -msgstr "" +msgstr "Kreiraj ulazni račun" #. module: account_menu_invoice_refund #: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_out_tree From 42359f11c01aa6479e7849df50643b4d1a7026d3 Mon Sep 17 00:00:00 2001 From: kittiu Date: Fri, 20 Mar 2020 17:19:20 +0700 Subject: [PATCH 08/20] [12.0][FIX] account_menu_invoice_refund, fix test error on old odoo12 --- .../tests/test_pay_net_invoice_refund.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/account_menu_invoice_refund/tests/test_pay_net_invoice_refund.py b/account_menu_invoice_refund/tests/test_pay_net_invoice_refund.py index 284100348ae..8d02bddcd82 100644 --- a/account_menu_invoice_refund/tests/test_pay_net_invoice_refund.py +++ b/account_menu_invoice_refund/tests/test_pay_net_invoice_refund.py @@ -83,8 +83,7 @@ def test_pay_net_invoice_refund(self): Form(PaymentWizard.with_context(ctx), view=view_id) refund.action_invoice_open() # Finally, do the payment - with Form(PaymentWizard.with_context(ctx), view=view_id) as f: - f.amount = 450.0 + f = Form(PaymentWizard.with_context(ctx), view=view_id) payment = f.save() payment.create_payments() self.assertEqual(invoice.state, 'paid') From 422eff7ecfaec741e85d6354a54fd2e040a1aa86 Mon Sep 17 00:00:00 2001 From: Kitti U Date: Sat, 25 Apr 2020 16:16:25 +0700 Subject: [PATCH 09/20] [12.0][ENH] account_menu_invoice_refund, remove payment netting feature --- account_menu_invoice_refund/__init__.py | 2 - account_menu_invoice_refund/__manifest__.py | 1 - account_menu_invoice_refund/hooks.py | 75 ---------------- .../readme/DESCRIPTION.rst | 9 +- account_menu_invoice_refund/readme/USAGE.rst | 4 - account_menu_invoice_refund/tests/__init__.py | 2 - .../tests/test_pay_net_invoice_refund.py | 90 ------------------- 7 files changed, 1 insertion(+), 182 deletions(-) delete mode 100644 account_menu_invoice_refund/hooks.py delete mode 100644 account_menu_invoice_refund/readme/USAGE.rst delete mode 100644 account_menu_invoice_refund/tests/__init__.py delete mode 100644 account_menu_invoice_refund/tests/test_pay_net_invoice_refund.py diff --git a/account_menu_invoice_refund/__init__.py b/account_menu_invoice_refund/__init__.py index 1993e078aa8..e330d3ae3f9 100644 --- a/account_menu_invoice_refund/__init__.py +++ b/account_menu_invoice_refund/__init__.py @@ -1,4 +1,2 @@ # Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) - -from .hooks import post_load_hook diff --git a/account_menu_invoice_refund/__manifest__.py b/account_menu_invoice_refund/__manifest__.py index abb0353019b..0b8421d1cf5 100644 --- a/account_menu_invoice_refund/__manifest__.py +++ b/account_menu_invoice_refund/__manifest__.py @@ -19,5 +19,4 @@ 'installable': True, 'development_status': 'beta', 'maintainers': ['kittiu'], - 'post_load': 'post_load_hook', } diff --git a/account_menu_invoice_refund/hooks.py b/account_menu_invoice_refund/hooks.py deleted file mode 100644 index 738b1f6ce75..00000000000 --- a/account_menu_invoice_refund/hooks.py +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/) -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) - -from odoo import api, _ -from odoo.exceptions import UserError -from odoo.addons.account.models.account_payment import account_abstract_payment - -MAP_INVOICE_TYPE_PARTNER_TYPE = { - 'out_invoice': 'customer', - 'out_refund': 'customer', - 'in_invoice': 'supplier', - 'in_refund': 'supplier', -} - - -def post_load_hook(): - - @api.model - def new_default_get(self, fields): - """ Removed condition that disallow mixing invoice and refund """ - rec = super(account_abstract_payment, self).default_get(fields) - active_ids = self._context.get('active_ids') - active_model = self._context.get('active_model') - - # Check for selected invoices ids - if not active_ids or active_model != 'account.invoice': - return rec - - invoices = self.env['account.invoice'].browse(active_ids) - - # Check all invoices are open - if any(invoice.state != 'open' for invoice in invoices): - raise UserError( - _("You can only register payments for open invoices")) - # Check all invoices have the same currency - if any(inv.currency_id != invoices[0].currency_id for inv in invoices): - raise UserError(_("In order to pay multiple invoices " - "at once, they must use the same currency.")) - - # Look if we are mixin multiple commercial_partner - # or customer invoices with vendor bills - multi = any(inv.commercial_partner_id != - invoices[0].commercial_partner_id - or MAP_INVOICE_TYPE_PARTNER_TYPE[inv.type] != - MAP_INVOICE_TYPE_PARTNER_TYPE[invoices[0].type] - or inv.account_id != invoices[0].account_id - or inv.partner_bank_id != invoices[0].partner_bank_id - for inv in invoices) - - currency = invoices[0].currency_id - - total_amount = self._compute_payment_amount(invoices=invoices, - currency=currency) - - rec.update({ - 'amount': abs(total_amount), - 'currency_id': currency.id, - 'payment_type': total_amount > 0 and 'inbound' or 'outbound', - 'partner_id': (False if multi else - invoices[0].commercial_partner_id.id), - 'partner_type': (False if multi else - MAP_INVOICE_TYPE_PARTNER_TYPE[invoices[0].type]), - 'communication': ' '.join( - [ref for ref in invoices.mapped('reference') if ref])[:2000], - 'invoice_ids': [(6, 0, invoices.ids)], - 'multi': multi, - }) - return rec - - if not hasattr(account_abstract_payment, - 'default_get_original'): - account_abstract_payment.default_get_original = \ - account_abstract_payment.default_get - - account_abstract_payment.default_get = new_default_get diff --git a/account_menu_invoice_refund/readme/DESCRIPTION.rst b/account_menu_invoice_refund/readme/DESCRIPTION.rst index 2bc8dfb8d71..7d8b81adaa1 100644 --- a/account_menu_invoice_refund/readme/DESCRIPTION.rst +++ b/account_menu_invoice_refund/readme/DESCRIPTION.rst @@ -1,13 +1,6 @@ By Odoo standard, Invoices and Refunds are in different menu, -and can't be mixed upon payment. -This module add 2 new menus, +This module simply adds 2 new menus, 1. Invoicing > Customers > Invoices / Credit Notes 2. Invoicing > Vendors > Bills / Refunds - -Additionally it allow register net payment by selecting both invoice and refund. - -**Note:** -This is accomplished by simply remove the condition that disallow -mixing invoice and refund in account.payment's default_get() diff --git a/account_menu_invoice_refund/readme/USAGE.rst b/account_menu_invoice_refund/readme/USAGE.rst deleted file mode 100644 index fd58915ba5c..00000000000 --- a/account_menu_invoice_refund/readme/USAGE.rst +++ /dev/null @@ -1,4 +0,0 @@ -To make payment that net invoice and refund, - -* Got to new menu, "Invoices / Credit Notes" or "Bills / Refunds" -* Make payment as normal, you will see the payment amount will be invoice amount minus refund amount diff --git a/account_menu_invoice_refund/tests/__init__.py b/account_menu_invoice_refund/tests/__init__.py deleted file mode 100644 index 74292cd7790..00000000000 --- a/account_menu_invoice_refund/tests/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from . import test_pay_net_invoice_refund diff --git a/account_menu_invoice_refund/tests/test_pay_net_invoice_refund.py b/account_menu_invoice_refund/tests/test_pay_net_invoice_refund.py deleted file mode 100644 index 8d02bddcd82..00000000000 --- a/account_menu_invoice_refund/tests/test_pay_net_invoice_refund.py +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright 2019 Ecosoft Co., Ltd (http://ecosoft.co.th/) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo.tests.common import TransactionCase, Form -from odoo.exceptions import UserError - - -class TestAccountMenuInvoiceRefund(TransactionCase): - - def test_pay_net_invoice_refund(self): - """By selecting 1 invoice and 1 refund document, - I expect to net pay all document in one go.""" - invoice_line1_vals = [ - (0, 0, { - 'product_id': self.env.ref('product.product_product_2').id, - 'quantity': 1.0, - 'account_id': self.env['account.account'].search( - [('user_type_id', '=', self.env.ref( - 'account.data_account_type_revenue').id)], - limit=1).id, - 'name': 'Product A', - 'price_unit': 450.00 - }) - ] - invoice_line2_vals = [ - (0, 0, { - 'product_id': self.env.ref('product.product_product_3').id, - 'quantity': 1.0, - 'account_id': self.env['account.account'].search( - [('user_type_id', '=', self.env.ref( - 'account.data_account_type_revenue').id)], - limit=1).id, - 'name': 'Product B', - 'price_unit': 200.00 - }) - ] - # 2 products = 650 - invoice = self.env['account.invoice'].create({ - 'name': 'Test Customer Invoice', - 'type': 'out_invoice', - 'journal_id': self.env['account.journal'].search( - [('type', '=', 'sale')], limit=1).id, - 'partner_id': self.env.ref('base.res_partner_12').id, - 'account_id': self.env['account.account'].search( - [('user_type_id', '=', self.env.ref( - 'account.data_account_type_receivable').id)], - limit=1).id, - 'invoice_line_ids': invoice_line1_vals + invoice_line2_vals, - }) - # refund 1 product = 200 - refund = self.env['account.invoice'].create({ - 'name': "Test Customer Refund", - 'type': 'out_refund', - 'journal_id': self.env['account.journal'].search( - [('type', '=', 'sale')], limit=1).id, - 'partner_id': self.env.ref('base.res_partner_12').id, - 'account_id': self.env['account.account'].search( - [('user_type_id', '=', self.env.ref( - 'account.data_account_type_receivable').id)], - limit=1).id, - 'invoice_line_ids': invoice_line2_vals, - }) - invoice.action_invoice_open() - ctx = {'active_ids': [invoice.id, refund.id], - 'active_model': 'account.invoice'} - # Make payment with net amount = 450, both invoice/refund is paid - PaymentWizard = self.env['account.register.payments'] - view_id = ('account.view_account_payment_from_invoices') - - # Test exception case, when refund currency is different - wrong_currency = self.env['res.currency'].search([ - ('id', '!=', invoice.currency_id.id)], limit=1) - wrong_refund = refund.copy({'currency_id': wrong_currency.id}) - wrong_refund.action_invoice_open() - ctx = {'active_ids': [invoice.id, wrong_refund.id], - 'active_model': 'account.invoice'} - with self.assertRaises(UserError): # Test wrong currency - Form(PaymentWizard.with_context(ctx), view=view_id) - - # Switch back to the valid refund, and try to make payment - ctx = {'active_ids': [invoice.id, refund.id], - 'active_model': 'account.invoice'} - with self.assertRaises(UserError): # Test doc status exception - Form(PaymentWizard.with_context(ctx), view=view_id) - refund.action_invoice_open() - # Finally, do the payment - f = Form(PaymentWizard.with_context(ctx), view=view_id) - payment = f.save() - payment.create_payments() - self.assertEqual(invoice.state, 'paid') - self.assertEqual(refund.state, 'paid') From d93fc5bc9cfaa54ba5e3d2a59b5d47d126842d52 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 27 Apr 2020 14:44:32 +0000 Subject: [PATCH 10/20] account_menu_invoice_refund 12.0.2.0.0 --- account_menu_invoice_refund/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_menu_invoice_refund/__manifest__.py b/account_menu_invoice_refund/__manifest__.py index 0b8421d1cf5..983e7d528c9 100644 --- a/account_menu_invoice_refund/__manifest__.py +++ b/account_menu_invoice_refund/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'Accunt Menu - Invoice & Refund', - 'version': '12.0.1.0.0', + 'version': '12.0.2.0.0', 'summary': 'New invoice menu that combine invoices and refunds', 'category': 'Accounting & Finance', 'author': 'Ecosoft, ' From 020c832594752bb495440ebd210ef633bcb70169 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Mon, 27 Apr 2020 14:57:37 +0000 Subject: [PATCH 11/20] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: account-invoicing-12.0/account-invoicing-12.0-account_menu_invoice_refund Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-12-0/account-invoicing-12-0-account_menu_invoice_refund/ --- account_menu_invoice_refund/i18n/hr.po | 26 ++++++++------------- account_menu_invoice_refund/i18n/pt.po | 32 +++++++++++++------------- 2 files changed, 25 insertions(+), 33 deletions(-) diff --git a/account_menu_invoice_refund/i18n/hr.po b/account_menu_invoice_refund/i18n/hr.po index cd7895aa352..0031308828e 100644 --- a/account_menu_invoice_refund/i18n/hr.po +++ b/account_menu_invoice_refund/i18n/hr.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * account_menu_invoice_refund +# * account_menu_invoice_refund # msgid "" msgstr "" @@ -13,8 +13,8 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=" -"4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" "X-Generator: Weblate 3.10\n" #. module: account_menu_invoice_refund @@ -35,18 +35,16 @@ msgstr "Kreiraj ulazni račun" #. module: account_menu_invoice_refund #: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_out_tree -msgid "Create invoices, register payments and keep track of the discussions with your customers." +msgid "" +"Create invoices, register payments and keep track of the discussions with " +"your customers." msgstr "" #. module: account_menu_invoice_refund #: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_in_tree -msgid "Create vendor bills, register payments and keep track of the discussions with your customers." -msgstr "" - -#. module: account_menu_invoice_refund -#: code:addons/account_menu_invoice_refund/hooks.py:37 -#, python-format -msgid "In order to pay multiple invoices at once, they must use the same currency." +msgid "" +"Create vendor bills, register payments and keep track of the discussions " +"with your customers." msgstr "" #. module: account_menu_invoice_refund @@ -54,9 +52,3 @@ msgstr "" #: model:ir.ui.menu,name:account_menu_invoice_refund.menu_action_invoice_out_tree msgid "Invoices / Credit Notes" msgstr "" - -#. module: account_menu_invoice_refund -#: code:addons/account_menu_invoice_refund/hooks.py:34 -#, python-format -msgid "You can only register payments for open invoices" -msgstr "" diff --git a/account_menu_invoice_refund/i18n/pt.po b/account_menu_invoice_refund/i18n/pt.po index f086b02f6c3..d740329f967 100644 --- a/account_menu_invoice_refund/i18n/pt.po +++ b/account_menu_invoice_refund/i18n/pt.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * account_menu_invoice_refund +# * account_menu_invoice_refund # msgid "" msgstr "" @@ -34,34 +34,34 @@ msgstr "Criar uma fatura de fornecedor" #. module: account_menu_invoice_refund #: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_out_tree -msgid "Create invoices, register payments and keep track of the discussions with your customers." +msgid "" +"Create invoices, register payments and keep track of the discussions with " +"your customers." msgstr "" "Crie faturas, registe pagamentos e mantenha um registo das conversações com " "os seus clientes." #. module: account_menu_invoice_refund #: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_in_tree -msgid "Create vendor bills, register payments and keep track of the discussions with your customers." +msgid "" +"Create vendor bills, register payments and keep track of the discussions " +"with your customers." msgstr "" "Crie faturas de fornecedores, registe pagamentos e mantenha um registo das " "conversações com os seus clientes." -#. module: account_menu_invoice_refund -#: code:addons/account_menu_invoice_refund/hooks.py:37 -#, python-format -msgid "In order to pay multiple invoices at once, they must use the same currency." -msgstr "" -"Para pagar simultaneamente múltiplas faturas, estas têm que ter a mesma " -"moeda." - #. module: account_menu_invoice_refund #: model:ir.actions.act_window,name:account_menu_invoice_refund.action_invoice_out_tree #: model:ir.ui.menu,name:account_menu_invoice_refund.menu_action_invoice_out_tree msgid "Invoices / Credit Notes" msgstr "Faturas / Créditos" -#. module: account_menu_invoice_refund -#: code:addons/account_menu_invoice_refund/hooks.py:34 -#, python-format -msgid "You can only register payments for open invoices" -msgstr "Só pode registar pagamentos para faturas em aberto" +#~ msgid "" +#~ "In order to pay multiple invoices at once, they must use the same " +#~ "currency." +#~ msgstr "" +#~ "Para pagar simultaneamente múltiplas faturas, estas têm que ter a mesma " +#~ "moeda." + +#~ msgid "You can only register payments for open invoices" +#~ msgstr "Só pode registar pagamentos para faturas em aberto" From 51e8842cfc96ed7c2b9891fca5a8cacc12ee8138 Mon Sep 17 00:00:00 2001 From: Maria Sparenberg Date: Fri, 12 Jun 2020 11:22:12 +0000 Subject: [PATCH 12/20] Added translation using Weblate (German) --- account_menu_invoice_refund/i18n/de.po | 47 ++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 account_menu_invoice_refund/i18n/de.po diff --git a/account_menu_invoice_refund/i18n/de.po b/account_menu_invoice_refund/i18n/de.po new file mode 100644 index 00000000000..d6279b2c1b9 --- /dev/null +++ b/account_menu_invoice_refund/i18n/de.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_menu_invoice_refund +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: de\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" + +#. module: account_menu_invoice_refund +#: model:ir.actions.act_window,name:account_menu_invoice_refund.action_invoice_in_tree +#: model:ir.ui.menu,name:account_menu_invoice_refund.menu_action_invoice_in_tree +msgid "Bills / Refunds" +msgstr "" + +#. module: account_menu_invoice_refund +#: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_out_tree +msgid "Create a customer invoice" +msgstr "" + +#. module: account_menu_invoice_refund +#: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_in_tree +msgid "Create a vendor bill" +msgstr "" + +#. module: account_menu_invoice_refund +#: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_out_tree +msgid "Create invoices, register payments and keep track of the discussions with your customers." +msgstr "" + +#. module: account_menu_invoice_refund +#: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_in_tree +msgid "Create vendor bills, register payments and keep track of the discussions with your customers." +msgstr "" + +#. module: account_menu_invoice_refund +#: model:ir.actions.act_window,name:account_menu_invoice_refund.action_invoice_out_tree +#: model:ir.ui.menu,name:account_menu_invoice_refund.menu_action_invoice_out_tree +msgid "Invoices / Credit Notes" +msgstr "" From ecc4b9967bfe1d9286e88352676c5ac4af66c785 Mon Sep 17 00:00:00 2001 From: Ethan Hildick Date: Thu, 24 Sep 2020 15:26:04 +0200 Subject: [PATCH 13/20] [IMP] account_menu_invoice_refund: black, isort, prettier --- account_menu_invoice_refund/__manifest__.py | 29 ++++----- .../views/account_invoice_view.xml | 61 ++++++++++--------- 2 files changed, 44 insertions(+), 46 deletions(-) diff --git a/account_menu_invoice_refund/__manifest__.py b/account_menu_invoice_refund/__manifest__.py index 983e7d528c9..c3efac687fc 100644 --- a/account_menu_invoice_refund/__manifest__.py +++ b/account_menu_invoice_refund/__manifest__.py @@ -2,21 +2,16 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) { - 'name': 'Accunt Menu - Invoice & Refund', - 'version': '12.0.2.0.0', - 'summary': 'New invoice menu that combine invoices and refunds', - 'category': 'Accounting & Finance', - 'author': 'Ecosoft, ' - 'Odoo Community Association (OCA)', - 'license': 'AGPL-3', - 'website': 'https://github.com/OCA/account-invoicing/', - 'depends': [ - 'account', - ], - 'data': [ - 'views/account_invoice_view.xml', - ], - 'installable': True, - 'development_status': 'beta', - 'maintainers': ['kittiu'], + "name": "Accunt Menu - Invoice & Refund", + "version": "12.0.2.0.0", + "summary": "New invoice menu that combine invoices and refunds", + "category": "Accounting & Finance", + "author": "Ecosoft, " "Odoo Community Association (OCA)", + "license": "AGPL-3", + "website": "https://github.com/OCA/account-invoicing/", + "depends": ["account",], + "data": ["views/account_invoice_view.xml",], + "installable": True, + "development_status": "beta", + "maintainers": ["kittiu"], } diff --git a/account_menu_invoice_refund/views/account_invoice_view.xml b/account_menu_invoice_refund/views/account_invoice_view.xml index 0a040507c98..f9aecca8466 100644 --- a/account_menu_invoice_refund/views/account_invoice_view.xml +++ b/account_menu_invoice_refund/views/account_invoice_view.xml @@ -1,75 +1,78 @@ - Invoices / Credit Notes account.invoice form tree,form - + [('type', 'in', ('out_invoice', 'out_refund'))] {'type':'out_invoice', 'journal_type': 'sale'} - +

Create a customer invoice -

+

+

Create invoices, register payments and keep track of the discussions with your customers.

- - + tree - - + + - - + form - - + + - - - + Bills / Refunds account.invoice form tree,form - + [('type', 'in', ('in_invoice', 'in_refund'))] {'type':'in_invoice', 'journal_type': 'purchase'} - +

Create a vendor bill -

+

+

Create vendor bills, register payments and keep track of the discussions with your customers.

- - + tree - - + + - - + form - - + + - - - +
From d4df89ec8d04c5277c62db8951688dff0862abcd Mon Sep 17 00:00:00 2001 From: Ethan Hildick Date: Thu, 24 Sep 2020 15:29:37 +0200 Subject: [PATCH 14/20] [MIG] account_menu_invoice_refund: Migration to 13.0 --- account_menu_invoice_refund/README.rst | 16 ++++++++-------- account_menu_invoice_refund/__manifest__.py | 8 ++++---- .../static/description/index.html | 12 ++++++------ .../views/account_invoice_view.xml | 14 ++++++-------- 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/account_menu_invoice_refund/README.rst b/account_menu_invoice_refund/README.rst index 4fa840b5e72..b7566e724e2 100644 --- a/account_menu_invoice_refund/README.rst +++ b/account_menu_invoice_refund/README.rst @@ -1,6 +1,6 @@ -============================== -Accunt Menu - Invoice & Refund -============================== +=============================== +Account Menu - Invoice & Refund +=============================== .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! @@ -14,13 +14,13 @@ Accunt Menu - Invoice & Refund :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/account_menu_invoice_refund + :target: https://github.com/OCA/account-invoicing/tree/13.0/account_menu_invoice_refund :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-account_menu_invoice_refund + :target: https://translation.odoo-community.org/projects/account-invoicing-13-0/account-invoicing-13-0-account_menu_invoice_refund :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 + :target: https://runbot.odoo-community.org/runbot/95/13.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -43,7 +43,7 @@ Bug Tracker Bugs are tracked on `GitHub 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -81,6 +81,6 @@ Current `maintainer `__: |maintainer-kittiu| -This module is part of the `OCA/account-invoicing `_ project on GitHub. +This module is part of the `OCA/account-invoicing `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_menu_invoice_refund/__manifest__.py b/account_menu_invoice_refund/__manifest__.py index c3efac687fc..7e7381b741d 100644 --- a/account_menu_invoice_refund/__manifest__.py +++ b/account_menu_invoice_refund/__manifest__.py @@ -2,15 +2,15 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) { - "name": "Accunt Menu - Invoice & Refund", - "version": "12.0.2.0.0", + "name": "Account Menu - Invoice & Refund", + "version": "13.0.1.0.0", "summary": "New invoice menu that combine invoices and refunds", "category": "Accounting & Finance", "author": "Ecosoft, " "Odoo Community Association (OCA)", "license": "AGPL-3", "website": "https://github.com/OCA/account-invoicing/", - "depends": ["account",], - "data": ["views/account_invoice_view.xml",], + "depends": ["account"], + "data": ["views/account_invoice_view.xml"], "installable": True, "development_status": "beta", "maintainers": ["kittiu"], diff --git a/account_menu_invoice_refund/static/description/index.html b/account_menu_invoice_refund/static/description/index.html index 02c7566d5f1..c95dd197e38 100644 --- a/account_menu_invoice_refund/static/description/index.html +++ b/account_menu_invoice_refund/static/description/index.html @@ -4,7 +4,7 @@ -Accunt Menu - Invoice & Refund +Account Menu - Invoice & Refund -
-

Accunt Menu - Invoice & Refund

+
+

Account Menu - Invoice & Refund

-

Beta License: AGPL-3 OCA/account-invoicing Translate me on Weblate Try me on Runbot

+

Beta License: AGPL-3 OCA/account-invoicing Translate me on Weblate Try me on Runbot

By Odoo standard, Invoices and Refunds are in different menu,

This module simply adds 2 new menus,

    @@ -391,7 +391,7 @@

    Bug Tracker

    Bugs are tracked on GitHub 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.

    +feedback.

    Do not contact contributors directly about support or help with technical issues.

@@ -417,7 +417,7 @@

Maintainers

promote its widespread use.

Current maintainer:

kittiu

-

This module is part of the OCA/account-invoicing project on GitHub.

+

This module is part of the OCA/account-invoicing project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/account_menu_invoice_refund/views/account_invoice_view.xml b/account_menu_invoice_refund/views/account_invoice_view.xml index f9aecca8466..95f65796bcf 100644 --- a/account_menu_invoice_refund/views/account_invoice_view.xml +++ b/account_menu_invoice_refund/views/account_invoice_view.xml @@ -4,8 +4,7 @@ Invoices / Credit Notes - account.invoice - form + account.move tree,form [('type', 'in', ('out_invoice', 'out_refund'))] @@ -23,13 +22,13 @@ tree - + form - + Bills / Refunds - account.invoice - form + account.move tree,form [('type', 'in', ('in_invoice', 'in_refund'))] @@ -60,13 +58,13 @@ tree - + form - + Date: Sun, 27 Sep 2020 06:24:56 +0000 Subject: [PATCH 15/20] [UPD] Update account_menu_invoice_refund.pot --- .../i18n/account_menu_invoice_refund.pot | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/account_menu_invoice_refund/i18n/account_menu_invoice_refund.pot b/account_menu_invoice_refund/i18n/account_menu_invoice_refund.pot index 436ca1c2659..46875b1c2b1 100644 --- a/account_menu_invoice_refund/i18n/account_menu_invoice_refund.pot +++ b/account_menu_invoice_refund/i18n/account_menu_invoice_refund.pot @@ -1,12 +1,12 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * account_menu_invoice_refund +# * account_menu_invoice_refund # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" +"Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: <>\n" +"Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -31,12 +31,16 @@ msgstr "" #. module: account_menu_invoice_refund #: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_out_tree -msgid "Create invoices, register payments and keep track of the discussions with your customers." +msgid "" +"Create invoices, register payments and keep track of the discussions with " +"your customers." msgstr "" #. module: account_menu_invoice_refund #: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_in_tree -msgid "Create vendor bills, register payments and keep track of the discussions with your customers." +msgid "" +"Create vendor bills, register payments and keep track of the discussions " +"with your customers." msgstr "" #. module: account_menu_invoice_refund @@ -44,4 +48,3 @@ msgstr "" #: model:ir.ui.menu,name:account_menu_invoice_refund.menu_action_invoice_out_tree msgid "Invoices / Credit Notes" msgstr "" - From 6f94a20cdeee401e423ea9b2f24ff36c4cb5082a Mon Sep 17 00:00:00 2001 From: komsans Date: Tue, 10 Nov 2020 17:48:22 +0700 Subject: [PATCH 16/20] [FIX] account_menu_invoice_refund : development_status --- account_menu_invoice_refund/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_menu_invoice_refund/__manifest__.py b/account_menu_invoice_refund/__manifest__.py index 7e7381b741d..3bb7c0ab529 100644 --- a/account_menu_invoice_refund/__manifest__.py +++ b/account_menu_invoice_refund/__manifest__.py @@ -12,6 +12,6 @@ "depends": ["account"], "data": ["views/account_invoice_view.xml"], "installable": True, - "development_status": "beta", + "development_status": "Beta", "maintainers": ["kittiu"], } From dde5722c4c7492d0c2ad9d2d1eccdc5cdb0999fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ana=20Su=C3=A1rez?= Date: Wed, 10 Mar 2021 08:54:49 +0000 Subject: [PATCH 17/20] Added translation using Weblate (Spanish) --- account_menu_invoice_refund/i18n/es.po | 51 ++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 account_menu_invoice_refund/i18n/es.po diff --git a/account_menu_invoice_refund/i18n/es.po b/account_menu_invoice_refund/i18n/es.po new file mode 100644 index 00000000000..982791a6f47 --- /dev/null +++ b/account_menu_invoice_refund/i18n/es.po @@ -0,0 +1,51 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_menu_invoice_refund +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\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" + +#. module: account_menu_invoice_refund +#: model:ir.actions.act_window,name:account_menu_invoice_refund.action_invoice_in_tree +#: model:ir.ui.menu,name:account_menu_invoice_refund.menu_action_invoice_in_tree +msgid "Bills / Refunds" +msgstr "" + +#. module: account_menu_invoice_refund +#: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_out_tree +msgid "Create a customer invoice" +msgstr "" + +#. module: account_menu_invoice_refund +#: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_in_tree +msgid "Create a vendor bill" +msgstr "" + +#. module: account_menu_invoice_refund +#: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_out_tree +msgid "" +"Create invoices, register payments and keep track of the discussions with " +"your customers." +msgstr "" + +#. module: account_menu_invoice_refund +#: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_in_tree +msgid "" +"Create vendor bills, register payments and keep track of the discussions " +"with your customers." +msgstr "" + +#. module: account_menu_invoice_refund +#: model:ir.actions.act_window,name:account_menu_invoice_refund.action_invoice_out_tree +#: model:ir.ui.menu,name:account_menu_invoice_refund.menu_action_invoice_out_tree +msgid "Invoices / Credit Notes" +msgstr "" From e15074d65854d9c29dab96f1a855e2db5be80427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ana=20Su=C3=A1rez?= Date: Wed, 10 Mar 2021 08:57:09 +0000 Subject: [PATCH 18/20] Translated using Weblate (Spanish) Currently translated at 100.0% (6 of 6 strings) Translation: account-invoicing-13.0/account-invoicing-13.0-account_menu_invoice_refund Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-13-0/account-invoicing-13-0-account_menu_invoice_refund/es/ --- account_menu_invoice_refund/i18n/es.po | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/account_menu_invoice_refund/i18n/es.po b/account_menu_invoice_refund/i18n/es.po index 982791a6f47..1f949f7ee5b 100644 --- a/account_menu_invoice_refund/i18n/es.po +++ b/account_menu_invoice_refund/i18n/es.po @@ -6,29 +6,31 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2021-03-10 10:46+0000\n" +"Last-Translator: Ana Suárez \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.3.2\n" #. module: account_menu_invoice_refund #: model:ir.actions.act_window,name:account_menu_invoice_refund.action_invoice_in_tree #: model:ir.ui.menu,name:account_menu_invoice_refund.menu_action_invoice_in_tree msgid "Bills / Refunds" -msgstr "" +msgstr "Facturas / Facturas Rectificativas" #. module: account_menu_invoice_refund #: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_out_tree msgid "Create a customer invoice" -msgstr "" +msgstr "Crear factura de cliente" #. module: account_menu_invoice_refund #: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_in_tree msgid "Create a vendor bill" -msgstr "" +msgstr "Crear factura de proveedor" #. module: account_menu_invoice_refund #: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_out_tree @@ -36,6 +38,8 @@ msgid "" "Create invoices, register payments and keep track of the discussions with " "your customers." msgstr "" +"Cree facturas, registre pagos y haga seguimiento de las conversaciones con " +"sus clientes." #. module: account_menu_invoice_refund #: model_terms:ir.actions.act_window,help:account_menu_invoice_refund.action_invoice_in_tree @@ -43,9 +47,11 @@ msgid "" "Create vendor bills, register payments and keep track of the discussions " "with your customers." msgstr "" +"Cree facturas, registre pagos y haga seguimiento de las conversaciones con " +"sus clientes." #. module: account_menu_invoice_refund #: model:ir.actions.act_window,name:account_menu_invoice_refund.action_invoice_out_tree #: model:ir.ui.menu,name:account_menu_invoice_refund.menu_action_invoice_out_tree msgid "Invoices / Credit Notes" -msgstr "" +msgstr "Facturas / Facturas Rectificativas" From 38a63a6680639e89601850e7e0e8a6e555ff02ec Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Tue, 20 Dec 2022 17:39:53 +0100 Subject: [PATCH 19/20] [IMP] account_menu_invoice_refund: pre-commit stuff --- account_menu_invoice_refund/__manifest__.py | 2 +- .../odoo/addons/account_menu_invoice_refund | 1 + setup/account_menu_invoice_refund/setup.py | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 120000 setup/account_menu_invoice_refund/odoo/addons/account_menu_invoice_refund create mode 100644 setup/account_menu_invoice_refund/setup.py diff --git a/account_menu_invoice_refund/__manifest__.py b/account_menu_invoice_refund/__manifest__.py index 3bb7c0ab529..9c9908846a9 100644 --- a/account_menu_invoice_refund/__manifest__.py +++ b/account_menu_invoice_refund/__manifest__.py @@ -8,7 +8,7 @@ "category": "Accounting & Finance", "author": "Ecosoft, " "Odoo Community Association (OCA)", "license": "AGPL-3", - "website": "https://github.com/OCA/account-invoicing/", + "website": "https://github.com/OCA/account-invoicing", "depends": ["account"], "data": ["views/account_invoice_view.xml"], "installable": True, diff --git a/setup/account_menu_invoice_refund/odoo/addons/account_menu_invoice_refund b/setup/account_menu_invoice_refund/odoo/addons/account_menu_invoice_refund new file mode 120000 index 00000000000..7a9d1673b6b --- /dev/null +++ b/setup/account_menu_invoice_refund/odoo/addons/account_menu_invoice_refund @@ -0,0 +1 @@ +../../../../account_menu_invoice_refund \ No newline at end of file diff --git a/setup/account_menu_invoice_refund/setup.py b/setup/account_menu_invoice_refund/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/account_menu_invoice_refund/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) From a8f65ba20cabe8a19b8b30678eda36048bc58fd4 Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Tue, 20 Dec 2022 17:42:22 +0100 Subject: [PATCH 20/20] [MIG] account_menu_invoice_refund: Migration to 16.0 --- account_menu_invoice_refund/__manifest__.py | 2 +- .../views/account_invoice_view.xml | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/account_menu_invoice_refund/__manifest__.py b/account_menu_invoice_refund/__manifest__.py index 9c9908846a9..b71eb2fbf81 100644 --- a/account_menu_invoice_refund/__manifest__.py +++ b/account_menu_invoice_refund/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Account Menu - Invoice & Refund", - "version": "13.0.1.0.0", + "version": "16.0.1.0.0", "summary": "New invoice menu that combine invoices and refunds", "category": "Accounting & Finance", "author": "Ecosoft, " "Odoo Community Association (OCA)", diff --git a/account_menu_invoice_refund/views/account_invoice_view.xml b/account_menu_invoice_refund/views/account_invoice_view.xml index 95f65796bcf..1dff40f6f49 100644 --- a/account_menu_invoice_refund/views/account_invoice_view.xml +++ b/account_menu_invoice_refund/views/account_invoice_view.xml @@ -7,8 +7,10 @@ account.move tree,form - [('type', 'in', ('out_invoice', 'out_refund'))] - {'type':'out_invoice', 'journal_type': 'sale'} + [('move_type', 'in', ('out_invoice', 'out_refund'))] + {'default_move_type':'out_invoice'}

@@ -43,8 +45,8 @@ account.move tree,form - [('type', 'in', ('in_invoice', 'in_refund'))] - {'type':'in_invoice', 'journal_type': 'purchase'} + [('move_type', 'in', ('in_invoice', 'in_refund'))] + {'default_move_type':'in_invoice'}