erpnext
Open Source ERP built for the Web. Uses Python, MariaDB.
Free and Open Source Cloud ERP - ERPNext erp for entrepreneurs erpnext helps you take full control of your business.
I was trying to compare a custom date with date field in sql.I done the following query but it returned an error and rightfully so. I have my date value in date1
and want to comapare it with sale.posting_date
.I tried reading the related posts here,but no use.Can anyone help me?
def get_total(filters):
date1= filters.get("Date")
total_amount=frappe.db.sql("""SELECT SUM(sale.grand_total) FROM `tabSales Invoice` sale,`tabPayment` payment where payment.parent=sale.name and sale.posting_date = date1 """ )
return total_amount
Source: (StackOverflow)
I have installed ERPNext on Ubuntu, now I have a specific requirement where I want to install it on Windows OS.
I have download the following Pre requisites.
1. Python 2.7
2. MariaDB
What is the correct procedure to install erpnext on windows. ?
Source: (StackOverflow)
i am trying to install erpnext by running 'install_erpnext.py' and it gives an error message :
root@erpnext:~# python2.7 install_erpnext.py --create_user
useradd: user 'erpnext' already exists
Enter new UNIX password: Retype new UNIX password: passwd: password updated succ essfully
Operating System = Linux
Python Version = 2.7.3
Distribution = ubuntu
--------------------------------------------------------------------------------
Installing Packages: (This may take some time)
python python-setuptools python-dev build-essential python-mysqldb git memcached ntp vim screen htop
--------------------------------------------------------------------------------
MySQL Root user's Password:
--------------------------------------------------------------------------------
Installing Python Modules: (This may take some time)
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Pre-requisites Installed
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Installing ERPNext
--------------------------------------------------------------------------------
ERPNext Database Name: erpnext
Traceback (most recent call last):
File "install_erpnext.py", line 301, in <module>
File "install_erpnext.py", line 39, in install
File "install_erpnext.py", line 177, in install_erpnext
ImportError: No module named wnf
I don't know what to do now. I also try to copy the file 'erpnext/lib/wnf.py'and put it with 'install_erpnext.py' but it still gave the same error. I have already installed Python modules and other packages. thanks in advance...
Source: (StackOverflow)
I am using ERPNext which has a JSON API and Prestashop. As an example, I want to save transactions and so forth TO ERPNext FROM Prestashop when a client makes a purchase on Prestashop.
In essence, I would like to create a "Logic Hook" that gets triggered on the Prestashop side when a CRUD action occurs.
Examples:
1) A new user registers on Prestashop: The user is created as a client on ERPNext.
2) A client places an order on Prestashop: An order is created in ERPNext.
3) A contact is made on Prestashop: A ticket is created in ERPNext.
Where would I place the custom code (in Prestashop) for doing so, and how would it get fired?
I do not necessarily want to create new modules in Prestashop, just hook into or extend current functionality.
I know that I can access Prestashop's API / Webservice, but ideally, I would like to push transactions from Prestashop to the ERP, not the other way around.
Any help would be greatly appreciated.
It would be great if someone could point me in the right direction.
Source: (StackOverflow)
ERPNext + frappe need to change layout(footer & header) front-end. I tried to change base.html(frappe/templates/base.html) but nothing happened. Probably this is due to the fact that the html files need to somehow compile. Maybe someone have info how to do it?
UPDATE:
No such command "clear-cache".
Commands:
backup
backup-all-sites
config
get-app
init
migrate-3to4
new-app
new-site
patch
prime-wheel-cache
release
restart
set-default-site
set-mariadb-host
set-nginx-port
setup
shell
start
update
Source: (StackOverflow)
I have received code for a modified older version of ERPNext from a backup tarball, and I want to add this code into a local Git repository on my Ubuntu laptop so I can keep track of changes until my employer can host a remote repository. Assuming that the backup was already extracted in ~/backup/erpnext/
, I am trying to set up my Git repository for an initial commit like this:
cd ~
mkdir erpnext
cd erpnext
cp -r ~/backup/erpnext/* ./
git init
git add *
This, I thought, should add all of the files and folders in the backup to the ~/erpnext
directory and stage them all for an initial commit. However, just to make sure it all works as expected, I ran git status
before making a commit and was greeted with this output:
On branch master
Initial commit
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: app
new file: conf.py
new file: conf.pyc
new file: erpnext-backup.log
new file: erpnext-sch.log
new file: lib
new file: public/app
new file: public/app.html
new file: public/css/all-app.css
new file: public/css/all-web.css
new file: public/js/all-app.min.js
new file: public/js/all-web.min.js
new file: public/js/editor.min.js
new file: public/js/slickgrid.min.js
new file: public/lib
new file: scheduler.lock
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)
modified: app (modified content, untracked content)
modified: lib (modified content, untracked content)
What took me by surprise was that app
and lib
(which are both folders) were marked as having modified contents and were not staged for committing. I tried running git add --force
on *
, app
and lib
, but it doesn't seem to change anything.
I don't want to commit my code and have these folders excluded from the repository. How do I fix this?
Source: (StackOverflow)
I wanted to print barcodes using for loop in python. This is my code:
`{%- from "templates/print_formats/standard_macros.html" import add_header -%}
<hr>
{% set a = doc.end %}
{% set count = 0 %}
<div class="row">
{%- for i in range(doc.start,doc.end) -%}
<div class="col-md-4 text-center">
<p style="font-family: Code39AzaleaFont;font-weight: normal;font-style: normal;font-size:30px;">
00000000000000{{ i }}</p>
{% set count = count + 1 %}
{{count}}
<br/>
</div>
{%- endfor -%}
</div>
<hr>
<br>
<p class="strong">
<br>
<br>
<br>
{{ _("Authorized Signatory") }}
</p>
</div>`
The problem is,I wanted to restrict the number of barcodes printed on one sheet of paper to 24.Is there any way to do that?
Source: (StackOverflow)
I am a newbie to centos commands and scripting.
Scenario:
I have installed ERPNEXT and is working okay on the server but I have to do it manually by doing ./lib/wnfy.py --serve
What I want to do is to start it automatically using supervisord. I have gunicorn and nginx installed. Upon trying to start supervisord here's the error:
[root@vps3 etc]# chkconfig supervisord on [root@vps3 etc]# service
supervisord start /etc/init.d/supervisord: line 11:
./etc/rc.d/init.d/functionsprog=supervisord: No such file or directory
Starting : daemon --pidfile [ -f ]/etc/init.d/supervisord: line 14:
success: command not found /etc/init.d/supervisord: line 14: failure:
command not found
I am not yet familiar with how things work. Please advise. Thanks in advance.
Source: (StackOverflow)
I was trying to retrieve some data from DB in Python.and I got this error:
Traceback:
Traceback (innermost last):
File "/home/adminuser/frappe-bench-hitech/apps/frappe/frappe/app.py", line 49, in application
response = frappe.handler.handle()
File "/home/adminuser/frappe-bench-hitech/apps/frappe/frappe/handler.py", line 66, in handle
execute_cmd(cmd)
File "/home/adminuser/frappe-bench-hitech/apps/frappe/frappe/handler.py", line 77, in execute_cmd
method = get_attr(cmd)
File "/home/adminuser/frappe-bench-hitech/apps/frappe/frappe/handler.py", line 98, in get_attr
method = frappe.get_attr(cmd)
File "/home/adminuser/frappe-bench- hitech/apps/frappe/frappe/__init__.py", line 519, in get_attr
return getattr(get_module(modulename), methodname)
AttributeError: 'module' object has no attribute 'generate_barcode'
here is what I was doing:
@frappe.whitelist()
def generate_barcode(self):
brand=self.get("brand_code")
final_barcode="%05d" % random.randint(0,9999)
return {'final_barcode':final_barcode,'brand':brand}
can anyone help me?
Source: (StackOverflow)
Im quite new in here, but it seems to be the place where i should ask my question.
I'm in the progress of writing my bachelor, and for that my assigned task is to implement an ERP system.
I have choosen the open source platform erpnext, where i have the posibility to write custom javascripts for certain tasks.
I do have my javascript code which will convert my serial number from 012+00002GF SN200011+0593 to 200011-0593 and B133924(start serial) SN0020(End serial) R204 Y1345 CZ to 133924-0020.
<script type="text/javascript">
function convertSN(value) {
var splitted = value.split(" ");
if (splitted.length === 2) {
document.getElementById("done").value = splitted[1].substring(2).replace("+","-");
}
else if (splitted.length === 5) {
document.getElementById("done").value = splitted[0].substring(1)+"-"+splitted[1].substring(2);
}
}
</script>
But since erpnext is running of frappe framework, i need to add a listener so it will point directly to the field "add serial"
frappe.ui.form.on("Stock Entry", "add_serial", function(frm) {
// "frm.doc" will give you access to all properties of the doc
}):
My question is how do i combine my javescript with the listener in web_form.
I know this is quite a vague question, and i must admit that i have absolutly not technical/programming skills. I am very new at this!
The supporter of the system guided me to the following page, but must say that i cant see what to do.
https://github.com/frappe/frappe/blob/76d5075bbcbcb2503f6400ee0f92f5a72579684d/frappe/website/doctype/web_form/web_form.js#L30
Hope someone can help me.
Source: (StackOverflow)
I am trying to install ERPnext
on my cpanel
.
But I am getting Missing Dependency: libmysqlclient_r.so.15()(64bit)
this message from the script.
I have googled it but no helpful material was found .
As far as I knows from my research I have to install mysql-devel
on my server but when I tryed to install it. I gets a message that it is already installed on the server.
Any idea how can I get it resolved or what should I do
Image of my terminal
Source: (StackOverflow)
I was trying to filter some data's from db using sale.posting_date
and payment.mode_of_payment
.
when I try to filter using payment.mode_of_payment=Cash
:I got the following error:
"Unknown column 'payment.mode_of_payment' in 'where clause'"
from __future__ import unicode_literals
import frappe
from frappe import _, msgprint
from frappe.utils import flt
def execute(filters=None):
if not filters: filters = {}
columns = get_columns()
data = get_entries(filters)
if data:
total=get_total(filters)
paid_amount=get_paid_amount(filters)
data.append(['Total ','','',total,paid_amount])
return columns, data
def get_columns():
return [_("Sales Invoice") + ":Link/Sales Invoice:140", _("Customer") + ":Link/Customer:140", _(" Mode of Payment") + ":200",
_("Total Amount") + ":200",
_("Paid Amount") + ":120"
]
def get_conditions(filters):
conditions = ""
if not filters.get("Date"):
msgprint(_("Please select Date"), raise_exception=1
)
else:
conditions += " and sale.posting_date = '%s'" % filters["Date"]
if filters.get("Mode of Payment"): conditions += " and payment.mode_of_payment='%s'" % filters["Mode of Payment"]
# if filters.get("Mode of Payment"): conditions += " and payment.mode_of_payment=%(Mode of Payment)s"
return conditions
def get_entries(filters):
conditions = get_conditions(filters)
entries = frappe.db.sql("""select payment.parent, sale.customer,payment.mode_of_payment,
sale.grand_total, payment.paid_amount
from `tabSales Invoice` sale, `tabPayment` payment
where payment.parent=sale.name %s
order by payment.parent DESC""" %
conditions, filters, as_list=1)
return entries
def get_total(filters):
conditions = get_conditions(filters)
date1= filters.get("Date")
mode= filters.get("Mode of Payment")
total_amount=frappe.db.sql("""SELECT SUM(sale.grand_total) FROM `tabSales Invoice` sale where sale.grand_total=sale.rounded_total %s """ % conditions, filters )
# total_amount=frappe.db.sql("""SELECT SUM(sale.grand_total) FROM `tabSales Invoice` sale , `tabPayment` payment where sale.posting_date= %s """ % date1 )
print total_amount
return total_amount
def get_paid_amount(filters):
conditions = get_conditions(filters)
date1= filters.get("Date")
paid_amount=frappe.db.sql("""SELECT SUM(payment.paid_amount) FROM `tabSales Invoice` sale, `tabPayment` payment where payment.parent=sale.name %s """ % conditions, filters )
return paid_amount
Traceback:
Traceback (innermost last):
File "/home/adminuser/frappe-bench-hitech/apps/frappe/frappe/app.py", line 49, in application
response = frappe.handler.handle()
File "/home/adminuser/frappe-bench-hitech/apps/frappe/frappe/handler.py", line 66, in handle
execute_cmd(cmd)
File "/home/adminuser/frappe-bench-hitech/apps/frappe/frappe/handler.py", line 89, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File "/home/adminuser/frappe-bench-hitech/apps/frappe/frappe/__init__.py", line 531, in call
return fn(*args, **newargs)
File "/home/adminuser/frappe-bench-hitech/apps/frappe/frappe/widgets/query_report.py", line 87, in run
columns, result = frappe.get_attr(method_name)(frappe._dict(filters))
File "/home/adminuser/frappe-bench-hitech/apps/erpnext/erpnext/accounts/report/daily_sales__report/daily_sales__report.py", line 16, in execute
total=get_total(filters)
File "/home/adminuser/frappe-bench-hitech/apps/erpnext/erpnext/accounts/report/daily_sales__report/daily_sales__report.py", line 54, in get_total
total_amount=frappe.db.sql("""SELECT SUM(sale.grand_total) FROM `tabSales Invoice` sale where sale.grand_total=sale.rounded_total %s """ % conditions, filters )
File "/home/adminuser/frappe-bench-hitech/apps/frappe/frappe/database.py", line 110, in sql
self._cursor.execute(query, values)
File "/home/adminuser/frappe-bench-hitech/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
self.errorhandler(self, exc, value)
File "/home/adminuser/frappe-bench-hitech/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'payment.mode_of_payment' in 'where clause'")
Can someone help me?
Source: (StackOverflow)
I am trying to install ERPNext on my system at Ubuntu environment.but after
python2.7 install_erpnext.py commond it stuck.
it said that it take time,i had wait for a day but process stucked at same position
please see the screenshot
Source: (StackOverflow)