From 58bc4842e076dc757cbe61257054ff8b3ca07dbc Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 8 Feb 2016 17:22:28 +0100 Subject: [PATCH 01/26] [FIX] portal_sale: Portal users can read taxes groups If a portal can read an `account.tax`, there is no reason he cannot read an `account.tax.group`. Without this read access on the tax groups, a portal user cannot print the invoice report from the portal, due to the `o._get_tax_amount_by_group()` call in the invoice report. opw-668973 --- addons/portal_sale/security/ir.model.access.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/portal_sale/security/ir.model.access.csv b/addons/portal_sale/security/ir.model.access.csv index 88cd0e961d3..4ca1fb4c2b9 100644 --- a/addons/portal_sale/security/ir.model.access.csv +++ b/addons/portal_sale/security/ir.model.access.csv @@ -8,6 +8,7 @@ access_account_journal,account.journal,account.model_account_journal,base.group_ access_product_list,product.pricelist,product.model_product_pricelist,base.group_portal,1,0,0,0 access_res_partner,res.partner,base.model_res_partner,base.group_portal,1,0,0,0 access_account_tax,account.tax,account.model_account_tax,base.group_portal,1,0,0,0 +access_account_tax_group,account.tax.group,account.model_account_tax_group,base.group_portal,1,0,0,0 access_res_partner_category,res.partner.category,base.model_res_partner_category,base.group_portal,1,0,0,0 access_product_attribute_portal,product.attribute portal,product.model_product_attribute,base.group_portal,1,0,0,0 access_product_attribute_value_portal,product.attribute value portal,product.model_product_attribute_value,base.group_portal,1,0,0,0 From dd52faaec0b9a0fc63242984b6da3023c5b8d302 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Mon, 8 Feb 2016 16:48:21 +0100 Subject: [PATCH 02/26] [FIX] website: reset request attribute When rerouting from a lang path token to the given route (eg: /en_US/route_path to /route_path) it is better to keep request variable clean. opw-668563 --- addons/website/models/ir_http.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/website/models/ir_http.py b/addons/website/models/ir_http.py index 9af3f55df3c..43e80ec3894 100644 --- a/addons/website/models/ir_http.py +++ b/addons/website/models/ir_http.py @@ -158,6 +158,7 @@ class ir_http(orm.AbstractModel): redirect.set_cookie('website_lang', request.lang) return redirect elif url_lang: + request.uid = None path.pop(1) return self.reroute('/'.join(path) or '/') From ac73871ee292430d771297d805698de5164b0345 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 9 Feb 2016 08:47:44 +0100 Subject: [PATCH 03/26] [FIX] doc: missing import --- doc/howtos/backend.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/howtos/backend.rst b/doc/howtos/backend.rst index 752a70b2e5e..2541fc2f07b 100644 --- a/doc/howtos/backend.rst +++ b/doc/howtos/backend.rst @@ -775,7 +775,7 @@ method should simply set the value of the field to compute on every record in .. code-block:: python import random - from openerp import models, fields + from openerp import models, fields, api class ComputedModel(models.Model): _name = 'test.computed' From 0948656a67d7c401984b92e2be58940020c2d55e Mon Sep 17 00:00:00 2001 From: Damien Bouvy Date: Mon, 8 Feb 2016 11:41:22 +0100 Subject: [PATCH 04/26] [FIX] payment_ogone: batch files expect ASCII encoding When registering a payment method using batch, ogone expects an ascii file. To avoid stipping characters like they do on Friday the 13th, let's use a normalize function to strip diacritics more or less properly. See https://payment-services.ingenico.com/int/en/ogone/support/guides/integration%20guides/batch --- addons/payment_ogone/models/ogone.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/payment_ogone/models/ogone.py b/addons/payment_ogone/models/ogone.py index 47d8cc49814..0a07315467f 100644 --- a/addons/payment_ogone/models/ogone.py +++ b/addons/payment_ogone/models/ogone.py @@ -7,6 +7,7 @@ from lxml import etree, objectify from openerp.tools.translate import _ from pprint import pformat import time +from unicodedata import normalize from urllib import urlencode import urllib2 import urlparse @@ -478,7 +479,7 @@ class PaymentMethod(osv.Model): 'TRANSACTION_CODE': 'ATR', 'OPERATION': 'SAL', 'NB_PAYMENTS': 1, # even if we do not actually have any payment, ogone want it to not be 0 - 'FILE': line, + 'FILE': normalize('NFKD', line).encode('ascii','ignore'), # Ogone Batch must be ASCII only 'REPLY_TYPE': 'XML', 'PSPID': acquirer.ogone_pspid, 'USERID': acquirer.ogone_userid, From 39b8330331c015efaff0616f5e60f24ab2827ee5 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Mon, 8 Feb 2016 15:42:35 +0100 Subject: [PATCH 05/26] [FIX] base: enable o2m test foreseen in 4de3f4c4 See 4de3f4c4baa45b6bc5d0d2ede158d29ca4f99d57 --- openerp/addons/base/tests/test_osv_expression.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/tests/test_osv_expression.yml b/openerp/addons/base/tests/test_osv_expression.yml index 482e34a1a51..fcaf7c2cad0 100644 --- a/openerp/addons/base/tests/test_osv_expression.yml +++ b/openerp/addons/base/tests/test_osv_expression.yml @@ -428,7 +428,7 @@ assert [p1,p2] == res_partner.search(cr, uid, [('user_ids', 'in', [u1a,u2])]), "o2m IN matches any on the right side" all_partners = res_partner.search(cr, uid, []) assert (set(all_partners) - set([p1])) == set(res_partner.search(cr, uid, [('user_ids', 'not in', u1a)])), "o2m NOT IN matches none on the right side" - # For 9.0: assert (set(all_partners) - set([p1])) == set(res_partner.search(cr, uid, [('user_ids', '!=', 'Dédé Boitaclou')])), "o2m NOT IN matches none on the right side" + assert (set(all_partners) - set([p1])) == set(res_partner.search(cr, uid, [('user_ids', '!=', 'Dédé Boitaclou')])), "o2m NOT IN matches none on the right side" assert (set(all_partners) - set([p1,p2])) == set(res_partner.search(cr, uid, [('user_ids', 'not in', [u1b, u2])])), "o2m NOT IN matches none on the right side" From f0dcb4493bca0b789ba84db37a79b7da48520831 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 9 Feb 2016 10:17:31 +0100 Subject: [PATCH 06/26] [FIX] doc: iterating on a recordset --- doc/howtos/backend.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/howtos/backend.rst b/doc/howtos/backend.rst index 2541fc2f07b..e89d2253328 100644 --- a/doc/howtos/backend.rst +++ b/doc/howtos/backend.rst @@ -808,7 +808,7 @@ field whenever some of its dependencies have been modified:: @api.depends('value') def _compute_name(self): for record in self: - self.name = "Record with value %s" % self.value + record.name = "Record with value %s" % record.value .. exercise:: Computed fields From 8a2b172c3e1765c3fe64bb64b832d0b42866b807 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Fri, 5 Feb 2016 14:45:51 +0100 Subject: [PATCH 07/26] [FIX] addons: fix usage of decorators `api.v7`/`api.v8` --- addons/account/models/account_invoice.py | 2 +- addons/account/models/account_move.py | 9 +++------ addons/account_tax_python/account_tax_python.py | 2 +- addons/procurement/procurement.py | 5 ----- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 2350e21dc35..447d26b3c6d 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -960,7 +960,7 @@ class AccountInvoice(models.Model): recs = self.browse(cr, uid, ids, context) pay_journal = self.pool.get('account.journal').browse(cr, uid, pay_journal_id, context=context) writeoff_acc = self.pool.get('account.account').browse(cr, uid, writeoff_acc_id, context=context) - return recs.pay_and_reconcile(pay_journal, pay_amount, date, writeoff_acc) + return AccountInvoice.pay_and_reconcile(recs, pay_journal, pay_amount, date, writeoff_acc) @api.multi def _track_subtype(self, init_values): diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 6fdcf5cc8b8..3838b6a830e 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -599,8 +599,9 @@ class AccountMoveLine(models.Model): @api.v7 def prepare_move_lines_for_reconciliation_widget(self, cr, uid, line_ids, target_currency_id=False, context=None): + recs = self.browse(cr, uid, line_ids, context) target_currency = target_currency_id and self.pool.get('res.currency').browse(cr, uid, target_currency_id, context=context) or False - return self.browse(cr, uid, line_ids, context).prepare_move_lines_for_reconciliation_widget(target_currency=target_currency) + return AccountMoveLine.prepare_move_lines_for_reconciliation_widget(recs, target_currency=target_currency) @api.v8 def prepare_move_lines_for_reconciliation_widget(self, target_currency=False, target_date=False): @@ -695,11 +696,7 @@ class AccountMoveLine(models.Model): accounts = self.pool['account.account'].browse(cr, uid, datum['id'], context=context) self.pool['account.account'].mark_as_reconciled(cr, uid, accounts.ids, context=context) - @api.v7 - def process_reconciliation(self, cr, uid, mv_line_ids, new_mv_line_dicts, context=None): - return self.browse(cr, uid, mv_line_ids, context).process_reconciliation(new_mv_line_dicts) - - @api.v8 + @api.multi def process_reconciliation(self, new_mv_line_dicts): """ Create new move lines from new_mv_line_dicts (if not empty) then call reconcile_partial on self and new move lines diff --git a/addons/account_tax_python/account_tax_python.py b/addons/account_tax_python/account_tax_python.py index 42a83610f79..57527de81f8 100644 --- a/addons/account_tax_python/account_tax_python.py +++ b/addons/account_tax_python/account_tax_python.py @@ -52,7 +52,7 @@ class AccountTaxPython(models.Model): partner = partner_id and self.pool.get('res.partner').browse(cr, uid, partner_id, context=context) or None ids = isinstance(ids, (int, long)) and [ids] or ids recs = self.browse(cr, uid, ids, context=context) - return recs.compute_all(price_unit, currency, quantity, product, partner) + return AccountTaxPython.compute_all(recs, price_unit, currency, quantity, product, partner) class AccountTaxTemplatePython(models.Model): _inherit = 'account.tax.template' diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index ab4fe3c04cc..6c53bd5d545 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -182,11 +182,6 @@ class procurement_order(osv.osv): def reset_to_confirmed(self, cr, uid, ids, context=None): return self.write(cr, uid, ids, {'state': 'confirmed'}, context=context) - @api.v8 - def run(self, autocommit=False): - return self._model.run(self._cr, self._uid, self.ids, autocommit=False, context=self._context) - - @api.v7 def run(self, cr, uid, ids, autocommit=False, context=None): for procurement_id in ids: #we intentionnaly do the browse under the for loop to avoid caching all ids which would be resource greedy From 3ea3348d20339c08b9a5f12323d7c2a75a3b5e16 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Tue, 9 Feb 2016 11:02:48 +0100 Subject: [PATCH 08/26] [FIX] website_crm: fix medium_id for website sent form In ddac26c `crm.crm_medium_website` was replaced by `utm.utm_medium_website`. There was one place where it was not reverberated so the medium_id was always unset in that instance (a crm.lead created from a website form). opw-668853 note: no need to forward port after saas-6 (code change) --- addons/website_crm/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_crm/controllers/main.py b/addons/website_crm/controllers/main.py index 3b1b2e1d803..a834589e1ad 100644 --- a/addons/website_crm/controllers/main.py +++ b/addons/website_crm/controllers/main.py @@ -60,7 +60,7 @@ class contactus(http.Controller): post_description = [] # Info to add after the message values = {} - values['medium_id'] = request.registry['ir.model.data'].xmlid_to_res_id(request.cr, SUPERUSER_ID, 'crm.crm_medium_website') + values['medium_id'] = request.registry['ir.model.data'].xmlid_to_res_id(request.cr, SUPERUSER_ID, 'utm.utm_medium_website') values['team_id'] = request.registry['ir.model.data'].xmlid_to_res_id(request.cr, SUPERUSER_ID, 'website.salesteam_website_sales') for field_name, field_value in kwargs.items(): From 37dc9303a6c15137c1bbb48ce740b3c2023b741c Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Tue, 9 Feb 2016 10:43:00 +0100 Subject: [PATCH 09/26] [FIX] website_crm: fix medium_id for website sent form In ddac26c `crm.crm_medium_website` was replaced by `utm.utm_medium_website`. There was one place where it was not reverberated so the medium_id was always unset in that instance (a crm.lead created from a website form). opw-668853 note: equivalent of saas-6's 3ea3348 --- addons/website_crm/models/crm_lead.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_crm/models/crm_lead.py b/addons/website_crm/models/crm_lead.py index ce1fad60cdd..27bf6330a1b 100644 --- a/addons/website_crm/models/crm_lead.py +++ b/addons/website_crm/models/crm_lead.py @@ -4,5 +4,5 @@ class Lead(models.Model): _inherit = 'crm.lead' def website_form_input_filter(self, request, values): - values.setdefault('medium_id', request.registry['ir.model.data'].xmlid_to_res_id(request.cr, SUPERUSER_ID, 'crm.crm_medium_website')) + values.setdefault('medium_id', request.registry['ir.model.data'].xmlid_to_res_id(request.cr, SUPERUSER_ID, 'utm.utm_medium_website')) return values From d8503b68a258f158d1decafafa9b1843f4ca60f8 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 8 Feb 2016 17:21:24 +0100 Subject: [PATCH 10/26] [FIX] sale: invoicable line When invoicing the invoiceable lines on a SO, if there is no invoicable lines then a UserError is raised to avoid to create an empty invoice. opw:668844 --- addons/sale/i18n/sale.pot | 6 ++++++ addons/sale/sale.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/addons/sale/i18n/sale.pot b/addons/sale/i18n/sale.pot index e158af64e08..2ce03cb92df 100644 --- a/addons/sale/i18n/sale.pot +++ b/addons/sale/i18n/sale.pot @@ -1093,6 +1093,12 @@ msgstr "" msgid "Please define an accounting sale journal for this company." msgstr "" +#. module: sale +#: code:addons/sale/sale.py:316 +#, python-format +msgid "There is no invoicable line." +msgstr "" + #. module: sale #: code:addons/sale/sale.py:654 #, python-format diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 109bec1cdf1..17a966b32e5 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -312,6 +312,8 @@ class SaleOrder(models.Model): line.invoice_line_create(invoices[group_key].id, line.qty_to_invoice) for invoice in invoices.values(): + if not invoice.invoice_line_ids: + raise UserError(_('There is no invoicable line.')) # If invoice is negative, do a refund invoice instead if invoice.amount_untaxed < 0: invoice.type = 'out_refund' From 98ccb8539e8e3470aab4bbba6484562bf3e69088 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 9 Feb 2016 10:44:08 +0100 Subject: [PATCH 11/26] [FIX] sale: invoice_status of a SO line from an advance payment When making an advance payment, the SO line created from this payment must have a qty_invoiced equal to 0 and the invoice line created for this SO line must have a quantity equal to 0. In this way, the SO line created is "Fully invoiced". opw:668844 --- addons/sale/wizard/sale_make_invoice_advance.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py index 73798aa4695..a66bd83add9 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.py +++ b/addons/sale/wizard/sale_make_invoice_advance.py @@ -81,7 +81,7 @@ class SaleAdvancePaymentInv(models.TransientModel): 'origin': order.name, 'account_id': account_id, 'price_unit': amount, - 'quantity': 1.0, + 'quantity': 0.0, 'discount': 0.0, 'uom_id': self.product_id.uom_id.id, 'product_id': self.product_id.id, @@ -131,6 +131,7 @@ class SaleAdvancePaymentInv(models.TransientModel): 'product_uom': self.product_id.uom_id.id, 'product_id': self.product_id.id, 'tax_id': [(6, 0, self.product_id.taxes_id.ids)], + 'qty_invoiced': 0.0, }) self._create_invoice(order, so_line, amount) if self._context.get('open_invoices', False): From b0ce65daccb1918f99de598916424845e23a586e Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 9 Feb 2016 14:32:08 +0100 Subject: [PATCH 12/26] [FIX] sale: quantity in invoice line from invoicing Introduced by 98ccb8539e8e3470aab4bbba6484562bf3e69088 --- addons/sale/wizard/sale_make_invoice_advance.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py index a66bd83add9..73798aa4695 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.py +++ b/addons/sale/wizard/sale_make_invoice_advance.py @@ -81,7 +81,7 @@ class SaleAdvancePaymentInv(models.TransientModel): 'origin': order.name, 'account_id': account_id, 'price_unit': amount, - 'quantity': 0.0, + 'quantity': 1.0, 'discount': 0.0, 'uom_id': self.product_id.uom_id.id, 'product_id': self.product_id.id, @@ -131,7 +131,6 @@ class SaleAdvancePaymentInv(models.TransientModel): 'product_uom': self.product_id.uom_id.id, 'product_id': self.product_id.id, 'tax_id': [(6, 0, self.product_id.taxes_id.ids)], - 'qty_invoiced': 0.0, }) self._create_invoice(order, so_line, amount) if self._context.get('open_invoices', False): From 07a19b7949ff9d5d03fab659157d975601954e0b Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 9 Feb 2016 15:18:20 +0100 Subject: [PATCH 13/26] [FIX] doc: deprecated tree parameter colors --- doc/howtos/backend/exercise-advanced-treeview | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/howtos/backend/exercise-advanced-treeview b/doc/howtos/backend/exercise-advanced-treeview index 53b82c8abce..3d674bb25f2 100644 --- a/doc/howtos/backend/exercise-advanced-treeview +++ b/doc/howtos/backend/exercise-advanced-treeview @@ -10,7 +10,7 @@ Index: addons/openacademy/views/openacademy.xml openacademy.session - -+ ++ + From 328d34a22168bd9106dde810981bfd838b675a5c Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 9 Feb 2016 13:44:46 +0100 Subject: [PATCH 14/26] [FIX] base: active field of a related partner The related partner created from a user must be active=false if the user.active=false opw:668984 --- openerp/addons/base/res/res_users.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openerp/addons/base/res/res_users.py b/openerp/addons/base/res/res_users.py index fcdc0ce1045..5ae88f74145 100644 --- a/openerp/addons/base/res/res_users.py +++ b/openerp/addons/base/res/res_users.py @@ -336,6 +336,7 @@ class res_users(osv.osv): def create(self, cr, uid, vals, context=None): user_id = super(res_users, self).create(cr, uid, vals, context=context) user = self.browse(cr, uid, user_id, context=context) + user.partner_id.active = user.active if user.partner_id.company_id: user.partner_id.write({'company_id': user.company_id.id}) return user_id From 980cc6363e9788d5ef3ebf0c009972fd7a5c4386 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 9 Feb 2016 15:56:49 +0100 Subject: [PATCH 15/26] [FIX] doc: missing mode attribute in calendar doc --- doc/reference/views.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/reference/views.rst b/doc/reference/views.rst index bbc82ffeda1..c5a40dcdb61 100644 --- a/doc/reference/views.rst +++ b/doc/reference/views.rst @@ -971,6 +971,9 @@ calendar view are: ``all_day`` name of a boolean field on the record indicating whether the corresponding event is flagged as day-long (and duration is irrelevant) +``mode`` + Default display mode when loading the calendar. + Possible attributes are: ``day``, ``week``, ``month`` .. todo:: From 5c853870bcae481af849f29f8ee61e430b253929 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Tue, 9 Feb 2016 15:05:46 +0100 Subject: [PATCH 16/26] [IMP] website_crm: set utm medium override Website To set utm values (medium, source and campaign) on created record, the system use default function which check cookies and other funny things. But for website form creating a record, the medium value would be overrided always to Website whilst that should be a fallback (and the set medium should have priority). closes #10848 opw-668853 --- addons/website_crm/models/crm_lead.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/website_crm/models/crm_lead.py b/addons/website_crm/models/crm_lead.py index 27bf6330a1b..b9b29aa37ab 100644 --- a/addons/website_crm/models/crm_lead.py +++ b/addons/website_crm/models/crm_lead.py @@ -4,5 +4,9 @@ class Lead(models.Model): _inherit = 'crm.lead' def website_form_input_filter(self, request, values): - values.setdefault('medium_id', request.registry['ir.model.data'].xmlid_to_res_id(request.cr, SUPERUSER_ID, 'utm.utm_medium_website')) + values['medium_id'] = ( + values.get('medium_id') or + self.default_get(['medium_id']).get('medium_id') or + self.sudo().env['ir.model.data'].xmlid_to_res_id('utm.utm_medium_website') + ) return values From 50a4ca31f8de8bb427cb1d0f182322a3d1e04486 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 9 Feb 2016 15:40:19 +0100 Subject: [PATCH 17/26] [IMP] mail: remove deprecated annoucement bar This bar was never displayed as the remote css was always empty. When using the enterprise web client, the printing stylesheet show the target of links ( tags) between parentheses, including the one from the annoucement bar that should be kept hidden. --- addons/mail/__openerp__.py | 1 - addons/mail/static/src/js/announcement.js | 68 ------------------- addons/mail/static/src/less/announcement.less | 7 -- addons/mail/static/src/xml/announcement.xml | 18 ----- addons/mail/views/mail_templates.xml | 2 - 5 files changed, 96 deletions(-) delete mode 100644 addons/mail/static/src/js/announcement.js delete mode 100644 addons/mail/static/src/less/announcement.less delete mode 100644 addons/mail/static/src/xml/announcement.xml diff --git a/addons/mail/__openerp__.py b/addons/mail/__openerp__.py index 8af27a4f011..0a3b34bf163 100644 --- a/addons/mail/__openerp__.py +++ b/addons/mail/__openerp__.py @@ -64,6 +64,5 @@ Main Features 'static/src/xml/systray.xml', 'static/src/xml/thread.xml', 'static/src/xml/chat_window.xml', - 'static/src/xml/announcement.xml', ], } diff --git a/addons/mail/static/src/js/announcement.js b/addons/mail/static/src/js/announcement.js deleted file mode 100644 index 61e6ac1159d..00000000000 --- a/addons/mail/static/src/js/announcement.js +++ /dev/null @@ -1,68 +0,0 @@ -odoo.define('mail.announcement', function (require) { -"use strict"; - -var core = require('web.core'); -var Model = require('web.DataModel'); -var session = require('web.session'); -var WebClient = require('web.WebClient'); - -var QWeb = core.qweb; - -WebClient.include({ - show_application: function() { - return $.when(this._super.apply(this, arguments)).then(this.proxy('show_announcement_bar')); - }, - _ab_location: function(dbuuid) { - return _.str.sprintf('https://services.openerp.com/openerp-enterprise/ab/css/%s.css', dbuuid); - }, - show_announcement_bar: function() { - if (session.get_cookie('ab') === 'c') { - return; - } - var self = this; - var config_parameter = new Model('ir.config_parameter'); - $(QWeb.render('WebClient.announcement_bar')).prependTo($('body')); - var $bar = $('#announcement_bar_table'); - - return config_parameter.call('get_param', ['database.uuid', false]).then(function(dbuuid) { - if (!dbuuid) { - return; - } - var $link = $bar.find('.url a'); - $link.attr('href', _.str.sprintf('%s/%s', $link.attr('href'), dbuuid)); - var $css = $('').attr({ - rel : 'stylesheet', - type: 'text/css', - media: 'screen', - href: self._ab_location(dbuuid) - }); - $css.on('load', function() { - var close = function() { - var ttl = 7*24*60*60; - session.set_cookie('ab', 'c', ttl); - $bar.slideUp(); - setTimeout(function () { - $('.openerp_webclient_container').css('height', 'calc(100% - 34px)'); - }, 400); - }; - /* - We need a timeout of at least 350ms because the announcement bar appears - with an animation of 350ms and the computed height might be wrong if we don't wait - */ - setTimeout(function(){ - var height = $('#announcement_bar_table').outerHeight() - + $('#oe_main_menu_navbar').outerHeight(); - $('.openerp_webclient_container').css('height', 'calc(100% - ' + height + 'px)'); - $bar.find('.close').on('click', close); - self.trigger('ab_loaded', $bar); - }, 400); - }); - - $('head').append($css); - }).fail(function(result, ev){ - ev.preventDefault(); - }); - } -}); - -}); diff --git a/addons/mail/static/src/less/announcement.less b/addons/mail/static/src/less/announcement.less deleted file mode 100644 index 6efcfb69adb..00000000000 --- a/addons/mail/static/src/less/announcement.less +++ /dev/null @@ -1,7 +0,0 @@ -.openerp .annoucement_bar { - display: none; -} - -#announcement_bar_table > table { - width: 100%; -} \ No newline at end of file diff --git a/addons/mail/static/src/xml/announcement.xml b/addons/mail/static/src/xml/announcement.xml deleted file mode 100644 index 46397861992..00000000000 --- a/addons/mail/static/src/xml/announcement.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - -
- - - - -
- - - - - -
-
-
-
diff --git a/addons/mail/views/mail_templates.xml b/addons/mail/views/mail_templates.xml index 8afb474e9f2..666adf1400a 100644 --- a/addons/mail/views/mail_templates.xml +++ b/addons/mail/views/mail_templates.xml @@ -4,7 +4,6 @@