Giter Club home page Giter Club logo

alfodoo's Introduction

Pre-commit Status Build Status codecov

Alfodoo

Alfodoo is a set of addons to seamlessly integrate an external Document Management System with Odoo.

Available addons

addon version maintainers summary
cmis_alf 16.0.1.0.0 Alfresco extension for the CMIS Connector
cmis_field 16.0.1.0.0 Specialized field to work with a CMIS server
cmis_report_write 16.0.1.0.1 Save your report into a CMIS container
cmis_web 16.0.1.0.0 CMIS Web browser widget
cmis_web_alf 16.0.1.0.0 Extensions to the Alfodoo web widgets for Alfresco

Unported addons

addon version maintainers summary
cmis_web_bus 16.0.1.0.0 (unported) Cmis Web Bus
cmis_web_proxy 14.0.1.0.1 (unported) Odoo as proxy server for your cmis requests.
cmis_web_proxy_alf 14.0.1.0.1 (unported) Alfodoo CMIS Web Proxy for Alfresco
cmis_web_report_write 16.0.1.0.0 (unported) Cmis Web Report Write
cmis_web_report_write_alf 14.0.1.0.1 (unported) Cmis Web Report Write Alf

Licenses

This repository is licensed under AGPL-3.0.

However, each module can have a totally different license, as long as they adhere to ACSONE policy. Consult each module's __manifest__.py file, which contains a license key that explains its license.


alfodoo's People

Contributors

apineux avatar benwillig avatar ccasula avatar francomaxime avatar glitchov avatar gva-acsone avatar jdoutreloux avatar lmignon avatar marielejeune avatar pierre-halleux avatar qgroulard avatar robinetdenisacsone avatar rousseldenis avatar sbidoul avatar thomasbinsfeld avatar zakiuu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alfodoo's Issues

Buttons not displayed after "Create folder in DMS"

On odoo 12, I have installed alfodoo-12.0-dev and connector-cmis-12.0.
The confguration of the cmis backend is OK.
I have had a cmis_folder = fields.CmisFolder() in project.project and so, the button "Create folder in DMS" is shown on the project view. When I click on the button, a folder is created in Alfresco.
But no buttons are now showed on the project view in order to add a file or create a directory. And if I had files or directory in the created directory in Alfresco, they are not showed in the project view.

PS : excuse my english, I'm french
PS 2 : my target is to teach how to use odoo and alfresco to students of a school management in Toulouse

Authentication

Branch: 11.0
Alfresco: Community 6.1.2 (r589dc49b-b205)

How the cmis_folder field widget supposed to authenticate itself on alfresco?
It seems there is no code inside cmis_web/static/src/js/form_widget.js that takes username and password fields from the cmis.backend model. I didn't find where the _token variable was initialized either (I have it empty all the times).

I'm getting this type of error when trying to see Documents folder (cmis_folder field widget):

 05110023 Authentication failed for Web Script org/alfresco/api/opencmis/OpenCMIS.get

[10.0-cmis_report_write-jne] --TypeError: get_pdf() takes at least 5 arguments (4 given)

alfodoo-10.0-cmis_report_write-jne - installed and configured, cmis field implemented in sale order, while printing sale order getting error like this

Traceback (most recent call last):
File "/home/iswasu-4/Desktop/odoo-10.0-e-20161123/odoo/addons/report/controllers/main.py", line 96, in report_download
response = self.report_routes(reportname, docids=docids, converter='pdf')
File "/home/iswasu-4/Desktop/odoo-10.0-e-20161123/odoo/http.py", line 504, in response_wrap
response = f(*args, **kw)
File "/home/iswasu-4/Desktop/odoo-10.0-e-20161123/odoo/addons/report/controllers/main.py", line 45, in report_routes
pdf = report_obj.with_context(context).get_pdf(docids, reportname, data=data)
TypeError: get_pdf() takes at least 5 arguments (4 given)

Value error:invalid literal

