SpreeTravel / odoo-saas-tools

Odoo (OpenERP) addons to provide SaaS
5 stars 4 forks source link

SaaS menu #5

Closed yelizariev closed 9 years ago

yelizariev commented 9 years ago

There is something wrong with SaaS menu. It is created in saas_portal and then used in all other modules, but it means that all of them should depend on saas_portal module which is incorrect.

Also, the same name for saas menu in databases of all types can confuse users.

So, my sugestion is use own menu with a different name for each type of database instead of simple "SaaS":

So, user sees name of menu and understand where he is. It also fixes the problem with dependencies.

kaerdsar commented 9 years ago

That's true. I'm not really sure it's so important to have saas_portal and saas_server as separeted modules. I saw your diagram and understand you allow to have many server saas thru one portal. I'm afraid this is a very specific situation, in the most of cases you just want a saas solution. We are going to found some others dependencies problems between server and portal, like features for oauth_application and saas_server.client. In my idea I would have just saas_portal (or server) and think the multi saas in other module or scenario.

yelizariev commented 9 years ago

One who needs just a saas solution can install both modules saas_portal and saas_server in one database or in a different databases, but in a single server (e.g. vps).

With one saas_portal and many saas_server the system is scalable. What saas owner should do when his single server if fulled and become slow?

Also, it usefull to have different servers from start:

So, I think, it's not very specific situation.

I think, it doesn't bring a lot of issues. Just keep in mind the scheme when you make updates in modules.

kaerdsar commented 9 years ago

Good point. I will check both modules and avoid dependencies, so we can keep your idea. Now, I have a new question: I added a plan model to know what kind of tenant the system will create, where is the right place for the tenant, saas_server or saas_portal? How do you know what server use when a new tenant is created, random?

yelizariev commented 9 years ago

Great!

Plans should be in saas_portal. With regards to tenants, I desined saas_server only to collect information from client databases (like file storage size, db storage size) and then from portal you can sync such data. So, all accounting, billing are made in saas_portal.

About choosing server. It's already random:

def book_then_signup(self, **post):
    saas_server_list = request.registry['ir.config_parameter'].get_param(request.cr, SUPERUSER_ID, 'saas_portal.saas_server_list')
    saas_server_list = saas_server_list.split(',')
    saas_server = saas_server_list[random.randint(0, len(saas_server_list)-1)]
yelizariev commented 9 years ago

Related PR: https://github.com/yelizariev/odoo-saas-tools/pull/2