+
+
@@ -103,7 +99,6 @@
-
@@ -136,7 +131,7 @@
account.invoice.report
form
tree,graph
- {'search_default_month':1,'search_default_product':1,'group_by_no_leaf':1,'group_by':[]}
+ {'search_default_month':1,'search_default_partner':1,'group_by_no_leaf':1,'group_by':[],'search_default_user_id':1}
A tool search lets you know statistics on invoices that match your needs.
diff --git a/addons/account/report/account_profit_horizontal.rml b/addons/account/report/account_profit_horizontal.rml
index 28215f06075..76d462aacf8 100644
--- a/addons/account/report/account_profit_horizontal.rml
+++ b/addons/account/report/account_profit_horizontal.rml
@@ -282,7 +282,7 @@
|
- [[ a['balance'] and formatLang(get_abs(a['balance'])) or 0.0 ]]
+ [[ a['balance'] and formatLang(abs(a['balance'])) or 0.0 ]]
|
@@ -295,7 +295,7 @@
|
- [[ a['balance1'] and formatLang(get_abs(a['balance1'])) or '' ]]
+ [[ a['balance1'] and formatLang(abs(a['balance1'])) or '' ]]
|
@@ -308,7 +308,7 @@
[[ final_result()['type'] == 'Net Profit C.F.B.L.' and final_result()['type'] or '' ]]
- [[ final_result()['balance'] and final_result()['type'] == 'Net Profit C.F.B.L.' and formatLang(get_abs(final_result()['balance'])) or 0.0 ]]
+ [[ final_result()['balance'] and final_result()['type'] == 'Net Profit C.F.B.L.' and formatLang(abs(final_result()['balance'])) or 0.0 ]]
|
@@ -317,7 +317,7 @@
[[ final_result()['type'] == 'Net Loss C.F.B.L.' and final_result()['type'] or '' ]]
|
- [[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and formatLang(get_abs(final_result()['balance'])) or 0.0 ]]
+ [[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and formatLang(abs(final_result()['balance'])) or 0.0 ]]
|
@@ -328,13 +328,13 @@
Total:([[ get_currency(data['form']) ]])
- [[ sum_dr() and formatLang(get_abs(sum_dr())) or 0.0 ]]
+ [[ sum_dr() and formatLang(abs(sum_dr())) or 0.0 ]]
|
Total:([[ get_currency(data['form']) ]])
|
- [[ sum_cr() and formatLang(get_abs(sum_cr())) or 0.0 ]]
+ [[ sum_cr() and formatLang(abs(sum_cr())) or 0.0 ]]
|
diff --git a/addons/account/report/account_profit_loss.py b/addons/account/report/account_profit_loss.py
index d8da95b53e2..c1c74a1f54d 100644
--- a/addons/account/report/account_profit_loss.py
+++ b/addons/account/report/account_profit_loss.py
@@ -36,7 +36,6 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header):
self.result_temp = []
self.localcontext.update( {
'time': time,
- 'get_abs' : self.get_abs,
'get_lines' : self.get_lines,
'get_lines_another' : self.get_lines_another,
'get_currency': self._get_currency,
@@ -57,8 +56,6 @@ class report_pl_account_horizontal(rml_parse.rml_parse, common_report_header):
})
self.context = context
- def get_abs(self,amount):
- return abs(amount)
def final_result(self):
return self.res_pl
diff --git a/addons/account/report/account_profit_loss.rml b/addons/account/report/account_profit_loss.rml
index 0a5c03ad395..7bf0704b8a0 100644
--- a/addons/account/report/account_profit_loss.rml
+++ b/addons/account/report/account_profit_loss.rml
@@ -274,7 +274,7 @@
- [[ a.balance and formatLang(get_abs(a.balance)) or 0.0 ]]
+ [[ a.balance and formatLang(abs(a.balance)) or 0.0 ]]
|
@@ -287,7 +287,7 @@
[[ final_result()['type'] == 'Net Profit C.F.B.L.' and final_result()['type'] or removeParentNode('blockTable') ]]
- [[ final_result()['balance'] and final_result()['type'] == 'Net Profit C.F.B.L.' and formatLang(get_abs(final_result()['balance'])) or 0.0 ]]
+ [[ final_result()['balance'] and final_result()['type'] == 'Net Profit C.F.B.L.' and formatLang(abs(final_result()['balance'])) or 0.0 ]]
|
@@ -297,7 +297,7 @@
Total:([[ get_currency(data) ]])
- [[ sum_dr() and formatLang(get_abs(sum_dr())) or 0.0 ]]
+ [[ sum_dr() and formatLang(abs(sum_dr())) or 0.0 ]]
|
@@ -329,7 +329,7 @@
- [[ a.balance and formatLang(get_abs(a.balance)) or 0.0 ]]
+ [[ a.balance and formatLang(abs(a.balance)) or 0.0 ]]
|
@@ -342,7 +342,7 @@
[[ final_result()['type'] == 'Net Loss C.F.B.L.' and final_result()['type'] or removeParentNode('blockTable') ]]
- [[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and formatLang(get_abs(final_result()['balance'])) or 0.0 ]]
+ [[ final_result()['balance'] and final_result()['type'] == 'Net Loss C.F.B.L.' and formatLang(abs(final_result()['balance'])) or 0.0 ]]
|
@@ -352,7 +352,7 @@
Total:([[ get_currency(data) ]])
- [[ sum_cr() and formatLang(get_abs(sum_cr())) or 0.0 ]]
+ [[ sum_cr() and formatLang(abs(sum_cr())) or 0.0 ]]
|
diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv
index c43a1edebeb..890d4f505ea 100644
--- a/addons/account/security/ir.model.access.csv
+++ b/addons/account/security/ir.model.access.csv
@@ -38,7 +38,6 @@
"access_account_invoice_uinvoice","account.invoice","model_account_invoice","account.group_account_invoice",1,1,1,1
"access_account_invoice_line_uinvoice","account.invoice.line","model_account_invoice_line","account.group_account_invoice",1,1,1,1
"access_account_invoice_tax_uinvoice","account.invoice.tax","model_account_invoice_tax","account.group_account_invoice",1,1,1,1
-"access_account_analytic_line_uinvoice","account.analytic.line","model_account_analytic_line","account.group_account_manager",1,0,0,0
"access_account_move_uinvoice","account.move","model_account_move","account.group_account_invoice",1,0,0,0
"access_account_move_line_uinvoice","account.move.line invoice","model_account_move_line","account.group_account_invoice",1,1,1,1
"access_account_move_reconcile_uinvoice","account.move.reconcile","model_account_move_reconcile","account.group_account_invoice",1,1,1,1
@@ -155,3 +154,7 @@
"access_res_partner_address_invoice","res.partner.address invoice","base.model_res_partner_address","account.group_account_invoice",1,1,1,1
"access_account_invoice_line_system","account.invoice.line system","model_account_invoice_line","base.group_system",1,0,0,0
"access_account_analytic_accountant","account.analytic.account accountant","analytic.model_account_analytic_account","account.group_account_user",1,1,1,1
+"access_account_account_type_invoice","account.account.type invoice","model_account_account_type","account.group_account_invoice",1,1,1,1
+"access_report_account_receivable_invoice","report.account.receivable.invoice","model_report_account_receivable","account.group_account_invoice",1,1,1,1
+"access_report_account_receivable_user","report.account.receivable.user","model_report_account_receivable","account.group_account_user",1,1,1,1
+"access_account_sequence_fiscal_year_invoice","account.sequence.fiscalyear invoice","model_account_sequence_fiscalyear","account.group_account_invoice",1,1,1,1
diff --git a/addons/account/test/account_fiscalyear_close.yml b/addons/account/test/account_fiscalyear_close.yml
index fa4f24effc1..5af4787c6a6 100644
--- a/addons/account/test/account_fiscalyear_close.yml
+++ b/addons/account/test/account_fiscalyear_close.yml
@@ -48,7 +48,6 @@
-
!record {model: account.move.journal, id: account_move_journal_0}:
journal_id: account.sales_journal
- period_id: account_period_jan11
-
I clicked on Open Journal Button to check the entries
diff --git a/addons/account/wizard/account_journal_select_view.xml b/addons/account/wizard/account_journal_select_view.xml
index f5df24fa585..348218dd04d 100644
--- a/addons/account/wizard/account_journal_select_view.xml
+++ b/addons/account/wizard/account_journal_select_view.xml
@@ -8,11 +8,11 @@
form
diff --git a/addons/account/wizard/account_move_journal.py b/addons/account/wizard/account_move_journal.py
index 142ade01737..92e8f23da49 100644
--- a/addons/account/wizard/account_move_journal.py
+++ b/addons/account/wizard/account_move_journal.py
@@ -26,23 +26,82 @@ import tools
class account_move_journal(osv.osv_memory):
_name = "account.move.journal"
_description = "Move journal"
- _columns = {
- 'journal_id': fields.many2one('account.journal', 'Journal', required=True),
- 'period_id': fields.many2one('account.period', 'Period', required=True),
- }
def _get_period(self, cr, uid, context={}):
- """Return default account period value"""
+ """
+ Return default account period value
+ """
ids = self.pool.get('account.period').find(cr, uid, context=context)
period_id = False
if len(ids):
period_id = ids[0]
return period_id
- _defaults = {
- 'period_id': _get_period
- }
+ def _get_journal(self, cr, uid, context={}):
+ """
+ Return journal based on the journal type
+ """
+ journal_id = False
+
+ journal_pool = self.pool.get('account.journal')
+ if context.get('journal_type', False):
+ jids = journal_pool.search(cr, uid, [('type','=', context.get('journal_type'))])
+ journal_id = jids[0]
+
+ return journal_id
+
+ def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
+ """
+ Returns views and fields for current model where view will depend on {view_type}.
+ @param cr: A database cursor
+ @param user: ID of the user currently logged in
+ @param view_id: list of fields, which required to read signatures
+ @param view_type: defines a view type. it can be one of (form, tree, graph, calender, gantt, search, mdx)
+ @param context: context arguments, like lang, time zone
+ @param toolbar: contains a list of reports, wizards, and links related to current model
+
+ @return: Returns a dict that contains definition for fields, views, and toolbars
+ """
+
+ res = super(account_move_journal, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar, submenu)
+
+ if not view_id:
+ return res
+
+ period_pool = self.pool.get('account.period')
+ journal_pool = self.pool.get('account.journal')
+
+ journal_id = self._get_journal(cr, uid, context)
+ period_id = self._get_period(cr, uid, context)
+
+ journal = False
+ if journal_id:
+ journal = journal_pool.read(cr, uid, [journal_id], ['name'])[0]['name']
+ else:
+ journal = "All"
+
+ period = False
+ if period_id:
+ period = period_pool.browse(cr, uid, [period_id], ['name'])[0]['name']
+
+ view = """
+ """ % (str(journal), str(period))
+
+ res.update({
+ 'arch':view
+ })
+ return res
+
def action_open_window(self, cr, uid, ids, context=None):
"""
This function Open action move line window on given period and Journal/Payment Mode
@@ -50,48 +109,60 @@ class account_move_journal(osv.osv_memory):
@param uid: the current user’s ID for security checks,
@param ids: account move journal’s ID or list of IDs
@return: dictionary of Open action move line window on given period and Journal/Payment Mode
-
"""
- jp = self.pool.get('account.journal.period')
- mod_obj = self.pool.get('ir.model.data')
+
+ period_pool = self.pool.get('account.journal.period')
+ data_pool = self.pool.get('ir.model.data')
+ journal_pool = self.pool.get('account.journal')
+
if context is None:
context = {}
- data = self.read(cr, uid, ids, ['journal_id', 'period_id'], context=context)[0]
- cr.execute('select id,name from ir_ui_view where model=%s and type=%s', ('account.move.line', 'form'))
- view_res = cr.fetchone()
- journal_id = data['journal_id']
- period_id = data['period_id']
-
- ids = jp.search(cr, uid, [('journal_id', '=', journal_id), \
- ('period_id', '=', period_id)],context=context)
-
- if not len(ids):
- name = self.pool.get('account.journal').read(cr, uid, [journal_id])[0]['name']
- state = self.pool.get('account.period').read(cr, uid, [period_id])[0]['state']
- if state == 'done':
- raise osv.except_osv(_('UserError'), _('This period is already closed !'))
- company = self.pool.get('account.period').read(cr, uid, [period_id])[0]['company_id'][0]
- jp.create(cr, uid, {'name': name, 'period_id': period_id, 'journal_id': journal_id, 'company_id': company},context=context)
-
- ids = jp.search(cr, uid, [('journal_id', '=', journal_id), ('period_id', '=', period_id)],context=context)
- jp = jp.browse(cr, uid, ids, context=context)[0]
- name = (jp.journal_id.code or '') + ':' + (jp.period_id.code or '')
-
- result = mod_obj._get_id(cr, uid, 'account', 'view_account_move_line_filter')
- res = mod_obj.read(cr, uid, result, ['res_id'],context=context)
+
+ journal_id = self._get_journal(cr, uid, context)
+ period_id = self._get_period(cr, uid, context)
+ name = _("Journal Items")
+ if journal_id:
+ ids = period_pool.search(cr, uid, [('journal_id', '=', journal_id), ('period_id', '=', period_id)], context=context)
+
+ if not len(ids):
+ journal = journal_pool.browse(cr, uid, journal_id)
+ period = self.pool.get('account.period').browse(cr, uid, period_id)
+
+ name = journal.name
+ state = period.state
+
+ if state == 'done':
+ raise osv.except_osv(_('UserError'), _('This period is already closed !'))
+
+ company = period.company_id.id
+ res = {
+ 'name': name,
+ 'period_id': period_id,
+ 'journal_id': journal_id,
+ 'company_id': company
+ }
+ period_pool.create(cr, uid, res,context=context)
+
+ ids = period_pool.search(cr, uid, [('journal_id', '=', journal_id), ('period_id', '=', period_id)],context=context)
+ period = period_pool.browse(cr, uid, ids[0], context=context)
+ name = (period.journal_id.code or '') + ':' + (period.period_id.code or '')
+
+ result = data_pool._get_id(cr, uid, 'account', 'view_account_move_line_filter')
+ res_id = data_pool.browse(cr, uid, result, context=context).res_id
+
return {
- 'domain': "[('journal_id','=',%d), ('period_id','=',%d)]" % (journal_id, period_id),
+# 'domain': str([('journal_id', '=', journal_id), ('period_id', '=', period_id)]),
'name': name,
'view_type': 'form',
- 'view_mode': 'tree,form',
+ 'view_mode': 'tree,form,graph',
'res_model': 'account.move.line',
- 'view_id': view_res,
- 'context': "{'journal_id': %d, 'period_id': %d}" % (journal_id, period_id),
+ 'view_id': False,
+ 'context': "{'journal_id': %d, 'search_default_journal_id':%d, 'search_default_period_id':%d}" % (journal_id, journal_id, period_id),
'type': 'ir.actions.act_window',
- 'search_view_id': res['res_id']
- }
-
+ 'search_view_id': res_id
+ }
+
account_move_journal()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/wizard/account_move_journal_view.xml b/addons/account/wizard/account_move_journal_view.xml
index d766153a9b4..fbc160f9eb4 100644
--- a/addons/account/wizard/account_move_journal_view.xml
+++ b/addons/account/wizard/account_move_journal_view.xml
@@ -2,40 +2,72 @@
-
+
account.move.journal.form
account.move.journal
form
-
- Entries by Line
+
+ Journal Items
account.move.journal
form
- tree,form
-
- new
+
+ {'journal_type':'sale'}
+ new
+
+
+
+
+ Journal Refund Items
+ account.move.journal
+ form
+
+ {'journal_type':'purchase_refund'}
+ new
+
+
+
+
+ Journal Items
+ account.move.journal
+ form
+
+ {'journal_type':'purchase'}
+ new
+
+
+
+
+ Journal Refund Items
+ account.move.journal
+ form
+
+ {'journal_type':'sale_refund'}
+ new
+
+
+
+
+ Journal Items
+ account.move.journal
+ form
+
+ {'journal_type':'bank'}
+ new
-
-
-
-
-
+
-
\ No newline at end of file
+