@@ -955,6 +939,7 @@
+
@@ -969,11 +954,18 @@
search
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/mrp/mrp_wizard.xml b/addons/mrp/mrp_wizard.xml
index 74001494c77..f7bfdcd7395 100644
--- a/addons/mrp/mrp_wizard.xml
+++ b/addons/mrp/mrp_wizard.xml
@@ -1,35 +1,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- Product Cost Structure
-
-
-
-
-
diff --git a/addons/mrp/product.py b/addons/mrp/product.py
new file mode 100644
index 00000000000..375bd0c9f46
--- /dev/null
+++ b/addons/mrp/product.py
@@ -0,0 +1,70 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from osv import fields, osv
+from tools.translate import _
+
+
+class product_product(osv.osv):
+ _inherit = "product.product"
+
+ def do_change_standard_price(self, cr, uid, ids, datas, context={}):
+ #TODO : TO Check
+ res = super(product_product, self).do_change_standard_price(cr, uid, ids, datas, context=context)
+ bom_obj = self.pool.get('mrp.bom')
+ product_uom_obj = self.pool.get('product.uom')
+
+ def _compute_price(bom):
+ price = 0
+ if bom.bom_lines:
+ for sbom in bom.bom_lines:
+ price += _compute_price(sbom) * sbom.product_qty
+ else:
+
+ no_child_bom = bom_obj.search(cr, uid, [('product_id', '=', bom.product_id.id), ('bom_id', '=', False)])
+ if no_child_bom and bom.id not in no_child_bom:
+ other_bom = bom_obj.browse(cr, uid, no_child_bom)[0]
+ if not other_bom.product_id.calculate_price:
+ price += _compute_price(other_bom) * other_bom.product_qty
+ else:
+ price += other_bom.product_id.standard_price
+ else:
+ price += bom.product_id.standard_price
+
+ if bom.routing_id:
+ for wline in bom.routing_id.workcenter_lines:
+ wc = wline.workcenter_id
+ cycle = wline.cycle_nbr
+ hour = (wc.time_start + wc.time_stop + cycle * wc.time_cycle) * (wc.time_efficiency or 1.0)
+ price += wc.costs_cycle * cycle + wc.costs_hour * hour
+ price = product_uom_obj._compute_price(cr, uid, bom.product_uom.id, price, bom.product_id.uom_id.id)
+ if bom.bom_lines:
+ self.write(cr, uid, [bom.product_id.id], {'standard_price' : price/bom.product_qty})
+ if bom.product_uom.id != bom.product_id.uom_id.id:
+ price = product_uom_obj._compute_price(cr, uid, bom.product_uom.id, price, bom.product_id.uom_id.id)
+ return price
+
+
+ bom_ids = bom_obj.search(cr, uid, [('product_id', 'in', ids)])
+ for bom in bom_obj.browse(cr, uid, bom_ids):
+ _compute_price(bom)
+ return res
+product_product()
diff --git a/addons/mrp/report/__init__.py b/addons/mrp/report/__init__.py
index a053b3998b2..471e3440af3 100644
--- a/addons/mrp/report/__init__.py
+++ b/addons/mrp/report/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
@@ -23,6 +23,8 @@ import price
import workcenter_load
import order
import bom_structure
+import mrp_report
+import mrp_production_order
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp/report/mrp_production_order.py b/addons/mrp/report/mrp_production_order.py
new file mode 100644
index 00000000000..d2299a19731
--- /dev/null
+++ b/addons/mrp/report/mrp_production_order.py
@@ -0,0 +1,66 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+from osv import fields,osv
+import tools
+
+
+class mrp_production_order(osv.osv):
+ _name = "mrp.production.order"
+ _description = "Production Order Report"
+ _auto = False
+ _columns = {
+ 'name': fields.char('Year',size=64,required=False, readonly=True),
+ 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
+ ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
+ 'reference': fields.char('Reference', size=64, required=True),
+ 'origin': fields.char('Source Document', size=64),
+ 'nbr': fields.integer('# of Orders', readonly=True),
+ 'product_id': fields.many2one('product.product', 'Product', required=True, domain=[('type','<>','service')]),
+ 'state': fields.selection([('draft','Draft'),('picking_except', 'Picking Exception'),('confirmed','Waiting Goods'),('ready','Ready to Produce'),('in_production','In Production'),('cancel','Cancelled'),('done','Done')],'State', readonly=True),
+ 'scheduled_date':fields.date('Scheduled Date'),
+ 'location_src_id': fields.many2one('stock.location', 'Raw Materials Location', required=True),
+ 'location_dest_id': fields.many2one('stock.location', 'Finished Products Location', required=True),
+
+
+ }
+ def init(self, cr):
+ tools.drop_view_if_exists(cr, 'mrp_production_order')
+ cr.execute("""
+ create or replace view mrp_production_order as (
+ select
+ min(c.id) as id,
+ to_char(c.create_date, 'YYYY') as name,
+ to_char(c.create_date, 'MM') as month,
+ c.state,
+ c.product_id,
+ count(*) as nbr,
+ to_date(to_char(c.date_planned, 'dd-MM-YYYY'),'dd-MM-YYYY') as scheduled_date,
+ c.name as reference,
+ c.origin,
+ c.location_src_id,
+ c.location_dest_id
+ from
+ mrp_production c
+ group by to_char(c.create_date, 'YYYY'), to_char(c.create_date, 'MM'), c.state,c.product_id,to_date(to_char(c.date_planned, 'dd-MM-YYYY'),'dd-MM-YYYY'),c.name,c.location_src_id,c.location_dest_id,c.origin
+ )""")
+mrp_production_order()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/mrp/report/mrp_production_order_view.xml b/addons/mrp/report/mrp_production_order_view.xml
new file mode 100644
index 00000000000..abb046bd685
--- /dev/null
+++ b/addons/mrp/report/mrp_production_order_view.xml
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+ mrp.production.order.tree
+ mrp.production.order
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ mrp.production.order.form
+ mrp.production.order
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+ mrp.production.order.graph
+ mrp.production.order
+ graph
+
+
+
+
+
+
+
+
+
+ mrp.production.order.select
+ mrp.production.order
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Production Order
+ mrp.production.order
+ form
+ tree,graph
+
+
+
+
+
+
+ tree
+
+
+
+
+
+
+ graph
+
+
+
+
+
+
+
+
+
diff --git a/addons/report_mrp/report_mrp.py b/addons/mrp/report/mrp_report.py
similarity index 100%
rename from addons/report_mrp/report_mrp.py
rename to addons/mrp/report/mrp_report.py
diff --git a/addons/report_mrp/report_mrp_view.xml b/addons/mrp/report/mrp_report_view.xml
similarity index 98%
rename from addons/report_mrp/report_mrp_view.xml
rename to addons/mrp/report/mrp_report_view.xml
index c14688d9cbf..5de7c7be34b 100644
--- a/addons/report_mrp/report_mrp_view.xml
+++ b/addons/mrp/report/mrp_report_view.xml
@@ -98,7 +98,7 @@
formgraph,tree
-
+
diff --git a/addons/mrp/report/workcenter_load.py b/addons/mrp/report/workcenter_load.py
index a65a51d03f7..248e9e5707e 100644
--- a/addons/mrp/report/workcenter_load.py
+++ b/addons/mrp/report/workcenter_load.py
@@ -134,9 +134,9 @@ class report_custom(report_int):
# select workcenters
cr.execute(
- "SELECT id, name FROM mrp_workcenter " \
- "WHERE id=ANY(%s)" \
- "ORDER BY mrp_workcenter.id" ,(ids,))
+ "SELECT mw.id, rs.name FROM mrp_workcenter mw, resource_resource rs " \
+ "WHERE mw.id=ANY(%s) and mw.resource_id=rs.id " \
+ "ORDER BY mw.id" ,(ids,))
workcenters = cr.dictfetchall()
data = []
@@ -144,13 +144,13 @@ class report_custom(report_int):
vals = []
for workcenter in workcenters:
cr.execute("SELECT SUM(mrp_production_workcenter_line.hour) AS hours, SUM(mrp_production_workcenter_line.cycle) AS cycles, \
- mrp_workcenter.name AS name, mrp_workcenter.id AS id \
- FROM mrp_production_workcenter_line, mrp_production, mrp_workcenter \
+ resource_resource.name AS name, mrp_workcenter.id AS id \
+ FROM mrp_production_workcenter_line, mrp_production, mrp_workcenter, resource_resource \
WHERE (mrp_production_workcenter_line.production_id=mrp_production.id) \
AND (mrp_production_workcenter_line.workcenter_id=mrp_workcenter.id) \
AND (mrp_workcenter.id=%s) \
AND (mrp_production.date_planned BETWEEN %s AND %s) \
- GROUP BY mrp_production_workcenter_line.workcenter_id, mrp_workcenter.name, mrp_workcenter.id \
+ GROUP BY mrp_production_workcenter_line.workcenter_id, resource_resource.name, mrp_workcenter.id \
ORDER BY mrp_workcenter.id", (workcenter['id'], dates[date]['start'] + ' 00:00:00', dates[date]['stop'] + ' 23:59:59'))
res = cr.dictfetchall()
if not res:
diff --git a/addons/mrp/schedulers.py b/addons/mrp/schedulers.py
index 509d50b46b9..097f81f7529 100644
--- a/addons/mrp/schedulers.py
+++ b/addons/mrp/schedulers.py
@@ -195,9 +195,9 @@ class mrp_procurement(osv.osv):
qty = max(op.product_min_qty, op.product_max_qty)-prods
reste = qty % op.qty_multiple
if reste > 0:
- qty += op.qty_multiple - reste
+ qty += op.qty_multiple - reste
newdate = DateTime.now() + DateTime.RelativeDateTime(
- days=op.product_id.seller_delay)
+ days=int(op.product_id.seller_delay))
if op.product_id.supply_method == 'buy':
location_id = op.warehouse_id.lot_input_id
elif op.product_id.supply_method == 'produce':
diff --git a/addons/mrp/security/ir.model.access.csv b/addons/mrp/security/ir.model.access.csv
index cdc658ff7c0..48f27679435 100644
--- a/addons/mrp/security/ir.model.access.csv
+++ b/addons/mrp/security/ir.model.access.csv
@@ -32,3 +32,12 @@
"access_mrp_production_stock_worker","mrp.production stock_worker","model_mrp_production","stock.group_stock_user",1,0,0,0
"access_mrp_installer","mrp.installer","model_mrp_installer","mrp.group_mrp_user",1,0,0,0
"access_mrp_product_produce","mrp.product.produce","model_mrp_product_produce","mrp.group_mrp_user",1,0,0,0
+"access_mrp_make_procurement","make.procurement","model_make_procurement","mrp.group_mrp_user",1,0,0,0
+"access_mrp_change_production_qty","change.production.qty","model_change_production_qty","mrp.group_mrp_user",1,0,0,0
+"access_mrp_procurement_compute_all","mrp.procurement.compute.all","model_mrp_procurement_compute_all","mrp.group_mrp_user",1,0,0,0
+"access_mrp_procurement_orderpoint_compute","mrp.procurement.orderpoint.compute","model_mrp_procurement_orderpoint_compute","mrp.group_mrp_user",1,0,0,0
+"access_mrp_production_order","mrp.production.order","model_mrp_production_order","mrp.group_mrp_user",1,0,0,0
+"access_report_workcenter_load","report.workcenter.load","model_report_workcenter_load","mrp.group_mrp_manager",1,0,0,0
+"access_report_mrp_inout","report.mrp.inout","model_report_mrp_inout","mrp.group_mrp_manager",1,0,0,0
+"access_mrp_product_price","mrp.product_price","model_mrp_product_price","mrp.group_mrp_manager",1,0,0,0
+"access_mrp_workcenter_load","mrp.workcenter.load","model_mrp_workcenter_load","mrp.group_mrp_manager",1,0,0,0
diff --git a/addons/mrp/stock.py b/addons/mrp/stock.py
new file mode 100644
index 00000000000..4ddfddf6d90
--- /dev/null
+++ b/addons/mrp/stock.py
@@ -0,0 +1,225 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from mx import DateTime
+from osv import fields
+from osv import osv
+from tools.translate import _
+import ir
+import netsvc
+import time
+
+
+class stock_warehouse_orderpoint(osv.osv):
+ _name = "stock.warehouse.orderpoint"
+ _description = "Orderpoint minimum rule"
+ _columns = {
+ 'name': fields.char('Name', size=32, required=True),
+ 'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the orderpoint without removing it."),
+ 'logic': fields.selection([('max','Order to Max'),('price','Best price (not yet active!)')], 'Reordering Mode', required=True),
+ 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True),
+ 'location_id': fields.many2one('stock.location', 'Location', required=True),
+ 'product_id': fields.many2one('product.product', 'Product', required=True, domain=[('type','=','product')]),
+ 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True ),
+ 'product_min_qty': fields.float('Min Quantity', required=True,
+ help="When the virtual stock goes belong the Min Quantity, Open ERP generates "\
+ "a requisition to bring the virtual stock to the Max Quantity."),
+ 'product_max_qty': fields.float('Max Quantity', required=True,
+ help="When the virtual stock goes belong the Min Quantity, Open ERP generates "\
+ "a requisition to bring the virtual stock to the Max Quantity."),
+ 'qty_multiple': fields.integer('Qty Multiple', required=True,
+ help="The requisition quantity will by rounded up to this multiple."),
+ 'procurement_id': fields.many2one('mrp.procurement', 'Latest Requisition'),
+ 'company_id': fields.many2one('res.company','Company',required=True),
+ }
+ _defaults = {
+ 'active': lambda *a: 1,
+ 'logic': lambda *a: 'max',
+ 'qty_multiple': lambda *a: 1,
+ 'name': lambda x,y,z,c: x.pool.get('ir.sequence').get(y,z,'mrp.warehouse.orderpoint') or '',
+ 'product_uom': lambda sel, cr, uid, context: context.get('product_uom', False),
+ 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.warehouse.orderpoint', context=c)
+ }
+ def onchange_warehouse_id(self, cr, uid, ids, warehouse_id, context={}):
+ if warehouse_id:
+ w=self.pool.get('stock.warehouse').browse(cr,uid,warehouse_id, context)
+ v = {'location_id':w.lot_stock_id.id}
+ return {'value': v}
+ return {}
+ def onchange_product_id(self, cr, uid, ids, product_id, context={}):
+ if product_id:
+ prod=self.pool.get('product.product').browse(cr,uid,product_id)
+ v = {'product_uom':prod.uom_id.id}
+ return {'value': v}
+ return {}
+ def copy(self, cr, uid, id, default=None,context={}):
+ if not default:
+ default = {}
+ default.update({
+ 'name': self.pool.get('ir.sequence').get(cr, uid, 'mrp.warehouse.orderpoint') or '',
+ })
+ return super(stock_warehouse_orderpoint, self).copy(cr, uid, id, default, context)
+stock_warehouse_orderpoint()
+
+class StockMove(osv.osv):
+ _inherit = 'stock.move'
+ _columns = {
+ 'production_id': fields.many2one('mrp.production', 'Production', select=True),
+ 'procurements': fields.one2many('mrp.procurement', 'move_id', 'Requisitions'),
+ }
+ def copy(self, cr, uid, id, default=None, context=None):
+ default = default or {}
+ default['procurements'] = []
+ return super(StockMove, self).copy(cr, uid, id, default, context)
+
+ def _action_explode(self, cr, uid, move, context={}):
+ if move.product_id.supply_method=='produce' and move.product_id.procure_method=='make_to_order':
+ bis = self.pool.get('mrp.bom').search(cr, uid, [
+ ('product_id','=',move.product_id.id),
+ ('bom_id','=',False),
+ ('type','=','phantom')])
+ if bis:
+ factor = move.product_qty
+ bom_point = self.pool.get('mrp.bom').browse(cr, uid, bis[0])
+ res = self.pool.get('mrp.bom')._bom_explode(cr, uid, bom_point, factor, [])
+ dest = move.product_id.product_tmpl_id.property_stock_production.id
+ state = 'confirmed'
+ if move.state=='assigned':
+ state='assigned'
+ for line in res[0]:
+ valdef = {
+ 'picking_id': move.picking_id.id,
+ 'product_id': line['product_id'],
+ 'product_uom': line['product_uom'],
+ 'product_qty': line['product_qty'],
+ 'product_uos': line['product_uos'],
+ 'product_uos_qty': line['product_uos_qty'],
+ 'move_dest_id': move.id,
+ 'state': state,
+ 'name': line['name'],
+ 'location_dest_id': dest,
+ 'move_history_ids': [(6,0,[move.id])],
+ 'move_history_ids2': [(6,0,[])],
+ 'procurements': [],
+ }
+ mid = self.pool.get('stock.move').copy(cr, uid, move.id, default=valdef)
+ prodobj = self.pool.get('product.product').browse(cr, uid, line['product_id'], context=context)
+ proc_id = self.pool.get('mrp.procurement').create(cr, uid, {
+ 'name': (move.picking_id.origin or ''),
+ 'origin': (move.picking_id.origin or ''),
+ 'date_planned': move.date_planned,
+ 'product_id': line['product_id'],
+ 'product_qty': line['product_qty'],
+ 'product_uom': line['product_uom'],
+ 'product_uos_qty': line['product_uos'] and line['product_uos_qty'] or False,
+ 'product_uos': line['product_uos'],
+ 'location_id': move.location_id.id,
+ 'procure_method': prodobj.procure_method,
+ 'move_id': mid,
+ 'company_id': line['company_id'],
+ })
+ wf_service = netsvc.LocalService("workflow")
+ wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr)
+ self.pool.get('stock.move').write(cr, uid, [move.id], {
+ 'location_id': move.location_dest_id.id,
+ 'auto_validate': True,
+ 'picking_id': False,
+ 'location_id': dest,
+ 'state': 'waiting'
+ })
+ for m in self.pool.get('mrp.procurement').search(cr, uid, [('move_id','=',move.id)], context):
+ wf_service = netsvc.LocalService("workflow")
+ wf_service.trg_validate(uid, 'mrp.procurement', m, 'button_wait_done', cr)
+ return True
+
+
+ def action_consume(self, cr, uid, ids, product_qty, location_id=False, context=None):
+ res = []
+ production_obj = self.pool.get('mrp.production')
+ wf_service = netsvc.LocalService("workflow")
+ for move in self.browse(cr, uid, ids):
+ new_moves = super(StockMove, self).action_consume(cr, uid, [move.id], product_qty, location_id, context=context)
+ production_ids = production_obj.search(cr, uid, [('move_lines', 'in', [move.id])])
+ for prod in production_obj.browse(cr, uid, production_ids, context=context):
+ if prod.state == 'confirmed':
+ production_obj.force_production(cr, uid, [prod.id])
+ wf_service.trg_validate(uid, 'mrp.production', prod.id, 'button_produce', cr)
+ for new_move in new_moves:
+ production_obj.write(cr, uid, production_ids, {'move_lines': [(4, new_move)]})
+ res.append(new_move)
+ return res
+
+ def action_scrap(self, cr, uid, ids, product_qty, location_id, context=None):
+ res = []
+ production_obj = self.pool.get('mrp.production')
+ wf_service = netsvc.LocalService("workflow")
+ for move in self.browse(cr, uid, ids):
+ new_moves = super(StockMove, self).action_scrap(cr, uid, [move.id], product_qty, location_id, context=context)
+ production_ids = production_obj.search(cr, uid, [('move_lines', 'in', [move.id])])
+ for prod_id in production_ids:
+ wf_service.trg_validate(uid, 'mrp.production', prod_id, 'button_produce', cr)
+ for new_move in new_moves:
+ production_obj.write(cr, uid, production_ids, {'move_lines': [(4, new_move)]})
+ res.append(new_move)
+ return {}
+
+StockMove()
+
+
+class StockPicking(osv.osv):
+ _inherit = 'stock.picking'
+
+ def test_finnished(self, cursor, user, ids):
+ wf_service = netsvc.LocalService("workflow")
+ res = super(StockPicking, self).test_finnished(cursor, user, ids)
+ for picking in self.browse(cursor, user, ids):
+ for move in picking.move_lines:
+ if move.state == 'done' and move.procurements:
+ for procurement in move.procurements:
+ wf_service.trg_validate(user, 'mrp.procurement',
+ procurement.id, 'button_check', cursor)
+ return res
+
+ #
+ # Explode picking by replacing phantom BoMs
+ #
+ def action_explode(self, cr, uid, picks, *args):
+ for move in self.pool.get('stock.move').browse(cr, uid, picks):
+ self.pool.get('stock.move')._action_explode(cr, uid, move)
+ return picks
+
+StockPicking()
+
+
+class spilt_in_production_lot(osv.osv_memory):
+ _inherit = "stock.move.split"
+ def split(self, cr, uid, ids, move_ids, context=None):
+ production_obj = self.pool.get('mrp.production')
+ move_obj = self.pool.get('stock.move')
+ res = []
+ for move in move_obj.browse(cr, uid, move_ids, context=context):
+ new_moves = super(spilt_in_production_lot, self).split(cr, uid, ids, move_ids, context=context)
+ production_ids = production_obj.search(cr, uid, [('move_lines', 'in', [move.id])])
+ for new_move in new_moves:
+ production_obj.write(cr, uid, production_ids, {'move_lines': [(4, new_move)]})
+ return res
+spilt_in_production_lot()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp/wizard/__init__.py b/addons/mrp/wizard/__init__.py
index 240f25daa9d..043cdc94465 100644
--- a/addons/mrp/wizard/__init__.py
+++ b/addons/mrp/wizard/__init__.py
@@ -19,14 +19,15 @@
#
##############################################################################
-import wizard_orderpoint_procurement
+import mrp_product_produce
+import orderpoint_procurement
import wizard_procurement
-import wizard_schedulers_all
-import wizard_price
-import wizard_workcenter_load
+import schedulers_all
+import mrp_price
+import mrp_workcenter_load
import wizard_track_prod
-import wizard_change_production_qty
-import make_procurement
+import change_production_qty
+import make_procurement_product
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp/wizard/change_production_qty.py b/addons/mrp/wizard/change_production_qty.py
new file mode 100644
index 00000000000..7f1496dd6a1
--- /dev/null
+++ b/addons/mrp/wizard/change_production_qty.py
@@ -0,0 +1,106 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import time
+import ir
+from osv.osv import except_osv
+from osv import fields, osv
+import netsvc
+from tools.translate import _
+
+class change_production_qty(osv.osv_memory):
+ _name = 'change.production.qty'
+ _description = 'Change Quantity of Products'
+
+ _columns = {
+ 'product_qty': fields.float('Product Qty', required=True),
+ }
+
+ def default_get(self, cr, uid, fields, context):
+ """
+ To get default values for the object.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+
+ @return: A dictionary which of fields with values.
+
+ """
+ res = super(change_production_qty, self).default_get(cr, uid, fields, context=context)
+ prod_obj = self.pool.get('mrp.production')
+ prod = prod_obj.browse(cr, uid, context.get('active_id'))
+ if 'product_qty' in fields:
+ res.update({'product_qty': prod.product_qty})
+ return res
+
+ def change_prod_qty(self, cr, uid, ids, context):
+ """
+ Changes the Quantity of Product.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+
+ @return:
+
+ """
+ record_id = context and context.get('active_id',False)
+ assert record_id, _('Active Id is not found')
+ prod_obj = self.pool.get('mrp.production')
+ product_lines_obj = self.pool.get('mrp.production.product.line')
+ bom_obj = self.pool.get('mrp.bom')
+ for wiz_qty in self.browse(cr, uid, ids):
+ prod = prod_obj.browse(cr, uid,record_id)
+ prod_obj.write(cr, uid,prod.id, {'product_qty': wiz_qty.product_qty})
+ prod_obj.action_compute(cr, uid, [prod.id])
+
+ move_lines_obj = self.pool.get('stock.move')
+ for move in prod.move_lines:
+ bom_point = prod.bom_id
+ bom_id = prod.bom_id.id
+ if not bom_point:
+ bom_id = bom_obj._bom_find(cr, uid, prod.product_id.id, prod.product_uom.id)
+ if not bom_id:
+ raise osv.except_osv(_('Error'), _("Couldn't find bill of material for product"))
+ prod_obj.write(cr, uid, [prod.id], {'bom_id': bom_id})
+ bom_point = bom_obj.browse(cr, uid, [bom_id])[0]
+
+ if not bom_id:
+ raise osv.except_osv(_('Error'), _("Couldn't find bill of material for product"))
+
+ factor = prod.product_qty * prod.product_uom.factor / bom_point.product_uom.factor
+ res = bom_obj._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, [])
+ for r in res[0]:
+ if r['product_id']== move.product_id.id:
+ move_lines_obj.write(cr, uid,move.id, {'product_qty' : r['product_qty']})
+ for m in prod.move_created_ids:
+ move_lines_obj.write(cr, uid,m.id, {'product_qty': wiz_qty.product_qty})
+
+ return {}
+
+change_production_qty()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp/wizard/change_production_qty_view.xml b/addons/mrp/wizard/change_production_qty_view.xml
new file mode 100644
index 00000000000..34520a71721
--- /dev/null
+++ b/addons/mrp/wizard/change_production_qty_view.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+ Change Product Qty
+ change.production.qty
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Change Product Qty
+ ir.actions.act_window
+ change.production.qty
+ form
+ form
+ new
+
+
+
+
diff --git a/addons/mrp/wizard/make_procurement.py b/addons/mrp/wizard/make_procurement.py
deleted file mode 100644
index 0cf12107181..00000000000
--- a/addons/mrp/wizard/make_procurement.py
+++ /dev/null
@@ -1,102 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import wizard
-import pooler
-import netsvc
-
-import time
-
-def _get_default(obj, cr, uid, data, context=None):
- pool = pooler.get_pool(cr.dbname)
- product = pool.get('product.product').browse(cr, uid, data['id'], context)
- return {'product_id': product.id, 'uom_id':product.uom_id.id, 'qty':1.0}
-
-def make_procurement(obj, cr, uid, data, context=None):
- '''Create procurement'''
- pool = pooler.get_pool(cr.dbname)
- wh = pool.get('stock.warehouse').browse(cr, uid, data['form']['warehouse_id'], context)
- user = pool.get('res.users').browse(cr, uid, uid, context)
- procure_id = pool.get('mrp.procurement').create(cr, uid, {
- 'name':'INT:'+str(user.login),
- 'date_planned':data['form']['date_planned'],
- 'product_id':data['form']['product_id'],
- 'product_qty':data['form']['qty'],
- 'product_uom':data['form']['uom_id'],
- 'location_id':wh.lot_stock_id.id,
- 'procure_method':'make_to_order',
- }, context=context)
- wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'mrp.procurement', procure_id, 'button_confirm', cr)
- return {}
-
-
-class MakeProcurement(wizard.interface):
- '''Wizard that create a procurement from a product form'''
-
- done_form = """
-
-
-
"""
- procurement_form = """
-
-
-
-
-
-
-
-
"""
- procurement_fields = {
- 'qty': {'string': 'Quantity', 'type': 'float', 'digits':(16,2), 'required': True},
- 'product_id': {'string': 'product', 'type': 'many2one', 'relation': 'product.product', 'required': True, 'readonly':1},
- 'uom_id': {'string': 'Unit of Measure', 'type': 'many2one', 'relation': 'product.uom', 'required':True},
- 'warehouse_id': {'string': 'Warehouse', 'type': 'many2one', 'relation':'stock.warehouse', 'required':True},
- 'date_planned': {'string': 'Planned Date', 'type': 'date', 'required':True, 'default': lambda *args: time.strftime('%Y-%m-%d')}
- }
-
- states = {
- 'init': {
- 'actions': [_get_default],
- 'result': {'type': 'form', 'arch': procurement_form, 'fields': procurement_fields,
- 'state': [
- ('end', 'Cancel'),
- ('create', 'Ask New Products')
- ]
- }
- },
- 'done': {
- 'actions': [],
- 'result': {'type': 'form', 'arch': done_form, 'fields': {},
- 'state': [
- ('end', 'Close'),
- ]
- }
- },
- 'create': {
- 'actions': [],
- 'result': {'type': 'action', 'action': make_procurement, 'state': 'done'}
- }
- }
-
-MakeProcurement('product.product.procurement')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/mrp/wizard/make_procurement_product.py b/addons/mrp/wizard/make_procurement_product.py
new file mode 100644
index 00000000000..a549d9f24b2
--- /dev/null
+++ b/addons/mrp/wizard/make_procurement_product.py
@@ -0,0 +1,134 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import netsvc
+import time
+
+from osv import fields, osv
+
+class make_procurement(osv.osv_memory):
+ _name = 'make.procurement'
+ _description = 'Make Procurements'
+
+ def onchange_product_id(self, cr, uid, ids, prod_id):
+ """
+ On Change of Product ID getting the value of related UoM.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param prod_id: Changed ID of Product
+
+ @return: A dictionary which gives the UoM of the changed Product
+
+ """
+ product = self.pool.get('product.product').browse(cr, uid, prod_id)
+ return {'value': {'uom_id': product.uom_id.id}}
+
+ _columns = {
+ 'qty': fields.float('Quantity', digits=(16,2), required=True),
+ 'product_id': fields.many2one('product.product', 'Product', required=True, readonly=1),
+ 'uom_id': fields.many2one('product.uom', 'Unit of Measure', required=True),
+ 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True),
+ 'date_planned': fields.date('Planned Date', required=True),
+ }
+
+ _defaults = {
+ 'date_planned': lambda *args: time.strftime('%Y-%m-%d'),
+ 'qty': lambda *args: 1.0,
+ }
+
+ def make_procurement(self, cr, uid, ids, context=None):
+ """
+ Creates procurement order for selected product.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+
+ @return: A dictionary which loads Procurement form view.
+
+ """
+ user = self.pool.get('res.users').browse(cr, uid, uid, context).login
+ wh_obj = self.pool.get('stock.warehouse')
+ procurement_obj = self.pool.get('mrp.procurement')
+ wf_service = netsvc.LocalService("workflow")
+ data_obj = self.pool.get('ir.model.data')
+
+ for proc in self.browse(cr, uid, ids):
+ wh = wh_obj.browse(cr, uid, proc.warehouse_id.id, context)
+ procure_id = procurement_obj.create(cr, uid, {
+ 'name':'INT: '+str(user),
+ 'date_planned': proc.date_planned,
+ 'product_id': proc.product_id.id,
+ 'product_qty': proc.qty,
+ 'product_uom': proc.uom_id.id,
+ 'location_id': wh.lot_stock_id.id,
+ 'procure_method':'make_to_order',
+ })
+
+ wf_service.trg_validate(uid, 'mrp.procurement', procure_id, 'button_confirm', cr)
+
+
+ id2 = data_obj._get_id(cr, uid, 'mrp', 'mrp_procurement_tree_view')
+ id3 = data_obj._get_id(cr, uid, 'mrp', 'mrp_procurement_form_view')
+
+ if id2:
+ id2 = data_obj.browse(cr, uid, id2, context=context).res_id
+ if id3:
+ id3 = data_obj.browse(cr, uid, id3, context=context).res_id
+
+ return {
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'mrp.procurement',
+ 'res_id' : procure_id,
+ 'views': [(id3,'form'),(id2,'tree')],
+ 'type': 'ir.actions.act_window',
+ }
+
+ def default_get(self, cr, uid, fields, context=None):
+ """
+ To get default values for the object.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+
+ @return: A dictionary which of fields with values.
+
+ """
+ record_id = context and context.get('active_id', False) or False
+
+ res = super(make_procurement, self).default_get(cr, uid, fields, context=context)
+ product_id = self.pool.get('product.product').browse(cr, uid, record_id, context=context).id
+ if 'product_id' in fields:
+ res.update({'product_id':product_id})
+ return res
+
+make_procurement()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/mrp/wizard/make_procurement_view.xml b/addons/mrp/wizard/make_procurement_view.xml
new file mode 100644
index 00000000000..08c4b2cabf5
--- /dev/null
+++ b/addons/mrp/wizard/make_procurement_view.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+ Requisition Request
+ make.procurement
+ form
+
+
'''
-
-_time_unit_fields = {
- 'time_unit': {'string':'Type of period', 'type':'selection', 'selection':[('day', 'Day by day'),('week', 'Per week'),('month', 'Per month')], 'required':True},
- 'measure_unit': {'string':'Amount measuring unit', 'type':'selection', 'selection':[('hours', 'Amount in hours'),('cycles', 'Amount in cycles')], 'required':True},
-}
-
-class wizard_mrp_workcenter(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type':'form', 'arch':_time_unit_form, 'fields':_time_unit_fields, 'state':[('end','Cancel'),('report','Print') ]},
- },
- 'report': {
- 'actions': [],
- 'result': {'type':'print', 'report':'mrp.workcenter.load', 'state':'end'},
- },
+class mrp_price(osv.osv_memory):
+ _name = 'mrp.product_price'
+ _description = 'Product Price'
+ _columns = {
+ 'number': fields.integer('Number of products to produce', required=True),
}
+
+ def print_report(self, cr, uid, ids, context=None):
+ """
+ To print the report of Product cost structure
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+
+ @return : Report
+ """
+ datas = {'ids' : context.get('active_ids',[])}
+ res = self.read(cr, uid, ids, ['number'])
+ res = res and res[0] or {}
+ datas['form'] = res
+
+ return {
+ 'type' : 'ir.actions.report.xml',
+ 'report_name':'product.price',
+ 'datas' : datas,
+ }
-wizard_mrp_workcenter('mrp.workcenter.load')
-
+mrp_price()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/mrp/wizard/mrp_price_view.xml b/addons/mrp/wizard/mrp_price_view.xml
new file mode 100644
index 00000000000..e2e294c5739
--- /dev/null
+++ b/addons/mrp/wizard/mrp_price_view.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+ Product Cost Structure
+ mrp.product_price
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/mrp/mrp_wizard.py b/addons/mrp/wizard/mrp_product_produce.py
similarity index 74%
rename from addons/mrp/mrp_wizard.py
rename to addons/mrp/wizard/mrp_product_produce.py
index 40d9f2ed1ab..7c77dfdee94 100644
--- a/addons/mrp/mrp_wizard.py
+++ b/addons/mrp/wizard/mrp_product_produce.py
@@ -34,6 +34,16 @@ class mrp_product_produce(osv.osv_memory):
}
def _get_product_qty(self, cr, uid, context):
+ """
+ To obtain product quantity
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return: quantity
+
+ """
prod = self.pool.get('mrp.production').browse(cr, uid,
context['active_id'], context=context)
done = 0.0
@@ -47,11 +57,22 @@ class mrp_product_produce(osv.osv_memory):
}
def do_produce(self, cr, uid, ids, context={}):
+ """
+ To check the product type
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return:
+
+ """
prod_obj = self.pool.get('mrp.production')
move_ids = context['active_ids']
for data in self.read(cr, uid, ids):
for move_id in move_ids:
- prod_obj.do_produce(cr, uid, move_id,
+ prod_obj.action_produce(cr, uid, move_id,
data['product_qty'], data['mode'], context=context)
return {}
diff --git a/addons/mrp/mrp_wizard_view.xml b/addons/mrp/wizard/mrp_product_produce_view.xml
similarity index 100%
rename from addons/mrp/mrp_wizard_view.xml
rename to addons/mrp/wizard/mrp_product_produce_view.xml
diff --git a/addons/mrp/wizard/mrp_workcenter_load.py b/addons/mrp/wizard/mrp_workcenter_load.py
new file mode 100644
index 00000000000..1b5478dcbeb
--- /dev/null
+++ b/addons/mrp/wizard/mrp_workcenter_load.py
@@ -0,0 +1,57 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from osv import fields, osv
+
+class mrp_workcenter_load(osv.osv_memory):
+ _name = 'mrp.workcenter.load'
+ _description = 'Workcenter Load'
+
+ _columns = {
+ 'time_unit': fields.selection([('day', 'Day by day'),('week', 'Per week'),('month', 'Per month')],'Type of period', required=True),
+ 'measure_unit': fields.selection([('hours', 'Amount in hours'),('cycles', 'Amount in cycles')],'Amount measuring unit', required=True),
+ }
+
+ def print_report(self, cr, uid, ids, context=None):
+ """
+ To print the report of Work Center Load
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+
+ @return : Report
+ """
+ datas = {'ids' : context.get('active_ids',[])}
+ res = self.read(cr, uid, ids, ['time_unit','measure_unit'])
+ res = res and res[0] or {}
+ datas['form'] = res
+
+ return {
+ 'type' : 'ir.actions.report.xml',
+ 'report_name':'mrp.workcenter.load',
+ 'datas' : datas,
+ }
+
+mrp_workcenter_load()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp/wizard/mrp_workcenter_load_view.xml b/addons/mrp/wizard/mrp_workcenter_load_view.xml
new file mode 100644
index 00000000000..a6b7a4f987d
--- /dev/null
+++ b/addons/mrp/wizard/mrp_workcenter_load_view.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+ Work Center Load
+ mrp.workcenter.load
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/mrp/wizard/orderpoint_procurement.py b/addons/mrp/wizard/orderpoint_procurement.py
new file mode 100644
index 00000000000..731c3fca440
--- /dev/null
+++ b/addons/mrp/wizard/orderpoint_procurement.py
@@ -0,0 +1,71 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+#
+# Order Point Method:
+# - Order if the virtual stock of today is bellow the min of the defined order point
+#
+
+import threading
+from osv import fields,osv
+
+class procurement_compute(osv.osv_memory):
+ _name = 'mrp.procurement.orderpoint.compute'
+ _description = 'Automatic Order Point'
+
+ _columns = {
+ 'automatic': fields.boolean('Automatic Orderpoint', help='If the stock of a product is under 0, it will act like an orderpoint'),
+ }
+
+ _defaults = {
+ 'automatic' : lambda *a: False,
+ }
+
+ def _procure_calculation_orderpoint(self, cr, uid, ids, context):
+ """
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+ """
+ proc_obj = self.pool.get('mrp.procurement')
+ for proc in self.browse(cr, uid, ids):
+ proc_obj._procure_orderpoint_confirm(cr, uid, automatic=proc.automatic, use_new_cursor=cr.dbname, context=context)
+
+ return {}
+
+ def procure_calculation(self, cr, uid, ids, context):
+ """
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+
+ """
+ threaded_calculation = threading.Thread(target=self._procure_calculation_orderpoint, args=(cr, uid, ids, context))
+ threaded_calculation.start()
+ return {}
+
+procurement_compute()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp/wizard/orderpoint_procurement_view.xml b/addons/mrp/wizard/orderpoint_procurement_view.xml
new file mode 100644
index 00000000000..c17bedae84f
--- /dev/null
+++ b/addons/mrp/wizard/orderpoint_procurement_view.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+ Compute Stock Minimum Rules Only
+ mrp.procurement.orderpoint.compute
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/mrp/wizard/schedulers_all.py b/addons/mrp/wizard/schedulers_all.py
new file mode 100644
index 00000000000..62497564905
--- /dev/null
+++ b/addons/mrp/wizard/schedulers_all.py
@@ -0,0 +1,68 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import threading
+
+from osv import osv, fields
+
+class procurement_compute(osv.osv_memory):
+ _name = 'mrp.procurement.compute.all'
+ _description = 'Compute all schedulers'
+
+ _columns = {
+ 'automatic': fields.boolean('Automatic orderpoint',help='Triggers an automatic procurement for all products that have a virtual stock under 0. You should probably not use this option, we suggest using a MTO configuration on products.'),
+ }
+
+ _defaults ={
+ 'automatic': lambda *a: False,
+ }
+
+ def _procure_calculation_all(self, cr, uid, ids, context):
+ """
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+ """
+ proc_obj = self.pool.get('mrp.procurement')
+ for proc in self.browse(cr, uid, ids):
+ proc_obj.run_scheduler(cr, uid, automatic=proc.automatic, use_new_cursor=cr.dbname,\
+ context=context)
+ return {}
+
+ def procure_calculation(self, cr, uid, ids, context):
+ """
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+ """
+ threaded_calculation = threading.Thread(target=self._procure_calculation_all, args=(cr, uid, ids, context))
+ threaded_calculation.start()
+ return {}
+
+procurement_compute()
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/mrp/wizard/schedulers_all_view.xml b/addons/mrp/wizard/schedulers_all_view.xml
new file mode 100644
index 00000000000..b8b465e03e9
--- /dev/null
+++ b/addons/mrp/wizard/schedulers_all_view.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+ Compute Schedulers
+ mrp.procurement.compute.all
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/mrp/wizard/wizard_change_production_qty.py b/addons/mrp/wizard/wizard_change_production_qty.py
deleted file mode 100644
index a9a8387acdf..00000000000
--- a/addons/mrp/wizard/wizard_change_production_qty.py
+++ /dev/null
@@ -1,117 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import time
-import wizard
-import ir
-import pooler
-from osv.osv import except_osv
-from osv import fields,osv
-import netsvc
-from tools.translate import _
-
-
-form1 = '''
-
-
-
'''
-
-form1_fields={
- 'product_qty': {'string': 'Product Qty', 'type':'float', 'required':True},
- }
-
-def _get_qty(self,cr,uid, data, state):
- prod_obj = pooler.get_pool(cr.dbname).get('mrp.production')
- prod = prod_obj.browse(cr, uid,data['ids'])[0]
- form1_fields['product_qty']['default']=prod.product_qty
- return {}
-def _get_states(self, cr, uid, data, context):
- prod_obj = pooler.get_pool(cr.dbname).get('mrp.production')
- prod = prod_obj.browse(cr, uid,data['ids'])[0]
- if prod.state in ('cancel', 'done'):
- raise wizard.except_wizard(_('Warning !'), _('The production is in "%s" state. You can not change the production quantity anymore') % (prod.state).upper() )
- return 'end'
- if prod.state in ('draft'):
- #raise wizard.except_wizard('Warning !', 'The production is in "%s" state. You can change the production quantity directly...!!!' % (prod.state).upper() )
- return 'end'
- else:
- return 'confirm'
-
-def _change_prod_qty(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- prod_obj = pool.get('mrp.production')
- prod = prod_obj.browse(cr, uid,data['ids'])[0]
- prod_obj.write(cr, uid,prod.id, {'product_qty' : data['form']['product_qty']})
- prod_obj.action_compute(cr, uid, [prod.id])
-
- move_lines_obj = pool.get('stock.move')
- for move in prod.move_lines:
- bom_point = prod.bom_id
- bom_id = prod.bom_id.id
- if not bom_point:
- bom_id = pool.get('mrp.bom')._bom_find(cr, uid, prod.product_id.id, prod.product_uom.id)
- if not bom_id:
- raise osv.except_osv(_('Error'), _("Couldn't find bill of material for product"))
- self.write(cr, uid, [prod.id], {'bom_id': bom_id})
- bom_point = pool.get('mrp.bom').browse(cr, uid, [bom_id])[0]
-
- if not bom_id:
- raise osv.except_osv(_('Error'), _("Couldn't find bill of material for product"))
-
- factor = prod.product_qty * prod.product_uom.factor / bom_point.product_uom.factor
- res = pool.get('mrp.bom')._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, [])
- for r in res[0]:
- if r['product_id']== move.product_id.id:
- move_lines_obj.write(cr, uid,move.id, {'product_qty' : r['product_qty']})
-
- product_lines_obj = pool.get('mrp.production.product.line')
-
- for m in prod.move_created_ids:
- move_lines_obj.write(cr, uid,m.id, {'product_qty' : data['form']['product_qty']})
-
- return {}
-
-class change_production_qty(wizard.interface):
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type' : 'choice', 'next_state' : _get_states}
- },
-
- 'confirm' : {
- 'actions' : [_get_qty],
- 'result': {'type': 'form', 'arch':form1, 'fields':form1_fields, 'state':[('end','Cancel'),('validate','Validate')]}
- },
-
- 'validate': {
- 'actions': [],
- 'result': {'type':'action', 'action':_change_prod_qty, 'state':'end'}
- },
-
- 'end' : {
- 'actions' : [],
- 'result': {'type': 'state', 'state': 'end'},
- },
- }
-
-change_production_qty('change_production_qty')
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp/wizard/wizard_orderpoint_procurement.py b/addons/mrp/wizard/wizard_orderpoint_procurement.py
deleted file mode 100644
index a4fa57bb9a8..00000000000
--- a/addons/mrp/wizard/wizard_orderpoint_procurement.py
+++ /dev/null
@@ -1,73 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-#
-# Order Point Method:
-# - Order if the virtual stock of today is bellow the min of the defined order point
-#
-
-import wizard
-import threading
-import pooler
-
-parameter_form = '''
-
-
-
'''
-
-parameter_fields = {
- 'automatic': {'string': 'Automatic orderpoint', 'type': 'boolean', 'help': 'If the stock of a product is under 0, it will act like an orderpoint', 'default': lambda *a: False},
-}
-
-def _procure_calculation_orderpoint(self, db_name, uid, data, context):
- db, pool = pooler.get_db_and_pool(db_name)
- cr = db.cursor()
- try:
- proc_obj = pool.get('mrp.procurement')
- automatic = data['form']['automatic']
- proc_obj._procure_orderpoint_confirm(cr, uid, automatic=automatic,\
- use_new_cursor=cr.dbname, context=context)
- finally:
- cr.close()
- return {}
-
-def _procure_calculation(self, cr, uid, data, context):
- threaded_calculation = threading.Thread(target=_procure_calculation_orderpoint, args=(self, cr.dbname, uid, data, context))
- threaded_calculation.start()
- return {}
-
-class procurement_compute(wizard.interface):
- states = {
- 'init': {
- 'actions': [],
- 'result': {'type': 'form', 'arch':parameter_form, 'fields': parameter_fields, 'state':[('end','Cancel'),('compute','Compute Stock')]}
- },
- 'compute': {
- 'actions': [_procure_calculation],
- 'result': {'type': 'state', 'state':'end'}
- },
- }
-procurement_compute('mrp.procurement.orderpoint.compute')
-
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/mrp/wizard/wizard_schedulers_all.py b/addons/mrp/wizard/wizard_schedulers_all.py
deleted file mode 100644
index e93e31c0599..00000000000
--- a/addons/mrp/wizard/wizard_schedulers_all.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import wizard
-import threading
-import pooler
-
-parameter_form = '''
-
- [[ format(o.quotation_notes) or '' ]]
+ [[ format(o.quotation_notes) or removeParentNode('blockTable') ]]
diff --git a/addons/mrp_repair/security/ir.model.access.csv b/addons/mrp_repair/security/ir.model.access.csv
index 0f12f66a815..c524afce69b 100644
--- a/addons/mrp_repair/security/ir.model.access.csv
+++ b/addons/mrp_repair/security/ir.model.access.csv
@@ -5,3 +5,7 @@
"access_mrp_repair_line_manager","MRP Repair Line manager","model_mrp_repair_line","stock.group_stock_manager",1,1,1,1
"access_mrp_repair_fee_user","MRP Repair Fee user","model_mrp_repair_fee","stock.group_stock_user",1,0,0,0
"access_mrp_repair_fee_manager","MRP Repair Fee manager","model_mrp_repair_fee","stock.group_stock_manager",1,1,1,1
+"access_mrp_repair_cancel_user","mrp.repair.cancel user","model_mrp_repair_cancel","stock.group_stock_user",1,0,0,0
+"access_mrp_repair_cancel_manager","mrp.repair.cancel manager","model_mrp_repair_cancel","stock.group_stock_manager",1,1,1,1
+"access_mrp_repair_make_invoice_user","mrp.repair.make_invoice user","model_mrp_repair_make_invoice","stock.group_stock_user",1,0,0,0
+"access_mrp_repair_make_invoice_manager","mrp.repair.make_invoice manager","model_mrp_repair_make_invoice","stock.group_stock_manager",1,1,1,1
diff --git a/addons/mrp_repair/wizard/__init__.py b/addons/mrp_repair/wizard/__init__.py
index ec3063f01de..4f3075f055c 100644
--- a/addons/mrp_repair/wizard/__init__.py
+++ b/addons/mrp_repair/wizard/__init__.py
@@ -19,7 +19,7 @@
#
##############################################################################
-import wizard_cancel_repair
-import wizard_make_invoice
+import cancel_repair
+import make_invoice
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp_repair/wizard/cancel_repair.py b/addons/mrp_repair/wizard/cancel_repair.py
new file mode 100644
index 00000000000..91df6fb01ef
--- /dev/null
+++ b/addons/mrp_repair/wizard/cancel_repair.py
@@ -0,0 +1,87 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import netsvc
+from osv import osv,fields
+from tools.translate import _
+
+class repair_cancel(osv.osv_memory):
+ _name = 'mrp.repair.cancel'
+ _description = 'Cancel Repair'
+
+ def cancel_repair(self, cr, uid, ids, context):
+ """
+ Cancels the repair
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+
+ @return:
+
+ """
+ record_id = context and context.get('active_id', False) or False
+ assert record_id, _('Active ID is not Found')
+ repair_order_obj = self.pool.get('mrp.repair')
+ repair_line_obj = self.pool.get('mrp.repair.line')
+ repair_order = repair_order_obj.browse(cr, uid, record_id)
+
+ if repair_order.invoiced or repair_order.invoice_method == 'none':
+ repair_order_obj.action_cancel(cr, uid, [record_id], context=context)
+ else:
+ raise osv.except_osv(_('Warning!'),_('Repair is not cancelled. It is not invoiced.'))
+
+ return {}
+
+ def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
+ """
+ Changes the view dynamically
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+
+ @return: New arch of view.
+
+ """
+ record_id = context and context.get('active_id', False) or False
+ res = super(repair_cancel, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
+ if record_id:
+ repair_order = self.pool.get('mrp.repair').browse(cr, uid, record_id)
+ if not repair_order.invoiced:
+ res['arch'] = """
+
+
+
+
+
+
+
+ """
+ return res
+
+repair_cancel()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/mrp_repair/wizard/make_invoice.py b/addons/mrp_repair/wizard/make_invoice.py
new file mode 100644
index 00000000000..063040590e6
--- /dev/null
+++ b/addons/mrp_repair/wizard/make_invoice.py
@@ -0,0 +1,64 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import netsvc
+from osv import osv, fields
+
+class make_invoice(osv.osv_memory):
+ _name = 'mrp.repair.make_invoice'
+ _description = 'Make Invoice'
+
+ _columns = {
+ 'group': fields.boolean('Group by partner invoice address'),
+ }
+
+ def make_invoices(self, cr, uid, ids, context):
+ """
+ Generates invoice(s) of selected records.
+
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+
+ @return: Loads the view of new invoice(s).
+
+ """
+ inv = self.browse(cr, uid, ids[0])
+ order_obj = self.pool.get('mrp.repair')
+ newinv = order_obj.action_invoice_create(cr, uid, context['active_ids'], group=inv.group,context=context)
+
+ return {
+ 'domain': [('id','in', newinv.values())],
+ 'name': 'Invoices',
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'account.invoice',
+ 'view_id': False,
+ 'context': "{'type':'out_invoice'}",
+ 'type': 'ir.actions.act_window'
+ }
+
+make_invoice()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/mrp_repair/wizard/mrp_repair_cancel_view.xml b/addons/mrp_repair/wizard/mrp_repair_cancel_view.xml
new file mode 100644
index 00000000000..4af2a3394b0
--- /dev/null
+++ b/addons/mrp_repair/wizard/mrp_repair_cancel_view.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+ Cancel Repair
+ mrp.repair.cancel
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Cancel Repair Order
+ ir.actions.act_window
+ mrp.repair.cancel
+ form
+ form
+ new
+
+
+
+
+
diff --git a/addons/mrp_repair/wizard/mrp_repair_make_invoice_view.xml b/addons/mrp_repair/wizard/mrp_repair_make_invoice_view.xml
new file mode 100644
index 00000000000..f914d198d06
--- /dev/null
+++ b/addons/mrp_repair/wizard/mrp_repair_make_invoice_view.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+ Make Invoice
+ mrp.repair.make_invoice
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/mrp_repair/wizard/wizard_cancel_repair.py b/addons/mrp_repair/wizard/wizard_cancel_repair.py
deleted file mode 100644
index d895096ce6f..00000000000
--- a/addons/mrp_repair/wizard/wizard_cancel_repair.py
+++ /dev/null
@@ -1,81 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import wizard
-import netsvc
-import pooler
-
-cancel_form = """
-
-
-
-"""
-
-cancel_fields = {}
-
-def check_state(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- repair_obj = pool.get('mrp.repair').browse(cr, uid, data['ids'])[0]
- if repair_obj.invoice_id:
- return 'display'
- else:
- pool.get('mrp.repair').write(cr,uid,data['ids'],{'state':'cancel'})
- return 'end'
-
-
-def _cancel_repair(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- repair_obj = pool.get('mrp.repair').browse(cr, uid, data['ids'])
- pool.get('mrp.repair').write(cr,uid,data['ids'],{'state':'cancel'})
- mrp_line_obj = pool.get('mrp.repair.line')
- for line in repair_obj:
- mrp_line_obj.write(cr, uid, [l.id for l in line.operations], {'state': 'cancel'})
- return {}
-
-class repair_cancel(wizard.interface):
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type' : 'choice', 'next_state' : check_state}
- },
-
- 'display' : {
- 'actions' : [],
- 'result' : {'type' : 'form',
- 'arch' : cancel_form,
- 'fields' : cancel_fields,
- 'state' : [('end', 'No'),('yes', 'Yes') ]}
- },
- 'yes' : {
- 'actions' : [],
- 'result' : {'type' : 'action',
- 'action' : _cancel_repair,
- 'state' : 'end'}
- },
- 'end' : {
- 'actions' : [],
- 'result': {'type': 'state', 'state': 'end'},
- },
- }
-repair_cancel("mrp.repair.cancel")
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/mrp_repair/wizard/wizard_make_invoice.py b/addons/mrp_repair/wizard/wizard_make_invoice.py
deleted file mode 100644
index 71aefadfe4b..00000000000
--- a/addons/mrp_repair/wizard/wizard_make_invoice.py
+++ /dev/null
@@ -1,81 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-import wizard
-import netsvc
-import pooler
-
-invoice_form = """
-