mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
Fix pep8 on repo
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
|
||||
#
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import industrial_design
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
from . import industrial_design
|
||||
|
||||
@@ -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': False
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
|
||||
#
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -56,7 +56,7 @@ class stock_move(orm.Model):
|
||||
'state': move.state,
|
||||
'prodlot_id': False,
|
||||
}
|
||||
#create the new move
|
||||
# create the new move
|
||||
self.copy(cr, uid, move.id, default_val, context=context)
|
||||
|
||||
# poor man's refresh
|
||||
|
||||
@@ -70,7 +70,7 @@ class stock_move(orm.Model):
|
||||
'prodlot_id': False,
|
||||
}
|
||||
|
||||
#create the new moves
|
||||
# create the new moves
|
||||
for i in xrange(int_qty - 1):
|
||||
self.copy(cr, uid, move.id, default_val, context=context)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user