Traceback (most recent call last):
File "/home/odoomaster/odoo-dev/odoo/odoo/http.py", line 640, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/odoomaster/odoo-dev/odoo/odoo/http.py", line 677, in dispatch
result = self._call_function(**self.params)
File "/home/odoomaster/odoo-dev/odoo/odoo/http.py", line 333, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/odoomaster/odoo-dev/odoo/odoo/service/model.py", line 101, in wrapper
return f(dbname, *args, **kwargs)
File "/home/odoomaster/odoo-dev/odoo/odoo/http.py", line 326, in checked_call
result = self.endpoint(*a, **kw)
File "/home/odoomaster/odoo-dev/odoo/odoo/http.py", line 935, in call
return self.method(*args, **kw)
File "/home/odoomaster/odoo-dev/odoo/odoo/http.py", line 506, in response_wrap
response = f(*args, **kw)
File "/home/odoomaster/odoo-dev/pta_ltd/cmis_field/controllers/main.py", line 13, in create_field_value
model_inst._fields[field_name].create_value(model_inst)
File "/home/odoomaster/odoo-dev/pta_ltd/cmis_field/fields/cmis_folder.py", line 110, in create_value
self._create_in_cmis(records, backend)
File "/home/odoomaster/odoo-dev/pta_ltd/cmis_field/fields/cmis_folder.py", line 114, in _create_in_cmis
parents = self.get_create_parents(records, backend)
File "/home/odoomaster/odoo-dev/pta_ltd/cmis_field/fields/cmis_folder.py", line 169, in get_create_parents
path_parts, create_if_not_found=True)
File "/home/odoomaster/odoo-dev/pta_ltd/cmis_field/models/cmis_backend.py", line 122, in get_folder_by_path_parts
path, create_if_not_found, cmis_parent_objectid)
File "/home/odoomaster/odoo-dev/pta_ltd/cmis/models/cmis_backend.py", line 98, in get_folder_by_path
repo = self.get_cmis_repository()
File "/home/odoomaster/odoo-dev/pta_ltd/cmis/models/cmis_backend.py", line 58, in get_cmis_repository
return client.defaultRepository
File "/usr/local/lib/python2.7/dist-packages/cmislib/model.py", line 102, in getDefaultRepository
return self.binding.getRepositoryService().getDefaultRepository(self)
File "/usr/local/lib/python2.7/dist-packages/cmislib/browser/binding.py", line 154, in getDefaultRepository
result = client.binding.get(client.repositoryUrl, client.username, client.password, **client.extArgs)
File "/usr/local/lib/python2.7/dist-packages/cmislib/browser/binding.py", line 76, in get
**kwargs)
File "/usr/local/lib/python2.7/dist-packages/cmislib/net.py", line 67, in get
return h.request(url, method='GET', headers=headers)
File "/usr/local/lib/python2.7/dist-packages/httplib2/init.py", line 1511, in request
proxy_info = self._get_proxy_info(scheme, authority)
File "/usr/local/lib/python2.7/dist-packages/httplib2/init.py", line 1696, in _get_proxy_info
proxy_info = proxy_info(scheme)
File "/usr/local/lib/python2.7/dist-packages/httplib2/init.py", line 844, in proxy_info_from_environment
pi = proxy_info_from_url(url, method)
File "/usr/local/lib/python2.7/dist-packages/httplib2/init.py", line 879, in proxy_info_from_url
port = int(port)
ValueError: invalid literal for int() with base 10: ':1%eth0]:13128'

Please help...why is this error occuring and how do i resolve it?
@zakiuu @lmignon

drag and drop inside folder

Initial situation: a document tab containing several subfolders.

Drag and drop a new document, Alfodoo drops it next to the other subfolders.

It would be nice to drop it into the folder below the pointer (with a visual cue that it will happen).

i Got Error while installing alfodoo in odoo 9

