fbpx
First you need to install python module for webdav
yum install pywebdav

Edit the configuration file global OpenERP

E ‘need to insert the following lines in the global configuration file of OpenERP, (usually OpenERP-server.conf ).
# #
# WEBDAV Settings

# Need webdav over the http (s) servers
enable = True

# That the webdav directory will be served at this default val
# That means webdav will be on "http://your-server:8069/webdav/"
# Or "https://your-server:443/webdav/"
vdir = webdav

# Turn on the verbose messages of webdav
verbose = True

# Turn on the debugging messages of webdav
debug = True
The last setting is optional.

Install OpenERP modules

And ‘necessary insallare the modules for document management and webdav. Installing: Shared Repositories (WebDAV) . are also installed all the necessary dependencies.
At the end of the installation OpenERP run the automatic configuration of folders and item appearsKnowledge in the main menu.
At this point the WebDAV connection is available and you can access the files with any client using the address: https://TUO-SERVER:443/webdav/NOME-DB/Documents/
See specific item for free with Windows using “Map network drive”

Save attachments on the filesystem

With document management you can attach any file to any object of OpenERP. By defualt attachments are saved in the database. The management of documents requires the FTP filesystem as storage of attachments, while setting WebDAV file system is not mandatory.
To instruct OpenERP to save the attachments on the filesystem you need to create a system parameter via
  • main menu OpenERP
  • > Settings> Technical> Parameters> System Parameters
  • Create a new parameter with the following values:
    • Keyword: ir_attachment.location
    • Value: file :/ / / filestore
From this moment OpenERP save attachments on the filesystem to the position / Root-di-openerp/filestore/nome-db /
For more information and a great script to transfer any attachments previously entered in the DB, see: http://help.openerp.com/question/529/where-are-document-attachments-stored/

Set up folders in OpenERP (for webdav and / or ftp)

The folders are automatically set to the installation of the module for document management, but you can set the folder structure to your liking from the Main Menu> Knowledge> Configuration> Document Management> Folders (the menu is available only if you have permission  technical capabilities )
We distinguish the static Folders and Folders resource .
A resource folder, a folder is connected to a dynamic object OpenERP. For example, to create (or set) a folder that contine all the estimates proceed as indicated in the figure
Create Resource Folder in OpenERP
This setting creates a folder Documents / All Sales Order / WebDav (or FTP) that will contain a folder for each quote generated in OpenERP. Field Name filed allows you to set the folder name of the individual objects. Default is to use the field name , then in the case of preventive folders will be Documents / All Sales Order/SO0001 /, Documents / All Sales Order/SO0002 / etc ..
And ‘possible to have subfolders resources, or that collect related items (see below).

File functional (Generated Files)

In each folder, you can define one or more ‘functional files that invoke the printing of one of the reports defined on the object. For example you could avoid saving the PDF to print a quote but have a functional file that is invoked when the user performs and print the report as defined at the present time.
To set a file functional procedre as indicated in the figure:
In this way you will have the files Documents / All Sales Order/SO0001 / SO0001_PrintNow (). pdf to zero bytes when required, view the report Quotation / Order in real time.
It should be noted that the estimate corresponds to the printed version of the quote at the current moment, which may be different from printed estimate time and maybe sent back to the customer.

Save the document at the time of printing

This function is only active on the bills but you can turn it on’re all available reports including the Estimates.
Just go to Settings> Technical> Actions> Reports and define a Prefix Attachment .
It ‘good to associate this option to have the document set and Reload From Attachment , otherwise it will generate many PDF with the same name how many prints will be launched on the document. In addition, the WebDAV client see n identical copies of the first copy is generated. On the other hand, the option prevents Reload From Attachment to save the report and in the event of changes to the document will not be saved in the PDF (it will be saved in the object OpenERP). In short, use these options with caution.

Create a subfolder of a folder resource resource

For example you might want a folder Partners Partner Quotations where budgets are only those of the individual Partner. Then have:
Connection is via the variable ” active_id . ” To get this feature just create a folder Quotations Partneras a subfolder of Partners and define the domain (filter) Domain: [('partner_id', '=', active_id)] ​​for the folder Partners Quotations .
where active_id is a variable defined in the function and contains the id associated with the object in the parent folder (so in this case res_partner.id) while 'partner_id' is the name of the object field of Sales Order OpenERP. If the option is active Sales> Allow different addresses> the object Estimates (Table sale_order) also has the field partner_invoice_id and partner_shipping_id then the domain could be:
  • Domain: ['|', ('partner_id', '=', active_id), ('partner_invoice_id', '=', active_id)]
Or
  • Domain: ['|', '|', ('partner_id', '=', active_id), ('partner_invoice_id', '=', active_id), ('partner_shipping_id', '=', active_id)]
Note the use of the operator ‘|’ (Bitwise OR) is in reverse notation fact, the following statement does not work:
[('Partner_id', '=', active_id), '|', ('partner_invoice_id', '=', active_id)]
Logical operators have two operands then the rule is
operator, operand1, operand2
The second notation is of the type:
operator1, operator2, operand1, operand2, operand3
and is equivalent to:
operator1, operando4, operand3
where:
operando4 = (operator2, operand1, operand2)
that more ‘readable in this way, even if written with parentheses does not work:
operator1 (operator 2 operand1, operand2), operand3