diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py
index fef8868f80f..e7763356e96 100644
--- a/addons/account/models/account_move.py
+++ b/addons/account/models/account_move.py
@@ -19,7 +19,7 @@ from lxml import etree
class AccountMove(models.Model):
_name = "account.move"
_description = "Journal Entries"
- _order = 'date desc, id desc'
+ _order = 'date desc, name desc, id desc'
_inherit = ['mail.thread', 'mail.activity.mixin']
@api.model
@@ -34,10 +34,11 @@ class AccountMove(models.Model):
def name_get(self):
result = []
for move in self:
+ name = move.name
+ if self.env.context.get('name_groupby'):
+ name = "**{date}**, {name} {partner}".format(date=format_date(self.env, move.date), name=move.name, partner=move.partner_id.name or "")
if move.state == 'draft':
name = '* ' + str(move.id)
- else:
- name = move.name
result.append((move.id, name))
return result
@@ -510,7 +511,7 @@ class AccountMove(models.Model):
class AccountMoveLine(models.Model):
_name = "account.move.line"
_description = "Journal Item"
- _order = "date desc, id desc"
+ _order = "date desc, move_name desc, id desc"
@api.onchange('debit', 'credit', 'tax_ids', 'analytic_account_id', 'analytic_tag_ids')
def onchange_tax_ids_create_aml(self):
@@ -614,6 +615,7 @@ class AccountMoveLine(models.Model):
record.parent_state = record.move_id.state
name = fields.Char(string="Label")
+ move_name = fields.Char(string='Number', related='move_id.name', store=True, index=True)
quantity = fields.Float(digits=dp.get_precision('Product Unit of Measure'),
help="The optional quantity expressed by this line, eg: number of product sold. The quantity is not a legal requirement but is very useful for some reports.")
product_uom_id = fields.Many2one('uom.uom', string='Unit of Measure')
@@ -1532,7 +1534,7 @@ class AccountMoveLine(models.Model):
@api.multi
def open_reconcile_view(self):
- [action] = self.env.ref('account.action_account_moves_all_a').read()
+ [action] = self.env.ref('account.action_account_moves_all').read()
ids = []
for aml in self:
if aml.account_id.reconcile:
diff --git a/addons/account/tests/test_payment.py b/addons/account/tests/test_payment.py
index 808393d89a5..1556bb14628 100644
--- a/addons/account/tests/test_payment.py
+++ b/addons/account/tests/test_payment.py
@@ -129,11 +129,10 @@ class TestPayment(AccountingTestCase):
})
payment.post()
self.assertRecordValues(payment.move_line_ids, [
+ {'account_id': self.account_usd.id, 'debit': 0.0, 'credit': 32.70, 'amount_currency': -50, 'currency_id': self.currency_usd_id},
+ {'account_id': self.transfer_account.id, 'debit': 32.70, 'credit': 0.0, 'amount_currency': 50, 'currency_id': self.currency_usd_id},
{'account_id': self.transfer_account.id, 'debit': 0.0, 'credit': 32.70, 'amount_currency': -50, 'currency_id': self.currency_usd_id},
{'account_id': self.account_eur.id, 'debit': 32.70, 'credit': 0.0, 'amount_currency': 0, 'currency_id': False},
- {'account_id': self.account_usd.id, 'debit': 0.0, 'credit': 32.70, 'amount_currency': -50, 'currency_id': self.currency_usd_id},
- {'account_id': self.transfer_account.id, 'debit': 32.70, 'credit': 0.0, 'amount_currency': 50,
- 'currency_id': self.currency_usd_id},
])
def test_payment_chf_journal_usd(self):
diff --git a/addons/account/views/account_analytic_view.xml b/addons/account/views/account_analytic_view.xml
index e3c773b1ce7..7f8164329b7 100644
--- a/addons/account/views/account_analytic_view.xml
+++ b/addons/account/views/account_analytic_view.xml
@@ -68,7 +68,7 @@
-
+
-
+
+ domain="[('type_tax_use','=','purchase'),('company_id', '=', parent.company_id)]"/>
@@ -539,10 +539,9 @@
-
+
+ domain="[('type_tax_use','=','sale'),('company_id', '=', parent.company_id)]"/>
diff --git a/addons/account/views/account_menuitem.xml b/addons/account/views/account_menuitem.xml
index 14f667247ad..e1a8b60121e 100644
--- a/addons/account/views/account_menuitem.xml
+++ b/addons/account/views/account_menuitem.xml
@@ -13,9 +13,11 @@
-
+
+
+
-
+
@@ -34,4 +36,3 @@
-
diff --git a/addons/account/views/account_move_views.xml b/addons/account/views/account_move_views.xml
index aa2e1a35123..6f3dd3c1f27 100644
--- a/addons/account/views/account_move_views.xml
+++ b/addons/account/views/account_move_views.xml
@@ -131,7 +131,7 @@
account.move.line.tree
account.move.line
-
+
@@ -154,17 +154,111 @@
+
+
+
+
+
+ account.move.line.tree.grouped
+ account.move.line
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+ account.move.line.tree.grouped.sales.purchase
+ account.move.line
+ primary
+
+
+ hide
+ hide
+ hide
+ hide
+
+ show
+ Tax Grid
+ [('applicability', '=', 'taxes')]
+
+
+
+
+
+ account.move.line.tree.grouped.bank.cash
+ account.move.line
+ primary
+
+
+ hide
+ hide
+ show
+ hide
+
+
+
+
+ account.move.line.tree.grouped.misc
+ account.move.line
+ primary
+
+
+ hide
+ hide
+
+
+
+
+ account.move.line.tree.grouped.misc
+ account.move.line
+ primary
+
+
+ hide
+
+
+
+
+
+ account.move.line.tree.grouped.partner
+ account.move.line
+ primary
+
+
+ hide
+ show
+
+
+
account.move.line.tax.audit.tree
account.move.line
@@ -172,11 +266,16 @@
-
+
+
+
+
+
+
@@ -201,6 +300,13 @@
+
+
+
+
+
+
+
@@ -216,9 +322,9 @@
-
+
+
-
@@ -451,10 +557,58 @@
view_id="account.view_move_line_tax_audit_tree"/>
- {'journal_type':'general', 'search_default_group_by_move': 1, 'search_default_posted':1}
+ {'journal_type':'general', 'search_default_group_by_move': 1, 'group_by':'move_id', 'search_default_posted':1, 'search_default_sales':1, 'name_groupby':1}
Journal Items
account.move.line
-
+
+ tree,pivot,graph,form,kanban
+
+
+
+ {'journal_type':'sales', 'search_default_group_by_move': 1, 'group_by':'move_id', 'search_default_posted':1, 'search_default_sales':1, 'name_groupby':1}
+ Sales
+ account.move.line
+
+ tree,pivot,graph,form,kanban
+
+
+
+ {'journal_type':'purchase', 'search_default_group_by_move': 1, 'group_by':'move_id', 'search_default_posted':1, 'search_default_purchases':1, 'name_groupby':1}
+ Purchase
+ account.move.line
+
+ tree,pivot,graph,form,kanban
+
+
+
+ {'journal_type':'bank', 'search_default_group_by_move': 1, 'group_by':'move_id', 'search_default_posted':1, 'search_default_bank':1, 'search_default_cash':1, 'name_groupby':1}
+ Bank and Cash
+ account.move.line
+
+ tree,pivot,graph,form,kanban
+
+
+
+ {'journal_type':'general', 'search_default_group_by_move': 1, 'group_by':'move_id', 'search_default_posted':1, 'search_default_misc_filter':1, 'name_groupby':1}
+ Miscellaneous
+ account.move.line
+
+ tree,pivot,graph,form,kanban
+
+
+
+ {'journal_type':'general', 'search_default_group_by_account': 1, 'group_by':'account_id', 'search_default_posted':1}
+ General Ledger
+ account.move.line
+
+ tree,pivot,graph,form,kanban
+
+
+
+ {'journal_type':'general', 'search_default_group_by_partner': 1, 'group_by':'partner_id', 'search_default_posted':1, 'search_default_payable':1, 'search_default_receivable':1, 'search_default_unreconciled':1}
+ Partner Ledger
+ account.move.line
+
tree,pivot,graph,form,kanban
@@ -465,6 +619,14 @@
+
+ {'journal_type':'general', 'search_default_posted':1}
+ Journal Items
+ account.move.line
+
+ tree,pivot,graph,form,kanban
+
+
Journal Items
graph,pivot
@@ -522,15 +684,57 @@
+
+
+
+
+
+
+
+
+
+
+
+