Giter Club home page Giter Club logo

pibiapp's Introduction

Pibiapp

Pibiapp is an application developed on the Frappe framework to integrate it with other systems and expand the functionality of applications on this framework.

This application is OBSOLETE and is not valid for versions of Frappe higher than 11, but if the part that interests you is the integration with Nextcloud you will find that functionality improved and expanded in https://github.com/pibico/pibiDAV

Current modules

  • Nextcloud

    Connect Frappe and Nextcloud, store the attachments on the Nextcloud server

    Create folders to archive by application and module.

    Share the link with Nextcloud users that belong to the group corresponding to the module

    Tag in Nextcloud the attached files taking into account the application, the modules, the identifier of the transaction and other related data. Includes tagging of the Frappe transaction as file tags in Nextcloud.

    Manage a history of versions in Nextcloud. When the same file is uploaded from Frappe with successive modifications.

    Include archives stored in Nextcloud as attachments to the email

    Upload database backups and local files

  • External Data

    Automatically create a new DocType with its data structure of a file

    Allows you to select the Module of a Frappe application in which you will create the DocType

    Supports files with formats: Excel, CSV, JSON and XML

    Analyze the data set to determine the type of data that fields are mandatory and lists of selectable values

    Allows successive data loads, provided that the format of the file and the position of the data match the original file used to create the DocType

    It is limited to data structures of simple records without tables. This version does not load a JSON or XML with hierarchized data in several levels.

  • Redash

    Integrate the view of dashboards in Frappe so that end users do not need to access Redash

    Provides a security layer that allows Frappe to manage user access to control panels according to their roles

    It is not the purpose of this connector to allow the definition of new Redash panels from Frappe. The system administrator or an expert BI technician should define directly in Redash the control panels that will be visible by this connector in this new module.

License

GNU General Public License v3. See license.txt

Install

You must have previously installed the Frappe framework v10.1.68+ and bench

Go to your bench folder and setup the new app

bench get-app pibiapp https://github.com/doloresjuliana/pibiapp
bench --site yoursite install-app pibiapp

Login to your site to configure the app.

https://github.com/doloresjuliana/pibiapp/wiki/NEXTCLOUD-SETTINGS

pibiapp's People

Contributors

doloresjuliana 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pibiapp's Issues

Error in attaching ย  for the second time the same file

Traceback (most recent call last):
File "/home/erpnext/erpnext-prd/apps/frappe/frappe/handler.py", line 109, in uploadfile
ret = frappe.utils.file_manager.upload()
File "/home/erpnext/erpnext-prd/apps/frappe/frappe/utils/file_manager.py", line 36, in upload
file_doc = get_file_doc()
File "/home/erpnext/erpnext-prd/apps/frappe/frappe/utils/file_manager.py", line 70, in get_file_doc
file_doc = save_url(r.file_url, r.filename, dt, dn, folder, is_private, df)
File "/home/erpnext/erpnext-prd/apps/frappe/frappe/utils/file_manager.py", line 102, in save_url
f.insert();
File "/home/erpnext/erpnext-prd/apps/frappe/frappe/model/document.py", line 242, in insert
self.run_method("after_insert")
File "/home/erpnext/erpnext-prd/apps/frappe/frappe/model/document.py", line 757, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/erpnext/erpnext-prd/apps/frappe/frappe/model/document.py", line 1026, in composer
return composed(self, method, *args, **kwargs)
File "/home/erpnext/erpnext-prd/apps/frappe/frappe/model/document.py", line 1011, in runner
add_to_return_value(self, f(self, method, *args, **kwargs))
File "/home/erpnext/erpnext-prd/apps/pibiapp/pibiapp/nextcloud/nextcloud_link.py", line 154, in nextcloud_insert
fileid = str(decoded["ocs"]["data"]["file_source"])
TypeError: list indices must be integers, not unicode

Error in last version frappe when validating file

This error is detected when installing the latest version of Frappe. The file uploads to nextcloud but the URL is not registered, due to an error in the validation.

