From baad38083fc96d1382c48300fc1af417c97ced40 Mon Sep 17 00:00:00 2001 From: JasminSForgeFlow Date: Wed, 19 Jul 2023 11:57:59 +0530 Subject: [PATCH] [IMP] rma_sale_analytic: black, isort, prettier --- rma_sale_analytic/__init__.py | 1 - rma_sale_analytic/__manifest__.py | 11 ++++------- rma_sale_analytic/models/__init__.py | 1 - rma_sale_analytic/models/sale_order_line.py | 13 +++++++------ rma_sale_analytic/wizards/__init__.py | 1 - rma_sale_analytic/wizards/rma_add_sale.py | 6 ++---- .../wizards/rma_order_line_make_sale_order.py | 9 +++------ setup/rma_sale_analytic/odoo/__init__.py | 1 + setup/rma_sale_analytic/odoo/addons/__init__.py | 1 + .../rma_sale_analytic/odoo/addons/rma_sale_analytic | 1 + setup/rma_sale_analytic/setup.py | 6 ++++++ 11 files changed, 25 insertions(+), 26 deletions(-) create mode 100644 setup/rma_sale_analytic/odoo/__init__.py create mode 100644 setup/rma_sale_analytic/odoo/addons/__init__.py create mode 120000 setup/rma_sale_analytic/odoo/addons/rma_sale_analytic create mode 100644 setup/rma_sale_analytic/setup.py diff --git a/rma_sale_analytic/__init__.py b/rma_sale_analytic/__init__.py index 380a9053..69f54da6 100644 --- a/rma_sale_analytic/__init__.py +++ b/rma_sale_analytic/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). from . import models diff --git a/rma_sale_analytic/__manifest__.py b/rma_sale_analytic/__manifest__.py index 7d638c93..70ce7f5a 100644 --- a/rma_sale_analytic/__manifest__.py +++ b/rma_sale_analytic/__manifest__.py @@ -1,17 +1,14 @@ -# -*- coding: utf-8 -*- # © 2017 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). { "name": "Analytic Account in RMA sale", "version": "10.0.1.0.0", - "author": "Eficent," - "Odoo Community Association (OCA)", + "author": "Eficent," "Odoo Community Association (OCA)", "license": "LGPL-3", - "website": "http://www.eficent.com", + "website": "https://github.com/ForgeFlow/stock-rma", "category": "Analytic", "depends": ["rma_account", "rma_analytic"], - "data": [ - ], - 'installable': True, + "data": [], + "installable": True, } diff --git a/rma_sale_analytic/models/__init__.py b/rma_sale_analytic/models/__init__.py index 1f0d3fde..18dd29c4 100644 --- a/rma_sale_analytic/models/__init__.py +++ b/rma_sale_analytic/models/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). from . import sale_order_line diff --git a/rma_sale_analytic/models/sale_order_line.py b/rma_sale_analytic/models/sale_order_line.py index dc10578c..b143e81d 100644 --- a/rma_sale_analytic/models/sale_order_line.py +++ b/rma_sale_analytic/models/sale_order_line.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # © 2018 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). @@ -8,11 +7,13 @@ from odoo import _, api, exceptions, models class SaleOrderLine(models.Model): _inherit = "sale.order.line" - @api.constrains('analytic_account_id') + @api.constrains("analytic_account_id") def check_analytic(self): for line in self: - if (line.analytic_account_id != - line.rma_line_id.analytic_account_id): + if line.analytic_account_id != line.rma_line_id.analytic_account_id: raise exceptions.ValidationError( - _("The analytic account in the sale line it's not the same" - " as in the rma line")) + _( + "The analytic account in the sale line it's not the same" + " as in the rma line" + ) + ) diff --git a/rma_sale_analytic/wizards/__init__.py b/rma_sale_analytic/wizards/__init__.py index 44cb5e0c..ad24407e 100644 --- a/rma_sale_analytic/wizards/__init__.py +++ b/rma_sale_analytic/wizards/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # © 2018 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) diff --git a/rma_sale_analytic/wizards/rma_add_sale.py b/rma_sale_analytic/wizards/rma_add_sale.py index 3af15856..cf068724 100644 --- a/rma_sale_analytic/wizards/rma_add_sale.py +++ b/rma_sale_analytic/wizards/rma_add_sale.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # © 2018 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) @@ -6,11 +5,10 @@ from odoo import api, models class RmaAddSale(models.TransientModel): - _inherit = 'rma_add_sale' + _inherit = "rma_add_sale" @api.model def _prepare_rma_line_from_sale_order_line(self, line): - data = super(RmaAddSale, self).\ - _prepare_rma_line_from_sale_order_line(line) + data = super(RmaAddSale, self)._prepare_rma_line_from_sale_order_line(line) data.update(analytic_account_id=line.analytic_account_id.id) return data diff --git a/rma_sale_analytic/wizards/rma_order_line_make_sale_order.py b/rma_sale_analytic/wizards/rma_order_line_make_sale_order.py index 7ec362df..a0a43a0d 100644 --- a/rma_sale_analytic/wizards/rma_order_line_make_sale_order.py +++ b/rma_sale_analytic/wizards/rma_order_line_make_sale_order.py @@ -1,8 +1,7 @@ -# -*- coding: utf-8 -*- # © 2018 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) -from odoo import models, api +from odoo import api, models class RmaLineMakeSaleOrder(models.TransientModel): @@ -10,8 +9,6 @@ class RmaLineMakeSaleOrder(models.TransientModel): @api.model def _prepare_sale_order(self, line): - res = super( - RmaLineMakeSaleOrder, self)._prepare_sale_order(line) - res.update( - project_id=line.analytic_account_id.id) + res = super(RmaLineMakeSaleOrder, self)._prepare_sale_order(line) + res.update(project_id=line.analytic_account_id.id) return res diff --git a/setup/rma_sale_analytic/odoo/__init__.py b/setup/rma_sale_analytic/odoo/__init__.py new file mode 100644 index 00000000..de40ea7c --- /dev/null +++ b/setup/rma_sale_analytic/odoo/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/rma_sale_analytic/odoo/addons/__init__.py b/setup/rma_sale_analytic/odoo/addons/__init__.py new file mode 100644 index 00000000..de40ea7c --- /dev/null +++ b/setup/rma_sale_analytic/odoo/addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/rma_sale_analytic/odoo/addons/rma_sale_analytic b/setup/rma_sale_analytic/odoo/addons/rma_sale_analytic new file mode 120000 index 00000000..fb6d548d --- /dev/null +++ b/setup/rma_sale_analytic/odoo/addons/rma_sale_analytic @@ -0,0 +1 @@ +../../../../rma_sale_analytic \ No newline at end of file diff --git a/setup/rma_sale_analytic/setup.py b/setup/rma_sale_analytic/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/rma_sale_analytic/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)