[PORT] disable_odoo_online. [REF] remove obsolete code. OCA convention. - #583
Conversation
| Images | ||
| ------ | ||
|
|
||
| * Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_. |
There was a problem hiding this comment.
If you dont need the OCA logo, no need to provide the credits
| _inherit = 'publisher_warranty.contract' | ||
|
|
||
| @api.multi | ||
| def update_notification(self, cron_mode=True, context=None): |
There was a problem hiding this comment.
Asking myself whether this is legal for people using EE.
For them it is not allowed to temper with the notification system.
This makes this module IMO not usable for them while the other features could make sense.
Would it be an option to split this function out of the module in a separate one?
There was a problem hiding this comment.
As suggested by Odoo staff, we made similar feature in web_debranding optional, but don't allow to switch it off (i.e. we always send request) for enterprise users.
Code to check whether it enterprise:
from odoo.release import version_info
is_enterprise = version_info[5] == 'e'
There was a problem hiding this comment.
I added the test.
| # Copyright (C) 2013 Therp BV (<http://therp.nl>). | ||
| # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
|
||
| from openerp import api, models |
|
disable_odoo_online used to remove user menu entries (top-right drop-down menu) such as "My odoo.com account"... but you dropped that part, so after installation of the module on v10, the menu entry "My odoo.com account" is still present. I would prefer to keep that part and remove such user menu entries. |
| _inherit = 'publisher_warranty.contract' | ||
|
|
||
| @api.multi | ||
| def update_notification(self, cron_mode=True, context=None): |
There was a problem hiding this comment.
Almost seems like Odoo SA is shooting themselves in the foot by using a method available in Community in order to phone home in Enterprise. Solution seems sound though.
Also, think we can drop the context arg?
There was a problem hiding this comment.
Yes wirh api.multi decorator we have access to context from self.env.context
|
@alexis-via : Thanks ! I didn't understand this part of code. I guessed it was obsolete. thanks for pointing this problem. Fixed. |
alexis-via
left a comment
There was a problem hiding this comment.
Code review and test. Thanks for the work !
|
👍 Thanks for the rework! |
…n. (OCA#583) * [PORT] disable_odoo_online. [REF] remove obsolete code. OCA convention. * [FIX] restauring old feature * [IMP] do not disable some feature for Enterprise Edition. [REF] some improvements
…n. (OCA#583) * [PORT] disable_odoo_online. [REF] remove obsolete code. OCA convention. * [FIX] restauring old feature * [IMP] do not disable some feature for Enterprise Edition. [REF] some improvements
Syncing from upstream OCA/server-tools (11.0)
Thanks for your reviews.
cc @StefanRijnhart, @hbrunn.