summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorRémy Voet (ryv) <ryv@odoo.com>2020-01-17 14:55:24 +0000
committerRémy Voet (ryv) <ryv@odoo.com>2020-01-20 13:58:52 +0000
commit177a479cf66ecab017fadf2034fc52501643ee41 (patch)
tree8763735e48fb30fc791ed5c9acf0a35bd804d6d2 /addons
parent53ebf7491e1eb6ca90f989979ce46251afe5eb53 (diff)
[REF] stock: clean imports
Clean imports of the main stock module: - Remove unsued import - Follow odoo guidelines - Sort them
Diffstat (limited to 'addons')
-rw-r--r--addons/stock/models/barcode.py2
-rw-r--r--addons/stock/models/product.py6
-rw-r--r--addons/stock/models/product_strategy.py2
-rw-r--r--addons/stock/models/res_company.py2
-rw-r--r--addons/stock/models/res_partner.py2
-rw-r--r--addons/stock/models/stock_inventory.py4
-rw-r--r--addons/stock/models/stock_location.py6
-rw-r--r--addons/stock/models/stock_move.py11
-rw-r--r--addons/stock/models/stock_move_line.py4
-rw-r--r--addons/stock/models/stock_orderpoint.py5
-rw-r--r--addons/stock/models/stock_package_level.py3
-rw-r--r--addons/stock/models/stock_picking.py10
-rw-r--r--addons/stock/models/stock_production_lot.py3
-rw-r--r--addons/stock/models/stock_quant.py8
-rw-r--r--addons/stock/models/stock_rule.py11
-rw-r--r--addons/stock/models/stock_scrap.py2
-rw-r--r--addons/stock/models/stock_warehouse.py5
-rw-r--r--addons/stock/static/src/xml/stock_traceability_report_line.xml2
-rw-r--r--addons/stock/views/report_stock_traceability.xml2
-rw-r--r--addons/stock/wizard/product_replenish.py3
-rw-r--r--addons/stock/wizard/stock_assign_serial_numbers.py3
-rw-r--r--addons/stock/wizard/stock_backorder_confirmation.py2
-rw-r--r--addons/stock/wizard/stock_change_product_qty.py3
-rw-r--r--addons/stock/wizard/stock_immediate_transfer.py2
-rw-r--r--addons/stock/wizard/stock_picking_return.py2
-rw-r--r--addons/stock/wizard/stock_quantity_history.py2
-rw-r--r--addons/stock/wizard/stock_track_confirmation.py2
-rw-r--r--addons/stock/wizard/stock_warn_insufficient_qty.py1
28 files changed, 53 insertions, 57 deletions
diff --git a/addons/stock/models/barcode.py b/addons/stock/models/barcode.py
index 7daf697f972..61b8a31dbc0 100644
--- a/addons/stock/models/barcode.py
+++ b/addons/stock/models/barcode.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from odoo import models, fields, _
+from odoo import fields, models
class BarcodeRule(models.Model):
diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py
index df95ce00d43..7810e7218ba 100644
--- a/addons/stock/models/product.py
+++ b/addons/stock/models/product.py
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from odoo import api, fields, models, _
+import operator as py_operator
+
+from odoo import _, api, fields, models
from odoo.exceptions import UserError
from odoo.osv import expression
from odoo.tools.float_utils import float_round
-from datetime import datetime
-import operator as py_operator
OPERATORS = {
'<': py_operator.lt,
diff --git a/addons/stock/models/product_strategy.py b/addons/stock/models/product_strategy.py
index 647c09ec30f..5606fb9f47d 100644
--- a/addons/stock/models/product_strategy.py
+++ b/addons/stock/models/product_strategy.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from odoo import fields, models, api, _
+from odoo import _, api, fields, models
from odoo.exceptions import UserError
diff --git a/addons/stock/models/res_company.py b/addons/stock/models/res_company.py
index 6f97e54fbcb..ef944848019 100644
--- a/addons/stock/models/res_company.py
+++ b/addons/stock/models/res_company.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from odoo import api, fields, models, _
+from odoo import _, api, fields, models
class Company(models.Model):
diff --git a/addons/stock/models/res_partner.py b/addons/stock/models/res_partner.py
index 5f2590d1ae8..78244d20cf1 100644
--- a/addons/stock/models/res_partner.py
+++ b/addons/stock/models/res_partner.py
@@ -2,7 +2,7 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
-from odoo.addons.base.models.res_partner import WARNING_MESSAGE, WARNING_HELP
+from odoo.addons.base.models.res_partner import WARNING_HELP, WARNING_MESSAGE
class Partner(models.Model):
diff --git a/addons/stock/models/stock_inventory.py b/addons/stock/models/stock_inventory.py
index 1020f0a1b58..2f6e3f045fa 100644
--- a/addons/stock/models/stock_inventory.py
+++ b/addons/stock/models/stock_inventory.py
@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from odoo import api, fields, models, _
+from odoo import _, api, fields, models
+from odoo.addons.base.models.ir_model import MODULE_UNINSTALL_FLAG
from odoo.exceptions import UserError, ValidationError
from odoo.osv import expression
from odoo.tools import float_compare, float_is_zero
-from odoo.addons.base.models.ir_model import MODULE_UNINSTALL_FLAG
class Inventory(models.Model):
diff --git a/addons/stock/models/stock_location.py b/addons/stock/models/stock_location.py
index 5160b80c109..822773beb01 100644
--- a/addons/stock/models/stock_location.py
+++ b/addons/stock/models/stock_location.py
@@ -1,13 +1,9 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from datetime import datetime
-from dateutil import relativedelta
+from odoo import _, api, fields, models
from odoo.exceptions import UserError
-
-from odoo import api, fields, models, _
from odoo.osv import expression
-from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
class Location(models.Model):
diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py
index 8b903222069..165e750251f 100644
--- a/addons/stock/models/stock_move.py
+++ b/addons/stock/models/stock_move.py
@@ -3,15 +3,16 @@
from collections import defaultdict
from datetime import datetime
-from dateutil import relativedelta
from itertools import groupby
from operator import itemgetter
-from re import findall as regex_findall, split as regex_split
+from re import findall as regex_findall
+from re import split as regex_split
+
+from dateutil import relativedelta
-from odoo import api, fields, models, _, SUPERUSER_ID
+from odoo import SUPERUSER_ID, _, api, fields, models
from odoo.exceptions import UserError
-from odoo.osv import expression
-from odoo.tools.float_utils import float_compare, float_round, float_is_zero
+from odoo.tools.float_utils import float_compare, float_is_zero, float_round
PROCUREMENT_PRIORITIES = [('0', 'Not urgent'), ('1', 'Normal'), ('2', 'Urgent'), ('3', 'Very Urgent')]
diff --git a/addons/stock/models/stock_move_line.py b/addons/stock/models/stock_move_line.py
index 251a0a224e5..bdf659dc6b8 100644
--- a/addons/stock/models/stock_move_line.py
+++ b/addons/stock/models/stock_move_line.py
@@ -3,9 +3,9 @@
from collections import Counter
-from odoo import api, fields, models, _
+from odoo import _, api, fields, models
from odoo.exceptions import UserError, ValidationError
-from odoo.tools.float_utils import float_round, float_compare, float_is_zero
+from odoo.tools.float_utils import float_compare, float_is_zero, float_round
class StockMoveLine(models.Model):
diff --git a/addons/stock/models/stock_orderpoint.py b/addons/stock/models/stock_orderpoint.py
index b805de95ecb..8864d1e7bbf 100644
--- a/addons/stock/models/stock_orderpoint.py
+++ b/addons/stock/models/stock_orderpoint.py
@@ -2,10 +2,11 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime, time
-from dateutil import relativedelta
from json import dumps
-from odoo import api, fields, models, _
+from dateutil import relativedelta
+
+from odoo import _, api, fields, models
from odoo.exceptions import UserError, ValidationError
from odoo.osv import expression
diff --git a/addons/stock/models/stock_package_level.py b/addons/stock/models/stock_package_level.py
index 98db85e9cd6..f2280839b48 100644
--- a/addons/stock/models/stock_package_level.py
+++ b/addons/stock/models/stock_package_level.py
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from odoo import api, fields, models, _
from itertools import groupby
from operator import itemgetter
+from odoo import _, api, fields, models
+
class StockPackageLevel(models.Model):
_name = 'stock.package_level'
diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py
index 9ef591aa88f..3885dc5874b 100644
--- a/addons/stock/models/stock_picking.py
+++ b/addons/stock/models/stock_picking.py
@@ -1,19 +1,19 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
+import json
+import time
from ast import literal_eval
from datetime import date
from itertools import groupby
from operator import itemgetter
-import time
-import json
-from odoo import api, fields, models, SUPERUSER_ID, _
+from odoo import SUPERUSER_ID, _, api, fields, models
+from odoo.addons.stock.models.stock_move import PROCUREMENT_PRIORITIES
+from odoo.exceptions import UserError
from odoo.osv import expression
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT, format_datetime
from odoo.tools.float_utils import float_compare, float_is_zero, float_round
-from odoo.exceptions import UserError
-from odoo.addons.stock.models.stock_move import PROCUREMENT_PRIORITIES
class PickingType(models.Model):
diff --git a/addons/stock/models/stock_production_lot.py b/addons/stock/models/stock_production_lot.py
index 0c56abb18b6..2ac426d33f5 100644
--- a/addons/stock/models/stock_production_lot.py
+++ b/addons/stock/models/stock_production_lot.py
@@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from odoo import api, fields, models, _
+from odoo import _, api, fields, models
from odoo.exceptions import UserError
-from odoo.osv import expression
class ProductionLot(models.Model):
diff --git a/addons/stock/models/stock_quant.py b/addons/stock/models/stock_quant.py
index 66eb4cd5a9f..73b90d4d5b6 100644
--- a/addons/stock/models/stock_quant.py
+++ b/addons/stock/models/stock_quant.py
@@ -1,15 +1,15 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from psycopg2 import OperationalError, Error
+import logging
+
+from psycopg2 import Error, OperationalError
-from odoo import api, fields, models, _
+from odoo import _, api, fields, models
from odoo.exceptions import UserError, ValidationError
from odoo.osv import expression
from odoo.tools.float_utils import float_compare, float_is_zero, float_round
-import logging
-
_logger = logging.getLogger(__name__)
diff --git a/addons/stock/models/stock_rule.py b/addons/stock/models/stock_rule.py
index 704ea9a8341..99433257da1 100644
--- a/addons/stock/models/stock_rule.py
+++ b/addons/stock/models/stock_rule.py
@@ -1,18 +1,19 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from collections import namedtuple, defaultdict
+import logging
+from collections import defaultdict, namedtuple
from datetime import datetime, time
+
from dateutil.relativedelta import relativedelta
-from odoo.tools.misc import split_every
from psycopg2 import OperationalError
-from odoo import api, fields, models, registry, SUPERUSER_ID, _
+from odoo import SUPERUSER_ID, _, api, fields, models, registry
+from odoo.exceptions import UserError
from odoo.osv import expression
from odoo.tools import float_compare, float_round, frozendict, html_escape
-from odoo.exceptions import UserError
+from odoo.tools.misc import split_every
-import logging
_logger = logging.getLogger(__name__)
diff --git a/addons/stock/models/stock_scrap.py b/addons/stock/models/stock_scrap.py
index 5690d93bdd4..2329bc82cc6 100644
--- a/addons/stock/models/stock_scrap.py
+++ b/addons/stock/models/stock_scrap.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from odoo import api, fields, models, _
+from odoo import _, api, fields, models
from odoo.exceptions import UserError
from odoo.tools import float_compare
diff --git a/addons/stock/models/stock_warehouse.py b/addons/stock/models/stock_warehouse.py
index 7fb1a33f1ea..8c324467409 100644
--- a/addons/stock/models/stock_warehouse.py
+++ b/addons/stock/models/stock_warehouse.py
@@ -1,13 +1,12 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
+import logging
from collections import namedtuple
-from odoo import api, fields, models, _
+from odoo import _, api, fields, models
from odoo.exceptions import UserError
-import logging
-
_logger = logging.getLogger(__name__)
diff --git a/addons/stock/static/src/xml/stock_traceability_report_line.xml b/addons/stock/static/src/xml/stock_traceability_report_line.xml
index 00b00eb8a16..fa39b9c3087 100644
--- a/addons/stock/static/src/xml/stock_traceability_report_line.xml
+++ b/addons/stock/static/src/xml/stock_traceability_report_line.xml
@@ -34,7 +34,7 @@
</t>
<t t-if="l.reference == c">
<span t-if="c" t-att-class="spanclass">
- <a t-att-data-active-id="l.res_id" t-att-data-res-model="l.res_model" class="o_stock_reports_web_action" href="#"><t t-raw="c"/></a>
+ <a t-att-data-active-id="l.res_id" t-att-data-res-model="l.res_model" class="o_stock_reports_web_action" href="#"><t t-raw="c" /></a>
</span>
</t>
<t t-elif="l.lot_name == c and l.lot_name != false">
diff --git a/addons/stock/views/report_stock_traceability.xml b/addons/stock/views/report_stock_traceability.xml
index 4e4ad63c6b3..20936403bf0 100644
--- a/addons/stock/views/report_stock_traceability.xml
+++ b/addons/stock/views/report_stock_traceability.xml
@@ -38,7 +38,7 @@
</span>
</t>
<t t-else="">
- <t t-raw="c"/>
+ <t t-raw="c"/>
</t>
</td>
</t>
diff --git a/addons/stock/wizard/product_replenish.py b/addons/stock/wizard/product_replenish.py
index 735020e07b2..ee61fa30e6b 100644
--- a/addons/stock/wizard/product_replenish.py
+++ b/addons/stock/wizard/product_replenish.py
@@ -2,7 +2,8 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
-from odoo import api, fields, models, _
+
+from odoo import _, api, fields, models
from odoo.exceptions import UserError
from odoo.tools.misc import clean_context
diff --git a/addons/stock/wizard/stock_assign_serial_numbers.py b/addons/stock/wizard/stock_assign_serial_numbers.py
index dbe45a201af..1429f445835 100644
--- a/addons/stock/wizard/stock_assign_serial_numbers.py
+++ b/addons/stock/wizard/stock_assign_serial_numbers.py
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-import re
-from odoo import api, fields, models, _
+from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
diff --git a/addons/stock/wizard/stock_backorder_confirmation.py b/addons/stock/wizard/stock_backorder_confirmation.py
index 87be55c221f..5866b463930 100644
--- a/addons/stock/wizard/stock_backorder_confirmation.py
+++ b/addons/stock/wizard/stock_backorder_confirmation.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from odoo import api, fields, models, _
+from odoo import api, fields, models
from odoo.tools.float_utils import float_compare
diff --git a/addons/stock/wizard/stock_change_product_qty.py b/addons/stock/wizard/stock_change_product_qty.py
index 8a2d4f4dae0..ee4d1563776 100644
--- a/addons/stock/wizard/stock_change_product_qty.py
+++ b/addons/stock/wizard/stock_change_product_qty.py
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from odoo import api, models, fields, tools, _
-from odoo.addons import decimal_precision as dp
+from odoo import _, api, fields, models
from odoo.exceptions import UserError
diff --git a/addons/stock/wizard/stock_immediate_transfer.py b/addons/stock/wizard/stock_immediate_transfer.py
index 19898eca9e9..fc494d8d5bc 100644
--- a/addons/stock/wizard/stock_immediate_transfer.py
+++ b/addons/stock/wizard/stock_immediate_transfer.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from odoo import api, fields, models, _
+from odoo import _, api, fields, models
from odoo.exceptions import UserError
diff --git a/addons/stock/wizard/stock_picking_return.py b/addons/stock/wizard/stock_picking_return.py
index 8b39d2fa9ac..a197cd722bc 100644
--- a/addons/stock/wizard/stock_picking_return.py
+++ b/addons/stock/wizard/stock_picking_return.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from odoo import api, fields, models, _
+from odoo import _, api, fields, models
from odoo.exceptions import UserError
from odoo.tools.float_utils import float_round
diff --git a/addons/stock/wizard/stock_quantity_history.py b/addons/stock/wizard/stock_quantity_history.py
index a89f1fbd1e4..1fd8a811eaa 100644
--- a/addons/stock/wizard/stock_quantity_history.py
+++ b/addons/stock/wizard/stock_quantity_history.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from odoo import fields, models, _
+from odoo import _, fields, models
from odoo.osv import expression
diff --git a/addons/stock/wizard/stock_track_confirmation.py b/addons/stock/wizard/stock_track_confirmation.py
index 946fbe68e20..786b14cd0ef 100644
--- a/addons/stock/wizard/stock_track_confirmation.py
+++ b/addons/stock/wizard/stock_track_confirmation.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from odoo import api, models, fields, tools
+from odoo import fields, models
class StockTrackConfirmation(models.TransientModel):
diff --git a/addons/stock/wizard/stock_warn_insufficient_qty.py b/addons/stock/wizard/stock_warn_insufficient_qty.py
index 876d73ddc16..a7ac3830dc1 100644
--- a/addons/stock/wizard/stock_warn_insufficient_qty.py
+++ b/addons/stock/wizard/stock_warn_insufficient_qty.py
@@ -2,7 +2,6 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
-from odoo.tools import float_compare
class StockWarnInsufficientQty(models.AbstractModel):