From 9b705d6c4cd0c27ee391c76cb5a5c227807a3085 Mon Sep 17 00:00:00 2001 From: hveficent Date: Tue, 31 Dec 2019 13:50:00 +0100 Subject: [PATCH] [MIG] l10n_us_form_1099: Migration to 13.0 --- l10n_us_form_1099/README.rst | 10 ++++---- l10n_us_form_1099/__manifest__.py | 2 +- l10n_us_form_1099/models/res_partner.py | 12 +-------- .../reports/account_payment_1099_report.py | 8 +++--- .../account_payment_1099_report_views.xml | 1 - .../static/description/index.html | 8 +++--- l10n_us_form_1099/tests/__init__.py | 5 ---- .../tests/test_l10n_us_form_1099.py | 25 ------------------- .../views/box_1099_misc_view.xml | 1 - l10n_us_form_1099/views/res_partner.xml | 4 +-- l10n_us_form_1099/views/type_1099_view.xml | 1 - 11 files changed, 17 insertions(+), 60 deletions(-) delete mode 100644 l10n_us_form_1099/tests/__init__.py delete mode 100644 l10n_us_form_1099/tests/test_l10n_us_form_1099.py diff --git a/l10n_us_form_1099/README.rst b/l10n_us_form_1099/README.rst index bdcf35e5..35cba654 100644 --- a/l10n_us_form_1099/README.rst +++ b/l10n_us_form_1099/README.rst @@ -11,13 +11,13 @@ US Form 1099 :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge2| image:: https://img.shields.io/badge/github-OCA%2Fl10n--usa-lightgray.png?logo=github - :target: https://github.com/OCA/l10n-usa/tree/12.0/l10n_us_form_1099 + :target: https://github.com/OCA/l10n-usa/tree/13.0/l10n_us_form_1099 :alt: OCA/l10n-usa .. |badge3| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/l10n-usa-12-0/l10n-usa-12-0-l10n_us_form_1099 + :target: https://translation.odoo-community.org/projects/l10n-usa-13-0/l10n-usa-13-0-l10n_us_form_1099 :alt: Translate me on Weblate .. |badge4| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/203/12.0 + :target: https://runbot.odoo-community.org/runbot/203/13.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| @@ -68,7 +68,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. @@ -119,6 +119,6 @@ Current `maintainer `__: |maintainer-max3903| -This module is part of the `OCA/l10n-usa `_ project on GitHub. +This module is part of the `OCA/l10n-usa `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_us_form_1099/__manifest__.py b/l10n_us_form_1099/__manifest__.py index b9e21e88..c5658aad 100644 --- a/l10n_us_form_1099/__manifest__.py +++ b/l10n_us_form_1099/__manifest__.py @@ -4,7 +4,7 @@ { "name": "US Form 1099", - "version": "12.0.1.2.0", + "version": "13.0.1.2.0", "author": "Open Source Integrators, " "Brian McMaster, " "Odoo Community Association (OCA)", diff --git a/l10n_us_form_1099/models/res_partner.py b/l10n_us_form_1099/models/res_partner.py index 6af5a770..bcaf7c5e 100644 --- a/l10n_us_form_1099/models/res_partner.py +++ b/l10n_us_form_1099/models/res_partner.py @@ -2,7 +2,7 @@ # Copyright (C) 2019 Brian McMaster # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, fields, models +from odoo import fields, models class ResPartner(models.Model): @@ -11,13 +11,3 @@ class ResPartner(models.Model): is_1099 = fields.Boolean("Is a 1099?") type_1099_id = fields.Many2one("type.1099", string="1099 Type") box_1099_misc_id = fields.Many2one("box.1099.misc", string="1099-MISC Box") - - @api.onchange("is_1099") - def _on_change_is_1099(self): - if self.is_1099 and not self.supplier: - self.supplier = True - - @api.onchange("supplier") - def _on_change_supplier(self): - if self.is_1099 and not self.supplier: - self.is_1099 = False diff --git a/l10n_us_form_1099/reports/account_payment_1099_report.py b/l10n_us_form_1099/reports/account_payment_1099_report.py index 641f8584..933092ad 100644 --- a/l10n_us_form_1099/reports/account_payment_1099_report.py +++ b/l10n_us_form_1099/reports/account_payment_1099_report.py @@ -2,7 +2,7 @@ # Copyright (C) 2019 Open Source Integrators # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, fields, models, tools +from odoo import fields, models, tools class AccountPayment1099Report(models.Model): @@ -43,9 +43,9 @@ def _where(self): v.is_1099 = TRUE """ - @api.model_cr def init(self): tools.drop_view_if_exists(self._cr, self._table) + # pylint: disable=sql-injection self._cr.execute( """ CREATE OR REPLACE VIEW %s AS ( @@ -54,6 +54,6 @@ def init(self): %s %s ) - """, - (self._table, self._select(), self._from(), self._join(), self._where()), + """ + % (self._table, self._select(), self._from(), self._join(), self._where()) ) diff --git a/l10n_us_form_1099/reports/account_payment_1099_report_views.xml b/l10n_us_form_1099/reports/account_payment_1099_report_views.xml index 6841c116..70eb7de9 100644 --- a/l10n_us_form_1099/reports/account_payment_1099_report_views.xml +++ b/l10n_us_form_1099/reports/account_payment_1099_report_views.xml @@ -52,7 +52,6 @@ 1099 Payment Analysis account.payment.1099.report - form pivot,graph From this report, you can have an overview of the amount paid to your 1099 vendors. diff --git a/l10n_us_form_1099/static/description/index.html b/l10n_us_form_1099/static/description/index.html index 88fc1384..81b99dd1 100644 --- a/l10n_us_form_1099/static/description/index.html +++ b/l10n_us_form_1099/static/description/index.html @@ -3,7 +3,7 @@ - + US Form 1099