When you get the an error message that DocType POS Offer Detail not found, you are most likely missing POS Awesome app in your instance. All you need to do is get it installed.
Technology
Good software design will emphasize the importance of separating the database from the software application. The server where the database is hosted needs an extra layer of protection as it contains all the data. This is sometimes known as remote database setup. This can also be achieved in ERPNext and the Frappe Framework.
In this article I will demonstrate to you how this can be achieved with simple steps.
Setup the remote DB to accept remote connections
After you have installed your database in the remote server (You may use the script provided on my GitHub repository), you will need to set it up to allow remote connections by doing the following:
Edit MariaDB configuration file to accept remote connections by changing its bind-address from 127.0.0.1 to 0.0.0.0
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
Login to your MySQL and create a database user that Frappe will use to authenticate.
CREATE USER 'root'@'[IP ADDRESS FOR ERPNext HOST]' IDENTIFIED BY '[YOUR PASSWORD OF CHOICE]';
Grant the created root user permissions to make changes to the created databases.
GRANT ALL PRIVILEGES ON *.* TO 'root'@'[IP ADDRESS FOR ERPNext HOST]' IDENTIFIED BY 'YOUR PASSWORD OF CHOICE' WITH GRANT OPTION;
Flush the privileges to effect changes to the database and log out from MySQL.
FLUSH PRIVILEGES;
EXIT;
Restart MySQL server to effect all the made changes.
sudo service mysql restart
Test the connection using the below command:
mysql -u root -h [IP ADDRESS FOR DATABASE HOST] -p
If the request doesn’t go through, you may need to ensure that there is no firewall that blocks connections to TCP port 3306 of the MySQL server. We use the below command to allow an IP address on Ubuntu servers:
ufw allow from [IP ADDRESS FOR ERPNext HOST] to any port 3306
Setup your ERPNext or Frappe Framework Installation to connect to your remote Database
bench set-mariadb-host [IP ADDRESS FOR DATABASE HOST]
Restart supervisor if your instance is in production mode
supervisorctl restart all
If your instance is in development mode, restart bench
bench restart
At this point you may decide to test the connection or dive in and create a new site. The database that Frappe will create will be in the server you just set up 🙂
bench new-site erp.upeosoft.com --mariadb-root-password [YOUR PASSWORD OF CHOICE]
When you install ERPNext for the first time, it sometimes gets frustrating when the fields are not properly arranged as you would expect. I will share some of the commands I have found useful in this article.
bench build – This command has more abilities if you supply additional options, but we just run it as this to build our app assets.
bench migrate – This command also has greater capabilities, but we are interested in only this basic one. It will run patches, sync schema and rebuild files/translations.
The bench migrate command may sometimes require you to supply the site name, especially when your instance is on production mode. In this case, just run:
bench –site [xyz] migrate
The last command I would like to share today, which clears your browser cache just in case you have cached content that may be causing this problem:
bench clear-website-cache
Here is a sample of the issue we are discussing here:
If you have other ways to solve this problem, please share in the comments section below.
When I graduated from college and landed a Software Developer job at Futuristic, I was all in. I was so enthusiastic about code that finding time to have my lunch was becoming difficult by the day. I wanted to write these little symbols on my computer that made people’s problems fade away. It was so satisfying. This, however, is a pretty common occurrence, especially in small companies: most junior developers are thrown into the deep end, struggle a bit, learn a lot and use their youthful energy to code and work all over the place.
For most developers, this is not the only case. They want to be involved in developer evangelism, meaning they go for hackathons and conferences in addition to their day job. They also have tonnes of personal projects to work on whenever they have a minute spared. I know, it feels good: it makes one feel like they are growing at a supersonic speed, and say yes to everything.
This wasn’t very different from my case, and I burnt out, hard. Saying yes to everything meant I didn’t have time to rest, reflect on life and have quality personal time.
Unfortunately, burnout is difficult explain to anyone who hasn’t been through it. When I burn’t out, I didn’t want to speak to anyone, and the thought of going to work in the morning made me want to cry (actually, I often did). I thought saying no to people would mean I have let them down, and therefore didn’t have the courage to say so.
On this fateful day my alarm went off at 5.30 A.M as usual, I responded to it, prepared and left my house for work. I waited at the bus stop for a ‘matatu’ as we commonly refer to them in Kenya. When the matatu arrived, I stepped one foot inside, thought for a moment and decided not to board. I went back home and just like that, I had lost all interest in the job and worst of all, quit. This is a situation I wouldn’t want anyone to find themselves in.
This didn’t leave me without a change. It gave me valuable lessons. When I recovered considerably, I decided to try out a different company, speak less and pursue my interests more. This is how I joined Software Technologies. The new resolutions made me much more comfortable in my new role, and this way I realized career growth and completed more enterprise level projects. Since then, I have worked with other companies and have learnt even more about developer burnout.
Causes of Burnout
The most common cause of burnout for software developers is a prolonged state of intense stress, accompanied by a perceived feeling of lack of control. Burnout grows slowly and builds up a little step at the time. I’ve seen it manifest when developers feel stuck working very hard and for long periods on projects that:
- Require large amounts of personal sacrifice
- Seem impossible to complete
- Are high-stake
- Offer no relief in sight
Actually some people define this kind of project as a “death march”, a term that for the bigger part describes a preventable reality.
In those conditions, burnout starts taking hold of your life causing progressively worsening feelings of:
- Emotional and physical fatigue
- Lack of accomplishment
- Ineffectiveness
- Cynicism
- Sense of doubt
- Indifference
A death march is a project that, after the autopsy, usually reveals the following characteristics:
- It has a fixed and immovable scope, timeline and resources available to get it done
- Everyone who understands the details agrees it is not achievable, but management doesn’t want to hear it
- Management gets progressively more and more worried and loses trust in its people. It gets to a point where a significant portion of people’s time is spent giving status
- The people who are doing the work struggle to understand the value of the project
Being on a death march feels like walking in the middle of a railway tunnel, too far from the entrance to run back, and too exhausted to continue moving forward. You see the light in front of you, but you have the feeling that what you see is not sunlight. It comes from an old and rusty locomotive headlamp. You can feel the vibration, and you can hear the train’s whistle. It looks like it is coming at full speed toward you. You realize that you forgot why you even started walking in that tunnel, and you keep getting text messages from your boss asking when you are going to be out of the tunnel, and from your family asking at what time you are going to be back home for dinner.
Symptoms of Burnout
Burnout enters your life slowly, and manifest itself with symptoms that increase in intensity over time. Those include the following, but this list is definitely not exhaustive. I will keep updating it to make it more exhaustive with time:
- Insomnia
- Anxiety
- Depression
- Lack of attention span
- Fatigue
- Chest pains
- Shortness of breath
- Dizziness
- Headaches
- Loss or increase of appetite
- Irritability
- Pessimism
- A sense of detachment
- Loss of enjoyment of things you used to enjoy
- A general feeling of being disconnected
- Apathy
- Hopelessness
- Poor performance
How to avoid Burning out
It is far easier to stop burnout during the early stages. It is much harder to fix once you’ve been deep in it for weeks or months.
Here are the strategies that I recommend. Note that this is also not all and I will certainly keep adding to it:
Understand that you are the captain of your ship
You have a boss, and you have a job. Your boss could be a client, a manager, the board, or who knows what else. It doesn’t matter who you report to. Everybody reports to someone or something. What matters is that you are ultimately in control of what you choose to do.
Your boss can choose to fire you if he or she is not happy with your performance. If you do your absolute best, and your boss decides to let you go, maybe it wasn’t meant to be, and you should move forward and do something else. No job is worth losing your health for, and you are responsible for deciding what you need to stay healthy and productive. Most importantly, you are responsible for letting your boss know what you need to be at your best to achieve the best.
Understand that, if you burnout, you won’t be productive
If you burnout, your productivity goes down to almost zero, your life becomes miserable, and all your efforts to get your work done were for nothing. If you care about the work you are doing, you need to avoid getting to that point. It will not help you, your career, your family, your team or your client.
Define your non-negotiable boundaries and make them clear
We are all different. Nobody knows where your breaking point is. Your boss might be a beast that can work 18 hours a day for years, never eat or sleep and still be productive. That’s commendable, but maybe that’s not you.
If your boss is a gymnast who can perform flips in the air from a standing position, you might be in awe of his or her skills, but you don’t get to that point just because you are asked to stretch. You won’t be able to do it from one day to the next, and you should not give the impression that you commit to doing it with no help if you know it is not possible. You’ll fall on your head and break your neck.
In a given context, you might be more of a 10 hour work day maximum kind of person, imagine that, and you might be one of those people that needs to eat a few times a day and sleep a few hours a night. Go figure.
Regardless of where your “too much” point is, it is your responsibility to make it clear to your boss and the organization you work for. You need to establish your “non-negotiables,” and you must make them clear. Your boss might not tell you, but he or she expects that from you.
You also need to be at peace with the potential consequences of your non-negotiables. If your boss is not happy with your limits, you might not get that promotion or raise that you wanted. You should be okay with that because you already established that you cannot go past your non-negotiables. If your limits are not compatible with your company expectations, you might have to find a place that is more compatible with you.
Keep in mind that if you keep telling everyone “I’ll try,” even if you know that you won’t be successful, you are not doing a favor to your company or your team. Be realistic, and don’t promise things that you know are not going to happen. If you do and fail, you are entirely responsible for it.
On the other hand – and, this is very important – your non-negotiables do not define you. They only establish how you can and should operate in a given context. There are companies and projects where working crazy hours is not a problem. In fact, it can be a lot of fun. I’ve been there, and it is a fantastic experience. It depends on the support you get from the company, the environment, the team, the boss, the reasons for the push, the mission, what is on the horizon and the people you have around.
If you feel like you are with friends and you have a stable support structure around you, what could be unbearable becomes doable. That is why good leadership and a great culture are essential for teams to become highly-performant and operating at their best.
Communicate What You Need To Be Successful
It is your responsibility to communicate to your boss what you and your team need to be successful. If you need more resources, make it clear. If the timeline is too short, make it clear. If the project is too big, make it clear. Be vocal. Don’t make people guess.
Your boss might not always be able to give you what you need. However, if you painted an explicit picture of reality, and you believe that you have good, unselfish and ethical reasons for what you are asking, then you did what you could, and you should be able to sleep soundly at night.
Stay physically healthy
You have heard it one million times and maybe ignored it. There are more books on the topic than letters in this blog post. I’ll just give you the 30 seconds executive summary.
- Eat healthy food
- Sleep enough hours
- Maintain a stable schedule
- Move around as much as possible
- Take care of your body
- Exercise regularly
I’ll let the real experts tell you what flavor of each of those points is right for you, but please don’t ignore it. Your brain needs your body to function. You cannot do your best if your body is falling apart. A Ferrari with flat tires is going to lose a race against a Toyota 110.
Make time for doing things that you like doing
For some people, life is work. For others, work is life. For the majority, a balance of work and non-work activities is a healthy balance for a happy life.
For example, I have a demanding job and working on a project to which I have become very attached that is very important to me. However, I also want to dedicate myself to other activities outside of work. That includes time with my family, reading, writing articles, teaching programming, hiking, etc. I need it not because I don’t like work. I need it because it makes me better at my job, and happier in general.
Do not sacrifice some of the things you like to do because there is not enough time in your day. Make the time; it will boost your performance at work. Find a right balance, and put it on your list of non-negotiables.
Conclusion
If there is one message that I hope you’ll take away from this post is that you are in control of what you are going to do. Don’t let things happen to you. Eliminate any fatalist view of reality, and take ownership of your actions. Make it clear to everyone what your boundaries are, tell people what you need for you to be successful, and accept that others might not agree with you.
Ultimately, you can’t control what other people do or think, but you can positively influence it. Doing so will go a long way to keep you out of burnout and in control of what railway tunnel you choose to cross.
When ERPNext is installed in development mode, you will have to restart the instance with the bench start command every time you want to access it. You can however start your instance when the server boots by setting up your instance for production.
In this article, I will show you a simple way to move your instance from development mode to production mode.
We will be using Supervisor to manage to manage the ERPNext process and Nginx as a reverse proxy to access the ERPNext process without using port 8000.
Process
There are two ways this can be done. I will start with the simple and straightforward one.
Run the below commands from your bench directory:
sudo bench setup production [BENCH USER]
sudo supervisorctl restart all
If you are successful, your instance should be in production mode.
If this didn’t work for you, follow the following steps:
First, change the user to your bench user and install Supervisor and Nginx with the following command:
su - erpnext sudo apt-get -y install supervisor nginx
Next, install the frappe-bench add-on with the following command:
sudo pip3 install frappe-bench
Next, run the following command to configure ERPNext for a production environment:
sudo /home/erpnext/.local/bin/bench setup production erpnext
You should see the following output:
Site erpnext.example.com assigned port: 80 $ sudo /usr/bin/supervisorctl reread erpnext-redis: available erpnext-web: available erpnext-workers: available $ sudo /usr/bin/supervisorctl update erpnext-redis: added process group erpnext-web: added process group erpnext-workers: added process group nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful $ sudo systemctl reload nginx
At this point, ERPNext is installed and configured to run on port 80. Now, open your web browser and type in Your URL without the port.
When you install ERPNext for the first time, you may realize that you are running the developer version of both Frappe and ERPNext. You cannot proceed with the developer branch, as things keep changing, some of which may not be tested thoroughly.
In this video, you will learn how to switch from developer branch to the official release of both apps. I will also show you how to resolve all the issues that arise when you do the movement.
These are the steps you need to take
To switch from Developer to Official Branch, we run the command:
bench switch-to-branch version-13 frappe erpnext
After this has completed executing, the instance will prompt you to run the following command:
bench update –patch
When you run this command, most of the time you will get an error message that says:
No module names bleach_whitelist
When this happens, all you need to do is install this module in your environment. Note, I said environment. If you just run the command without specifying that you are installing it on the environment, it will not work. Frappe runs on an environment, and therefore all dependencies need to be installed on the environment.
Make sure that you are on the root directory of your instance, where you can see the env directory. Run the following command:
./env/bin/pip3 install bleach-whitelist
When this is successful, the command bench update –patch should succeed.
Next, run the below command to gather all requirements and set them onto your instance:
bench setup requirements
When this is successful, your instance should be accessible. You may however notice that the instance has not loaded assets. To load and compile assets to yout instance, run the following command:
bench build
After this is done successfully, your assets will be setup properly, and your instance will look fine. In some cases, you may get the message that your system is being updated. Please refresh again after a few moments. If you encounter such, its a configuration issue. Open sites/common_site_config.json file and locate maintenance_mode. You will find that its value is set to 1. Change the value to 0, so the value should look as shown below:
You will need to have SSL certificate installed on your instance to keep users of your system safe online. In Frappe Framework or ERPNext, this is a simple process.
Prerequisites
- You need to have a DNS Multitenant Setup
- Your site should be accessible via a valid domain
- You need root permissions on your server
- You need a valid certificate generated through a trusted Certificate Authority or a Self-Signed Certificate.
Steps to Install SSL
Install snapd on your machine
sudo apt install snapd
Update snapd
sudo snap install core; sudo snap refresh core
Remove existing installations of certbot
sudo apt-get remove certbot
Install certbot
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
For one-step automatic ssl installation
sudo certbot --nginx
If you prefer manual installation,. do the following:
sudo certbot certonly --nginx
Certbot packages on your system come with a cron job or systemd timer that will renew your certificates automatically before they expire. So no further steps are required. If necessary, you can test automatic renewal for your certificates by running this command:
sudo certbot renew --dry-run
Wish you all the best.
Fixtures in ERPNext and the Frappe Framework is a tool to help export Data and Settings. When you need to have data migrated to your custom apps, fixtures will come in handy to help you achieve this.
A simple bench export-fixtures command creates a .json file with the information you want to migrate. This information can then be imported to the other application by running the bench migrate command.
Custom fields are also a way to add your custom fields to doctypes created by ERPNext, and ensure your fields will not get erased the next time you upgrade the instance.
In Software, multi-tenancy is an architecture in which a single instance of a software application serves multiple customers, who are called tenants. The application can be offered as a service or as a platform.
Companies today are leveraging software as a service, or SaaS, to provide data protection in a package that results in superior security, better economics and reduced overhead. One of the ways we do this is through multi-tenant architecture.
In today’s video, we will loon at how to implement multi-tenancy in ERPNext and the Frappe Framework.
Steps needed
bench config dns_multitenant on
bench new-site first.site
bench setup nginx
sudo service nginx reload
bench –site first.site install-app erpnext
After this is successful, navigate to /etc/hosts and make the following changes.
Please take into account the name of your sites. You will need to add a route for every site you add.
Add routes:
127.0.0.1 first.site
127.0.0.1 second.site