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

@@ -27,7 +27,7 @@
'description': """ 'description': """
This module adds product price and stock to bom view This module adds product price and stock to bom view
""", """,
'depends': ["base","mrp"], 'depends': ["base", "mrp"],
'demo': [], 'demo': [],
'data': ['mrp_bom_product_details.xml'], 'data': ['mrp_bom_product_details.xml'],
'auto_install': False, 'auto_install': False,

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_standard_price': fields.related('product_id', 'standard_price', type='float', string='Cost Price', 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), ),
'product_qty_available': fields.related(
'product_id', 'qty_available', type='float', string='Quantity On Hand', readonly=True
),
} }
_defaults = {
}
mrp_bom()

View File

@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*- # -*- encoding: utf-8 -*-
############################################################################## ##############################################################################
# #
# OpenERP, Open Source Management Solution # OpenERP, Open Source Management Solution
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). # Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
# #
@@ -15,10 +15,8 @@
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################## ##############################################################################
import industrial_design from . import industrial_design
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@@ -21,14 +21,14 @@
############################################################################## ##############################################################################
{ {
'name' : 'Industrial design specification in BoM', 'name': 'Industrial design specification in BoM',
'version' : '1.0', 'version': '1.0',
"author" : "Savoir-faire Linux", "author": "Savoir-faire Linux",
"website" : "http://www.savoirfairelinux.com", "website": "http://www.savoirfairelinux.com",
'license': 'AGPL-3', 'license': 'AGPL-3',
'category' : 'Specific Industry Applications', 'category': 'Specific Industry Applications',
'depends' : ['mrp'], 'depends': ['mrp'],
"data" : ['mrp_industrial_design.xml'], "data": ['mrp_industrial_design.xml'],
'description': """ 'description': """
This module adds the fields 'Bubble Number' and 'RefDes' (reference description) to a component in BoM view. 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, 'auto_install': False,
'installable': False 'installable': False
} }
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*- # -*- encoding: utf-8 -*-
############################################################################## ##############################################################################
# #
# OpenERP, Open Source Management Solution # OpenERP, Open Source Management Solution
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>). # Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
# #

View File

@@ -1,4 +1,4 @@
## -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################## ##############################################################################
# #
# OpenERP, Open Source Management Solution # OpenERP, Open Source Management Solution
@@ -21,15 +21,14 @@
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):
super(bom_structure, self).__init__(cr, uid, name, context=context) super(bom_structure, self).__init__(cr, uid, name, context=context)
self.localcontext.update({ self.localcontext.update({
'time': time, 'time': time,
'get_children':self.get_children, 'get_children': self.get_children,
}) })
def get_children(self, object, level=0): def get_children(self, object, level=0):
@@ -37,25 +36,26 @@ 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
children = _get_rec(object,level) children = _get_rec(object, level)
return children return children
@@ -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:

View File

@@ -56,7 +56,7 @@ class stock_move(orm.Model):
'state': move.state, 'state': move.state,
'prodlot_id': False, 'prodlot_id': False,
} }
#create the new move # create the new move
self.copy(cr, uid, move.id, default_val, context=context) self.copy(cr, uid, move.id, default_val, context=context)
# poor man's refresh # poor man's refresh

View File

@@ -70,7 +70,7 @@ class stock_move(orm.Model):
'prodlot_id': False, 'prodlot_id': False,
} }
#create the new moves # create the new moves
for i in xrange(int_qty - 1): for i in xrange(int_qty - 1):
self.copy(cr, uid, move.id, default_val, context=context) self.copy(cr, uid, move.id, default_val, context=context)