diff --git a/MANIFEST.in b/MANIFEST.in index d27848ab760..034e06807ff 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -8,6 +8,7 @@ recursive-include openerp *.html recursive-include openerp *.jpeg recursive-include openerp *.jpg recursive-include openerp *.js +recursive-include openerp *.less recursive-include openerp *.md recursive-include openerp *.png recursive-include openerp *.po diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index 3abd46bc02f..6a426c6e774 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -48,7 +48,6 @@ Processes like maintaining general ledgers are done through the defined Financia for a particular financial year and for preparation of vouchers there is a module named account_voucher. """, 'website': 'https://www.odoo.com/page/billing', - 'images' : ['images/accounts.jpeg','images/bank_statement.jpeg','images/cash_register.jpeg','images/chart_of_accounts.jpeg','images/customer_invoice.jpeg','images/journal_entries.jpeg'], 'depends' : ['base_setup', 'product', 'analytic', 'board', 'edi', 'report'], 'data': [ 'security/account_security.xml', diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index d06f85e5115..630af63708b 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -873,7 +873,7 @@ class account_bank_statement_line(osv.osv): # Unfortunately, that spawns a "no access rights" error ; it shouldn't. def _needaction_domain_get(self, cr, uid, context=None): user = self.pool.get("res.users").browse(cr, uid, uid) - return ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id]), ('journal_entry_ids', '=', False)] + return ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id]), ('journal_entry_ids', '=', False), ('account_id', '=', False)] _order = "statement_id desc, sequence" _name = "account.bank.statement.line" diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 83fcebb45ce..b0dbb55bd51 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -2554,7 +2554,7 @@ - + diff --git a/addons/account/static/src/css/account_bank_statement_reconciliation.css b/addons/account/static/src/css/account_bank_statement_reconciliation.css index 3543360fb26..a5710c2e0b1 100644 --- a/addons/account/static/src/css/account_bank_statement_reconciliation.css +++ b/addons/account/static/src/css/account_bank_statement_reconciliation.css @@ -55,6 +55,10 @@ top: 2px; z-index: 10; text-shadow: -1px -1px 0 #f5f5f5, 1px -1px 0 #f5f5f5, -1px 1px 0 #f5f5f5, 1px 1px 0 #f5f5f5; } + .openerp .oe_bank_statement_reconciliation .show_more_container { + text-align: center; } + .openerp .oe_bank_statement_reconciliation .show_more_container .show_more { + display: none; } .openerp .oe_bank_statement_reconciliation .notification_area { margin: 0 15px; } .openerp .oe_bank_statement_reconciliation .interface_options { diff --git a/addons/account/static/src/css/account_bank_statement_reconciliation.scss b/addons/account/static/src/css/account_bank_statement_reconciliation.scss index 1b4acdb2ee5..a773e20b4f4 100644 --- a/addons/account/static/src/css/account_bank_statement_reconciliation.scss +++ b/addons/account/static/src/css/account_bank_statement_reconciliation.scss @@ -92,6 +92,13 @@ $aestetic_animation_speed: 300ms; } } + .show_more_container { + text-align: center; + + .show_more { + display: none; + } + } .notification_area { margin: 0 $actionColWidth; } diff --git a/addons/account/static/src/js/account_widgets.js b/addons/account/static/src/js/account_widgets.js index 126ceaa6d94..136c571f495 100644 --- a/addons/account/static/src/js/account_widgets.js +++ b/addons/account/static/src/js/account_widgets.js @@ -15,11 +15,13 @@ openerp.account = function (instance) { "click .statement_name span": "statementNameClickHandler", "keyup .change_statement_name_field": "changeStatementNameFieldHandler", "click .change_statement_name_button": "changeStatementButtonClickHandler", + "click .show_more": "showMoreButtonClickHandler", }, init: function(parent, context) { this._super(parent); - this.max_reconciliations_displayed = 10; + // Number of reconciliations loaded initially and by clicking 'show more' + this.num_reconciliations_fetched_in_batch = 10; if (context.context.statement_id) this.statement_ids = [context.context.statement_id]; if (context.context.statement_ids) this.statement_ids = context.context.statement_ids; this.single_statement = this.statement_ids !== undefined && this.statement_ids.length === 1; @@ -237,7 +239,7 @@ openerp.account = function (instance) { total_lines: self.already_reconciled_lines+self.st_lines.length })); self.updateProgressbar(); - var reconciliations_to_show = self.st_lines.slice(0, self.max_reconciliations_displayed); + var reconciliations_to_show = self.st_lines.slice(0, self.num_reconciliations_fetched_in_batch); self.last_displayed_reconciliation_index = reconciliations_to_show.length; self.$(".reconciliation_lines_container").css("opacity", 0); @@ -251,6 +253,7 @@ openerp.account = function (instance) { $.when.apply($, child_promises).then(function(){ self.$(".reconciliation_lines_container").animate({opacity: 1}, self.aestetic_animation_speed); self.getChildren()[0].set("mode", "match"); + self.updateShowMoreButton(); if (self.notifications) { self.displayNotifications(self.notifications); } @@ -340,7 +343,7 @@ openerp.account = function (instance) { var child = reconciliations[i]; data.push([child.st_line_id, child.makeMoveLineDicts()]); } - var deferred_animation = self.$(".reconciliation_lines_container").fadeOut(self.aestetic_animation_speed); + var deferred_animation = self.$(".reconciliation_lines_container, .show_more_container").fadeOut(self.aestetic_animation_speed); deferred_rpc = self.model_bank_statement_line.call("process_reconciliations", [data]); return $.when(deferred_animation, deferred_rpc) .done(function() { @@ -359,48 +362,25 @@ openerp.account = function (instance) { // Display new line if there are left if (self.last_displayed_reconciliation_index < self.st_lines.length) { - var begin = self.last_displayed_reconciliation_index; - var end = Math.min((begin+self.max_reconciliations_displayed), self.st_lines.length); - var reconciliations_to_show = self.st_lines.slice(begin, end); - - return self.model_bank_statement_line - .call("get_data_for_reconciliations", [reconciliations_to_show]) - .then(function (data) { - var child_promises = []; - var datum; - while ((datum = data.shift()) !== undefined) { - var context = { - st_line_id: datum.st_line.id, - mode: 'inactive', - animate_entrance: false, - initial_data_provided: true, - st_line: datum.st_line, - reconciliation_proposition: datum.reconciliation_proposition, - }; - var widget = new instance.web.account.bankStatementReconciliationLine(self, context); - child_promises.push(widget.appendTo(self.$(".reconciliation_lines_container"))); + return self.displayReconciliations(self.num_reconciliations_fetched_in_batch).then(function() { + // Put the first line in match mode + if (self.reconciled_lines !== self.st_lines.length) { + var first_child = self.getChildren()[0]; + if (first_child.get("mode") === "inactive") { + first_child.set("mode", "match"); } - self.last_displayed_reconciliation_index += reconciliations_to_show.length; - return $.when.apply($, child_promises).then(function() { - // Put the first line in match mode - if (self.reconciled_lines !== self.st_lines.length) { - var first_child = self.getChildren()[0]; - if (first_child.get("mode") === "inactive") { - first_child.set("mode", "match"); - } - } - self.$(".reconciliation_lines_container").fadeIn(self.aestetic_animation_speed); - }); - }); + } + self.$(".reconciliation_lines_container, .show_more_container").fadeIn(self.aestetic_animation_speed); + }); } else if (self.reconciled_lines === self.st_lines.length) { // Congratulate the user if the work is done self.displayDoneMessage(); } else { // Some lines weren't persisted because they were't valid - self.$(".reconciliation_lines_container").fadeIn(self.aestetic_animation_speed); + self.$(".reconciliation_lines_container, .show_more_container").fadeIn(self.aestetic_animation_speed); } }).fail(function() { - self.$(".reconciliation_lines_container").fadeIn(self.aestetic_animation_speed); + self.$(".reconciliation_lines_container, .show_more_container").fadeIn(self.aestetic_animation_speed); }); }, @@ -433,7 +413,8 @@ openerp.account = function (instance) { // Update children if needed _.each(self.getChildren(), function(child){ - if ((child.partner_id === partner_id || child.st_line.has_no_partner) && child !== source_child) { + if (child === source_child || child.st_line === undefined) return; + if (child.partner_id === partner_id || child.st_line.has_no_partner) { if (contains_lines(child.get("mv_lines_selected"), line_ids)) { child.set("mv_lines_selected", _.filter(child.get("mv_lines_selected"), function(o){ return line_ids.indexOf(o.id) === -1 })); } else if (contains_lines(child.mv_lines_deselected, line_ids)) { @@ -457,6 +438,7 @@ openerp.account = function (instance) { // Update children if needed _.each(self.getChildren(), function(child){ + if (child.st_line === undefined) return; if (child.partner_id === partner_id && child !== source_child && (child.get("mode") === "match" || child.$el.hasClass("no_match"))) child.updateMatches(); if (child.st_line.has_no_partner && child.get("mode") === "match" || child.$el.hasClass("no_match")) @@ -464,6 +446,42 @@ openerp.account = function (instance) { }); }, + displayReconciliations: function(number) { + var self = this; + var begin = self.last_displayed_reconciliation_index; + var end = Math.min((begin+number), self.st_lines.length); + var reconciliations_to_show = self.st_lines.slice(begin, end); + + // Get ids of selected move lines (to exclude them from reconciliation proposition) + var excluded_move_lines_ids = []; + _.each(self.excluded_move_lines_ids, function(o){ + excluded_move_lines_ids = excluded_move_lines_ids.concat(o); + }); + + return self.model_bank_statement_line + .call("get_data_for_reconciliations", [reconciliations_to_show, excluded_move_lines_ids]) + .then(function (data) { + var child_promises = []; + var datum; + while ((datum = data.shift()) !== undefined) { + var context = { + st_line_id: datum.st_line.id, + mode: 'inactive', + animate_entrance: false, + initial_data_provided: true, + st_line: datum.st_line, + reconciliation_proposition: datum.reconciliation_proposition, + }; + var widget = new instance.web.account.bankStatementReconciliationLine(self, context); + child_promises.push(widget.appendTo(self.$(".reconciliation_lines_container"))); + } + self.last_displayed_reconciliation_index += reconciliations_to_show.length; + return $.when.apply($, child_promises).then(function(){ + self.updateShowMoreButton(); + }); + }); + }, + displayReconciliation: function(st_line_id, mode, animate_entrance, initial_data_provided, st_line, reconciliation_proposition) { var self = this; animate_entrance = (animate_entrance === undefined ? true : animate_entrance); @@ -489,7 +507,7 @@ openerp.account = function (instance) { self.doReloadMenuReconciliation(); // Display new line if there are left - if (self.last_displayed_reconciliation_index < self.st_lines.length) { + if (self.last_displayed_reconciliation_index < self.st_lines.length && self.getChildren().length < self.num_reconciliations_fetched_in_batch) { self.displayReconciliation(self.st_lines[self.last_displayed_reconciliation_index++], 'inactive'); } // Congratulate the user if the work is done @@ -504,6 +522,7 @@ openerp.account = function (instance) { first_child.set("mode", "match"); } } + self.updateShowMoreButton(); }, goBackToStatementsTreeView: function() { @@ -557,6 +576,7 @@ openerp.account = function (instance) { // Render it self.$(".protip").hide(); + self.updateShowMoreButton(); self.$(".oe_form_sheet").append(QWeb.render("bank_statement_reconciliation_done_message", { title: title, time_taken: time_taken, @@ -606,7 +626,19 @@ openerp.account = function (instance) { }); } }, + + showMoreButtonClickHandler: function() { + this.displayReconciliations(this.num_reconciliations_fetched_in_batch); + }, + updateShowMoreButton: function() { + var items_remaining = this.st_lines.length - this.last_displayed_reconciliation_index; + if (items_remaining > 0) + this.$(".show_more").show().find(".num_items_remaining").text(items_remaining); + else + this.$(".show_more").hide(); + }, + updateProgressbar: function() { var self = this; var done = self.already_reconciled_lines + self.reconciled_lines; diff --git a/addons/account/static/src/xml/account_bank_statement_reconciliation.xml b/addons/account/static/src/xml/account_bank_statement_reconciliation.xml index 415be5dde94..9d3ec4a67a4 100644 --- a/addons/account/static/src/xml/account_bank_statement_reconciliation.xml +++ b/addons/account/static/src/xml/account_bank_statement_reconciliation.xml @@ -34,6 +34,7 @@
+

Tip : Hit ctrl-enter to validate the whole sheet.

diff --git a/addons/account/tests/__init__.py b/addons/account/tests/__init__.py index e09bcc6ee99..8a0a9394c3a 100644 --- a/addons/account/tests/__init__.py +++ b/addons/account/tests/__init__.py @@ -1,9 +1,3 @@ from . import test_tax from . import test_search from . import test_reconciliation - -fast_suite = [ - test_tax, - test_search, - test_reconciliation, -] diff --git a/addons/account_analytic_analysis/__openerp__.py b/addons/account_analytic_analysis/__openerp__.py index 3e376c526ca..6fe9d954345 100644 --- a/addons/account_analytic_analysis/__openerp__.py +++ b/addons/account_analytic_analysis/__openerp__.py @@ -32,7 +32,6 @@ Adds menu to show relevant information to each manager.You can also view the rep """, 'author': 'Camptocamp / Odoo', 'website': 'https://www.odoo.com/page/billing', - 'images': ['images/bill_tasks_works.jpeg','images/overpassed_accounts.jpeg'], 'depends': ['hr_timesheet_invoice', 'sale'], #although sale is technically not required to install this module, all menuitems are located under 'Sales' application 'data': [ 'security/ir.model.access.csv', diff --git a/addons/account_analytic_default/__openerp__.py b/addons/account_analytic_default/__openerp__.py index 74ae986d163..6aa65c4a6c4 100644 --- a/addons/account_analytic_default/__openerp__.py +++ b/addons/account_analytic_default/__openerp__.py @@ -37,7 +37,6 @@ Allows to automatically select analytic accounts based on criterions: """, 'author': 'OpenERP SA', 'website': 'https://www.odoo.com/page/accounting', - 'images': ['images/analytic_defaults.jpeg'], 'depends': ['sale_stock'], 'data': [ 'security/ir.model.access.csv', diff --git a/addons/account_analytic_plans/__openerp__.py b/addons/account_analytic_plans/__openerp__.py index d4c99aa8fd3..9b5e467e69f 100644 --- a/addons/account_analytic_plans/__openerp__.py +++ b/addons/account_analytic_plans/__openerp__.py @@ -64,7 +64,6 @@ The analytic plan validates the minimum and maximum percentage at the time of cr """, 'author': 'OpenERP SA', 'website': 'https://www.odoo.com/page/accounting', - 'images': ['images/analytic_plan.jpeg'], 'depends': ['account', 'account_analytic_default'], 'data': [ 'security/account_analytic_plan_security.xml', diff --git a/addons/account_anglo_saxon/__openerp__.py b/addons/account_anglo_saxon/__openerp__.py index 89c7768ce6b..ee4f7437785 100644 --- a/addons/account_anglo_saxon/__openerp__.py +++ b/addons/account_anglo_saxon/__openerp__.py @@ -39,7 +39,6 @@ account when the invoice is created to transfer this amount to the debtor or creditor account. Secondly, price differences between actual purchase price and fixed product standard price are booked on a separate account.""", - 'images': ['images/account_anglo_saxon.jpeg'], 'depends': ['product', 'purchase'], 'category': 'Accounting & Finance', 'demo': [], diff --git a/addons/account_budget/__openerp__.py b/addons/account_budget/__openerp__.py index 116e84fc960..352914eaa21 100644 --- a/addons/account_budget/__openerp__.py +++ b/addons/account_budget/__openerp__.py @@ -48,7 +48,6 @@ Three reports are available: """, 'author': 'OpenERP SA', 'website': 'https://www.odoo.com/page/accounting', - 'images': ['images/budget.jpeg','images/budgetary_position.jpeg'], 'depends': ['account'], 'data': [ 'security/ir.model.access.csv', diff --git a/addons/account_cancel/__openerp__.py b/addons/account_cancel/__openerp__.py index f27901c6c55..7af5d2bd7f0 100644 --- a/addons/account_cancel/__openerp__.py +++ b/addons/account_cancel/__openerp__.py @@ -32,7 +32,6 @@ This module adds 'Allow Canceling Entries' field on form view of account journal If set to true it allows user to cancel entries & invoices. """, 'website': 'https://www.odoo.com/page/accounting', - 'images': ['images/account_cancel.jpeg'], 'depends' : ['account'], 'data': ['account_cancel_view.xml' ], 'demo': [], diff --git a/addons/account_followup/__openerp__.py b/addons/account_followup/__openerp__.py index fa5d97a3a46..c612d8f6b63 100644 --- a/addons/account_followup/__openerp__.py +++ b/addons/account_followup/__openerp__.py @@ -45,7 +45,6 @@ Note that if you want to check the follow-up level for a given partner/account e """, 'author': 'OpenERP SA', 'website': 'https://www.odoo.com/page/billing', - 'images': ['images/follow_ups.jpeg','images/send_followups.jpeg'], 'depends': ['account_accountant', 'mail'], 'data': [ 'security/account_followup_security.xml', diff --git a/addons/account_followup/tests/__init__.py b/addons/account_followup/tests/__init__.py index abad074cc09..84a004e7a11 100644 --- a/addons/account_followup/tests/__init__.py +++ b/addons/account_followup/tests/__init__.py @@ -20,6 +20,3 @@ ############################################################################## from . import test_account_followup -checks = [ - test_account_followup, -] diff --git a/addons/account_payment/__openerp__.py b/addons/account_payment/__openerp__.py index 83940178180..6c04b162e33 100644 --- a/addons/account_payment/__openerp__.py +++ b/addons/account_payment/__openerp__.py @@ -42,7 +42,6 @@ when you get the confirmation from your bank that your order has been accepted that you can book it in your accounting. To help you with that operation, you have a new option to import payment orders as bank statement lines. """, - 'images': ['images/payment_mode.jpeg','images/payment_order.jpeg'], 'depends': ['account','account_voucher'], 'data': [ 'security/account_payment_security.xml', diff --git a/addons/account_sequence/__openerp__.py b/addons/account_sequence/__openerp__.py index 8f12e4850b5..409fb111825 100644 --- a/addons/account_sequence/__openerp__.py +++ b/addons/account_sequence/__openerp__.py @@ -39,7 +39,6 @@ You can customize the following attributes of the sequence: """, 'author': 'OpenERP SA', 'website': 'https://www.odoo.com', - 'images': ['images/internal_sequence_number.jpeg'], 'depends': ['account'], 'data': [ 'account_sequence_data.xml', diff --git a/addons/account_voucher/__openerp__.py b/addons/account_voucher/__openerp__.py index 5dcfb7f28a6..09279f5eea3 100644 --- a/addons/account_voucher/__openerp__.py +++ b/addons/account_voucher/__openerp__.py @@ -42,7 +42,6 @@ This module manages: 'category': 'Accounting & Finance', 'sequence': 4, 'website' : 'https://www.odoo.com/page/billing', - 'images' : ['images/customer_payment.jpeg','images/journal_voucher.jpeg','images/sales_receipt.jpeg','images/supplier_voucher.jpeg','images/customer_invoice.jpeg','images/customer_refunds.jpeg'], 'depends' : ['account'], 'demo' : [], 'data' : [ diff --git a/addons/account_voucher/account_voucher_view.xml b/addons/account_voucher/account_voucher_view.xml index 353f725e52b..2ec6464d418 100644 --- a/addons/account_voucher/account_voucher_view.xml +++ b/addons/account_voucher/account_voucher_view.xml @@ -19,6 +19,24 @@
+ + account.voucher.tree_nocreate + account.voucher + + + + + + + + + + + + + + + account.voucher.line.form account.voucher.line @@ -40,7 +58,7 @@ account.voucher.form account.voucher -
+