first of all i installed cmislib (cmislib-0.5.1.tar.gz) from https://pypi.python.org/pypi/cmislib/0.5.1
this are followed by odoo forum instruction(https://www.odoo.com/forum/help-1/question/cant-install-and-use-odoo-cmis-connector-88414) after that i copy paste all the file into addons folder but i still i got error like this.
from cmislib.browser.binding import safe_urlencode
ImportError: No module named cmislib.browser.binding

please help me struggling last 2 days give me instruction how to install afodoo for odoo 9

Unable to find the server at alfrescodemo.eu

@lmignon I am trying to integrate Alfresco in Odoo for a complete document management solution..I tried to fill the fields with the information u sahred above and i've been getting this error..it says "Unable to find the server at alfrescodemo.eu".....plz let me know what should i do

Alfodoo V11

Currently, Alfodoo is available for Odoo 9 and 10. The modules suite needs to be migrated to the version 11 of Odoo which has been released on October 2017.

We would like to know if the community is interested to have the existing alfodoo modules to be compliant with Odoo 11 both community and enterprise versions and wants to participate in the financing of this technical migration?

Our initial objective was to initiate a crowdfunding project for this migration. We can relaunch a crowdfunding project if enough people are interested.

If you are interested by the migration and want to contribute, send an email to [email protected]

Solved: Need help after all addons installed

Dear Sirs,
I have a problem with "cmis_web" widget modul in my browsers if I try to open "Documents" tab in Odoo Version 9.0c-20170415 (Community Edition). After all described addons have been installed, I always get the following message by clicking on "Documents" tab and nothing runs anymore. By clicking on "Create new Folder in DMS" a new folder in Aflresco will be created properly. "Backend" branch 9.0-cmis-from-8.0 has been configurated and tested on my own local and alfresco servers successfully. Any idea? What goes wrong?

Best Regards,

Oleg

Update 27.05: Solved already, CORS in Alfresco wasn´t enabled correctly ;)

