diff --git a/addons/account/account.py b/addons/account/account.py
index 166d475fcba..9e48ca554b1 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -586,11 +586,11 @@ class account_journal_column(osv.osv):
'name': fields.char('Column Name', size=64, required=True),
'field': fields.selection(_col_get, 'Field Name', method=True, required=True, size=32),
'view_id': fields.many2one('account.journal.view', 'Journal View', select=True),
- 'sequence': fields.integer('Sequence', help="Gives the sequence order to journal column."),
+ 'sequence': fields.integer('Sequence', help="Gives the sequence order to journal column.", readonly=True),
'required': fields.boolean('Required'),
'readonly': fields.boolean('Readonly'),
}
- _order = "sequence"
+ _order = "view_id, sequence"
account_journal_column()
@@ -1130,7 +1130,7 @@ class account_move(osv.osv):
'to_check': fields.boolean('To Review', help='Check this box if you are unsure of that journal entry and if you want to note it as \'to be reviewed\' by an accounting expert.'),
'partner_id': fields.related('line_id', 'partner_id', type="many2one", relation="res.partner", string="Partner", store=True),
'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)]}),
+ 'date': fields.date('Date', required=True, states={'posted':[('readonly',True)]}, select=True),
'narration':fields.text('Narration'),
'company_id': fields.related('journal_id','company_id',type='many2one',relation='res.company',string='Company', store=True, readonly=True),
}
@@ -2610,6 +2610,24 @@ class wizard_multi_charts_accounts(osv.osv_memory):
res['value']["purchase_tax"] = purchase_tax_ids and purchase_tax_ids[0] or False
return res
+ def _get_purchase_tax(self, cr, uid, context=None):
+ ids = self.pool.get('account.chart.template').search(cr, uid, [], context=context)
+ if ids:
+ chart_template_id = ids[0]
+ purchase_tax_ids = self.pool.get('account.tax.template').search(cr, uid, [("chart_template_id"
+ , "=", chart_template_id), ('type_tax_use', 'in', ('purchase','all'))], order="sequence")
+ return purchase_tax_ids[0]
+ return False
+
+ def _get_sale_tax(self, cr, uid, context=None):
+ ids = self.pool.get('account.chart.template').search(cr, uid, [], context=context)
+ if ids:
+ chart_template_id = ids[0]
+ sale_tax_ids = self.pool.get('account.tax.template').search(cr, uid, [("chart_template_id"
+ , "=", chart_template_id), ('type_tax_use', 'in', ('sale','all'))], order="sequence")
+ return sale_tax_ids[0]
+ return False
+
def _get_chart(self, cr, uid, context=None):
ids = self.pool.get('account.chart.template').search(cr, uid, [], context=context)
if ids:
@@ -2626,6 +2644,8 @@ class wizard_multi_charts_accounts(osv.osv_memory):
'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, [uid], c)[0].company_id.id,
'chart_template_id': _get_chart,
'bank_accounts_id': _get_default_accounts,
+ 'sale_tax': _get_sale_tax,
+ 'purchase_tax': _get_purchase_tax,
'code_digits': 6,
'seq_journal': True
}
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index dfd6acdf7c3..b834ecf12e7 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -494,12 +494,12 @@ class account_move_line(osv.osv):
'journal_id': fields.many2one('account.journal', 'Journal', required=True, select=1),
'blocked': fields.boolean('Litigation', help="You can check this box to mark this journal item as a litigation with the associated partner"),
'partner_id': fields.many2one('res.partner', 'Partner', select=1, ondelete='restrict'),
- 'date_maturity': fields.date('Due date', help="This field is used for payable and receivable journal entries. You can put the limit date for the payment of this line."),
- 'date': fields.related('move_id','date', string='Effective date', type='date', required=True,
+ 'date_maturity': fields.date('Due date', select=True ,help="This field is used for payable and receivable journal entries. You can put the limit date for the payment of this line."),
+ 'date': fields.related('move_id','date', string='Effective date', type='date', required=True, select=True,
store = {
'account.move': (_get_move_lines, ['date'], 20)
}),
- 'date_created': fields.date('Creation date'),
+ 'date_created': fields.date('Creation date', select=True),
'analytic_lines': fields.one2many('account.analytic.line', 'move_id', 'Analytic lines'),
'centralisation': fields.selection([('normal','Normal'),('credit','Credit Centralisation'),('debit','Debit Centralisation')], 'Centralisation', size=6),
'balance': fields.function(_balance, fnct_search=_balance_search, method=True, string='Balance'),
@@ -901,7 +901,8 @@ class account_move_line(osv.osv):
if context.get('account_id', False):
cr.execute('SELECT code FROM account_account WHERE id = %s', (context['account_id'], ))
res = cr.fetchone()
- res = _('Entries: ')+ (res[0] or '')
+ if res:
+ res = _('Entries: ')+ (res[0] or '')
return res
if (not context.get('journal_id', False)) or (not context.get('period_id', False)):
return False
@@ -944,7 +945,7 @@ class account_move_line(osv.osv):
journal_pool = self.pool.get('account.journal')
if context is None:
context = {}
- result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context=context, toolbar=toolbar, submenu=submenu)
+ result = super(account_move_line, self).fields_view_get(cr, uid, view_id, view_type, context=context, toolbar=toolbar, submenu=submenu)
if view_type != 'tree':
#Remove the toolbar from the form view
if view_type == 'form':
@@ -1043,7 +1044,13 @@ class account_move_line(osv.osv):
if field in widths:
attrs.append('width="'+str(widths[field])+'"')
- attrs.append("invisible=\"context.get('visible_id') not in %s\"" % (fields.get(field)))
+
+ if field in ('journal_id',):
+ attrs.append("invisible=\"context.get('journal_id', False)\"")
+ elif field in ('period_id',):
+ attrs.append("invisible=\"context.get('period_id', False)\"")
+ else:
+ attrs.append("invisible=\"context.get('visible_id') not in %s\"" % (fields.get(field)))
xml += '''\n''' % (field,' '.join(attrs))
xml += ''''''
diff --git a/addons/account/account_report.xml b/addons/account/account_report.xml
index b3030dbaa96..beb23c9ebc3 100644
--- a/addons/account/account_report.xml
+++ b/addons/account/account_report.xml
@@ -35,15 +35,6 @@
rml="account/report/account_tax_report.rml"
string="Taxes Report"/>
-
-
+
@@ -2392,8 +2393,8 @@
-
-
+
+