). All Rights Reserved
+# $Id$
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU 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 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 .
+#
+##############################################################################
+
+import wizard
+import netsvc
+import pooler
+
+import time
+from osv import osv
+from tools.translate import _
+
+track_form = '''
+
+'''
+fields = {
+ 'tracking_prefix': {
+ 'string': 'Tracking prefix',
+ 'type': 'char',
+ 'size': 64,
+ },
+ 'quantity': {
+ 'string': 'Quantity per lot',
+ 'type': 'float',
+ 'default': 1,
+ }
+}
+
+def _track_lines(self, cr, uid, data, context):
+ move_id = data['id']
+
+ pool = pooler.get_pool(cr.dbname)
+ prodlot_obj = pool.get('stock.production.lot')
+ move_obj = pool.get('stock.move')
+ production_obj = pool.get('mrp.production')
+ ir_sequence_obj = pool.get('ir.sequence')
+
+ sequence = ir_sequence_obj.get(cr, uid, 'stock.lot.serial')
+ if not sequence:
+ raise wizard.except_wizard(_('Error!'), _('No production sequence defined'))
+ if data['form']['tracking_prefix']:
+ sequence=data['form']['tracking_prefix']+'/'+(sequence or '')
+
+ move = move_obj.browse(cr, uid, [move_id])[0]
+ quantity=data['form']['quantity']
+ if quantity <= 0 or move.product_qty == 0:
+ return {}
+ uos_qty=quantity/move.product_qty*move.product_uos_qty
+
+ quantity_rest = move.product_qty%quantity
+ uos_qty_rest = quantity_rest/move.product_qty*move.product_uos_qty
+
+ update_val = {
+ 'product_qty': quantity,
+ 'product_uos_qty': uos_qty,
+ }
+ new_move = []
+ production_ids = []
+ for idx in range(int(move.product_qty//quantity)):
+ if idx:
+ current_move = move_obj.copy(cr, uid, move.id, {'state': move.state, 'production_id': move.production_id.id})
+ new_move.append(current_move)
+ else:
+ current_move = move.id
+ new_prodlot = prodlot_obj.create(cr, uid, {'name': sequence, 'ref': '%d'%idx}, {'product_id': move.product_id.id})
+ update_val['prodlot_id'] = new_prodlot
+ move_obj.write(cr, uid, [current_move], update_val)
+ production_ids = production_obj.search(cr, uid, [('move_lines', 'in', [move.id])])
+
+ if quantity_rest > 0:
+ idx = int(move.product_qty//quantity)
+ update_val['product_qty']=quantity_rest
+ update_val['product_uos_qty']=uos_qty_rest
+ if idx:
+ current_move = move_obj.copy(cr, uid, move.id, {'state': move.state, 'production_id': move.production_id.id})
+ current_move = move_obj.copy(cr, uid, move.id, {'state': move.state})
+ new_move.append(current_move)
+ else:
+ current_move = move.id
+ new_prodlot = prodlot_obj.create(cr, uid, {'name': sequence, 'ref': '%d'%idx}, {'product_id': move.product_id.id})
+ update_val['prodlot_id'] = new_prodlot
+ move_obj.write(cr, uid, [current_move], update_val)
+
+ products = production_obj.read(cr, uid, production_ids, ['move_lines'])
+ for p in products:
+ for new in new_move:
+ if new not in p['move_lines']:
+ p['move_lines'].append(new)
+ production_obj.write(cr, uid, [p['id']], {'move_lines': [(6, 0, p['move_lines'])]})
+
+ return {}
+
+class wizard_track_move(wizard.interface):
+ states = {
+ 'init': {
+ 'actions': [],
+ 'result': {'type': 'form', 'arch': track_form, 'fields': fields, 'state': [('end', 'Cancel', 'gtk-cancel'), ('track', 'Ok', 'gtk-ok')]},
+ },
+ 'track': {
+ 'actions': [_track_lines],
+ 'result': {'type':'state', 'state':'end'}
+ }
+ }
+
+wizard_track_move('mrp.stock.move.track')
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/mrp_operations/report/mrp_code_barcode.py b/addons/mrp_operations/report/mrp_code_barcode.py
index a4431e55b57..336a46ba546 100755
--- a/addons/mrp_operations/report/mrp_code_barcode.py
+++ b/addons/mrp_operations/report/mrp_code_barcode.py
@@ -26,7 +26,7 @@ from report import report_sxw
class code_barcode(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(code_barcode, self).__init__(cr, uid, name, context)
+ super(code_barcode, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
})
diff --git a/addons/mrp_operations/report/mrp_wc_barcode.py b/addons/mrp_operations/report/mrp_wc_barcode.py
index bc4fe4976ee..6725f95a95d 100755
--- a/addons/mrp_operations/report/mrp_wc_barcode.py
+++ b/addons/mrp_operations/report/mrp_wc_barcode.py
@@ -26,7 +26,7 @@ from report import report_sxw
class workcenter_code(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(workcenter_code, self).__init__(cr, uid, name, context)
+ super(workcenter_code, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
})
diff --git a/addons/mrp_repair/report/order.py b/addons/mrp_repair/report/order.py
index be6897d8c2e..b7f3d0bc19d 100644
--- a/addons/mrp_repair/report/order.py
+++ b/addons/mrp_repair/report/order.py
@@ -27,7 +27,7 @@ import pooler
class order(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(order, self).__init__(cr, uid, name, context)
+ super(order, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'total': self.total,
diff --git a/addons/mrp_subproduct/mrp_subproduct.py b/addons/mrp_subproduct/mrp_subproduct.py
index b45d3e6424a..92622845818 100644
--- a/addons/mrp_subproduct/mrp_subproduct.py
+++ b/addons/mrp_subproduct/mrp_subproduct.py
@@ -68,9 +68,9 @@ class mrp_production(osv.osv):
qty2 = production.product_uos and production.product_uos_qty or False
if sub_product.subproduct_type=='variable':
if production.product_qty:
- qty1 *= production.product_qty / (sub_product.product_qty or 1.0)
+ qty1 *= production.product_qty / (production.bom_id.product_qty or 1.0)
if production.product_uos_qty:
- qty2 *= production.product_uos_qty / (sub_product.product_qty or 1.0)
+ qty2 *= production.product_uos_qty / (production.bom_id.product_uos_qty or 1.0)
data = {
'name':'PROD:'+production.name,
'date_planned': production.date_planned,
diff --git a/addons/point_of_sale/report/pos_details.py b/addons/point_of_sale/report/pos_details.py
index 1e5962c6586..6a6b9420255 100644
--- a/addons/point_of_sale/report/pos_details.py
+++ b/addons/point_of_sale/report/pos_details.py
@@ -112,7 +112,7 @@ class pos_details(report_sxw.rml_parse):
return '%s - %s' % (min_date, max_date)
def __init__(self, cr, uid, name, context):
- super(pos_details, self).__init__(cr, uid, name, context)
+ super(pos_details, self).__init__(cr, uid, name, context=context)
self.total = 0.0
self.localcontext.update({
'time': time,
diff --git a/addons/point_of_sale/report/pos_details_summary.py b/addons/point_of_sale/report/pos_details_summary.py
index 826844effd6..dc625aee62e 100644
--- a/addons/point_of_sale/report/pos_details_summary.py
+++ b/addons/point_of_sale/report/pos_details_summary.py
@@ -109,7 +109,7 @@ class pos_details_summary(report_sxw.rml_parse):
return '%s - %s' % (min_date, max_date)
def __init__(self, cr, uid, name, context):
- super(pos_details_summary, self).__init__(cr, uid, name, context)
+ super(pos_details_summary, self).__init__(cr, uid, name, context=context)
self.total = 0.0
self.localcontext.update({
'time': time,
diff --git a/addons/point_of_sale/report/pos_invoice.py b/addons/point_of_sale/report/pos_invoice.py
index 54423775614..1d2749b46ef 100644
--- a/addons/point_of_sale/report/pos_invoice.py
+++ b/addons/point_of_sale/report/pos_invoice.py
@@ -29,7 +29,7 @@ from tools.translate import _
class pos_invoice(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(pos_invoice, self).__init__(cr, uid, name, context)
+ super(pos_invoice, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
})
diff --git a/addons/point_of_sale/report/pos_lines.py b/addons/point_of_sale/report/pos_lines.py
index 1abec66dc80..66f9754f412 100644
--- a/addons/point_of_sale/report/pos_lines.py
+++ b/addons/point_of_sale/report/pos_lines.py
@@ -27,7 +27,7 @@ from report import report_sxw
class pos_lines(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(pos_lines, self).__init__(cr, uid, name, context)
+ super(pos_lines, self).__init__(cr, uid, name, context=context)
self.total = 0.0
self.localcontext.update({
'time': time,
diff --git a/addons/point_of_sale/report/pos_receipt.py b/addons/point_of_sale/report/pos_receipt.py
index 69f4bd706c2..15d8f177582 100644
--- a/addons/point_of_sale/report/pos_receipt.py
+++ b/addons/point_of_sale/report/pos_receipt.py
@@ -29,7 +29,7 @@ import pooler
class order(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(order, self).__init__(cr, uid, name, context)
+ super(order, self).__init__(cr, uid, name, context=context)
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid)
partner = user.company_id.partner_id
diff --git a/addons/product/report/product_pricelist.py b/addons/product/report/product_pricelist.py
index 3e232f7413c..dc3a1c3512c 100644
--- a/addons/product/report/product_pricelist.py
+++ b/addons/product/report/product_pricelist.py
@@ -27,7 +27,7 @@ import pooler
class product_pricelist(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(product_pricelist, self).__init__(cr, uid, name, context)
+ super(product_pricelist, self).__init__(cr, uid, name, context=context)
self.pricelist=False
self.quantity=[]
self.localcontext.update({
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index 29c67ee640a..029e7c48d9e 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -492,7 +492,7 @@
project.task
form
tree,form,calendar,graph,gantt
- [('state', '=', 'progress')]
+ [('state','=','open')]
diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py
index 71c3542c010..f914faec86f 100644
--- a/addons/project_timesheet/project_timesheet.py
+++ b/addons/project_timesheet/project_timesheet.py
@@ -84,7 +84,7 @@ class project_work(osv.osv):
if line_id in list_avail_ids:
obj = self.pool.get('hr.analytic.timesheet')
if 'name' in vals:
- vals_line['name'] = '%s: %s' % (tools.ustr(task.name), tools.ustr(vals['name']) or '/')
+ vals_line['name'] = '%s: %s' % (tools.ustr(task.task_id.name), tools.ustr(vals['name']) or '/')
if 'user_id' in vals:
vals_line['user_id'] = vals['user_id']
if 'date' in vals:
diff --git a/addons/purchase/report/order.py b/addons/purchase/report/order.py
index 52aaa1ae865..66ba383141d 100644
--- a/addons/purchase/report/order.py
+++ b/addons/purchase/report/order.py
@@ -27,7 +27,7 @@ import pooler
class order(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(order, self).__init__(cr, uid, name, context)
+ super(order, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'get_line_tax': self._get_line_tax,
diff --git a/addons/purchase/report/request_quotation.py b/addons/purchase/report/request_quotation.py
index 9acf4309264..0e920e2039d 100644
--- a/addons/purchase/report/request_quotation.py
+++ b/addons/purchase/report/request_quotation.py
@@ -27,7 +27,7 @@ import pooler
class request_quotation(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(request_quotation, self).__init__(cr, uid, name, context)
+ super(request_quotation, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'user': self.pool.get('res.users').browse(cr, uid, uid, context)
diff --git a/addons/report_intrastat/report/invoice.py b/addons/report_intrastat/report/invoice.py
index 692b33d0095..7afdd1c180e 100644
--- a/addons/report_intrastat/report/invoice.py
+++ b/addons/report_intrastat/report/invoice.py
@@ -26,7 +26,7 @@ import pooler
class account_invoice_intrastat(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(account_invoice_intrastat, self).__init__(cr, uid, name, context)
+ super(account_invoice_intrastat, self).__init__(cr, uid, name, context=context)
self.total=0
self.localcontext.update({
'time': time,
diff --git a/addons/sale/report/order.py b/addons/sale/report/order.py
index cb239b62f2a..ef33a9509f8 100644
--- a/addons/sale/report/order.py
+++ b/addons/sale/report/order.py
@@ -26,7 +26,7 @@ from osv import osv
class order(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(order, self).__init__(cr, uid, name, context)
+ super(order, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
})
diff --git a/addons/sale/report/sale_prepare_allot.py b/addons/sale/report/sale_prepare_allot.py
index ef59da50d7d..30f643d63f3 100644
--- a/addons/sale/report/sale_prepare_allot.py
+++ b/addons/sale/report/sale_prepare_allot.py
@@ -25,7 +25,7 @@ from report import report_sxw
class sale_prepare(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(sale_prepare, self).__init__(cr, uid, name, context)
+ super(sale_prepare, self).__init__(cr, uid, name, context=context)
self.localcontext.update( {
'allotment': self._allotment,
})
diff --git a/addons/sale_delivery_report/report/shipping.py b/addons/sale_delivery_report/report/shipping.py
index 63aeba6c10c..13ea8e754da 100644
--- a/addons/sale_delivery_report/report/shipping.py
+++ b/addons/sale_delivery_report/report/shipping.py
@@ -27,7 +27,7 @@ import pooler
class shipping(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(shipping, self).__init__(cr, uid, name, context)
+ super(shipping, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
# 'get_address': self._get_address,
diff --git a/addons/stock/report/lot_location.py b/addons/stock/report/lot_location.py
index e20f89bb81f..a44ae876a9e 100644
--- a/addons/stock/report/lot_location.py
+++ b/addons/stock/report/lot_location.py
@@ -25,7 +25,7 @@ from report import report_sxw
class lot_location(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(lot_location, self).__init__(cr, uid, name, context)
+ super(lot_location, self).__init__(cr, uid, name, context=context)
self.grand_total = 0.0
self.localcontext.update({
diff --git a/addons/stock/report/lot_overview.py b/addons/stock/report/lot_overview.py
index 3ecd26476df..f8442d7f3f6 100644
--- a/addons/stock/report/lot_overview.py
+++ b/addons/stock/report/lot_overview.py
@@ -25,7 +25,7 @@ from report import report_sxw
class lot_overview(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(lot_overview, self).__init__(cr, uid, name, context)
+ super(lot_overview, self).__init__(cr, uid, name, context=context)
self.price_total = 0.0
self.grand_total = 0.0
self.localcontext.update({
diff --git a/addons/stock/report/lot_overview_all.py b/addons/stock/report/lot_overview_all.py
index 2f349d9bd93..addd7a9009f 100644
--- a/addons/stock/report/lot_overview_all.py
+++ b/addons/stock/report/lot_overview_all.py
@@ -25,7 +25,7 @@ from report import report_sxw
class lot_overview_all(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(lot_overview_all, self).__init__(cr, uid, name, context)
+ super(lot_overview_all, self).__init__(cr, uid, name, context=context)
self.price_total = 0.0
self.grand_total = 0.0
self.localcontext.update({
diff --git a/addons/stock/report/picking.py b/addons/stock/report/picking.py
index 5a0746b80e8..0182ef3ba54 100644
--- a/addons/stock/report/picking.py
+++ b/addons/stock/report/picking.py
@@ -27,7 +27,7 @@ import pooler
class picking(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(picking, self).__init__(cr, uid, name, context)
+ super(picking, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
})
diff --git a/addons/stock/report/picking.rml b/addons/stock/report/picking.rml
index 8de93045b84..1540357c590 100644
--- a/addons/stock/report/picking.rml
+++ b/addons/stock/report/picking.rml
@@ -132,7 +132,9 @@
|
[[ (picking.address_id and picking.address_id.partner_id and picking.address_id.partner_id.title) or '' ]] [[ picking.address_id and picking.address_id.partner_id and picking.address_id.partner_id.name ]]
- [[ picking.address_id and picking.address_id.street or '' ]][[ picking.address_id and picking.address_id.zip or '' ]]
+ [[ picking.address_id and picking.address_id.street or '' ]]
+ [[ picking.address_id and picking.address_id.zip or '' ]] [[ picking.address_id and picking.address_id.city or '']]
+
@@ -190,7 +192,7 @@
Expected Shipping Date
|
- weight
+ Weight
|