diff --git a/addons/account/account.py b/addons/account/account.py
index 61851b30f1f..1817d50901e 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -1078,24 +1078,13 @@ class account_move(osv.osv):
'partner_id': fields.related('line_id', 'partner_id', type="many2one", relation="res.partner", string="Partner"),
'amount': fields.function(_amount_compute, method=True, string='Amount', digits_compute=dp.get_precision('Account'), type='float', fnct_search=_search_amount),
'date': fields.date('Date', required=True, states={'posted':[('readonly',True)]}),
- 'type': fields.selection([
- ('pay_voucher','Cash Payment'),
- ('bank_pay_voucher','Bank Payment'),
- ('rec_voucher','Cash Receipt'),
- ('bank_rec_voucher','Bank Receipt'),
- ('cont_voucher','Contra'),
- ('journal_sale_vou','Journal Sale'),
- ('journal_pur_voucher','Journal Purchase'),
- ('journal_voucher','Journal Voucher'),
- ],'Entry Type', select=True , size=128, readonly=True, states={'draft':[('readonly',False)]}),
- 'narration':fields.text('Narration', readonly=True, select=True, states={'draft':[('readonly',False)]}),
+ 'narration':fields.text('Narration', select=True),
'company_id': fields.related('journal_id','company_id',type='many2one',relation='res.company',string='Company',store=True),
}
_defaults = {
'name': lambda *a: '/',
'state': lambda *a: 'draft',
'period_id': _get_period,
- 'type' : lambda *a : 'journal_voucher',
'date': lambda *a:time.strftime('%Y-%m-%d'),
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
}
@@ -1174,8 +1163,20 @@ class account_move(osv.osv):
# TODO: Check if period is closed !
#
def create(self, cr, uid, vals, context={}):
- if 'line_id' in vals:
- if 'journal_id' in vals:
+ if 'line_id' in vals and context.get('copy'):
+ for l in vals['line_id']:
+ if not l[0]:
+ l[2].update({
+ 'reconcile_id':False,
+ 'reconcil_partial_id':False,
+ 'analytic_lines':False,
+ 'invoice':False,
+ 'ref':False,
+ 'balance':False,
+ 'account_tax_id':False,
+ })
+
+ if 'journal_id' in vals and vals.get('journal_id', False):
for l in vals['line_id']:
if not l[0]:
l[2]['journal_id'] = vals['journal_id']
@@ -1201,11 +1202,14 @@ class account_move(osv.osv):
result = super(account_move, self).create(cr, uid, vals, context)
return result
- def copy(self, cr, uid, id, default=None, context=None):
- if default is None:
- default = {}
- default = default.copy()
- default.update({'state':'draft', 'name':'/',})
+ def copy(self, cr, uid, id, default={}, context={}):
+ default.update({
+ 'state':'draft',
+ 'name':'/',
+ })
+ context.update({
+ 'copy':True
+ })
return super(account_move, self).copy(cr, uid, id, default, context)
def unlink(self, cr, uid, ids, context={}, check=True):
diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index ddd2cc2dabe..ae41562e124 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -424,7 +424,7 @@
[('type','=','out_invoice')]{'type':'out_invoice'}
- Most of customer invoices are automatically generate in draft mode by OpenERP flows, following a purchase order for instance. Review, confirm or cancel, pay or refund yours customers invoices here. A manual invoice can be created here.
+ Most of customer invoices are automatically generated in draft mode by OpenERP flows, following a purchase order for instance. Review, confirm or cancel, pay or refund your customers' invoices here. A manual invoice can be created here.
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index 76989d2f02c..40f3f113306 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -20,7 +20,6 @@
##############################################################################
import time
from datetime import datetime
-
import netsvc
from osv import fields, osv
from tools.translate import _
@@ -454,6 +453,7 @@ class account_move_line(osv.osv):
context=context)
dt = period.date_start
return dt
+
def _get_currency(self, cr, uid, context={}):
if not context.get('journal_id', False):
return False
@@ -926,6 +926,7 @@ class account_move_line(osv.osv):
def _check_date(self, cr, uid, vals, context=None, check=True):
if context is None:
context = {}
+ journal_id = False
if 'date' in vals.keys():
if 'journal_id' in vals and 'journal_id' not in context:
journal_id = vals['journal_id']
@@ -1110,10 +1111,10 @@ class account_move_line(osv.osv):
#if not 'currency_id' in vals:
# vals['currency_id'] = account.company_id.currency_id.id
-
+
result = super(osv.osv, self).create(cr, uid, vals, context)
# CREATE Taxes
- if vals.get('account_tax_id',False):
+ if vals.get('account_tax_id', False):
tax_id = tax_obj.browse(cr, uid, vals['account_tax_id'])
total = vals['debit'] - vals['credit']
if journal.refund_journal:
@@ -1186,7 +1187,7 @@ class account_move_line(osv.osv):
if check and ((not context.get('no_store_function')) or journal.entry_posted):
tmp = self.pool.get('account.move').validate(cr, uid, [vals['move_id']], context)
if journal.entry_posted and tmp:
- self.pool.get('account.move').button_validate(cr,uid, [vals['move_id']],context)
+ rs = self.pool.get('account.move').button_validate(cr,uid, [vals['move_id']],context)
return result
account_move_line()
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index be650a4613f..1fd373a1bdc 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -670,7 +670,7 @@
-
+
@@ -906,43 +906,69 @@
-
account.move.line.form2account.move.line
@@ -1000,6 +1025,19 @@
+
+ account.move.line.graph
+ account.move.line
+ graph
+
+
+
+
+
+
+
+
+
Entry Linesaccount.move.line
@@ -1053,6 +1091,17 @@
Account.Entry Edition
-->
+
+ account.move.graph
+ account.move
+ graph
+
+
+
+
+
+
+ account.move.treeaccount.move
@@ -1064,11 +1113,10 @@
-
-
+
@@ -1082,15 +1130,18 @@
@@ -1165,28 +1209,34 @@
+
-
+
+
+
+
+
-
+
+
+
-
-
+ Journal Entriesaccount.moveform
- tree,form
+ tree,form,graph
@@ -1215,21 +1265,20 @@
res_model="account.move.line"
src_model="account.move"/>
-
- Journal Entries
- ir.actions.act_window
- account.move
- form
-
-
- [('to_check','=',True), ('state','=','draft')]
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1249,7 +1298,7 @@
Journal Itemsaccount.move.lineform
- tree,form
+ tree,form,graph[('journal_id.type', 'in', ['sale', 'purchase_refund'])]
@@ -1261,7 +1310,7 @@
Journal Itemsaccount.move.lineform
- tree,form
+ tree,form,graph[('journal_id.type', 'in', ['purchase', 'sale_refund'])]
@@ -2281,7 +2330,7 @@
Journal Itemsaccount.move.lineform
- tree,form
+ tree,form,graph
diff --git a/addons/account/wizard/account_automatic_reconcile.py b/addons/account/wizard/account_automatic_reconcile.py
index 0ee58eeb01a..ef177516718 100644
--- a/addons/account/wizard/account_automatic_reconcile.py
+++ b/addons/account/wizard/account_automatic_reconcile.py
@@ -29,15 +29,15 @@ class account_automatic_reconcile(osv.osv_memory):
_description = 'Automatic Reconcile'
_columns = {
- 'account_ids': fields.many2many('account.account', 'reconcile_account_rel', 'reconcile_id', 'account_id', 'Account to reconcile', domain = [('reconcile','=',1)], \
+ 'account_ids': fields.many2many('account.account', 'reconcile_account_rel', 'reconcile_id', 'account_id', 'Accounts to Reconcile', domain = [('reconcile','=',1)], \
help = 'If no account is specified, the reconciliation will be made using every accounts that can be reconcilied'),
'writeoff_acc_id': fields.many2one('account.account', 'Account'),
'journal_id': fields.many2one('account.journal', 'Journal'),
'period_id': fields.many2one('account.period', 'Period'),
'max_amount': fields.float('Maximum write-off amount'),
'power': fields.selection([(p, str(p)) for p in range(2, 10)], 'Power', required=True, help='Number of partial amounts that can be combined to find a balance point can be chosen as the power of the automatic reconciliation'),
- 'date1': fields.date('Start of period', required=True),
- 'date2': fields.date('End of period', required=True),
+ 'date1': fields.date('Starting Date', required=True),
+ 'date2': fields.date('Ending Date', required=True),
'reconciled': fields.integer('Reconciled transactions', readonly=True),
'unreconciled': fields.integer('Not reconciled transactions', readonly=True),
'allow_write_off': fields.boolean('Allow write off')
@@ -54,6 +54,7 @@ class account_automatic_reconcile(osv.osv_memory):
'date2': time.strftime('%Y-%m-%d'),
'reconciled': _get_reconciled,
'unreconciled': _get_unreconciled,
+ 'power':2
}
#TODO: cleanup and comment this code... For now, it is awfulllll
@@ -245,4 +246,4 @@ class account_automatic_reconcile(osv.osv_memory):
account_automatic_reconcile()
-# 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/wizard/account_automatic_reconcile_view.xml b/addons/account/wizard/account_automatic_reconcile_view.xml
index 838d9fd9489..bda89971a3d 100644
--- a/addons/account/wizard/account_automatic_reconcile_view.xml
+++ b/addons/account/wizard/account_automatic_reconcile_view.xml
@@ -7,33 +7,33 @@
account.automatic.reconcileform
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
Account Automatic Reconcile
@@ -47,29 +47,29 @@
For an invoice to be considered as paid, the invoice entries must be reconciled with counterparts, usually payments. With the automatic reconciliation functionality, OpenERP make its own search for entries to reconcile in a series of accounts. It tries to find entries for each partner where the amounts correspond.
-
+
Automatic reconcile unreconcileaccount.automatic.reconcileform
-