Fix pep8 on repo

This commit is contained in:
Sandy Carter
2014-07-22 12:28:02 -04:00
parent f368b8ebf2
commit b1ea63aa5f
8 changed files with 41 additions and 49 deletions

View File

@@ -20,17 +20,16 @@
# #
############################################################################## ##############################################################################
from openerp.osv import fields, osv from openerp.osv import fields, orm
from openerp.tools.translate import _
class mrp_bom(osv.osv):
class mrp_bom(orm.Model):
_inherit = 'mrp.bom' _inherit = 'mrp.bom'
_columns = { _columns = {
'product_standard_price': fields.related('product_id', 'standard_price', type='float', string='Cost Price', readonly=True), 'product_standard_price': fields.related(
'product_qty_available': fields.related('product_id', 'qty_available', type='float', string='Quantity On Hand', readonly=True), '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()

View File

@@ -19,6 +19,4 @@
# #
############################################################################## ##############################################################################
import industrial_design from . import industrial_design
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@@ -37,5 +37,3 @@ It also point the BOM Structure report to a new version that uses the new fields
'auto_install': False, 'auto_install': False,
'installable': False 'installable': False
} }
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@@ -1,4 +1,4 @@
## -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################## ##############################################################################
# #
# OpenERP, Open Source Management Solution # OpenERP, Open Source Management Solution
@@ -21,8 +21,7 @@
import time import time
from openerp.report import report_sxw from openerp.report import report_sxw
from openerp.osv import osv
from openerp import pooler
class bom_structure(report_sxw.rml_parse): class bom_structure(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context): def __init__(self, cr, uid, name, context):
@@ -37,21 +36,22 @@ class bom_structure(report_sxw.rml_parse):
def _get_rec(object, level): def _get_rec(object, level):
for l in object: for l in object:
res = {} res = {
res['name'] = l.name 'name': l.name,
res['pname'] = l.product_id.name 'pname': l.product_id.name,
res['pcode'] = l.product_id.default_code 'pcode': l.product_id.default_code,
res['pqty'] = l.product_qty 'pqty': l.product_qty,
res['uname'] = l.product_uom.name 'uname': l.product_uom.name,
res['code'] = l.code 'code': l.code,
res['level'] = level 'level': level,
res['bnumber'] = l.bubble_number 'bnumber': l.bubble_number,
}
result.append(res) result.append(res)
if l.child_complete_ids: if l.child_complete_ids:
if level < 6: if level < 6:
level += 1 level += 1
_get_rec(l.child_complete_ids, level) _get_rec(l.child_complete_ids, level)
if level>0 and level<6: if 0 < level < 6:
level -= 1 level -= 1
return result return result
@@ -64,6 +64,3 @@ report_sxw.report_sxw('report.industrialdesign.bom.structure',
'mrp_industrial_design_bom/report/bom_structure_industrial_design.rml', 'mrp_industrial_design_bom/report/bom_structure_industrial_design.rml',
parser=bom_structure, parser=bom_structure,
header='internal') header='internal')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: