Giter Club home page Giter Club logo

Comments (7)

ska-ibees avatar ska-ibees commented on July 18, 2024

Update!
Is it possible to pass user name and password in the GET request to avoid basic authentication from Alfresco server?

This has been achieved by using proxy module and using alfresco's user name and passwords for each user in odoo. Now, each Odoo user has fields to hold alfresco's login details that are passed into proxy module.

For the second point, still trying to find a solution... Lets see.

from alfodoo.

cshardey avatar cshardey commented on July 18, 2024

Please how do I make use of the proxy to achieve the odoo user authentication.

from alfodoo.

lmignon avatar lmignon commented on July 18, 2024

@cshardey The proxy is an addon that forward the requests from the alfodoo widget to alfresco by using a specific alfresco user configued on the cmis_backend. To use it, you just need to install it and configure the cmis backend.

from alfodoo.

cshardey avatar cshardey commented on July 18, 2024

from alfodoo.

lmignon avatar lmignon commented on July 18, 2024

@go4site

1. Is it possible to pass user name and password in the GET request to avoid basic authentication from Alfresco server?
   Some thing as described in Alfresco's web scripts.

GET /alfresco/s/api/login?u={username}&pw={password?}
I hope this way we can avoid browser base "basic authentication" by setting user names and passwords for each Odoo's user.

Is it really safe to put the password into an HTTTP GET request....
It's also possible to put in place an SSO to avoid multiple authentication but it's a lot of work.

1. In the crm.lead, i want to automate creation of folders  when a new opportunity is created with below flow:

2. Folders needs to be created without "Create folder in DMS" button.

3. Two folders one for Sale and other for Design department with group level access rights on each. Like Sales and Design should be able to view each other's folders but have write/delete access on their respective folders.
   Is there any possibility to define such template?

We already have implemented such requirements for our customers. Alfodoo wth cmislib provides the apis to put in place these functionalities. For example, if you want to automatically create the folder when an instance of a model is created you just need to write something like:

@api.model
def create(self, vals):
    res = super().create(vals)
    self._fields['cmis_folder'].create_value(res)
    return res

from alfodoo.

ska-ibees avatar ska-ibees commented on July 18, 2024

@lmignon Thanks for the detailed response.
Actually, what i wanted was to automatically create a folder on odoo record creation (Project task in our case) for each department in our company. Like Sales, Design, Production etc.
Also, it was important to give ownership/permissions on folders and files to individual odoo users instead of a single user created in CMIS backend.

Good news is that somehow, this has already been achieved by doing some hacks.

  1. Manual Mapping of Alfresco Users with Odoo:

  2. First, users are created in alfresco with their groups. Like a group "Sales Department" having user accounts associated with it.
    We added new username and password fields in Odoo's user form to hold account info created in alfresco. So, now each Odoo user has account details to be used for alfresco.

  3. By hacking username and password in cmis_web_proxy module:

@api.model
@tools.cache('backend_id')
def get_proxy_info_by_id(self, backend_id):
backend = self.get_by_id(backend_id)
return {
'is_cmis_proxy': backend.is_cmis_proxy,
'apply_odoo_security': backend.apply_odoo_security,
'username': backend.username,
'password': backend.password,

'proxy_location': backend.proxy_location,
'location': backend.location,
'cmis_repository': backend.get_cmis_repository()
}
We replaced backend.username and backend.password with our newly created fields in user's form.
By doing this, now content is created/edited with the ownership of currently logged in Odoo user and Not with one in cmis backend.

  1. Auto creation of Folders on Odoo's record creation

"Create folder in DMS" was automated using:

var view = this.getParent();
if(!value && view.activeActions.edit == true){
this.on_click_create_root();
}

We are able to create default folder structure. For this we tried something in the form widget as below:

set_root_folder_id: function (folderId) {
            var self = this;
            if (self.root_folder_id === folderId) {
                return;
            }
            self.root_folder_id = folderId;
            $.when(self.cmis_session_initialized, self.table_rendered).done(function () {
                self.load_cmis_repositories().done(function () {
                    self.reset_breadcrumb();
                    self.display_folder(0, self.root_folder_id);
                    // change by rida
                    var cmis_session =  self.cmis_session;
                    cmis_session
                    .getChildren(self.root_folder_id, '')
                    .ok(function (data) {
                        if(data.numItems == 0){
                            var sales_folder = '1. Sales';
                            var designer_folder = '2. Graphic Design';
                            var production_folder = '3. Production';
                            var qa_folder = '4. Quality Control';
                            var shipping_folder = '5. Shipping';
                        
                            cmis_session.createFolder(folderId, sales_folder).ok(function (new_cmisobject) {
                                    var cmis_node_create = self.getParent().trigger('cmis_node_created', [new_cmisobject]);
                                    self.refresh_datatable();
                            });

                            cmis_session.createFolder(folderId, designer_folder).ok(function (new_cmisobject) {
                                    var cmis_node_create = self.getParent().trigger('cmis_node_created', [new_cmisobject]);
                                    self.refresh_datatable();
                            });

                            cmis_session.createFolder(folderId, production_folder).ok(function (new_cmisobject) {
                                    var cmis_node_create = self.getParent().trigger('cmis_node_created', [new_cmisobject]);
                                    self.refresh_datatable();
                            });

                            cmis_session.createFolder(folderId, qa_folder).ok(function (new_cmisobject) {
                                var cmis_node_create = self.getParent().trigger('cmis_node_created', [new_cmisobject]);
                                self.refresh_datatable();
                        });

                        cmis_session.createFolder(folderId, shipping_folder).ok(function (new_cmisobject) {
                            var cmis_node_create = self.getParent().trigger('cmis_node_created', [new_cmisobject]);
                            self.refresh_datatable();
                    });
                        }
                    });
                });
            });
        },

Conclusion:
We are having an integrated document system with Odoo with below features.

  1. For every Project Task, each department has it's own document folder. No one is allowed to edit/delete these folders.
  2. Within all folders, our employees can view and download but can not edit or delete any file that they don't own. This mean each Odoo user is mapped with a user created in Alfresco.
    All permissions are handled on Site level using Groups.

Thanks again for sharing such a robust and useful solution to the community!

from alfodoo.

github-actions avatar github-actions commented on July 18, 2024

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

from alfodoo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.