From 5cd5787e2b9896a19af362ae529df055815b0ed5 Mon Sep 17 00:00:00 2001 From: Sandy Carter Date: Tue, 22 Jul 2014 12:28:02 -0400 Subject: [PATCH] Fix pep8 on repo --- mrp_bom_product_details/__openerp__.py | 2 +- .../mrp_bom_product_details.py | 21 +++++------ mrp_industrial_design_bom/__init__.py | 8 ++-- mrp_industrial_design_bom/__openerp__.py | 16 ++++---- .../industrial_design.py | 2 +- .../report/bom_structure_industrial_design.py | 37 +++++++++---------- 6 files changed, 39 insertions(+), 47 deletions(-) diff --git a/mrp_bom_product_details/__openerp__.py b/mrp_bom_product_details/__openerp__.py index d5b1a86da..e3a5d422a 100644 --- a/mrp_bom_product_details/__openerp__.py +++ b/mrp_bom_product_details/__openerp__.py @@ -27,7 +27,7 @@ 'description': """ This module adds product price and stock to bom view """, - 'depends': ["base","mrp"], + 'depends': ["base", "mrp"], 'demo': [], 'data': ['mrp_bom_product_details.xml'], 'auto_install': False, diff --git a/mrp_bom_product_details/mrp_bom_product_details.py b/mrp_bom_product_details/mrp_bom_product_details.py index 6f505c623..07175e77d 100644 --- a/mrp_bom_product_details/mrp_bom_product_details.py +++ b/mrp_bom_product_details/mrp_bom_product_details.py @@ -20,17 +20,16 @@ # ############################################################################## -from openerp.osv import fields, osv -from openerp.tools.translate import _ +from openerp.osv import fields, orm -class mrp_bom(osv.osv): + +class mrp_bom(orm.Model): _inherit = 'mrp.bom' - - _columns ={ - 'product_standard_price': fields.related('product_id', 'standard_price', type='float', string='Cost Price', readonly=True), - 'product_qty_available': fields.related('product_id', 'qty_available', type='float', string='Quantity On Hand', readonly=True), + _columns = { + 'product_standard_price': fields.related( + 'product_id', 'standard_price', type='float', string='Cost Price', readonly=True + ), + 'product_qty_available': fields.related( + 'product_id', 'qty_available', type='float', string='Quantity On Hand', readonly=True + ), } - _defaults = { - } - -mrp_bom() diff --git a/mrp_industrial_design_bom/__init__.py b/mrp_industrial_design_bom/__init__.py index 55ce5467c..914610c5e 100644 --- a/mrp_industrial_design_bom/__init__.py +++ b/mrp_industrial_design_bom/__init__.py @@ -1,6 +1,6 @@ # -*- encoding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2013 Savoir-faire Linux (). # @@ -15,10 +15,8 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## -import industrial_design -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - +from . import industrial_design diff --git a/mrp_industrial_design_bom/__openerp__.py b/mrp_industrial_design_bom/__openerp__.py index ebd2995f6..27584893f 100644 --- a/mrp_industrial_design_bom/__openerp__.py +++ b/mrp_industrial_design_bom/__openerp__.py @@ -21,14 +21,14 @@ ############################################################################## { - 'name' : 'Industrial design specification in BoM', - 'version' : '1.0', - "author" : "Savoir-faire Linux", - "website" : "http://www.savoirfairelinux.com", + 'name': 'Industrial design specification in BoM', + 'version': '1.0', + "author": "Savoir-faire Linux", + "website": "http://www.savoirfairelinux.com", 'license': 'AGPL-3', - 'category' : 'Specific Industry Applications', - 'depends' : ['mrp'], - "data" : ['mrp_industrial_design.xml'], + 'category': 'Specific Industry Applications', + 'depends': ['mrp'], + "data": ['mrp_industrial_design.xml'], 'description': """ This module adds the fields 'Bubble Number' and 'RefDes' (reference description) to a component in BoM view. @@ -37,5 +37,3 @@ It also point the BOM Structure report to a new version that uses the new fields 'auto_install': False, 'installable': True } -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/mrp_industrial_design_bom/industrial_design.py b/mrp_industrial_design_bom/industrial_design.py index 7aa4c555c..42e06394c 100644 --- a/mrp_industrial_design_bom/industrial_design.py +++ b/mrp_industrial_design_bom/industrial_design.py @@ -1,6 +1,6 @@ # -*- encoding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2013 Savoir-faire Linux (). # diff --git a/mrp_industrial_design_bom/report/bom_structure_industrial_design.py b/mrp_industrial_design_bom/report/bom_structure_industrial_design.py index cba61bee7..bf94211b9 100644 --- a/mrp_industrial_design_bom/report/bom_structure_industrial_design.py +++ b/mrp_industrial_design_bom/report/bom_structure_industrial_design.py @@ -1,4 +1,4 @@ -## -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution @@ -21,15 +21,14 @@ import time from openerp.report import report_sxw -from openerp.osv import osv -from openerp import pooler + class bom_structure(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(bom_structure, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, - 'get_children':self.get_children, + 'get_children': self.get_children, }) def get_children(self, object, level=0): @@ -37,25 +36,26 @@ class bom_structure(report_sxw.rml_parse): def _get_rec(object, level): for l in object: - res = {} - res['name'] = l.name - res['pname'] = l.product_id.name - res['pcode'] = l.product_id.default_code - res['pqty'] = l.product_qty - res['uname'] = l.product_uom.name - res['code'] = l.code - res['level'] = level - res['bnumber'] = l.bubble_number + res = { + 'name': l.name, + 'pname': l.product_id.name, + 'pcode': l.product_id.default_code, + 'pqty': l.product_qty, + 'uname': l.product_uom.name, + 'code': l.code, + 'level': level, + 'bnumber': l.bubble_number, + } result.append(res) if l.child_complete_ids: - if level<6: + if level < 6: level += 1 - _get_rec(l.child_complete_ids,level) - if level>0 and level<6: + _get_rec(l.child_complete_ids, level) + if 0 < level < 6: level -= 1 return result - children = _get_rec(object,level) + children = _get_rec(object, level) return children @@ -64,6 +64,3 @@ report_sxw.report_sxw('report.industrialdesign.bom.structure', 'mrp_industrial_design_bom/report/bom_structure_industrial_design.rml', parser=bom_structure, header='internal') - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: