diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index 7394fc54b7e..99d1181fb7b 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -257,7 +257,7 @@
-
+
@@ -490,7 +490,7 @@
-
+
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index be77a4d30d5..daae3043a41 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1209,7 +1209,7 @@
tree,form
- [('journal_id.type', 'in', ['sale', 'sale_refund'])]
+ [('journal_id.type', 'in', ['sale', 'purchase_refund'])]
@@ -1221,7 +1221,7 @@
tree,form
- [('journal_id.type', 'in', ['purchase', 'purchase_refund'])]
+ [('journal_id.type', 'in', ['purchase', 'sale_refund'])]
{'journal_id':1}
diff --git a/addons/account/invoice.py b/addons/account/invoice.py
index 62f998fa751..0030d36d896 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -234,7 +234,7 @@ class account_invoice(osv.osv):
'number': fields.char('Invoice Number', size=32, readonly=True, help="Unique number of the invoice, computed automatically when the invoice is created."),
'reference': fields.char('Invoice Reference', size=64, help="The partner reference of this invoice."),
'reference_type': fields.selection(_get_reference_type, 'Reference Type',
- required=True),
+ required=True, readonly=True, states={'draft':[('readonly',False)]}),
'comment': fields.text('Additional Information', translate=True),
'state': fields.selection([
@@ -312,8 +312,8 @@ class account_invoice(osv.osv):
},
help="Remaining amount due."),
'payment_ids': fields.function(_compute_lines, method=True, relation='account.move.line', type="many2many", string='Payments'),
- 'move_name': fields.char('Ledger Posting', size=64),
- 'user_id': fields.many2one('res.users', 'Salesman'),
+ 'move_name': fields.char('Ledger Posting', size=64, readonly=True, states={'draft':[('readonly',False)]}),
+ 'user_id': fields.many2one('res.users', 'Salesman', readonly=True, states={'draft':[('readonly',False)]}),
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position')
}
_defaults = {
@@ -1574,4 +1574,4 @@ class res_partner(osv.osv):
res_partner()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_voucher_payment/account_voucher_payment.py b/addons/account_voucher_payment/account_voucher_payment.py
index 7bad021ba26..39c67787157 100755
--- a/addons/account_voucher_payment/account_voucher_payment.py
+++ b/addons/account_voucher_payment/account_voucher_payment.py
@@ -143,14 +143,15 @@ class account_voucher(osv.osv):
})
amount = line.amount
- if line.invoice_id:
- move_line.update({
- 'invoice_id':line.invoice_id.id
- })
- invoice_pool.pay_and_reconcile(cr, uid, [line.invoice_id.id], amount, inv.account_id.id, inv.period_id.id, inv.journal_id.id, False, False, False)
-
move_line_id = move_line_pool.create(cr, uid, move_line)
line_ids += [move_line_id]
+
+ if line.invoice_id:
+ rec_ids = [move_line_id]
+ for move_line in line.invoice_id.move_id.line_id:
+ if line.account_id.id == move_line.account_id.id:
+ rec_ids += [move_line.id]
+ move_line_pool.reconcile_partial(cr, uid, rec_ids)
rec = {
'move_id': move_id,