From 15eb172fee2b83a51915ebd004cc0a98449aba02 Mon Sep 17 00:00:00 2001 From: Roman Widmann Date: Wed, 7 Mar 2018 11:53:40 +0100 Subject: [PATCH] Pylint Anpassungen --- ext/custom-addons/dp_custom/models/account.py | 6 +++--- ext/custom-addons/dp_custom/models/commission_account.py | 2 +- ext/custom-addons/dp_custom/models/ir_ui_menu.py | 2 +- ext/custom-addons/dp_custom/models/res_partner.py | 4 ++-- ext/custom-addons/dp_custom/models/sale.py | 6 +++--- .../dp_custom/wizards/wizard_confirm_production.py | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ext/custom-addons/dp_custom/models/account.py b/ext/custom-addons/dp_custom/models/account.py index 7b5eaa6e..6839bd1e 100644 --- a/ext/custom-addons/dp_custom/models/account.py +++ b/ext/custom-addons/dp_custom/models/account.py @@ -49,10 +49,10 @@ class AccountInvoice(models.Model): @api.multi def _compute_weight_total(self): for record in self: - sum = 0 + _sum = 0 for line in record.invoice_line_ids: - sum += line.product_id.weight * line.quantity - record.weight_total = sum + _sum += line.product_id.weight * line.quantity + record.weight_total = _sum @api.multi def _compute_positions(self): diff --git a/ext/custom-addons/dp_custom/models/commission_account.py b/ext/custom-addons/dp_custom/models/commission_account.py index 70ed5864..5e8494d6 100644 --- a/ext/custom-addons/dp_custom/models/commission_account.py +++ b/ext/custom-addons/dp_custom/models/commission_account.py @@ -1,7 +1,7 @@ # Copyright 2018-Today datenpol gmbh () # License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses). -from odoo import api, fields, models, _ +from odoo import fields, models class CommissionAccount(models.Model): diff --git a/ext/custom-addons/dp_custom/models/ir_ui_menu.py b/ext/custom-addons/dp_custom/models/ir_ui_menu.py index 5b820b1c..3ad8c42d 100644 --- a/ext/custom-addons/dp_custom/models/ir_ui_menu.py +++ b/ext/custom-addons/dp_custom/models/ir_ui_menu.py @@ -42,7 +42,7 @@ class IrUiMenu(models.Model): def _filter_visible_menus(self): if self.env.uid != 1: disabled_ids = self.get_disabled_menu_ids() - ids = [id for id in self.ids if id not in disabled_ids] + ids = [_id for _id in self.ids if _id not in disabled_ids] self = self.browse(ids) ids = super(IrUiMenu, self)._filter_visible_menus() diff --git a/ext/custom-addons/dp_custom/models/res_partner.py b/ext/custom-addons/dp_custom/models/res_partner.py index 699eaa27..53143d03 100644 --- a/ext/custom-addons/dp_custom/models/res_partner.py +++ b/ext/custom-addons/dp_custom/models/res_partner.py @@ -18,8 +18,8 @@ # along with this program. If not, see . # ############################################################################## -import requests import json +import requests from odoo import tools, api, fields, models, _ from odoo.exceptions import ValidationError @@ -198,7 +198,7 @@ class Partner(models.Model): elif self.env.context.get('sst_11', False): common_list.extend(['name', 'ref', 'partner_sector_id', 'comment', 'vat', 'property_payment_term_id', 'property_pricelist_id', 'date_vat_check', 'active', 'property_product_pricelist', - 'retail_partner_id', 'retailer','info_uid']) + 'retail_partner_id', 'retailer', 'info_uid']) return common_list else: return super(Partner, self)._get_specified_fields() diff --git a/ext/custom-addons/dp_custom/models/sale.py b/ext/custom-addons/dp_custom/models/sale.py index 316c93f5..10c21999 100644 --- a/ext/custom-addons/dp_custom/models/sale.py +++ b/ext/custom-addons/dp_custom/models/sale.py @@ -54,10 +54,10 @@ class SaleOrder(models.Model): @api.multi def _compute_weight_total(self): for record in self: - sum = 0 + _sum = 0 for line in record.order_line: - sum += (line.lot_id.weight or line.product_id.weight) * line.product_uom_qty - record.weight_total = sum + _sum += (line.lot_id.weight or line.product_id.weight) * line.product_uom_qty + record.weight_total = _sum @api.multi def _compute_positions(self): diff --git a/ext/custom-addons/dp_custom/wizards/wizard_confirm_production.py b/ext/custom-addons/dp_custom/wizards/wizard_confirm_production.py index 51e767e1..6aa2cf49 100644 --- a/ext/custom-addons/dp_custom/wizards/wizard_confirm_production.py +++ b/ext/custom-addons/dp_custom/wizards/wizard_confirm_production.py @@ -21,7 +21,7 @@ class WizardConfirmProduction(models.TransientModel): if so.assembly_state == 'created' and so.state == 'sale': so.assembly_state = 'approved' else: - raise ValidationError(u'Auftrag %s: Bitte prüfen Sie den PG-Status und/oder Auftragsstatus.' % so.name) + raise ValidationError(_('Auftrag %s: Bitte prüfen Sie den PG-Status und/oder Auftragsstatus.' % so.name)) action = self.env.ref('sale.action_orders').read()[0] action['domain'] = [('id', 'in', active_ids)] return action