diff --git a/addons/account/account.py b/addons/account/account.py
index 73c42b4f863..6ae6968f364 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -920,7 +920,10 @@ class account_move(osv.osv):
amount+= (line.debit - line.credit)
return amount
- def _centralise(self, cr, uid, move, mode):
+ def _centralise(self, cr, uid, move, mode, context=None):
+ if context is None:
+ context = {}
+
if mode=='credit':
account_id = move.journal_id.default_debit_account_id.id
mode2 = 'debit'
@@ -943,8 +946,9 @@ class account_move(osv.osv):
if res:
line_id = res[0]
else:
+ context.update({'journal_id': move.journal_id.id, 'period_id': move.period_id.id})
line_id = self.pool.get('account.move.line').create(cr, uid, {
- 'name': 'Centralisation '+mode,
+ 'name': _t(cr, None, 'selection', context.get('lang'), source=(mode.capitalize()+' Centralisation')) or (mode.capitalize()+' Centralisation'),
'centralisation': mode,
'account_id': account_id,
'move_id': move.id,
@@ -953,7 +957,7 @@ class account_move(osv.osv):
'date': move.period_id.date_stop,
'debit': 0.0,
'credit': 0.0,
- }, {'journal_id': move.journal_id.id, 'period_id': move.period_id.id})
+ }, context)
# find the first line of this move with the other mode
# so that we can exclude it from our calculation
@@ -1035,8 +1039,8 @@ class account_move(osv.osv):
#
continue
if journal.centralisation:
- self._centralise(cr, uid, move, 'debit')
- self._centralise(cr, uid, move, 'credit')
+ self._centralise(cr, uid, move, 'debit', context=context)
+ self._centralise(cr, uid, move, 'credit', context=context)
self.pool.get('account.move.line').write(cr, uid, line_draft_ids, {
'state': 'valid'
}, context, check=False)
diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py
index 7e289f695ea..30a472032f0 100644
--- a/addons/account/account_bank_statement.py
+++ b/addons/account/account_bank_statement.py
@@ -578,7 +578,7 @@ class account_bank_statement_line(osv.osv):
'account_id': fields.many2one('account.account','Account',
required=True),
'statement_id': fields.many2one('account.bank.statement', 'Statement',
- select=True, required=True),
+ select=True, required=True, ondelete='cascade'),
'reconcile_id': fields.many2one('account.bank.statement.reconcile',
'Reconcile', states={'confirm':[('readonly',True)]}),
'move_ids': fields.many2many('account.move',
diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index f5beac34601..309b67c0299 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -425,6 +425,20 @@
{'type':'out_refund'}
+
+
+
+ tree
+
+
+
+
+
+ form
+
+
+
+
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index 04e695248db..fcade623b76 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -103,9 +103,10 @@ class account_move_line(osv.osv):
total_new=0.00
for i in context['lines']:
- total_new +=(i[2]['debit'] or 0.00)- (i[2]['credit'] or 0.00)
- for item in i[2]:
- data[item]=i[2][item]
+ if i[2]:
+ total_new +=(i[2]['debit'] or 0.00)- (i[2]['credit'] or 0.00)
+ for item in i[2]:
+ data[item]=i[2][item]
if context['journal']:
journal_obj=self.pool.get('account.journal').browse(cr,uid,context['journal'])
if journal_obj.type == 'purchase':
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 1fa6df738c5..590a82a3ab1 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -340,7 +340,6 @@
-
@@ -351,7 +350,6 @@
diff --git a/addons/l10n_be/account_pcmn_belgium.xml b/addons/l10n_be/account_pcmn_belgium.xml
index d3ec2a73f69..e657d259e60 100644
--- a/addons/l10n_be/account_pcmn_belgium.xml
+++ b/addons/l10n_be/account_pcmn_belgium.xml
@@ -3093,28 +3093,28 @@
T.V.A. due 0%
411000
- receivable
+ other
T.V.A. due 6%
4110001
- receivable
+ other
T.V.A. due 12%
4110002
- receivable
+ other
T.V.A. due 21%
4110003
- receivable
+ other
@@ -3689,28 +3689,28 @@
T.V.A. due 0%
451000
- payable
+ other
T.V.A. due 6%
4510001
- payable
+ other
T.V.A. due 12%
4510002
- payable
+ other
T.V.A. due 21%
4510003
- payable
+ other
diff --git a/addons/mrp/wizard/wizard_track_line.py b/addons/mrp/wizard/wizard_track_line.py
index 4a8c476c0d5..25dbef4c970 100644
--- a/addons/mrp/wizard/wizard_track_line.py
+++ b/addons/mrp/wizard/wizard_track_line.py
@@ -48,6 +48,13 @@ fields = {
}
}
+def _check_picking(self, cr, uid, data, context):
+ pool = pooler.get_pool(cr.dbname)
+ move_obj = pool.get('stock.move').browse(cr, uid, data['id'])
+ if not move_obj.picking_id:
+ raise wizard.except_wizard(_('Caution!'), _('Before splitting the production lots,make sure this move has a Picking attached !\nYou must save the move before performing this operation.'))
+ return data['form']
+
def _track_lines(self, cr, uid, data, context):
move_id = data['id']
@@ -115,7 +122,7 @@ def _track_lines(self, cr, uid, data, context):
class wizard_track_move(wizard.interface):
states = {
'init': {
- 'actions': [],
+ 'actions': [_check_picking],
'result': {'type': 'form', 'arch': track_form, 'fields': fields, 'state': [('end', 'Cancel', 'gtk-cancel'), ('track', 'Ok', 'gtk-ok')]},
},
'track': {
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index 3e3b19b3167..f2a54ce23d0 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -524,7 +524,7 @@ class sale_order(osv.osv):
for move in stock_move_obj.browse( cr, uid, move_ids ):
#if one of the related order lines is in state draft, auto or confirmed
#this order line is not yet delivered
- if move.state in ('draft', 'auto', 'confirmed'):
+ if move.state in ('draft', 'waiting', 'confirmed'):
pending_deliveries = True
# Reason => if there are no move lines,the following condition will always set to be true,and will set SO to 'DONE'.
# Added move_ids check to SOLVE.
@@ -967,7 +967,7 @@ class sale_order_line(osv.osv):
partner = partner_obj.browse(cr, uid, partner_id)
result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_obj.taxes_id)
if not flag:
- result['name'] = self.pool.get('product.product').name_get(cr, uid, [product_obj.id])[0][1]
+ result['name'] = self.pool.get('product.product').name_get(cr, uid, [product_obj.id], context=context)[0][1]
domain = {}
if (not uom) and (not uos):
result['product_uom'] = product_obj.uom_id.id
diff --git a/addons/stock/wizard/wizard_track_line.py b/addons/stock/wizard/wizard_track_line.py
index c16abe48c80..5b95249a2b7 100644
--- a/addons/stock/wizard/wizard_track_line.py
+++ b/addons/stock/wizard/wizard_track_line.py
@@ -47,6 +47,13 @@ fields = {
}
}
+def _check_picking(self, cr, uid, data, context):
+ pool = pooler.get_pool(cr.dbname)
+ move_obj = pool.get('stock.move').browse(cr, uid, data['id'])
+ if not move_obj.picking_id:
+ raise wizard.except_wizard(_('Caution!'), _('Before splitting the production lots,make sure this move has a Picking attached !\nYou must save the move before performing this operation.'))
+ return data['form']
+
def _track_lines(self, cr, uid, data, context):
move_id = data['id']
@@ -115,7 +122,7 @@ def _track_lines(self, cr, uid, data, context):
class wizard_track_move(wizard.interface):
states = {
'init': {
- 'actions': [],
+ 'actions': [_check_picking],
'result': {'type': 'form', 'arch': track_form, 'fields': fields, 'state': [('end', 'Cancel', 'gtk-cancel'), ('track', 'Ok', 'gtk-ok')]},
},
'track': {