I have doc type which needs the help of other module which is not pre-installed when i install erpnext. so installed this module using pip install now it is working in my local now i moved my current updated work to
pre production server when i open this doctype i get error module not found so installed this module
in my pre production server and now i wish is there any way to install this external modules at the time of installation or setting up of erpnext.
What type of functionality are you looking for from your custom module/Doc Type? Can you share the code or functionality, so that someone can better assess if that functionality can be met with delivered code or you can also contribute it to the ERPNext core?
# this is the module i want to install automatically wherever i install this instance
import qrcode
class MyDoctype(Document):
def before_save(self):
#generates qr code automatically
img = qrcode.make(daa_box_number)
img.save(./path_to_files_directory)
please help me with this
i tried to add it in requirement.txt
but it is not working
Maybe you can create a new field type for āqr codeā and build something similar to Is there a way to create a new field type? - #7 by revant_one and look to contribute it back using Pull Request to ERPNext core
@Pawan i donāt want a new field instead i want to install a module. just like add module name in requirement.txt and when i bench update this module should be installed.
hope now i am clear to you
thanks.
@shahid_ecit It is not clear to me what you mean by module, and unfortunately it can mean more than one thing in this context.
- Python module? āqrcodeā
- Frappe module, like āfrappe-bench/apps/qrcodeā, where module == app?
- Something else entirely?
For 1) you could solve it by importing your module in place and then calling a whitelisted function from other doctypes.
For 2) it sounds like you may need to bring some qrcode images with you when install it, in which case you should look at the fixtures functionality in hooks.py
For 3) weāll need a more detailed problem statement.
It updates environment on bench update
:
Updating Python libraries...
INFO:bench.utils:./env/bin/pip install --upgrade pip
Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
INFO:bench.utils:./env/bin/pip install -q -r /home/frappe/.bench/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/erpnext/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/frappe/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/custom_app/requirements.txt
@revant_one i was adding this one in bench-repo/requirement.txt
but now i got that have to i to the erpnext/requirement.txt file
sorry i should have been checked this before i asking
really sorry
and thanks for the time