diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py
index a83d1c148c7..7cde281c17a 100644
--- a/addons/point_of_sale/pos.py
+++ b/addons/point_of_sale/pos.py
@@ -238,6 +238,7 @@ class pos_order(osv.osv):
'invoice_id': False,
'account_move': False,
'picking_id': False,
+ 'statement_ids':[],
'nb_print': 0,
'pickings': []
})
diff --git a/addons/point_of_sale/pos_view.xml b/addons/point_of_sale/pos_view.xml
index 8ab8ced00fe..be55b33db2c 100644
--- a/addons/point_of_sale/pos_view.xml
+++ b/addons/point_of_sale/pos_view.xml
@@ -47,8 +47,8 @@
-
-
+
+
@@ -95,8 +95,8 @@
-
-
+
+
diff --git a/addons/point_of_sale/report/pos_invoice.py b/addons/point_of_sale/report/pos_invoice.py
index ee905ed74bf..eb59548758c 100644
--- a/addons/point_of_sale/report/pos_invoice.py
+++ b/addons/point_of_sale/report/pos_invoice.py
@@ -35,19 +35,19 @@ class pos_invoice(report_sxw.rml_parse):
})
- def set_context(self, objects, data, ids, report_type=None):
- super(pos_invoice, self).set_context(objects, data, ids, report_type)
+ def set_context(self, order, data, ids, report_type=None):
+ super(pos_invoice, self).set_context(order, data, ids, report_type)
iids = []
nids = []
- for order in objects:
- order.write({'nb_print': order.nb_print + 1})
- if order.invoice_id and order.invoice_id not in iids:
- if not order.invoice_id:
- raise osv.except_osv(_('Error !'), _('Please create an invoice for this sale.'))
- iids.append(order.invoice_id)
- nids.append(order.invoice_id.id)
+ order.write({'nb_print': order.nb_print + 1})
+
+ if order.invoice_id and order.invoice_id not in iids:
+ if not order.invoice_id:
+ raise osv.except_osv(_('Error !'), _('Please create an invoice for this sale.'))
+ iids.append(order.invoice_id)
+ nids.append(order.invoice_id.id)
self.cr.commit()
data['ids'] = nids
self.datas = data
diff --git a/addons/point_of_sale/statement_view.xml b/addons/point_of_sale/statement_view.xml
index 65b5fb419d6..cb9a7a9ce03 100644
--- a/addons/point_of_sale/statement_view.xml
+++ b/addons/point_of_sale/statement_view.xml
@@ -34,7 +34,7 @@
-
+
@@ -109,10 +109,10 @@
-
-
-
-
+
+
+
+
@@ -172,10 +172,10 @@
-
-
-
-
+
+
+
+
@@ -301,10 +301,11 @@
-
-
-
-
+
+
+
+
+
diff --git a/addons/product_manufacturer/product_manufacturer.py b/addons/product_manufacturer/product_manufacturer.py
index d77ab518efe..78e951bf448 100644
--- a/addons/product_manufacturer/product_manufacturer.py
+++ b/addons/product_manufacturer/product_manufacturer.py
@@ -1,5 +1,5 @@
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL ().
#
@@ -14,7 +14,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 .
#
##############################################################################
@@ -39,7 +39,7 @@ class res_partner_manufacturer(osv.osv):
'product_id': fields.many2one('product.product', 'Product', ondelete='cascade'),
}
_defaults = {
- 'authorized': lambda *a: True,
+ 'authorized': True,
}
res_partner_manufacturer()
diff --git a/addons/product_margin/product_margin.py b/addons/product_margin/product_margin.py
index b70733ee992..b5421d3798c 100644
--- a/addons/product_margin/product_margin.py
+++ b/addons/product_margin/product_margin.py
@@ -42,7 +42,7 @@ class product_product(osv.osv):
invoice_types=()
states=()
if invoice_state=='paid':
- states=('paid')
+ states=('paid',)
elif invoice_state=='open_paid':
states=('open','paid')
elif invoice_state=='draft_open_paid':
diff --git a/addons/stock/product.py b/addons/stock/product.py
index df34b9b86a1..7db85d95f1a 100644
--- a/addons/stock/product.py
+++ b/addons/stock/product.py
@@ -349,7 +349,8 @@ class product_product(osv.osv):
if location_info.usage == 'inventory':
if fields.get('virtual_available'):
res['fields']['virtual_available']['string'] = _('Future P&L')
- res['fields']['qty_available']['string'] = _('P&L Qty')
+ if fields.get('qty_available'):
+ res['fields']['qty_available']['string'] = _('P&L Qty')
if location_info.usage == 'procurement':
if fields.get('virtual_available'):
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index b86a46ac1f0..2e411f1afce 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -559,7 +559,7 @@ class stock_picking(osv.osv):
}
new_id = super(stock_picking, self).create(cr, user, vals, context)
if not vals.get('auto_picking', False):
- message = type_list.get(vals.get('type', False), _('Picking')) + " '" + (vals['name'] or "n/a") + _(" with origin")+" '" + (vals['origin'] or "n/a") + "' "+ _("is created.")
+ message = type_list.get(vals.get('type', False), _('Picking')) + " '" + (vals['name'] or "n/a") + _(" with origin")+" '" + (vals.get('origin') or "n/a") + "' "+ _("is created.")
self.log(cr, user, new_id, message)
return new_id
@@ -687,6 +687,8 @@ class stock_picking(osv.osv):
"""
wf_service = netsvc.LocalService("workflow")
for pick in self.browse(cr, uid, ids):
+ if not pick.move_lines:
+ raise osv.except_osv(_('Error !'),_('You can not process picking without stock moves'))
wf_service.trg_validate(uid, 'stock.picking', pick.id,
'button_confirm', cr)
#move_ids = [x.id for x in pick.move_lines]
@@ -1385,9 +1387,9 @@ class stock_move(osv.osv):
'price_unit': fields.float('Unit Price',
digits_compute= dp.get_precision('Account')),
'company_id': fields.many2one('res.company', 'Company', required=True, select=1),
- 'partner_id': fields.related('picking_id','address_id','partner_id',type='many2one', relation="res.partner", string="Partner"),
+ 'partner_id': fields.related('picking_id','address_id','partner_id',type='many2one', relation="res.partner", string="Partner", store=True),
'backorder_id': fields.related('picking_id','backorder_id',type='many2one', relation="stock.picking", string="Back Order"),
- 'origin': fields.related('picking_id','origin',type='char', size=64, relation="stock.picking", string="Origin"),
+ 'origin': fields.related('picking_id','origin',type='char', size=64, relation="stock.picking", string="Origin",store=True),
'scraped': fields.related('location_dest_id','scrap_location',type='boolean',relation='stock.location',string='Scraped'),
}
_constraints = [
@@ -1701,7 +1703,7 @@ class stock_move(osv.osv):
tracking_id = tracking_obj.search(cr, uid, ['name','=', tracking])
if prodlot_id:
update_val['prodlot_id'] = prodlot_id
- else:
+ else:
tracking_id = tracking_obj.create(cr, uid, {'name': tracking}, {'product_id': self.browse(cr, uid, ids)[0].product_id.id})
update_val['tracking_id'] = tracking_id
else:
@@ -2191,17 +2193,17 @@ class stock_move(osv.osv):
for move in complete:
self.action_done(cr, uid, [move.id], context)
-
- # TOCHECK : Done picking if all moves are done
- cr.execute("""
- SELECT move.id FROM stock_picking pick
- RIGHT JOIN stock_move move ON move.picking_id = pick.id AND move.state = %s
- WHERE pick.id = %s""",
- ('done', move.picking_id.id))
- res = cr.fetchall()
- if len(res) == len(move.picking_id.move_lines):
- picking_obj.action_move(cr, uid, [move.picking_id.id])
- wf_service.trg_validate(uid, 'stock.picking', move.picking_id.id, 'button_done', cr)
+ if move.picking_id.id :
+ # TOCHECK : Done picking if all moves are done
+ cr.execute("""
+ SELECT move.id FROM stock_picking pick
+ RIGHT JOIN stock_move move ON move.picking_id = pick.id AND move.state = %s
+ WHERE pick.id = %s""",
+ ('done', move.picking_id.id))
+ res = cr.fetchall()
+ if len(res) == len(move.picking_id.move_lines):
+ picking_obj.action_move(cr, uid, [move.picking_id.id])
+ wf_service.trg_validate(uid, 'stock.picking', move.picking_id.id, 'button_done', cr)
ref = {}
done_move_ids = []
diff --git a/addons/stock/stock_report.xml b/addons/stock/stock_report.xml
index 547ed785cd1..3084e8527a7 100644
--- a/addons/stock/stock_report.xml
+++ b/addons/stock/stock_report.xml
@@ -3,7 +3,6 @@
-
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index e8ffe0a577a..31579978ba8 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -1254,12 +1254,9 @@
-
-
-
-
+
@@ -1354,7 +1351,6 @@
-
diff --git a/addons/stock/stock_workflow.xml b/addons/stock/stock_workflow.xml
index 3d51b11025e..1c82eac49c3 100644
--- a/addons/stock/stock_workflow.xml
+++ b/addons/stock/stock_workflow.xml
@@ -41,7 +41,7 @@
cancel
True
function
- action_cancel_inventary()
+ action_cancel()
diff --git a/addons/stock/wizard/stock_inventory_merge_view.xml b/addons/stock/wizard/stock_inventory_merge_view.xml
index e8af34c0c71..5ae2987b59a 100644
--- a/addons/stock/wizard/stock_inventory_merge_view.xml
+++ b/addons/stock/wizard/stock_inventory_merge_view.xml
@@ -7,11 +7,14 @@
stock.inventory.merge
form
-
diff --git a/addons/stock/wizard/stock_move.py b/addons/stock/wizard/stock_move.py
index d66972fd36b..0666413e0f9 100644
--- a/addons/stock/wizard/stock_move.py
+++ b/addons/stock/wizard/stock_move.py
@@ -176,15 +176,16 @@ class split_in_production_lot(osv.osv_memory):
"""
res = super(split_in_production_lot, self).default_get(cr, uid, fields, context=context)
- move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
- if 'product_id' in fields:
- res.update({'product_id': move.product_id.id})
- if 'product_uom' in fields:
- res.update({'product_uom': move.product_uom.id})
- if 'qty' in fields:
- res.update({'qty': move.product_qty})
- if 'use_exist' in fields:
- res.update({'use_exist': (move.picking_id and move.picking_id.type=='out' and True) or False})
+ if context.get('active_id'):
+ move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
+ if 'product_id' in fields:
+ res.update({'product_id': move.product_id.id})
+ if 'product_uom' in fields:
+ res.update({'product_uom': move.product_uom.id})
+ if 'qty' in fields:
+ res.update({'qty': move.product_qty})
+ if 'use_exist' in fields:
+ res.update({'use_exist': (move.picking_id and move.picking_id.type=='out' and True) or False})
return res
_columns = {
diff --git a/addons/stock/wizard/stock_partial_move.py b/addons/stock/wizard/stock_partial_move.py
index 8f283ebee62..d9c97a5b885 100644
--- a/addons/stock/wizard/stock_partial_move.py
+++ b/addons/stock/wizard/stock_partial_move.py
@@ -44,7 +44,9 @@ class stock_partial_move(osv.osv_memory):
moveids = []
for m in move_obj.browse(cr, uid, context.get('active_ids', [])):
if m.state in ('done', 'cancel'):
- continue
+ raise osv.except_osv(_('Invalid action !'), _('Cannot delivery products which are already delivered !'))
+
+
if 'move%s_product_id'%(m.id) not in self._columns:
self._columns['move%s_product_id'%(m.id)] = fields.many2one('product.product',string="Product")
if 'move%s_product_qty'%(m.id) not in self._columns:
@@ -66,7 +68,8 @@ class stock_partial_move(osv.osv_memory):
move_ids = move_obj.search(cr, uid, [('id','in',move_ids)])
_moves_arch_lst = """
@@ -209,11 +209,13 @@
+
+
@@ -238,14 +240,20 @@
search
-
-
-
-
+
+
+
-
+
+
+
+
+
+
+
+
@@ -351,7 +359,7 @@
-
+
@@ -362,10 +370,10 @@
-
+
-
+
@@ -382,14 +390,18 @@
search
-
-
-
+
+
+
+
+
+
+