Uncaught TypeError: Cannot read property 'type' of undefined
http://192.168.0.180/web/content/372-10928b2/web.assets_backend.js.pagespeed.ce.8fzbFeunMo.js:6366
Traceback:
TypeError: Cannot read property 'type' of undefined
    at Class.on_cmis_error (http://192.168.0.180/web/content/372-10928b2/web.assets_backend.js.pagespeed.ce.8fzbFeunMo.js:6366:84)
    at http://192.168.0.180/web/content/372-10928b2/web.assets_backend.js.pagespeed.ce.8fzbFeunMo.js:6365:642
    at http://192.168.0.180/web/content/372-10928b2/web.assets_backend.js.pagespeed.ce.8fzbFeunMo.js:4295:1933
    at Request.callback (http://192.168.0.180/web/content/372-10928b2/web.assets_backend.js.pagespeed.ce.8fzbFeunMo.js:4224:163)
    at Request.crossDomainError (http://192.168.0.180/web/content/372-10928b2/web.assets_backend.js.pagespeed.ce.8fzbFeunMo.js:4224:490)
    at XMLHttpRequest.xhr.onreadystatechange (http://192.168.0.180/web/content/372-10928b2/web.assets_backend.js.pagespeed.ce.8fzbFeunMo.js:4225:94)

Odoo Client Error:

for Chrome:

Uncaught TypeError: Cannot read property 'type' of undefined
http://192.168.0.180/cmis_web/static/src/js/form_widgets.js.pagespeed.jm.V5u0DeNfX6.js:15
Traceback:
TypeError: Cannot read property 'type' of undefined
    at Class.on_cmis_error (http://192.168.0.180/cmis_web/static/src/js/form_widgets.js.pagespeed.jm.V5u0DeNfX6.js:15:84)
    at http://192.168.0.180/cmis_web/static/src/js/form_widgets.js.pagespeed.jm.V5u0DeNfX6.js:14:642
    at http://192.168.0.180/cmis_web/static/lib/cmisjs/cmis.0.3.1.js.pagespeed.jm.SPw9L7HV3v.js:56:1933
    at Request.callback (http://192.168.0.180/cmis_web/static/lib/cmisjs/superagent.7.2.0.js.pagespeed.jm.bzEp17jksd.js:35:163)
    at Request.crossDomainError (http://192.168.0.180/cmis_web/static/lib/cmisjs/superagent.7.2.0.js.pagespeed.jm.bzEp17jksd.js:35:490)
    at XMLHttpRequest.xhr.onreadystatechange (http://192.168.0.180/cmis_web/static/lib/cmisjs/superagent.7.2.0.js.pagespeed.jm.bzEp17jksd.j

for Internet Explorer:

Die Eigenschaft "type" eines undefinierten oder Nullverweises kann nicht abgerufen werden.
http://192.168.0.180/cmis_web/static/src/js/form_widgets.js.pagespeed.jm.V5u0DeNfX6.js:15
Traceback:
TypeError: Die Eigenschaft "type" eines undefinierten oder Nullverweises kann nicht abgerufen werden.
   at CmisMixin.on_cmis_error (http://192.168.0.180/cmis_web/static/src/js/form_widgets.js.pagespeed.jm.V5u0DeNfX6.js:15:76)
   at Anonymous function (http://192.168.0.180/cmis_web/static/src/js/form_widgets.js.pagespeed.jm.V5u0DeNfX6.js:14:637)
   at Anonymous function (http://192.168.0.180/cmis_web/static/lib/cmisjs/cmis.0.3.1.js.pagespeed.jm.SPw9L7HV3v.js:56:1933)
   at Request.prototype.callback (http://192.168.0.180/cmis_web/static/lib/cmisjs/superagent.7.2.0.js.pagespeed.jm.bzEp17jksd.js:35:163)
   at Request.prototype.crossDomainError (http://192.168.0.180/cmis_web/static/lib/cmisjs/superagent.7.2.0.js.pagespeed.jm.bzEp17jksd.js:35:485)
   at xhr.onreadystatechange (http://192.168.0.180/cmis_web/static/lib/cmisjs/superagent.7.2.0.js.pagespeed.jm.bzEp17jksd.js:36:82)

for Firefox:

http://192.168.0.180/web/content/372-10928b2/web.assets_backend.js.pagespeed.ce.8fzbFeunMo.js:6366
Traceback:
CmisMixin.on_cmis_error@http://192.168.0.180/web/content/372-10928b2/web.assets_backend.js.pagespeed.ce.8fzbFeunMo.js:6366:54
CmisMixin.load_cmis_repositories/<@http://192.168.0.180/web/content/372-10928b2/web.assets_backend.js.pagespeed.ce.8fzbFeunMo.js:6365:637
CmisRequest/<@http://192.168.0.180/web/content/372-10928b2/web.assets_backend.js.pagespeed.ce.8fzbFeunMo.js:4295:1933
[3]</Request.prototype.callback@http://192.168.0.180/web/content/372-10928b2/web.assets_backend.js.pagespeed.ce.8fzbFeunMo.js:4224:163
[3]</Request.prototype.crossDomainError@http://192.168.0.180/web/content/372-10928b2/web.assets_backend.js.pagespeed.ce.8fzbFeunMo.js:4224:485
[3]</Request.prototype.end/xhr.onreadystatechange@http://192.168.0.180/web/content/372-10928b2/web.assets_backend.js.pagespeed.ce.8fzbFeunMo.js:4225:82

How do you manage different environments?

A bit of context:

We have 3 Odoo v10 environments with Alfodoo and 1 Alfresco server.
During the implementation, we created one Alfresco directory for each Odoo database.
We have 1 DMS folder per partner.

Now that the project is live and on a support phase, we regularly copy the Odoo production database to the other environments (Test and QA).
After each copy, I change the initial directory on the backend configuration in Test (or QA):
Initial directory = prod to Initial directory = test

but it seems like each DMS folder still points to the original folder:
Partner record "John Doe" has his DMS folder in /prod/John Doe, instead of /test/John Doe.

Am I understanding this correctly? How do you handle this?

It sounds like we should:

  • set up 2 new Alfresco environments (QA and Test)
  • restore the whole setup (Alfresco DB + repo) every time we copy the Odoo database and
  • change the Alfresco URLs in the backend

Alternative authentication and default folders

@lmignon Could you please help to understand:

  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.

  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?

Thanking you!

Downgrade to Odoo 8.0 ?

I manage to downgrade most of the XML and Python.
Now, the modules installs ok in Odoo 8.0, but the Javascript files aren't working.
i.e.: "odoo.define('cmis_web.form_widgets', function(require) {..."
generates the following error: "Can't find variable: odoo"
If I replace odoo by openerp, I still get an error: "openerp.define is not a function. (In 'openerp.define', ..."
Has anyone tried to have this working for Odoo 8.0?

OpenKM result Path with sanitize

Hi, we're trying to implement cmis_field module using OpenKM, when click CREATE FOLDER IN DMS, it show a Error concerning Path.

OpenKM paths starts with /okm:root/... i check the code and is replacing /:*?"<>| characters. So the OpenKM path result invalid, we have tried to remove semicolon (:) from the list but itsnt work.

I made a test if i store directly in Odoo DB the uuid generated in OpenKM, i works fine.

How this can be workarounded

Default Folder for CMIS Field

Hello,
Please help me with this configuration. I don't want to create a folder for each mode when I add cmis_field to. I want all users to have the same folder that I specify in the backend. Kindly help.
I tried providing create_parent_get in my field but I keep getting this error " object has no attribute 'getObjectId' ".

TypeError: this.gen_cmis_session_token is not a function

I've installed from branch 10.0 - with current odoo community 10.0.
Alfresco running behind proxy - backend directory test does work. I've added cmis folder to res.partner - this does work - i can see the widget - i can upload files - but then it do get the above error.

bildschirmfoto von 2018-01-12 17-50-35

Uncaught TypeError: Cannot read property 'type' of undefined

Hello,

I am using Odoo 10.0 and Alfresco Community 5.2.0:

Alfresco Share v5.2.e
(r135148-b16, Aikau 1.0.101.3, Spring Surf 5.2.e, Spring WebScripts 6.13, Freemarker 2.3.20-alfresco-patched, Rhino 1.7R4-alfresco-patched, Yui 2.9.0-alfresco-20141223)
Alfresco Community v5.2.0
(r135134-b14) schema 10005

I created and installed a module to add a Documents tab on res.partner.

When I click on the Documents tab or edit the res.partner, I get the following error message:

https://********************/web/content/1122-305078b/web.assets_backend.js:5338
Traceback:
TypeError: Cannot read property 'type' of undefined
    at Class.on_cmis_error (https://********************/web/content/1122-305078b/web.assets_backend.js:5338:84)
    at https://********************/web/content/1122-305078b/web.assets_backend.js:5337:642
    at https://********************/web/content/1122-305078b/web.assets_backend.js:3267:1933
    at Request.callback (https://********************/web/content/1122-305078b/web.assets_backend.js:3196:163)
    at Request.crossDomainError (https://********************/web/content/1122-305078b/web.assets_backend.js:3196:490)
    at XMLHttpRequest.xhr.onreadystatechange (https://********************/web/content/1122-305078b/web.assets_backend.js:3197:94)

Any idea?

Unable to Preview .docx and .doc when uploaded from alfodoo

Hi,
I can't preview .docx and .doc files when i upload the files from alfodoo other file types (image,xlsx,pdf) works fine but uploading through alfresco share i can preview the files(docx,docs) on alfodoo.

I am working on Ubuntu 16.04 running odoo version 10.0 and as well Alfresco Community v5.2.0

I noticed the HTTP request to alfresco api is different for docx and pdf when viewing from alfodoo .
PDF
"GET /alfresco/api/-default-/public/cmis/versions/1.1/browser/root?succinct=true&cmisselector=content&objectId

docx /doc
GET **/alfresco/api/node/workspace/SpacesStore/**4d6c1e11-6e1c-489e-99ee-0206161f8da7/content/thumbnails/pdf/Training%20.docx?c=force&lastModified=pdf%936

Any help to resolve this ?

How to configure attachment from filestore >> Alfresco

Hello Laurent

Can you explain how to change the by default behaviour of Odoo when printing qweb. The pdf generated is attached in the filestore and I would rather see it transferd to Alfresco

Thanks and happy new year

issue with directory

Initial directory for writing :.........????...........
local directory or alfresco directory path,

Alfodoo not picking backend_name

Creating a module this way


class AccountIn(models.Model):
    _inherit = 'account.invoice'

    my_folder = fields.CmisFolder(backend_name="account", string="Account CMIS")

def get_backend(self, env, raise_if_not_found=True):
        return env['cmis.backend'].get_by_name(
            self.backend_name, raise_if_not_found)

self.backend_name is always None line 94 file cmis_folder.py

Owncloud / Nextcloud

Hi all,

i am thinking about adding Nextcloud / Owncloud support to alfodoo. Please share your knowledge - is the base code good enough abstracted so that it is possible to add support for Nextcloud/Owncloud ?

Drag and drop folders and dowload entire folder

Now users can create a folder and add documents to it.
Wanted functionality is enable users to drag and drop entire folders with all sub-folders and documents.

Users can download documents one by one.
Wanted functionality is to allow the users to download a specific folder or to select files they want to download.

Error raised when clicking on button "Create Folder in DMS"

When I click on "Create folder in DMS" although a folder is created in alfresco an error is raised:

image

and no buttons to import files are showing, unless i refresh the page:

image

Here is my alfresco-global.properties:

# CMIS #
alfresco.restApi.basicAuthScheme=true
opencmis.context.override=true
opencmis.context.value=
opencmis.servletpath.override=true
opencmis.servletpath.value=
opencmis.server.override=true
opencmis.server.value=http://192.168.0.141:8080/alfresco/api/

Here is my web.xml for enabling CORS:

<!-- CORS Filter Begin -->
<filter>
    <filter-name>CORS</filter-name>
    <filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
    <init-param>
        <param-name>cors.allowGenericHttpRequests</param-name>
        <param-value>true</param-value>
    </init-param>
    <init-param>
        <param-name>cors.allowOrigin</param-name>
        <param-value>*</param-value>
    </init-param>
    <init-param>
        <param-name>cors.allowSubdomains</param-name>
        <param-value>true</param-value>
    </init-param>
    <init-param>
        <param-name>cors.supportedMethods</param-name>
        <param-value>GET, HEAD, POST, PUT, DELETE, OPTIONS</param-value>
    </init-param>
    <init-param>
        <param-name>cors.supportedHeaders</param-name>
        <param-value>origin, authorization, x-file-size, x-file-name, content-type, accept, x-file-type, range</param-value>
    </init-param>
    <init-param>
        <param-name>cors.exposedHeaders</param-name>
        <param-value>Accept-Ranges, Content-Encoding, Content-Length, Content-Range</param-value>
    </init-param>
    <init-param>
        <param-name>cors.supportsCredentials</param-name>
        <param-value>true</param-value>
    </init-param>
    <init-param>
         <param-name>cors.maxAge</param-name>
         <param-value>3600</param-value>
    </init-param>
</filter>
 <!-- CORS Filter End -->
<!-- CORS Filter Mappings Begin -->
<filter-mapping>
    <filter-name>CORS</filter-name>
    <url-pattern>/api/*</url-pattern>
    <url-pattern>/service/*</url-pattern>
    <url-pattern>/s/*</url-pattern>
    <url-pattern>/cmisbrowser/*</url-pattern>
    <url-pattern>/definitions/*</url-pattern>
</filter-mapping>
   <!-- CORS Filter Mappings End -->

Unknown js error after clicking on 'CREATE FOLDER IN DMS' button

Odoo version : Odoo 11.0+e (Enterprise Edition)
Alfodoo version : 11.0.4.0.0

Following the example from the guide

model.py

from odoo import models
from odoo.addons.cmis_field import fields


class CrmClaim(models.Model):
    _inherit = 'crm.claim'

    cmis_folder = fields.CmisFolder()

view.xml

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <record id="crm_case_claims_form_view" model="ir.ui.view">
        <field name="name">CRM - Claims Form (cmis_crm_claim)</field>
        <field name="model">crm.claim</field>
        <field name="inherit_id" ref="crm_claim.crm_case_claims_form_view"/>
        <field name="arch" type="xml">
            <notebook position="inside">
                <page string="Documents" groups="base.group_user">
                    <field name="cmis_folder"/>
                </page>
            </notebook>
        </field>
    </record>
</odoo>

Clicking on button below
button

generates this error but everything still works, including the creation of the folder

Error:
Uncaught TypeError: Cannot read property 'type' of undefined

http://localhost/web/static/src/js/views/basic/basic_model.js:1285
Traceback:
TypeError: Cannot read property 'type' of undefined
    at Class._applyChange (http://localhost/web/static/src/js/views/basic/basic_model.js:1285:23)
    at Object.<anonymous> (http://localhost/web/static/src/js/core/concurrency.js:216:31)
    at Object.<anonymous> (http://localhost/web/static/lib/jquery/jquery.js:3276:89)
    at fire (http://localhost/web/static/lib/jquery/jquery.js:3119:58)
    at Object.add [as done] (http://localhost/web/static/lib/jquery/jquery.js:3165:49)
    at Array.<anonymous> (http://localhost/web/static/lib/jquery/jquery.js:3275:77)
    at Function.each (http://localhost/web/static/lib/jquery/jquery.js:383:58)
    at Object.<anonymous> (http://localhost/web/static/lib/jquery/jquery.js:3272:56)
    at Function.Deferred (http://localhost/web/static/lib/jquery/jquery.js:3332:30)
    at Object.then (http://localhost/web/static/lib/jquery/jquery.js:3271:55)

Cannot configure Alfodoo

My Alfresco is working fine as a standalone application. When I add the following code in the web.xml file under alfresco/tomcat/conf/web.xml, I cannot even run Alfresco -

<!-- CORS Filter Begin -->
<filter>
    <filter-name>CORS</filter-name>
    <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
    <init-param>
      <param-name>cors.allowed.origins</param-name>
      <param-value>http://localhost:8069,https://127:0.0.1:8080</param-value>
    </init-param>
    <init-param>
      <param-name>cors.allowed.methods</param-name>
      <param-value>GET,POST,HEAD,OPTIONS,PUT,DELETE</param-value>
    </init-param>
    <init-param>
      <param-name>cors.allowed.headers</param-name>
      <param-value>origin, authorization, x-file-size, x-file-name, content-type, accept, x-file-type, DNT, x-customheader ,keep-alive ,user-agent ,x-requested-with ,if-modified-since, cache-control,accept-ranges,content-encoding,content-length</param-value>
    </init-param>
    <init-param>
      <param-name>cors.exposed.headers</param-name>
      <param-value>origin, authorization, x-file-size, x-file-name, content-type, accept, x-file-type, DNT, x-customheader ,keep-alive ,user-agent ,x-requested-with ,if-modified-since, cache-control,accept-ranges,content-encoding,content-length</param-value>
    </init-param>
    <init-param>
      <param-name>cors.support.credentials</param-name>
      <param-value>true</param-value>
    </init-param>
    <init-param>
      <param-name>cors.preflight.maxage</param-name>
      <param-value>3600</param-value>
    </init-param>
 </filter>
 <!-- CORS Filter End -->

 <!-- CORS Filter Mappings Begin -->
 <filter-mapping>
    <filter-name>CORS</filter-name>
    <url-pattern>/api/*</url-pattern>
    <url-pattern>/service/*</url-pattern>
    <url-pattern>/s/*</url-pattern>
    <url-pattern>/cmisbrowser/*</url-pattern>
 </filter-mapping>

So, then when I try to connect my Odoo with Alfresco, system gives the below error -

image

Blueprint: Api Refactoring

Goal

Even if the current implementation seems lightweight at first read, it suffers of a lot of drawbacks that limit its usage and adds dependency on the connector addon without added value.
In the current implementation, if you want to link an Odoo model to a CMIS content you must inherit from an abstract model that adds 2 predefined fields.

  • cmis_backend_id: the odoo identifier of the CMIS backend where the content is stored,
  • cmis_objectid: the external identifier of the content into the container.
    The approach based on model inheritance doesn't allow to easily link multiple CMIS content to a same Odoo model instance.
    To avoid all these limitations, we propose to replace the current implementation (abstract model + 2 fields) by a new kind of field that encapsulates the logic actually provided by the abstract model.

Implementaion

Conceptually linking a CMIS content to an Odoo instance should be as easy as declaring a new field on the model.

from openerp import models
from openerp.addons.cmis import fields as cmis_fields

class CrmClaim(models.Model):
    _inherit = 'crm.claim'

    related_cmis_folder = cmis_fields.Folder()

The actual javascript widget web_cmis_viewer.CmisViewer will be renamed as FieldCmisFolder and registerd as the default widget for the new field CmisFolder

core.form_widget_registry
    .add('cmis_folder', FieldCmisFolder);

The new field should extend fields.Field (or maybe a base field that could be common to all cmis fields) and defines the following attributes

from openerp import fields

class Folder(fields.Field):
    """A link to a cmis:folder
    The following attributes may be provided when instanciating the field:
    :param backend_domain: an optional domain to set on backend candidate values on the
        client side (domain or string) to propose the backends in which the folder can be created.
        Depending of the number of `cmis.backend` values matching the domain the create button
        on the widget will be a simple button if only one value matches or a dropdown button if more
        than one values matches. If no value matches, the button will be hidden
    :param allow_create: (by default True)
    :param allow_delete: (by default False)
    :param create_method:
    :param cmis_path: (by default backend.initial_directory_write + '/' model._name)
    :param cmis_object_type: (by default 'cmis:folder') 
    :param cmis_name_get: (by default instance.name_get)
    """

    type='cmis_folder'

TODO EXPLAIN

  • field.field_get (adapted to return the field description to the widget)
  • field value formatting (bakend_name + ':' + objectId)
  • field.create_method(field, record, name, bakend_id) can call a method on field: create_content(backend_id, record, path, properties, cmis_objecy_type)
  • keep cmis.backend but remove inherit on 'connector.backend'
    ...

Informations posted to cmis from the browser are not properly encoded

If the widget is extended to post information to the cmis server and this information contains accented characters, this information will not be properly encoded on the server.
This problem is not new and only appeared when creating a document in the native widget behavior if the file name contained accented characters. A work arround was put in place consisting of a request to update the document name directly after its creation.
This solution has the effect of systematically creating 2 versions of the document when it is created.
When developing an extension of the module to support checkin/checkout (#89), this problem reappeared. Indeed, during the checkin, it is possible to specify a comment for the version to be created and the file to be used can also contain accented characters.
After a lot of investigations, this problem is due to the fact that in the multipart message posted to the server for this type of request no charset is specified for fields that are not files.
The HTML5 standard specifies the use of a hidden field' charset' in the HTML form to declare this charset. https://dev.w3.org/html5/spec-preview/attributes-common-to-form-controls.html#attr-fe-name-charset The problem in this case is that these messages are posted directly from javascript in the cmisJS library. It is therefore necessary to modify this one in order to be able to declare the charset used for the data to be posted to the server.

SSL issue

In the alfodoo developer's guide ,the SSL issue has been identifed.But i m not quite aure about where to use that code .Could any body help me out?
alfodo

What exactly does custom odoo addon mean?

Alfodoo in Safari browser

Hello,

I have a problem with your module in a safari browser.
The issue is on Ipad, Iphone and Mac OSX in a safari browser.
The dialog box for login is not given, and you get an error that you are not logged in.

Kind Regards,
Jean-Paul Robineau

download/preview/goto alfresco should work on last version by default

Here is the problematic scenario:

  • view a document folder in Odoo
  • goto to alfresco
  • modify the document
  • refresh the preview in alfresco
  • come back to Odoo
  • download the document => we get the previous version, this is unexpected
  • preview the document => ok (to be verified)
  • go to alfresco with the flower icon => a pdf preview error occurs (might not be related?)

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.