diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index 03e2ea03f57..0dddb10c03c 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -257,6 +257,8 @@ class AccountBankStatement(models.Model): def button_journal_entries(self): context = dict(self._context or {}) context['journal_id'] = self.journal_id.id + aml = self.env['account.move.line'].search([('statement_id', 'in', self.ids)]) + aml |= aml.mapped('move_id').mapped('line_ids') return { 'name': _('Journal Items'), 'view_type': 'form', @@ -264,7 +266,7 @@ class AccountBankStatement(models.Model): 'res_model': 'account.move.line', 'view_id': False, 'type': 'ir.actions.act_window', - 'domain': [('statement_id', 'in', self.ids)], + 'domain': [('id', 'in', aml.ids)], 'context': context, } diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index d4ea16b6677..e295bab8fa7 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -1311,15 +1311,17 @@ class AccountInvoiceTax(models.Model): for invoice in self.mapped('invoice_id'): tax_grouped[invoice.id] = invoice.get_taxes_values() for tax in self: - key = self.env['account.tax'].browse(tax.tax_id.id).get_grouping_key({ - 'tax_id': tax.tax_id.id, - 'account_id': tax.account_id.id, - 'account_analytic_id': tax.account_analytic_id.id, - }) - if tax.invoice_id and key in tax_grouped[tax.invoice_id.id]: - tax.base = tax_grouped[tax.invoice_id.id][key]['base'] - else: - _logger.warning('Tax Base Amount not computable probably due to a change in an underlying tax (%s).', tax.tax_id.name) + tax.base = 0.0 + if tax.tax_id: + key = tax.tax_id.get_grouping_key({ + 'tax_id': tax.tax_id.id, + 'account_id': tax.account_id.id, + 'account_analytic_id': tax.account_analytic_id.id, + }) + if tax.invoice_id and key in tax_grouped[tax.invoice_id.id]: + tax.base = tax_grouped[tax.invoice_id.id][key]['base'] + else: + _logger.warning('Tax Base Amount not computable probably due to a change in an underlying tax (%s).', tax.tax_id.name) invoice_id = fields.Many2one('account.invoice', string='Invoice', ondelete='cascade', index=True) name = fields.Char(string='Tax Description', required=True) diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index 70e79867d20..e723c984709 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -45,7 +45,7 @@ class AccountInvoiceReport(models.Model): user_currency_price_total = fields.Float(string="Total Without Tax", compute='_compute_amounts_in_user_currency', digits=0) price_average = fields.Float(string='Average Price', readonly=True, group_operator="avg") user_currency_price_average = fields.Float(string="Average Price", compute='_compute_amounts_in_user_currency', digits=0) - currency_rate = fields.Float(string='Currency Rate', readonly=True) + currency_rate = fields.Float(string='Currency Rate', readonly=True, group_operator="avg") nbr = fields.Integer(string='# of Lines', readonly=True) # TDE FIXME master: rename into nbr_lines type = fields.Selection([ ('out_invoice', 'Customer Invoice'), diff --git a/addons/account/views/account_invoice_view.xml b/addons/account/views/account_invoice_view.xml index ea70b164070..7e3b12b469f 100644 --- a/addons/account/views/account_invoice_view.xml +++ b/addons/account/views/account_invoice_view.xml @@ -135,8 +135,8 @@ - - + + @@ -200,8 +200,8 @@ - - + + diff --git a/addons/account/views/account_payment_view.xml b/addons/account/views/account_payment_view.xml index e54aa4317c1..2682408e313 100644 --- a/addons/account/views/account_payment_view.xml +++ b/addons/account/views/account_payment_view.xml @@ -12,7 +12,7 @@ - + @@ -31,7 +31,7 @@ - + @@ -149,7 +149,7 @@

- + Payments account.payment diff --git a/addons/account/views/web_planner_data.xml b/addons/account/views/web_planner_data.xml index 86d4254978c..f8cf2953d58 100644 --- a/addons/account/views/web_planner_data.xml +++ b/addons/account/views/web_planner_data.xml @@ -408,7 +408,7 @@

Revenue Recognition

Use in conjunction with contracts to calculate your monthly revenue for multi-month contracts.

