translate.py, regular express has bug: messages.extend(re.findall('"([^:,^"]*):', report.query))

12 views
Skip to first unread message

Y Y

unread,
Sep 9, 2014, 11:30:05 PM9/9/14
to erpnext-dev...@googlegroups.com
use query report query:
SELECT\n    `tabSupplier`.name as \"Supplier:Link/Supplier:120\",\n\t`tabSupplier`.supplier_name as \"Supplier Name::120\",\n\t`tabSupplier`.supplier_type as \"Supplier Type:Link/Supplier Type:120\",\n\tconcat_ws(', ', \n\t\ttrim(',' from `tabAddress`.address_line1), \n\t\ttrim(',' from tabAddress.address_line2), \n\t\ttabAddress.state, tabAddress.pincode, tabAddress.country\n\t) as 'Address::180',\n    concat_ws(', ', `tabContact`.first_name, `tabContact`.last_name) as 'Contact Name::180',\n\t`tabContact`.phone as \"Phone\",\n\t`tabContact`.mobile_no as \"Mobile No\",\n\t`tabContact`.email_id as \"Email Id::120\",\n\t`tabContact`.is_primary_contact as \"Is Primary Contact::120\"\nFROM\n\t`tabSupplier`\n\tleft join `tabAddress` on (\n\t\t`tabAddress`.supplier=`tabSupplier`.name\n\t)\n\tleft join `tabContact` on (\n\t\t`tabContact`.supplier=`tabSupplier`.name\n\t)\nWHERE\n\t`tabSupplier`.docstatus<2\nORDER BY\n\t`tabSupplier`.name asc", 
 "ref_doctype": "Supplier

say, Contact Name will miss found. as well as Phone   etc.

Please suggest if need to fix the regular express itself of change the query....

Thanks.

Rushabh Mehta

unread,
Sep 10, 2014, 1:18:19 AM9/10/14
to erpnext-dev...@googlegroups.com
Please fix if you can. 

Thanks for reporting!

--
Note:
 
If you are posting an issue,
 
1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/461b017f-41ec-4bdd-9f68-1b923aeee39c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Y Y

unread,
Sep 10, 2014, 1:35:16 AM9/10/14
to erpnext-dev...@googlegroups.com
In this case, fix the query would be better?

在 2014年9月10日星期三UTC+8下午1时18分19秒,rushabh写道:
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.

Rushabh Mehta

unread,
Sep 10, 2014, 1:37:19 AM9/10/14
to erpnext-dev...@googlegroups.com
Yeah - you are right, sorry did not see the query.


To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/37a049aa-ee6a-4a0f-aab9-ac4458fadaa8%40googlegroups.com.

Y Y

unread,
Sep 10, 2014, 1:41:38 AM9/10/14
to erpnext-dev...@googlegroups.com
I want to get another suggestion from you for fix Script Report, you know that Script Report doesn't have query, thus, currently frappe doesn't get Script Report column translations into __message.

I know that Script Report, say supplier_wise_sales_analytics.py, its columns are:
columns = ["Item:Link/Item:100"] + ["Item Name::100"] + \
["Description::150"] + ["UOM:Link/UOM:90"] + \
["Consumed Qty:Float:110"] + ["Consumed Amount:Currency:130"] + \
["Delivered Qty:Float:110"] + ["Delivered Amount:Currency:130"] + \
["Total Qty:Float:110"] + ["Total Amount:Currency:130"] + \
["Supplier(s)::250"]

How to i obtain translations for those columns, is that also need to do change in translate.py?

Best,
yang


在 2014年9月10日星期三UTC+8下午1时37分19秒,rushabh写道:

Rushabh Mehta

unread,
Sep 10, 2014, 5:20:59 AM9/10/14
to erpnext-dev...@googlegroups.com
How about this?

[_("Item") + ":Link/Item:100"] + [_("Item Name") + "::100"] + ...


To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ede130de-39ff-4cbf-8511-16f62de96223%40googlegroups.com.

Y Y

unread,
Sep 10, 2014, 5:25:35 AM9/10/14
to erpnext-dev...@googlegroups.com
It does't work, as translate.py, get message from report method didn't check .py file, i'm working on this, will update.

在 2014年9月10日星期三UTC+8下午5时20分59秒,rushabh写道:
Reply all
Reply to author
Forward
0 new messages