diff --git a/addons/account/account.py b/addons/account/account.py
index 06060f59e28..87eb6dfd2a8 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -81,7 +81,7 @@ class account_payment_term(osv.osv):
if amt:
next_date = datetime.strptime(date_ref, '%Y-%m-%d') + relativedelta(days=line.days)
if line.days2 < 0:
- next_date += relativedelta(day=line.days2)
+ next_date += relativedelta(day=31)
if line.days2 > 0:
next_date += relativedelta(day=line.days2, months=1)
result.append( (next_date.strftime('%Y-%m-%d'), amt) )
@@ -2121,7 +2121,7 @@ class account_tax_code_template(osv.osv):
'info': fields.text('Description'),
'parent_id': fields.many2one('account.tax.code.template', 'Parent Code', select=True),
'child_ids': fields.one2many('account.tax.code.template', 'parent_id', 'Child Codes'),
- 'sign': fields.float('Sign for parent', required=True),
+ 'sign': fields.float('Sign for parent', required=True, help="Choose 1.00 to add the total to the parent account or -1.00 to subtract it"),
'notprintable':fields.boolean("Not Printable in Invoice", help="Check this box if you don't want any VAT related to this Tax Code to appear on invoices"),
}
@@ -2153,7 +2153,7 @@ class account_chart_template(osv.osv):
_columns={
'name': fields.char('Name', size=64, required=True),
- 'account_root_id': fields.many2one('account.account.template','Root Account',required=True,domain=[('parent_id','=',False)]),
+ 'account_root_id': fields.many2one('account.account.template','Root Account',required=True,domain=[('parent_id','=',False)], help=""),
'tax_code_root_id': fields.many2one('account.tax.code.template','Root Tax Code',required=True,domain=[('parent_id','=',False)]),
'tax_template_ids': fields.one2many('account.tax.template', 'chart_template_id', 'Tax Template List', help='List of all the taxes that have to be installed by the wizard'),
'bank_account_view_id': fields.many2one('account.account.template','Bank Account',required=True),
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index a93179e3f98..82781b45ab0 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -12,12 +12,14 @@
form
+
+ account.period.search
+ account.period
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Periods
account.period
form
- tree,form
+ tree,form,search
@@ -154,10 +198,21 @@
search
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -262,7 +317,28 @@
-
+
+ account.journal.search
+ account.journal
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
account.journal.form
account.journal
@@ -351,16 +427,38 @@
-
+
+ account.bank.statement.search
+ account.bank.statement
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
account.bank.statement.form
account.bank.statement
form
@@ -629,6 +727,26 @@
+
+ account.tax.search
+ account.tax
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
account.tax.form
account.tax
@@ -847,6 +965,13 @@
+
+
+
+
+
+
+
@@ -1041,7 +1166,7 @@
tree,form
- [('journal_id.type', '=', 'sale')]
+ [('journal_id.type', 'in', ['sale', 'sale_refund'])]
@@ -1053,7 +1178,7 @@
tree,form
- [('journal_id.type', '=', 'purchase')]
+ [('journal_id.type', 'in', ['purchase', 'purchase_refund'])]
@@ -1296,7 +1421,7 @@
-
+
@@ -1373,12 +1498,32 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Payment Terms
account.payment.term
@@ -1572,13 +1717,14 @@
- Account Add wizard
+ Create Account
account.addtmpl.wizard
form
-
-
+
-
+
-
-
+
+
-
+
+
@@ -1651,12 +1799,36 @@
+
+
+ account.account.template.search
+ account.account.template
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Account Templates
account.account.template
form
- tree,form
+ tree,form,search
@@ -1670,21 +1842,50 @@
form
+
+ account.chart.template.search
+ account.chart.template
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
account.chart.template.tree
account.chart.template
@@ -1702,7 +1903,7 @@
Chart of Accounts Templates
account.chart.template
form
- tree,form
+ tree,form,search
@@ -1716,11 +1917,11 @@
+
+ account.tax.template.search
+ account.tax.template
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Tax Templates
account.tax.template
@@ -1796,7 +2018,26 @@
-
+
+
+ account.tax.code.template.search
+ account.tax.code.template
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
account.tax.code.template.form
account.tax.code.template
@@ -1808,7 +2049,8 @@
-
+
+
@@ -1817,7 +2059,7 @@
Tax Code Templates
account.tax.code.template
form
- tree,form
+ tree,form,search
@@ -1905,7 +2147,7 @@
-
+
@@ -1915,7 +2157,7 @@
-
+
diff --git a/addons/account/demo/account_minimal.xml b/addons/account/demo/account_minimal.xml
index 37225273e03..18abf70dd80 100644
--- a/addons/account/demo/account_minimal.xml
+++ b/addons/account/demo/account_minimal.xml
@@ -169,7 +169,7 @@ your own chart of account.
x Sales Credit Note Journal
SCNJ
- sale
+ sale_refund
True
@@ -191,7 +191,7 @@ your own chart of account.
x Expenses Credit Notes Journal
ECNJ
- purchase
+ purchase_refund
True
diff --git a/addons/account/invoice.py b/addons/account/invoice.py
index f478881ac7c..a5df2a6f1a0 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -51,11 +51,12 @@ class account_invoice(osv.osv):
type_inv = context.get('type', 'out_invoice')
user = self.pool.get('res.users').browse(cr, uid, uid)
company_id = context.get('company_id', user.company_id.id)
- type2journal = {'out_invoice': 'sale', 'in_invoice': 'purchase', 'out_refund': 'sale', 'in_refund': 'purchase'}
+ type2journal = {'out_invoice': 'sale', 'in_invoice': 'purchase', 'out_refund': 'sale_refund', 'in_refund': 'purchase_refund'}
refund_journal = {'out_invoice': False, 'in_invoice': False, 'out_refund': True, 'in_refund': True}
journal_obj = self.pool.get('account.journal')
res = journal_obj.search(cr, uid, [('type', '=', type2journal.get(type_inv, 'sale')),
- ('company_id', '=', company_id),('refund_journal', '=', refund_journal.get(type_inv, False))],
+ ('company_id', '=', company_id),
+ ('refund_journal', '=', refund_journal.get(type_inv, False))],
limit=1)
if res:
return res[0]
@@ -753,6 +754,8 @@ class account_invoice(osv.osv):
cur_obj = self.pool.get('res.currency')
context = {}
for inv in self.browse(cr, uid, ids):
+ if not inv.invoice_line:
+ raise osv.except_osv(_('No Invoice Lines !'), _('Please create some invoice lines.'))
if inv.move_id:
continue
@@ -774,7 +777,8 @@ class account_invoice(osv.osv):
# one move line per tax line
iml += ait_obj.move_line_get(cr, uid, inv.id)
-
+
+ entry_type=''
if inv.type in ('in_invoice', 'in_refund'):
ref = inv.reference
entry_type = 'journal_pur_voucher'
@@ -1011,7 +1015,7 @@ class account_invoice(osv.osv):
def refund(self, cr, uid, ids, date=None, period_id=None, description=None):
invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id', 'address_contact_id', 'address_invoice_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line', 'journal_id'])
-
+
new_ids = []
for invoice in invoices:
del invoice['id']
@@ -1030,6 +1034,10 @@ class account_invoice(osv.osv):
tax_lines = self.pool.get('account.invoice.tax').read(cr, uid, invoice['tax_line'])
tax_lines = filter(lambda l: l['manual'], tax_lines)
tax_lines = self._refund_cleanup_lines(cr, uid, tax_lines)
+ if invoice['type'] == 'in_invoice':
+ refund_journal_ids = self.pool.get('account.journal').search(cr, uid, [('type','=','purchase_refund')])
+ else:
+ refund_journal_ids = self.pool.get('account.journal').search(cr, uid, [('type','=','sale_refund')])
if not date :
date = time.strftime('%Y-%m-%d')
invoice.update({
@@ -1038,7 +1046,8 @@ class account_invoice(osv.osv):
'state': 'draft',
'number': False,
'invoice_line': invoice_lines,
- 'tax_line': tax_lines
+ 'tax_line': tax_lines,
+ 'journal_id': refund_journal_ids
})
if period_id :
invoice.update({
@@ -1092,7 +1101,6 @@ class account_invoice(osv.osv):
ref = invoice.reference
else:
ref = self._convert_ref(cr, uid, invoice.number)
-
# Pay attention to the sign for both debit/credit AND amount_currency
l1 = {
'debit': direction * pay_amount>0 and direction * pay_amount,
diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml
index 5d9bbb7e9b0..a22e6860a15 100644
--- a/addons/account/partner_view.xml
+++ b/addons/account/partner_view.xml
@@ -10,9 +10,9 @@
-
+
@@ -32,6 +32,8 @@
+
+
diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml
index 067fbd38ab1..15bbd58b0c2 100644
--- a/addons/account/project/project_view.xml
+++ b/addons/account/project/project_view.xml
@@ -24,7 +24,7 @@
search
-
+
@@ -32,7 +32,15 @@
-
+
+
+
+
+
+
+
+
+
@@ -195,6 +203,14 @@
+
+
+
+
+
+
+
+
@@ -277,7 +293,20 @@
-
+
+
+ account.analytic.journal.search
+ account.analytic.journal
+ search
+
+
+
+
+
+
+
+
+
account.analytic.journal.form
account.analytic.journal
@@ -296,7 +325,7 @@
Analytic Journals
account.analytic.journal
form
- tree,form
+ tree,form,search
diff --git a/addons/account/wizard/account_automatic_reconcile.py b/addons/account/wizard/account_automatic_reconcile.py
index 3fb921696f4..0ee58eeb01a 100644
--- a/addons/account/wizard/account_automatic_reconcile.py
+++ b/addons/account/wizard/account_automatic_reconcile.py
@@ -241,7 +241,6 @@ class account_automatic_reconcile(osv.osv_memory):
'type': 'ir.actions.act_window',
'target': 'new',
'context': context,
- 'nodestroy':True,
}
account_automatic_reconcile()
diff --git a/addons/account/wizard/account_fiscalyear_close_state.xml b/addons/account/wizard/account_fiscalyear_close_state.xml
index 370aacbf2e3..f0384134a66 100644
--- a/addons/account/wizard/account_fiscalyear_close_state.xml
+++ b/addons/account/wizard/account_fiscalyear_close_state.xml
@@ -7,16 +7,18 @@
form
diff --git a/addons/account/wizard/account_reconcile.py b/addons/account/wizard/account_reconcile.py
index e8db687edf7..59ea16b2c23 100644
--- a/addons/account/wizard/account_reconcile.py
+++ b/addons/account/wizard/account_reconcile.py
@@ -23,19 +23,19 @@ import time
from osv import fields, osv
from tools.translate import _
-class account_move_line_reconcile_prompt(osv.osv_memory):
- """
- Asks user he wants to reconcile entries or not.
- """
- _name = 'account.move.line.reconcile.prompt'
- _description = 'Account move line reconcile'
- _columns = {
- }
-
- def ask_reconcilation(self, cr, uid, ids, context):
- return self.pool.get('account.move.line.reconcile').partial_check(cr, uid, ids, context)
-
-account_move_line_reconcile_prompt()
+#class account_move_line_reconcile_prompt(osv.osv_memory):
+# """
+# Asks user he wants to reconcile entries or not.
+# """
+# _name = 'account.move.line.reconcile.prompt'
+# _description = 'Account move line reconcile'
+# _columns = {
+# }
+#
+# def ask_reconcilation(self, cr, uid, ids, context):
+# return self.pool.get('account.move.line.reconcile').partial_check(cr, uid, ids, context)
+#
+#account_move_line_reconcile_prompt()
class account_move_line_reconcile(osv.osv_memory):
"""
diff --git a/addons/account/wizard/account_reconcile_view.xml b/addons/account/wizard/account_reconcile_view.xml
index 1bed69d45fe..5ce124bfcc7 100644
--- a/addons/account/wizard/account_reconcile_view.xml
+++ b/addons/account/wizard/account_reconcile_view.xml
@@ -2,86 +2,130 @@
-
- account.move.line.reconcile.prompt.form
- account.move.line.reconcile.prompt
- form
-
-
-
-
+
+
+
+
+
+
+
+
-
- Reconcile Entries
- account.move.line.reconcile.prompt
- form
- tree,form
-
- new
-
-
-
-
-
- Reconcile Entries
- client_action_multi
-
- action
- account.move.line
-
-
-
+
+
+
+
+
+
+
+
+
+
+
account.move.line.reconcile.full.form
account.move.line.reconcile
form
-
-
- account.move.line.reconcile.partial.form
- account.move.line.reconcile
- form
-
-
-
+
+
+ Reconcile Entries
+ account.move.line.reconcile
+ form
+ tree,form
+
+ new
+
+
+
+
+ Reconcile Entries
+ client_action_multi
+
+ action
+ account.move.line
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
account.move.line.reconcile.writeoff.form
diff --git a/addons/account/wizard/account_use_model_view.xml b/addons/account/wizard/account_use_model_view.xml
index 9ff781ea53c..59ff85e1a57 100644
--- a/addons/account/wizard/account_use_model_view.xml
+++ b/addons/account/wizard/account_use_model_view.xml
@@ -8,9 +8,10 @@
form