- Install Now diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py index e560e2419b7..b56bad7bbe1 100644 --- a/addons/account_asset/account_asset.py +++ b/addons/account_asset/account_asset.py @@ -427,7 +427,7 @@ class AccountAssetDepreciationLine(models.Model): move_check = fields.Boolean(compute='_get_move_check', string='Posted', track_visibility='always', store=True) @api.one - @api.depends('move_id') + @api.depends('move_id', 'asset_id.account_move_ids') def _get_move_check(self): self.move_check = bool(self.move_id) diff --git a/addons/l10n_in/l10n_in_standard_tax_template.xml b/addons/l10n_in/l10n_in_standard_tax_template.xml index 03c239bb4c8..5680f5cf782 100644 --- a/addons/l10n_in/l10n_in_standard_tax_template.xml +++ b/addons/l10n_in/l10n_in_standard_tax_template.xml @@ -607,7 +607,7 @@ - +
(standard)Input Education Cess @ 2% On Service Tax @@ -667,7 +667,7 @@ - + @@ -681,7 +681,7 @@ - + (standard)Output Purchase Tax @ 12% @@ -693,7 +693,7 @@ - + (standard)Output Purchase Tax @ 4% diff --git a/addons/product/product.py b/addons/product/product.py index 825ec1873a8..14bf0231c0a 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -1083,8 +1083,7 @@ class product_product(osv.osv): name = variant and "%s (%s)" % (product.name, variant) or product.name sellers = [] if partner_ids: - if variant: - sellers = [x for x in product.seller_ids if (x.name.id in partner_ids) and (x.product_id == product)] + sellers = [x for x in product.seller_ids if (x.name.id in partner_ids) and (x.product_id == product)] if not sellers: sellers = [x for x in product.seller_ids if (x.name.id in partner_ids) and not x.product_id] if sellers: diff --git a/addons/resource/resource.py b/addons/resource/resource.py index a604764fcfb..f1ba88a1f3e 100644 --- a/addons/resource/resource.py +++ b/addons/resource/resource.py @@ -644,7 +644,7 @@ class resource_calendar_attendance(osv.osv): 'date_to': fields.date('End Date'), 'hour_from' : fields.float('Work from', required=True, help="Start and End time of working.", select=True), 'hour_to' : fields.float("Work to", required=True), - 'calendar_id' : fields.many2one("resource.calendar", "Resource's Calendar", required=True), + 'calendar_id' : fields.many2one("resource.calendar", "Resource's Calendar", required=True, ondelete='cascade'), } _order = 'dayofweek, hour_from' diff --git a/addons/web_planner/models/web_planner.py b/addons/web_planner/models/web_planner.py index ae16d429b30..a88720b9506 100644 --- a/addons/web_planner/models/web_planner.py +++ b/addons/web_planner/models/web_planner.py @@ -65,6 +65,8 @@ class Planner(models.Model): module = self.env['ir.module.module'].sudo().search([('name', '=', module_name)], limit=1) if module: params['id'] = module.id + else: + return "#show_enterprise" return "/web#%s" % (urlencode(params),) @api.model diff --git a/addons/web_planner/static/src/js/web_planner_common.js b/addons/web_planner/static/src/js/web_planner_common.js index 93bcf2bc775..ad27739f2c5 100644 --- a/addons/web_planner/static/src/js/web_planner_common.js +++ b/addons/web_planner/static/src/js/web_planner_common.js @@ -49,6 +49,7 @@ var PlannerDialog = Widget.extend({ category_selector: 'div[menu-category-id]', events: { 'click li a[href^="#"]:not([data-toggle="collapse"])': 'change_page', + 'click a[href^="#show_enterprise"]': 'show_enterprise', 'click button.mark_as_done': 'click_on_done', 'click a.btn-next': 'change_to_next_page', 'click .o_planner_close_block span': 'close_modal', @@ -420,7 +421,40 @@ var PlannerDialog = Widget.extend({ destroy: function() { this.$el.modal('hide'); return this._super.apply(this, arguments); - } + }, + show_enterprise: function(ev) { + ev.preventDefault(); + var message = $(QWeb.render('EnterpriseUpgrade')); + var buttons = [ + { + text: _t("Upgrade now"), + classes: 'btn-primary', + close: true, + click: this.confirm_upgrade, + }, + { + text: _t("Cancel"), + close: true, + }, + ]; + var dialog = new Dialog(this, { + size: 'medium', + buttons: buttons, + $content: $('
', { + html: message, + }), + title: _t("Odoo Enterprise"), + }).open(); + + // force dialog to be hover the planner + dialog.$el.parents('.modal').css('z-index', 1052); + return dialog; + }, + confirm_upgrade: function() { + new Model("res.users").call("search_count", [[["share", "=", false]]]).then(function(data) { + window.location = "https://www.odoo.com/odoo-enterprise/upgrade?utm_medium=community_upgrade&num_users=" + data; + }); + }, }); return { diff --git a/openerp/tests/common.py b/openerp/tests/common.py index 3cc9c918152..c4d17264d69 100644 --- a/openerp/tests/common.py +++ b/openerp/tests/common.py @@ -360,7 +360,7 @@ class HttpCase(TransactionCase): _logger.info("phantomjs: %s", line) if line == "ok": - break + return True def phantom_run(self, cmd, timeout): _logger.info('phantom_run executing %s', ' '.join(cmd)) @@ -373,8 +373,9 @@ class HttpCase(TransactionCase): phantom = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=None) except OSError: raise unittest.SkipTest("PhantomJS not found") + result = False try: - self.phantom_poll(phantom, timeout) + result = self.phantom_poll(phantom, timeout) finally: # kill phantomjs if phantom.exit() wasn't called in the test if phantom.poll() is None: @@ -383,6 +384,10 @@ class HttpCase(TransactionCase): self._wait_remaining_requests() # we ignore phantomjs return code as we kill it as soon as we have ok _logger.info("phantom_run execution finished") + self.assertTrue( + result, + "PhantomJS test completed without reporting success; " + "the log may contain errors or hints.") def _wait_remaining_requests(self): t0 = int(time.time())