File "/opt/aknobte/frappe/apps/frappe/frappe/core/doctype/file/file.py", line 99, in validate
self.validate_file()
File "/opt/aknobte/frappe/apps/frappe/frappe/core/doctype/file/file.py", line 177, in validate_file
full_path = self.get_full_path()
File "/opt/aknobte/frappe/apps/frappe/frappe/core/doctype/file/file.py", line 388, in get_full_path
frappe.throw(_("There is some problem with the file url: {0}").format(file_path))
File "/opt/aknobte/frappe/apps/frappe/frappe/init.py", line 345, in throw
msgprint(msg, raise_exception=exc, title=title, indicator='red')
File "/opt/aknobte/frappe/apps/frappe/frappe/init.py", line 331, in msgprint
_raise_exception()
File "/opt/aknobte/frappe/apps/frappe/frappe/init.py", line 304, in _raise_exception
raise raise_exception(msg)
ValidationError: There is some problem with the file url: https://docs.xxxx.es:4334/s/JWjz7zwKbBS93H8

Detect incidents in the file that contains the external data

  • Empty columns
  • Tags with characters "." Y ","
  • Empty records
  • Avoid duplicate loading of identical records
  • Control of data type. For example when in a column of dates they are also including literals

When the user makes a mistake and tries to load the wrong file, avoid the system error message by saying: "The fields of the file that you are trying to load do not correspond to the fields of the initial template file"

New module to load external data in Frappe creating automatically new DocType

Frappe has functionality to import data in a previously defined DocType. For this, the data must conform to a specific template.

Sometimes we may be interested in recording data in Frappe as it is found in another system or in office files. This module will save us time avoiding the following tasks:

  1. Manually create a new Doctype with the structure of the data source.
  2. Export the template for data import
  3. Copy the data from the data source file to the import template
  4. Record the template with the data in CSV format
  5. Import the data recorded in the template

There are many reasons that can make it desirable or even necessary to load data into new doctypes and not do it in the Doctypes of Frappe applications. These are some reasons:

  • The historical data of the company can be found in Excel sheets. These data are not homogeneous, they are not complete, they are not related to each other, they contain errors, etc. The task of correcting and converting the data to incorporate them into an application is considered by the users as unaffordable together with their current workload. Despite the poor quality of the historical data, the company does not want to give up its future consultation.

  • The historical data can be found in the old system that is replaced with an application in Frappe. The company does not want or can not keep the old system active for inquiries. The cost of the extraction work from the old system, conversion and loading of data in the new application, is too high for the budget of the project.

  • You want to build a report that aggregates the information contained in Frappe applications and other information found in Excel sheets.

  • It is desired to convert an Excel sheet shared by several users into a transactional record in Frappe, fully respecting the structure that users have defined in excel.

  • Create a prototype of a new module based on the management that users currently perform in Excel.

Failure to include in an email a previously attached file in a transaction

Traceback (most recent call last):
File "/home/erpnext/erpnext-prd/apps/frappe/frappe/app.py", line 62, in application
response = frappe.handler.handle()
File "/home/erpnext/erpnext-prd/apps/frappe/frappe/handler.py", line 22, in handle
data = execute_cmd(cmd)
File "/home/erpnext/erpnext-prd/apps/frappe/frappe/handler.py", line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "/home/erpnext/erpnext-prd/apps/frappe/frappe/init.py", line 939, in call
return fn(*args, **newargs)
File "/home/erpnext/erpnext-prd/apps/frappe/frappe/core/doctype/communication/email.py", line 86, in make
add_attachments(comm.name, attachments)
File "/home/erpnext/erpnext-prd/apps/frappe/frappe/core/doctype/communication/email.py", line 410, in add_attachments
"Home/Attachments", attach.is_private)
File "/home/erpnext/erpnext-prd/apps/frappe/frappe/utils/file_manager.py", line 102, in save_url
f.insert();
File "/home/erpnext/erpnext-prd/apps/frappe/frappe/model/document.py", line 242, in insert
self.run_method("after_insert")
File "/home/erpnext/erpnext-prd/apps/frappe/frappe/model/document.py", line 757, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/erpnext/erpnext-prd/apps/frappe/frappe/model/document.py", line 1026, in composer
return composed(self, method, *args, **kwargs)
File "/home/erpnext/erpnext-prd/apps/frappe/frappe/model/document.py", line 1011, in runner
add_to_return_value(self, f(self, method, *args, **kwargs))
File "/home/erpnext/erpnext-prd/apps/pibiapp/pibiapp/nextcloud/nextcloud_link.py", line 133, in nextcloud_insert
nc.webdav.upload(local_fileobj, remote_fileobj=fileobj[uu], nc_path=path)
File "/home/erpnext/erpnext-prd/apps/pibiapp/pibiapp/nextcloud/nextcloud_apis.py", line 122, in upload
with open(local_fileobj, 'rb') as fileobj:
IOError: [Errno 2] No such file or directory: u'./erp.eshttps://docs.es:4334/f/2815'

