From 8ed44d013f9f2df1a8903d75210b42864a9f6042 Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Thu, 19 Dec 2019 11:48:41 +0100 Subject: [PATCH] [IMP] stock_location_bin_name: black, isort --- stock_location_bin_name/__manifest__.py | 27 ++++++++----------- .../models/stock_location.py | 20 +++++++------- 2 files changed, 21 insertions(+), 26 deletions(-) diff --git a/stock_location_bin_name/__manifest__.py b/stock_location_bin_name/__manifest__.py index 8b7a3f3b7..23898c0c3 100644 --- a/stock_location_bin_name/__manifest__.py +++ b/stock_location_bin_name/__manifest__.py @@ -3,20 +3,15 @@ # Copyright 2019 Camptocamp SA # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) { - 'name': 'Stock Location Bin Name', - 'version': '12.0.1.0.0', - 'author': "BCIM, Okia, Camptocamp, Odoo Community Association (OCA)", - 'website': "https://github.com/OCA/stock-logistics-warehouse", - 'summary': "Compute bin stock location name automatically", - 'category': 'Stock Management', - 'depends': [ - 'stock_location_zone', - 'stock_location_attribute', - ], - 'data': [ - 'views/stock_location.xml', - ], - 'installable': True, - 'development_status': 'Alpha', - 'license': 'AGPL-3', + "name": "Stock Location Bin Name", + "version": "12.0.1.0.0", + "author": "BCIM, Okia, Camptocamp, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/stock-logistics-warehouse", + "summary": "Compute bin stock location name automatically", + "category": "Stock Management", + "depends": ["stock_location_zone", "stock_location_attribute"], + "data": ["views/stock_location.xml"], + "installable": True, + "development_status": "Alpha", + "license": "AGPL-3", } diff --git a/stock_location_bin_name/models/stock_location.py b/stock_location_bin_name/models/stock_location.py index 3fa503d79..80593687e 100644 --- a/stock_location_bin_name/models/stock_location.py +++ b/stock_location_bin_name/models/stock_location.py @@ -7,30 +7,30 @@ from odoo import api, fields, models class StockLocation(models.Model): - _inherit = 'stock.location' + _inherit = "stock.location" location_name_format = fields.Char( - 'Location Name Format', + "Location Name Format", help="Format string that will compute the name of the location. " - "Use location fields. Example: " - "'{area}-{corridor:0>2}.{rack:0>3}" - ".{level:0>2}'") + "Use location fields. Example: " + "'{area}-{corridor:0>2}.{rack:0>3}" + ".{level:0>2}'", + ) area = fields.Char( - string='Area', + string="Area", # Field used for _onchange_attribute_compute_name, so we # have the name in the record's cache. Does not need to be # stored as we already have 'area_location_id' - related='area_location_id.name', + related="area_location_id.name", readonly=True, ) @api.multi - @api.onchange('corridor', 'row', 'rack', 'level', - 'posx', 'posy', 'posz') + @api.onchange("corridor", "row", "rack", "level", "posx", "posy", "posz") def _onchange_attribute_compute_name(self): for location in self: - if not location.location_kind == 'bin': + if not location.location_kind == "bin": continue area = location while area and not area.location_name_format: