Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] add ability to unlink databases from subscription more easily #28614

Open
wants to merge 1 commit into
base: 10.0
from

Conversation

Projects
None yet
7 participants

@Goaman Goaman requested a review from antonylesuisse Nov 13, 2018

@Goaman Goaman force-pushed the odoo-dev:10.0-force-unlink-database-nby branch Nov 13, 2018

@C3POdoo C3POdoo added the RD label Nov 13, 2018

@Goaman Goaman force-pushed the odoo-dev:10.0-force-unlink-database-nby branch Nov 19, 2018

@Goaman Goaman force-pushed the odoo-dev:10.0-force-unlink-database-nby branch Dec 13, 2018

@robodoo robodoo added the seen 🙂 label Dec 13, 2018

@tbe-odoo tbe-odoo self-requested a review Jan 15, 2019

@tbe-odoo
Copy link
Contributor

tbe-odoo left a comment

Hello : )

One big issue here is that we never changed the returned type and signature of a function in a stable version.
By storing as system parameters the values returned by the Publisher Warranty the change can be considered stable 👍

addons/mail/models/update.py Outdated

except Exception:
if cron_mode:
return False # we don't want to see any stack trace in cron
else:
raise
return True
return enterprise_info

This comment has been minimized.

@tbe-odoo

tbe-odoo Jan 15, 2019

Contributor

We do not change the return type of a function in standard.

addons/mail/models/update.py Outdated
@@ -116,10 +117,15 @@ def update_notification(self, cron_mode=True):
self.env['ir.config_parameter'].sudo().set_param('database.expiration_date', result['enterprise_info'].get('expiration_date'), ['base.group_user'])
self.env['ir.config_parameter'].sudo().set_param('database.expiration_reason', result['enterprise_info'].get('expiration_reason', 'trial'), ['base.group_system'])
self.env['ir.config_parameter'].sudo().set_param('database.enterprise_code', result['enterprise_info'].get('enterprise_code'), ['base.group_user'])
if result['enterprise_info'].get('database_already_linked_subscription_url'):
enterprise_info = {
'database_already_linked_subscription_url': result['enterprise_info'].get('database_already_linked_subscription_url'),

This comment has been minimized.

@tbe-odoo

tbe-odoo Jan 15, 2019

Contributor

Wouldn't it be better to store these values in ir.config_parameter just like we do above?

@Goaman Goaman force-pushed the odoo-dev:10.0-force-unlink-database-nby branch Jan 21, 2019

@Goaman Goaman force-pushed the odoo-dev:10.0-force-unlink-database-nby branch Jan 31, 2019

@Goaman

This comment has been minimized.

Copy link
Contributor Author

Goaman commented Jan 31, 2019

@tbe-odoo updated

Show resolved Hide resolved addons/mail/models/update.py Outdated
Show resolved Hide resolved addons/mail/models/update.py Outdated
Show resolved Hide resolved addons/mail/models/update.py Outdated
addons/mail/models/update.py Outdated
@@ -116,6 +117,11 @@ def update_notification(self, cron_mode=True):
self.env['ir.config_parameter'].sudo().set_param('database.expiration_date', result['enterprise_info'].get('expiration_date'), ['base.group_user'])
self.env['ir.config_parameter'].sudo().set_param('database.expiration_reason', result['enterprise_info'].get('expiration_reason', 'trial'), ['base.group_system'])
self.env['ir.config_parameter'].sudo().set_param('database.enterprise_code', result['enterprise_info'].get('enterprise_code'), ['base.group_user'])
if result['enterprise_info'].get('database_already_linked_subscription_url'):

This comment has been minimized.

@tbe-odoo

tbe-odoo Feb 1, 2019

Contributor

You should add an "else" statement where it removes the database.already_linked_subscription_url and database_already_linked_subscription_url

Otherwise the customer will always see that his database is linked to an other one when he should renew his subscription

This comment has been minimized.

@Goaman

Goaman Feb 4, 2019

Author Contributor

I removed the if and used result[...].get(...) so that when it is not defined, it equal to None. Because it is None, set_param will unlink the system parameter.

@Goaman Goaman force-pushed the odoo-dev:10.0-force-unlink-database-nby branch Feb 4, 2019

@Goaman

This comment has been minimized.

Copy link
Contributor Author

Goaman commented Feb 4, 2019

updated @tbe-odoo

@tbe-odoo
Copy link
Contributor

tbe-odoo left a comment

Well played :)

@tbe-odoo

This comment has been minimized.

Copy link
Contributor

tbe-odoo commented Feb 5, 2019

@robodoo robodoo added the r+ 👌 label Feb 5, 2019

@mart-e

This comment has been minimized.

Copy link
Contributor

mart-e commented Feb 6, 2019

@Goaman please amend your commit to use your odoo email address as author to get a gree cla verification

@tbe-odoo

This comment has been minimized.

Copy link
Contributor

tbe-odoo commented Feb 7, 2019

@robodoo robodoo added CI 🤖 and removed r+ 👌 labels Feb 7, 2019

@tbe-odoo tbe-odoo requested review from KangOl and julienlegros Feb 7, 2019

@Goaman Goaman force-pushed the odoo-dev:10.0-force-unlink-database-nby branch Feb 7, 2019

@robodoo robodoo removed the CI 🤖 label Feb 7, 2019

@Goaman Goaman force-pushed the odoo-dev:10.0-force-unlink-database-nby branch Feb 7, 2019

@robodoo robodoo added the CI 🤖 label Feb 7, 2019

@tbe-odoo tbe-odoo force-pushed the odoo-dev:10.0-force-unlink-database-nby branch Feb 28, 2019

@robodoo robodoo removed the CI 🤖 label Feb 28, 2019

@tbe-odoo tbe-odoo force-pushed the odoo-dev:10.0-force-unlink-database-nby branch Feb 28, 2019

@robodoo robodoo added the CI 🤖 label Feb 28, 2019

@tbe-odoo

This comment has been minimized.

Copy link
Contributor

tbe-odoo commented Mar 12, 2019

@robodoo robodoo added the r+ 👌 label Mar 12, 2019

@robodoo

This comment has been minimized.

Copy link
Contributor

robodoo commented Mar 12, 2019

Linked pull request(s) odoo/enterprise#3045 not ready. Linked PRs are not staged until all of them are ready.

@tbe-odoo tbe-odoo force-pushed the odoo-dev:10.0-force-unlink-database-nby branch Mar 12, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 r+ 👌 labels Mar 12, 2019

@tbe-odoo tbe-odoo force-pushed the odoo-dev:10.0-force-unlink-database-nby branch to 8e55dba Mar 14, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Mar 14, 2019

@tbe-odoo tbe-odoo force-pushed the odoo-dev:10.0-force-unlink-database-nby branch from 8e55dba to eb76dd0 Mar 18, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Mar 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.