Version management of the attached file

New functionality that allows to annex successive versions of a file in Frappe.

In Nextcloud the successive versions will be stored, which will allow restoring an earlier version if necessary.

From the attached Frappe file, the current version of the file will be accessed

Install Fails on V13.4.1

Installing pibiapp...
Updating DocTypes for pibiapp : [========================================] 100%
An error occurred while installing pibiapp:
Module import failed for Package Publish Tool (frappe.custom.doctype.package_publish_tool.package_publish_tool Error: No module named 'frappe.custom.doctype.package_publish_tool')

Error adding a URL as an attachment

Correct the error that occurs in modules not excluded when the Nextcloud connector is activated and tries to append a URL.

This error does not occur in the 12.x.x version in development, only the previous versions present the error.

Nextcloud excluding file formats is case sensitive, avoid this

Currently, if the format is not exactly configured (example: JPEG and not jpeg), the exclusion does not work.

With this change, the system administrator who configures the Nextcloud connector will have to take into account the distinction between uppercase and lowercase.

Version 12 installation fails

Hi,

I wanted to try your application but I was unable to install on ERPNext Version 12. Please see error details below.

Installing pibiapp...
Updating DocTypes for pibiapp : [======= ]Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py", line 204, in load_doctype_module
doctype_python_modules[key] = frappe.get_module(module_name)
File "/home/frappe/frappe-bench/apps/frappe/frappe/init.py", line 814, in get_module
return importlib.import_module(modulename)
File "/home/frappe/frappe-bench/env/lib/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "", line 678, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/frappe/frappe-bench/apps/pibiapp/pibiapp/nextcloud/doctype/nextcloud_settings/nextcloud_settings.py", line 26, in
from pibiapp.nextcloud.nextcloud_link import nextcloud_callback, nextcloud_backup
File "/home/frappe/frappe-bench/apps/pibiapp/pibiapp/nextcloud/nextcloud_link.py", line 27, in
from frappe.desk.tags import DocTags
ModuleNotFoundError: No module named 'frappe.desk.tags'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 97, in
main()
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
click.Group(commands=commands)(prog_name='bench')
File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 764, in call
return self.main(*args, **kwargs)
File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py", line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 173, in install_app
_install_app(app, verbose=context.verbose)
File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 82, in install_app
sync_for(name, force=True, sync_everything=True, verbose=verbose, reset_permissions=True)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/sync.py", line 56, in sync_for
reset_permissions=reset_permissions, for_sync=True)
File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 66, in import_file_by_path
ignore_version=ignore_version, reset_permissions=reset_permissions)
File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 141, in import_doc
doc.insert()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 259, in insert
self.run_post_save_methods()
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 919, in run_post_save_methods
self.run_method("on_update")
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 787, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1058, in composer
return composed(self, method, *args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1041, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 781, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 299, in on_update
self.run_module_method("on_doctype_update")
File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 368, in run_module_method
module = load_doctype_module(self.name, self.module)
File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py", line 206, in load_doctype_module
raise ImportError('Module import failed for {0} ({1})'.format(doctype, module_name + ' Error: ' + str(e)))
ImportError: Module import failed for Nextcloud Settings (pibiapp.nextcloud.doctype.nextcloud_settings.nextcloud_settings Error: No module named 'frappe.desk.tags')

Regards

Port 445 not required on NC V14 or V15

Hi
Had to make a correction on your code by removing the port 445
self.baseurl = '{0}://{1}'.format(protocol, host)

You should test to see if the NC requires that port or not...

Functionality to change data model in empty external data source

After the analysis of the template of a new external data source, the system generates a data model. If the volume of data analyzed is high and these data are sufficiently representative, the data model will not need changes.

But sometimes the template data does not represent all the casuistry and we will need to make changes. For example, make a field not mandatory or include more values in the list of a select.

It is convenient to have a menu option that facilitates these changes, we will call it "Change DocType Empty". It will only work on empty DocType to avoid incompatible changes with the pre-recorded data.

Nextcloud connector exclusions more granular

The exclusion of complete modules sometimes does not cover the needs of users, who want to exclude from the connection only certain DocTypes or files with a specific format.

Connecting to my Nextcloud Server Problem

Hi,
On Settings the Server Path should check for Backslash \ as i entered the full path with it and was not connecting only after checking the Source i could see that the problem was with the \ being present on the Script URL

Version 12 - No Features at all after installation

Hi,

as mentioned in the post #27 even if the app is successfully installed on Version 12, I cannot see any menu/feature related to that (I have tried to search something related to the Nextcloud module without success).

The only new thing that I can see related to the app is the Checkbox "Nextcloud" that is inside the "ALLOW MODULES" tab in the User Form.

Any idea related to that?

Thanks and Regards,
Roberto

Naming files problem

Also having some issues with file naming ... renamed from
fname = frappe.db.get_value("File", {"file_name": ["like", doc.file_name + " NC/f/%"]}, "name")

to
fname = frappe.db.get_value("File", {"file_name": ["like", doc.file_name + "%"]}, "name")

Just give a test from your side to see... currently using Frappe v10.1.42 / ERpnext 10.1.43 will upgrade to last V10 soon and give a try again...

Tag Nextcloud file with a job in the background

Goal of the change:
Reduce the system execution time for the file upload process to Nextcloud.

The labeling of Nexcloud documents is not required immediately, compared to the rest of the actions that have to be executed online.

Functionality to clean data loaded in external data source

A new option called "Clean Data Loaded" will be included in the drop-down menu of the detailed view of an external data source (Home> External Data> Ext Data Source >> Menu button).

It will delete all the records loaded in that DocType. This will allow repeating a data load with errors or duplicate records. Another utility of this option will be to allow to change the Doctype before loading the data again.

Error when the attached is marked as public

The default attachments are private and the upload to Nextcloud works correctly, but when the user marks the file as public, the following error occurs:

File "/home/erpnext/erpnext-prd/apps/pibiapp/pibiapp/nextcloud/nextcloud_apis.py", line 119, in upload
    with open(local_fileobj, 'rb') as fileobj:
IOError: [Errno 2] No such file or directory: u'./dev.xxxxx.es/files/cliente.jpg'

Despite bug, the file is correctly appended to the public folder of the site, without uploading to Nextcloud.

Error uploading a file whose name contains special characters

File "/home/erpnext/erpnext-prd/apps/pibiapp/pibiapp/nextcloud/nextcloud_apis.py", line 123, in upload
self.command('PUT', remote_fileobj, (200, 201, 204), data=fileobj)
File "/home/erpnext/erpnext-prd/apps/pibiapp/pibiapp/nextcloud/nextcloud_apis.py", line 64, in command
url = self.getUrl(path)
File "/home/erpnext/erpnext-prd/apps/pibiapp/pibiapp/nextcloud/nextcloud_apis.py", line 58, in getUrl
path = str(path).strip()
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 11: ordinal not in range(128)

New module to integrate the dashboards of Redash with Frappe

Frappe has reporting functionality that can be reinforced with dashboards.

In the Pibi project we have selected Redash to complete the business intelligence of the Frappe applications. Redash allows you to easily build dashboards taking as a data source the database of a Frappe site.

The objective is to integrate the view of the dashboards in Frappe so that the final users do not need to access Redash. It will also provide a security layer that allows Frappe to manage user access to dashboards.

It is not the purpose of this connector to allow the definition of new Redash dashboards from Frappe. The administrator, the system manager or an expert BI technician must define directly in Redash the control panels that will be visible by this connector in this new module.

Add Nextcloud tags to an attached file

Tag the file in Nexcloud to facilitate the search from this system.

The tags will be:

  • Module, Doctype, Transaction reference
    For example, a technical guide attached to an item, should have the labels: "stock", "item", "[the item code]"

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.