merge upstream

bzr revid: chs@openerp.com-20111108163644-8mlg48lua376lzgg
This commit is contained in:
Christophe Simonis
2011-11-08 17:36:44 +01:00
121 changed files with 4847 additions and 1215 deletions
+5
View File
@@ -11,6 +11,7 @@
"static/lib/datejs/sugarpak.js",
"static/lib/datejs/extras.js",
"static/lib/jquery/jquery-1.6.2.js",
"static/lib/jquery.MD5/jquery.md5.js",
"static/lib/jquery.form/jquery.form.js",
"static/lib/jquery.validate/jquery.validate.js",
"static/lib/jquery.ba-bbq/jquery.ba-bbq.js",
@@ -43,6 +44,7 @@
"static/src/js/view_list.js",
"static/src/js/view_list_editable.js",
"static/src/js/view_tree.js",
"static/src/js/view_editor.js"
],
'css' : [
"static/lib/jquery.superfish/css/superfish.css",
@@ -52,4 +54,7 @@
"static/src/css/data_export.css",
"static/src/css/data_import.css",
],
'qweb' : [
"static/src/xml/*.xml",
],
}
+17 -2
View File
@@ -129,6 +129,18 @@ class XmlRPCConnector(Connector):
# TODO should try except and wrap exception into LibException
return getattr(service, method)(*args)
class XmlRPCSConnector(XmlRPCConnector):
"""
A type of connector that uses the secured XMLRPC protocol.
"""
PROTOCOL = 'xmlrpcs'
__logger = _getChildLogger(_logger, 'connector.xmlrpcs')
def __init__(self, hostname, port=8071):
super(XmlRPCSConnector, self).__init__(hostname, port)
self.url = 'https://%s:%d/xmlrpc' % (self.hostname, self.port)
class NetRPC_Exception(Exception):
"""
Exception for NetRPC errors.
@@ -438,6 +450,7 @@ class Model(object):
:return: A list of dictionaries containing all the specified fields.
"""
record_ids = self.search(domain or [], offset, limit or False, order or False, context or {})
if not record_ids: return []
records = self.read(record_ids, fields or [], context or {})
return records
@@ -450,15 +463,17 @@ def get_connector(hostname=None, protocol="xmlrpc", port="auto"):
:param port: The number of the port. Defaults to auto.
"""
if port == 'auto':
port = 8069 if protocol=="xmlrpc" else 8070
port = 8069 if protocol=="xmlrpc" else (8070 if protocol == "netrpc" else 8071)
if protocol == "xmlrpc":
return XmlRPCConnector(hostname, port)
elif protocol == "xmlrpcs":
return XmlRPCSConnector(hostname, port)
elif protocol == "netrpc":
return NetRPCConnector(hostname, port)
elif protocol == "local":
return LocalConnector()
else:
raise ValueError("You must choose xmlrpc or netrpc or local")
raise ValueError("You must choose xmlrpc(s), netrpc or local")
def get_connection(hostname=None, protocol="xmlrpc", port='auto', database=None,
login=None, password=None, user_id=None):
+79 -7
View File
@@ -24,19 +24,51 @@ openerpweb = web.common.http
# OpenERP Web web Controllers
#----------------------------------------------------------
def concat_files(file_list):
""" Concatenate file content
def concat_xml(file_list):
"""Concatenate xml files
return (concat,timestamp)
concat: concatenation of file content
timestamp: max(os.path.getmtime of file_list)
"""
root = None
files_timestamp = 0
for fname in file_list:
ftime = os.path.getmtime(fname)
if ftime > files_timestamp:
files_timestamp = ftime
xml = ElementTree.parse(fname).getroot()
if root is None:
root = ElementTree.Element(xml.tag)
#elif root.tag != xml.tag:
# raise ValueError("Root tags missmatch: %r != %r" % (root.tag, xml.tag))
for child in xml.getchildren():
root.append(child)
return ElementTree.tostring(root, 'utf-8'), files_timestamp
def concat_files(file_list, reader=None):
""" Concatenate file content
return (concat,timestamp)
concat: concatenation of file content, read by `reader`
timestamp: max(os.path.getmtime of file_list)
"""
if reader is None:
def reader(f):
with open(f) as fp:
return fp.read()
files_content = []
files_timestamp = 0
for fname in file_list:
ftime = os.path.getmtime(fname)
if ftime > files_timestamp:
files_timestamp = ftime
files_content.append(open(fname).read())
files_content.append(reader(fname))
files_concat = "".join(files_content)
return files_concat,files_timestamp
@@ -98,10 +130,42 @@ class WebClient(openerpweb.Controller):
def jslist(self, req, mods=None):
return self.manifest_list(req, mods, 'js')
@openerpweb.jsonrequest
def qweblist(self, req, mods=None):
return self.manifest_list(req, mods, 'qweb')
@openerpweb.httprequest
def css(self, req, mods=None):
files = [f[0] for f in self.manifest_glob(req, mods, 'css')]
content,timestamp = concat_files(files)
files = list(self.manifest_glob(req, mods, 'css'))
file_map = dict(files)
rx_import = re.compile(r"""@import\s+('|")(?!'|"|/|https?://)""", re.U)
rx_url = re.compile(r"""url\s*\(\s*('|"|)(?!'|"|/|https?://)""", re.U)
def reader(f):
"""read the a css file and absolutify all relative uris"""
with open(f) as fp:
data = fp.read()
web_path = file_map[f]
web_dir = os.path.dirname(web_path)
data = re.sub(
rx_import,
r"""@import \1%s/""" % (web_dir,),
data,
)
data = re.sub(
rx_url,
r"""url(\1%s/""" % (web_dir,),
data,
)
return data
content,timestamp = concat_files((f[0] for f in files), reader)
# TODO use timestamp to set Last mofified date and E-tag
return req.make_response(content, [('Content-Type', 'text/css')])
@@ -112,6 +176,14 @@ class WebClient(openerpweb.Controller):
# TODO use timestamp to set Last mofified date and E-tag
return req.make_response(content, [('Content-Type', 'application/javascript')])
@openerpweb.httprequest
def qweb(self, req, mods=None):
files = [f[0] for f in self.manifest_glob(req, mods, 'qweb')]
content,timestamp = concat_xml(files)
# TODO use timestamp to set Last mofified date and E-tag
return req.make_response(content, [('Content-Type', 'text/xml')])
@openerpweb.httprequest
def home(self, req, s_action=None, **kw):
js = "\n ".join('<script type="text/javascript" src="%s"></script>'%i for i in self.manifest_list(req, None, 'js'))
@@ -451,7 +523,7 @@ def clean_action(req, action, do_not_eval=False):
# values come from the server, we can just eval them
if isinstance(action.get('context'), basestring):
action['context'] = eval( action['context'], eval_ctx ) or {}
if isinstance(action.get('domain'), basestring):
action['domain'] = eval( action['domain'], eval_ctx ) or []
else:
@@ -1412,7 +1484,7 @@ class Import(View):
return fields
@openerpweb.httprequest
def detect_data(self, req, csvfile, csvsep, csvdel, csvcode, jsonp):
def detect_data(self, req, csvfile, csvsep=',', csvdel='"', csvcode='utf-8', jsonp='callback'):
try:
data = list(csv.reader(
csvfile, quotechar=str(csvdel), delimiter=str(csvsep)))
+699
View File
@@ -0,0 +1,699 @@
# Arabic translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:38+0200\n"
"PO-Revision-Date: 2011-11-08 05:44+0000\n"
"Last-Translator: Ahmad Khayyat <Unknown>\n"
"Language-Team: Arabic <ar@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-08 06:12+0000\n"
"X-Generator: Launchpad (build 14231)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
"Warning, the record has been modified, your changes will be discarded."
msgstr "تحذير، تم تحرير السجل، تعديلاتك سيتم تجاهلها"
#: addons/web/static/src/js/view_form.js:1659
msgid "<em>   Search More...</em>"
msgstr "<em>    مزيداً من البحث...</em>"
#: addons/web/static/src/js/view_form.js:1672
#, python-format
msgid "<em>   Create \"<strong>%s</strong>\"</em>"
msgstr "<em>   إنشاء \"<strong>%s</strong>\"</em>"
#: addons/web/static/src/js/view_form.js:1678
msgid "<em>   Create and Edit...</em>"
msgstr "<em>   إنشاء و تحرير...</em>"
#: addons/web/static/src/js/views.js:568
msgid "You must choose at least one record."
msgstr "عليك إختيار سجل واحد علي الأقل."
#: addons/web/static/src/js/views.js:569
msgid "Warning"
msgstr "تحذير"
#: addons/web/static/src/js/views.js:609
msgid "Translations"
msgstr "ترجمات"
#: addons/web/static/src/js/views.js:614 addons/web/static/src/xml/base.xml:0
msgid "Save"
msgstr "حفظ"
#: addons/web/static/src/js/views.js:615
msgid "Close"
msgstr "إغلاق"
#: addons/web/static/src/xml/base.xml:0
msgid "x"
msgstr "x"
#: addons/web/static/src/xml/base.xml:0
msgid "#{title}"
msgstr "#{لقب}"
#: addons/web/static/src/xml/base.xml:0
msgid "#{text}"
msgstr "#{text}"
#: addons/web/static/src/xml/base.xml:0
msgid "Powered by"
msgstr "مدعوم من kifcaliph و"
#: addons/web/static/src/xml/base.xml:0
msgid "openerp.com"
msgstr "openerp.com"
#: addons/web/static/src/xml/base.xml:0
msgid "."
msgstr "."
#: addons/web/static/src/xml/base.xml:0
msgid "Loading..."
msgstr "جاري التحميل..."
#: addons/web/static/src/xml/base.xml:0
msgid "Create"
msgstr "إنشاء"
#: addons/web/static/src/xml/base.xml:0
msgid "Drop"
msgstr "إزالة"
#: addons/web/static/src/xml/base.xml:0
msgid "Backup"
msgstr "نسخة إحتياطية"
#: addons/web/static/src/xml/base.xml:0
msgid "Restore"
msgstr "استرجاع"
#: addons/web/static/src/xml/base.xml:0
msgid "Password"
msgstr "كلمة المرور"
#: addons/web/static/src/xml/base.xml:0
msgid "Back to Login"
msgstr "العودة للدخول"
#: addons/web/static/src/xml/base.xml:0
msgid "CREATE DATABASE"
msgstr "إنشاء قاعدة بيانات"
#: addons/web/static/src/xml/base.xml:0
msgid "Master password:"
msgstr "كلمة المرور الرئيسية:"
#: addons/web/static/src/xml/base.xml:0
msgid "New database name:"
msgstr "اسم قاعدة البيانات الجديدة:"
#: addons/web/static/src/xml/base.xml:0
msgid "Load Demonstration data:"
msgstr "تحميل البيانات الوهمية:"
#: addons/web/static/src/xml/base.xml:0
msgid "Default language:"
msgstr "اللغة الافتراضية:"
#: addons/web/static/src/xml/base.xml:0
msgid "Admin password:"
msgstr "كلمة مرور المشرف العام:"
#: addons/web/static/src/xml/base.xml:0
msgid "Confirm password:"
msgstr "تأكيد كلمة المرور:"
#: addons/web/static/src/xml/base.xml:0
msgid "DROP DATABASE"
msgstr "إسقاط قاعدة البيانات"
#: addons/web/static/src/xml/base.xml:0
msgid "Database:"
msgstr "قاعدة البيانات:"
#: addons/web/static/src/xml/base.xml:0
msgid "Master Password:"
msgstr "كلمة المرور الرئيسية:"
#: addons/web/static/src/xml/base.xml:0
msgid "BACKUP DATABASE"
msgstr "نسخ إحتياطي لقاعدة البيانات"
#: addons/web/static/src/xml/base.xml:0
msgid "RESTORE DATABASE"
msgstr "إسترجاع قاعدة بيانات"
#: addons/web/static/src/xml/base.xml:0
msgid "File:"
msgstr "ملف:"
#: addons/web/static/src/xml/base.xml:0
msgid "CHANGE MASTER PASSWORD"
msgstr "تغيير كلمة المرور الرئيسية"
#: addons/web/static/src/xml/base.xml:0
msgid "New master password:"
msgstr "كلمة مرور رئيسية جديدة:"
#: addons/web/static/src/xml/base.xml:0
msgid "Confirm new master password:"
msgstr "تأكيد كلمة المرور الرئيسية الجديدة:"
#: addons/web/static/src/xml/base.xml:0
msgid "User:"
msgstr "مستخدم:"
#: addons/web/static/src/xml/base.xml:0
msgid "Password:"
msgstr "كلمة المرور:"
#: addons/web/static/src/xml/base.xml:0
msgid "Database"
msgstr "قاعدة بيانات"
#: addons/web/static/src/xml/base.xml:0
msgid "Login"
msgstr "تسجيل الدخول"
#: addons/web/static/src/xml/base.xml:0
msgid "Bad username or password"
msgstr "اسم مستخدم او كلمة مرور خاطئة"
#: addons/web/static/src/xml/base.xml:0
msgid ""
"We think that daily job activities can be more intuitive, efficient, "
"automated, .. and even fun."
msgstr "نؤمن بأن نشاط العمل اليومي يمكن أن يكون بديهي، فعال، سريع و ممتع"
#: addons/web/static/src/xml/base.xml:0
msgid "OpenERP's vision to be:"
msgstr "رؤي برنامج OpenERP هي:"
#: addons/web/static/src/xml/base.xml:0
msgid "Full featured"
msgstr "كامل الأوصاف"
#: addons/web/static/src/xml/base.xml:0
msgid ""
"Today's enterprise challenges are multiple. We provide one module for each "
"need."
msgstr ""
"تتعدد تحديات المنشآت اليوم، و لذلك نوفر العديد من الوحدات البرمجية لكل "
"احتياج."
#: addons/web/static/src/xml/base.xml:0
msgid "Open Source"
msgstr "مفتوح المصدر"
#: addons/web/static/src/xml/base.xml:0
msgid ""
"To Build a great product, we rely on the knowledge of thousands of "
"contributors."
msgstr "لبناء منتج قوي، نحن نعتمد علي معرفة ألاف المساهمين."
#: addons/web/static/src/xml/base.xml:0
msgid "User Friendly"
msgstr "سهل الإستخدام"
#: addons/web/static/src/xml/base.xml:0
msgid ""
"In order to be productive, people need clean and easy to use interface."
msgstr "تتمثل الإنتاجية في حاجة الأفراد إلي إستخدام واجهة سهلة و لائقة."
#: addons/web/static/src/xml/base.xml:0
msgid "("
msgstr "("
#: addons/web/static/src/xml/base.xml:0
msgid ")"
msgstr ")"
#: addons/web/static/src/xml/base.xml:0
msgid "LOGOUT"
msgstr "تسجيل الخروج"
#: addons/web/static/src/xml/base.xml:0
msgid "&laquo;"
msgstr "&laquo;"
#: addons/web/static/src/xml/base.xml:0
msgid "&raquo;"
msgstr "&raquo;"
#: addons/web/static/src/xml/base.xml:0
msgid "oe_secondary_menu_item"
msgstr "oe_secondary_menu_item"
#: addons/web/static/src/xml/base.xml:0
msgid "oe_secondary_submenu_item"
msgstr "oe_secondary_submenu_item"
#: addons/web/static/src/xml/base.xml:0
msgid "Hide this tip"
msgstr "إخفاء هذه الملحوظة"
#: addons/web/static/src/xml/base.xml:0
msgid "Disable all tips"
msgstr "تعطيل جميع الإرشادات"
#: addons/web/static/src/xml/base.xml:0
msgid "View#"
msgstr "View#"
#: addons/web/static/src/xml/base.xml:0
msgid "Fields"
msgstr "حقول"
#: addons/web/static/src/xml/base.xml:0
msgid "View labels"
msgstr "عرض التسميات"
#: addons/web/static/src/xml/base.xml:0
msgid "Sidebar Relates"
msgstr "روابط الشريط الجانبي"
#: addons/web/static/src/xml/base.xml:0
msgid "Field"
msgstr "حقل"
#: addons/web/static/src/xml/base.xml:0
msgid ":"
msgstr ":"
#: addons/web/static/src/xml/base.xml:0
msgid "Translate view"
msgstr "ترجمة العرض"
#: addons/web/static/src/xml/base.xml:0
msgid "Translate sidebar"
msgstr "ترجمة الشريط الجانبي"
#: addons/web/static/src/xml/base.xml:0
msgid "Delete"
msgstr "حذف"
#: addons/web/static/src/xml/base.xml:0
msgid "First"
msgstr "الأول"
#: addons/web/static/src/xml/base.xml:0
msgid "<"
msgstr "<"
#: addons/web/static/src/xml/base.xml:0
msgid ">"
msgstr ">"
#: addons/web/static/src/xml/base.xml:0
msgid "Last"
msgstr "الأخير"
#: addons/web/static/src/xml/base.xml:0
msgid "♻"
msgstr "♻"
#: addons/web/static/src/xml/base.xml:0
msgid "Save & Edit"
msgstr "حفظ و تحرير"
#: addons/web/static/src/xml/base.xml:0
msgid "Create & Edit"
msgstr "إنشاء و تحرير"
#: addons/web/static/src/xml/base.xml:0
msgid "New"
msgstr "جديد"
#: addons/web/static/src/xml/base.xml:0
msgid "Duplicate"
msgstr "تكرار"
#: addons/web/static/src/xml/base.xml:0
msgid "Readonly/Editable"
msgstr "للقراءة فقط/قابل للتحرير"
#: addons/web/static/src/xml/base.xml:0
msgid "<<"
msgstr ">>"
#: addons/web/static/src/xml/base.xml:0
msgid "0"
msgstr "0"
#: addons/web/static/src/xml/base.xml:0
msgid "/"
msgstr "/"
#: addons/web/static/src/xml/base.xml:0
msgid ">>"
msgstr ">>"
#: addons/web/static/src/xml/base.xml:0
msgid "Add"
msgstr "اضافة"
#: addons/web/static/src/xml/base.xml:0
msgid "Unhandled widget"
msgstr "أداة غير معالجة"
#: addons/web/static/src/xml/base.xml:0
msgid "?"
msgstr "؟"
#: addons/web/static/src/xml/base.xml:0
msgid "#"
msgstr "#"
#: addons/web/static/src/xml/base.xml:0
msgid "Done"
msgstr "تم"
#: addons/web/static/src/xml/base.xml:0
msgid "Open..."
msgstr "فتح..."
#: addons/web/static/src/xml/base.xml:0
msgid "Create..."
msgstr "إنشاء..."
#: addons/web/static/src/xml/base.xml:0
msgid "Search..."
msgstr "بحث..."
#: addons/web/static/src/xml/base.xml:0
msgid "..."
msgstr "..."
#: addons/web/static/src/xml/base.xml:0
msgid "Uploading ..."
msgstr "جاري التحميل..."
#: addons/web/static/src/xml/base.xml:0
msgid "Select"
msgstr "حدّد"
#: addons/web/static/src/xml/base.xml:0
msgid "Save As"
msgstr "حفظ كـ"
#: addons/web/static/src/xml/base.xml:0
msgid "Clear"
msgstr "إفراغ"
#: addons/web/static/src/xml/base.xml:0
msgid "Advanced Filter"
msgstr "مرشحات متقدمة"
#: addons/web/static/src/xml/base.xml:0
msgid "-- Filters --"
msgstr "-- مرشحات --"
#: addons/web/static/src/xml/base.xml:0
msgid "-- Actions --"
msgstr "-- إجراءات --"
#: addons/web/static/src/xml/base.xml:0
msgid "Save Filter"
msgstr "حفظ المرشح"
#: addons/web/static/src/xml/base.xml:0
msgid "Manage Filters"
msgstr "إدارة المرشحات"
#: addons/web/static/src/xml/base.xml:0
msgid "Filter Name:"
msgstr "اسم المرشح:"
#: addons/web/static/src/xml/base.xml:0
msgid "(Any existing filter with the same name will be replaced)"
msgstr "(لاحظ أن أي مرشح بنفس الاسم سيتم إستبداله)"
#: addons/web/static/src/xml/base.xml:0
msgid "Any of the following conditions must match"
msgstr "يجب تطابق أي من الشروط التالية"
#: addons/web/static/src/xml/base.xml:0
msgid "All the following conditions must match"
msgstr "يجب تطابق كل الشروط التالية"
#: addons/web/static/src/xml/base.xml:0
msgid "None of the following conditions must match"
msgstr "لا يجب تطابق أي من الشروط التالية"
#: addons/web/static/src/xml/base.xml:0
msgid "Add condition"
msgstr "إضافة شرط"
#: addons/web/static/src/xml/base.xml:0
msgid "and"
msgstr "و"
#: addons/web/static/src/xml/base.xml:0
msgid "Cancel"
msgstr "إلغاء"
#: addons/web/static/src/xml/base.xml:0
msgid "Save & New"
msgstr "حفظ و جديد"
#: addons/web/static/src/xml/base.xml:0
msgid "Save & Close"
msgstr "حفظ و إغلاق"
#: addons/web/static/src/xml/base.xml:0
msgid "Export"
msgstr "تصدير"
#: addons/web/static/src/xml/base.xml:0
msgid ""
"This wizard will export all data that matches the current search criteria to "
"a CSV file.\n"
" You can export all data or only the fields that can be "
"reimported after modification."
msgstr ""
"هذا المعالج سيقوم بتصدير كافة البيانات التي تطابق شروط البحث الحالية لملف "
"CSV.\n"
" يمكنك تصدير كل البيانات أو الحقول التي يمكن إستيرادها بعد "
"التعديل."
#: addons/web/static/src/xml/base.xml:0
msgid "Export Type:"
msgstr "نوع التصدير:"
#: addons/web/static/src/xml/base.xml:0
msgid "Import Compatible Export"
msgstr "إستيراد بيانات ملائمة للتصدير"
#: addons/web/static/src/xml/base.xml:0
msgid "Export all Data"
msgstr "تصدير جميع البيانات"
#: addons/web/static/src/xml/base.xml:0
msgid "Export Formats"
msgstr "تنسيقات التصدير"
#: addons/web/static/src/xml/base.xml:0
msgid "Available fields"
msgstr "الحقول المتوفرة"
#: addons/web/static/src/xml/base.xml:0
msgid "Fields to export"
msgstr "حقول للتصدير"
#: addons/web/static/src/xml/base.xml:0
msgid "Save fields list"
msgstr "حفظ قائمة الحقول"
#: addons/web/static/src/xml/base.xml:0
msgid "Remove"
msgstr "إزالة"
#: addons/web/static/src/xml/base.xml:0
msgid "Remove All"
msgstr "إزالة الكل"
#: addons/web/static/src/xml/base.xml:0
msgid "Name"
msgstr "اسم"
#: addons/web/static/src/xml/base.xml:0
msgid "&nbsp;"
msgstr "&nbsp;"
#: addons/web/static/src/xml/base.xml:0
msgid "Save as:"
msgstr "حفظ باسم:"
#: addons/web/static/src/xml/base.xml:0
msgid "Ok"
msgstr "تم"
#: addons/web/static/src/xml/base.xml:0
msgid "Saved exports:"
msgstr "مُصدرة محفوظة:"
#: addons/web/static/src/xml/base.xml:0
msgid "Old Password:"
msgstr "كلمة المرور القديمة:"
#: addons/web/static/src/xml/base.xml:0
msgid "New Password:"
msgstr "كلمة المرور الجديدة:"
#: addons/web/static/src/xml/base.xml:0
msgid "Confirm Password:"
msgstr "تأكيد كلمة المرور:"
#: addons/web/static/src/xml/base.xml:0
msgid "Import"
msgstr "استيراد"
#: addons/web/static/src/xml/base.xml:0
msgid "1. Import a .CSV file"
msgstr "إستيراد ملف .CSV"
#: addons/web/static/src/xml/base.xml:0
msgid ""
"Select a .CSV file to import. If you need a sample of file to import,\n"
" you should use the export tool with the \"Import Compatible\" option."
msgstr ""
"اختر ملف .CSV للإستيراد. إذا كنت بحاجة إلى عينة ملف للاستيراد،\n"
" يجب عليك إستخدام أداة تصدير مع الخيار \" Compatible\" option."
#: addons/web/static/src/xml/base.xml:0
msgid "CSV File:"
msgstr "ملف CSV :"
#: addons/web/static/src/xml/base.xml:0
msgid "2. Check your file format"
msgstr "تأكد من إمتداد الملف"
#: addons/web/static/src/xml/base.xml:0
msgid "Import Options"
msgstr "خيارات الاستيراد"
#: addons/web/static/src/xml/base.xml:0
msgid "Does your file have titles?"
msgstr "هل لملفك عناوين؟"
#: addons/web/static/src/xml/base.xml:0
msgid "Separator:"
msgstr "فاصل :"
#: addons/web/static/src/xml/base.xml:0
msgid "Delimiter:"
msgstr "محدد:"
#: addons/web/static/src/xml/base.xml:0
msgid "Encoding:"
msgstr "ترميز:"
#: addons/web/static/src/xml/base.xml:0
msgid "UTF-8"
msgstr "UTF-8"
#: addons/web/static/src/xml/base.xml:0
msgid "Latin 1"
msgstr "Latin 1"
#: addons/web/static/src/xml/base.xml:0
msgid "Lines to skip"
msgstr "خطوط للتجاهل"
#: addons/web/static/src/xml/base.xml:0
msgid "The import failed due to:"
msgstr "فشلت عملية الإستيراد للأسباب التالية:"
#: addons/web/static/src/xml/base.xml:0
msgid "Here is a preview of the file we could not import:"
msgstr "هذه معاينة لملف لم يتمكن من إستيراده:"
#: addons/web/static/src/xml/base.xml:0
msgid "OpenERP Web"
msgstr "OpenERP عبر الإنترنت"
#: addons/web/static/src/xml/base.xml:0
msgid "Version"
msgstr "الإصدار"
#: addons/web/static/src/xml/base.xml:0
msgid "Copyright © 2011-TODAY OpenERP SA. All Rights Reserved."
msgstr "جميع حقوق النشر محفوظة لـ © 2011-TODAY OpenERP SA."
#: addons/web/static/src/xml/base.xml:0
msgid "OpenERP is a trademark of the"
msgstr "OpenERP هي علامة تجارية لـ"
#: addons/web/static/src/xml/base.xml:0
msgid "OpenERP SA Company"
msgstr "شركة OpenERP SA"
#: addons/web/static/src/xml/base.xml:0
msgid "Licenced under the terms of"
msgstr "النظام مرخص بشروط"
#: addons/web/static/src/xml/base.xml:0
msgid "GNU Affero General Public License"
msgstr "GNU Affero General Public License"
#: addons/web/static/src/xml/base.xml:0
msgid "About OpenERP"
msgstr "عن OpenERP"
#: addons/web/static/src/xml/base.xml:0
msgid "OpenERP"
msgstr "OpenERP"
#: addons/web/static/src/xml/base.xml:0
msgid ""
"is a free enterprise-scale software system that is designed to boost\n"
" productivity and profit through data integration. It connects, "
"improves and\n"
" manages business processes in areas such as sales, finance, "
"supply chain,\n"
" project management, production, services, CRM, etc..."
msgstr ""
"هو نظام حر يناسب المؤسسات و الشركات و تم تصميمه لتعزيز\n"
" الإنتاجية و الربح من خلال تكامل البيانات. فيمكنك من ربط، و "
"تحسين، و\n"
" إدارة العمليات التجارية في إدارات مثل المبيعات، المحاسبة "
"المالية، المخازن،\n"
" إدارة المشروعات، الإنتاج و العمليات الصناعية، و القطاع الخدمي، , "
"إدارة علاقات العملاء..."
#: addons/web/static/src/xml/base.xml:0
msgid ""
"The system is platform-independent, and can be installed on Windows, Mac OS "
"X,\n"
" and various Linux and other Unix-based distributions. Its "
"architecture enables\n"
" new functionality to be rapidly created, modifications to be "
"made to a\n"
" production system and migration to a new version to be "
"straightforward."
msgstr ""
"يعمل البرنامج مع العديد من الأنظمة مثل Windows، و Mac OS X، و\n"
" معظم أنظمة لينكس بالإضافة إلي اليونكس. فلقد تم تصميمه ليتيح "
"إمكانية\n"
" إضافة وظائف أخري له بسهولة، و برمجته و تعديله بسرعه ليلائم "
"الواقع العملي\n"
" كما أنه يتيح سهولة نقل البيانات من إصدار إلي إصدار."
#: addons/web/static/src/xml/base.xml:0
msgid ""
"Depending on your needs, OpenERP is available through a web or application "
"client."
msgstr ""
"حسب إحتياجاتك، نظام OpenERP متاح من خلال تطبيق الويب أو البرنامج المحلي."
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-12 04:44+0000\n"
"X-Generator: Launchpad (build 14124)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n"
"X-Generator: Launchpad (build 14123)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-08 05:29+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n"
"X-Generator: Launchpad (build 14123)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n"
"X-Generator: Launchpad (build 14185)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-09 05:22+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-08 05:29+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
+687
View File
@@ -0,0 +1,687 @@
# Polish translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:38+0200\n"
"PO-Revision-Date: 2011-11-04 16:44+0000\n"
"Last-Translator: Grzegorz Grzelak (OpenGLOBE.pl) <grzegorz@openglobe.pl>\n"
"Language-Team: Polish <pl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-05 06:04+0000\n"
"X-Generator: Launchpad (build 14231)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
"Warning, the record has been modified, your changes will be discarded."
msgstr "Uwaga, rekord został zmodyfikowany, twoje zmiany zostaną odrzucone."
#: addons/web/static/src/js/view_form.js:1659
msgid "<em>   Search More...</em>"
msgstr "<em>   Szukaj dalej...</em>"
#: addons/web/static/src/js/view_form.js:1672
#, python-format
msgid "<em>   Create \"<strong>%s</strong>\"</em>"
msgstr "<em>   Utwórz \"<strong>%s</strong>\"</em>"
#: addons/web/static/src/js/view_form.js:1678
msgid "<em>   Create and Edit...</em>"
msgstr "<em>   Utwórz i edytuj...</em>"
#: addons/web/static/src/js/views.js:568
msgid "You must choose at least one record."
msgstr "Musisz wybrac co najmniej jeden rekord."
#: addons/web/static/src/js/views.js:569
msgid "Warning"
msgstr "Ostrzeżenie"
#: addons/web/static/src/js/views.js:609
msgid "Translations"
msgstr "Tłumaczenia"
#: addons/web/static/src/js/views.js:614 addons/web/static/src/xml/base.xml:0
msgid "Save"
msgstr "Zapisz"
#: addons/web/static/src/js/views.js:615
msgid "Close"
msgstr "Zamknij"
#: addons/web/static/src/xml/base.xml:0
msgid "x"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "#{title}"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "#{text}"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "Powered by"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "openerp.com"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "."
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "Loading..."
msgstr "Wczytywanie..."
#: addons/web/static/src/xml/base.xml:0
msgid "Create"
msgstr "Utwórz"
#: addons/web/static/src/xml/base.xml:0
msgid "Drop"
msgstr "Usuń bazę danych"
#: addons/web/static/src/xml/base.xml:0
msgid "Backup"
msgstr "Kopia zapasowa bazy danych"
#: addons/web/static/src/xml/base.xml:0
msgid "Restore"
msgstr "Odtwórz bazę danych"
#: addons/web/static/src/xml/base.xml:0
msgid "Password"
msgstr "Hasło"
#: addons/web/static/src/xml/base.xml:0
msgid "Back to Login"
msgstr "Wróć do logowania"
#: addons/web/static/src/xml/base.xml:0
msgid "CREATE DATABASE"
msgstr "UTWÓRZ BAZĘ DANYCH"
#: addons/web/static/src/xml/base.xml:0
msgid "Master password:"
msgstr "Hasło madrzędne:"
#: addons/web/static/src/xml/base.xml:0
msgid "New database name:"
msgstr "Nazwa nowej bazy danych:"
#: addons/web/static/src/xml/base.xml:0
msgid "Load Demonstration data:"
msgstr "Wczytaj dane demonstracyjne:"
#: addons/web/static/src/xml/base.xml:0
msgid "Default language:"
msgstr "Domyślny język:"
#: addons/web/static/src/xml/base.xml:0
msgid "Admin password:"
msgstr "Hasło admina:"
#: addons/web/static/src/xml/base.xml:0
msgid "Confirm password:"
msgstr "Potwierdź hasło:"
#: addons/web/static/src/xml/base.xml:0
msgid "DROP DATABASE"
msgstr "USUŃ BAZĘ DANYCH"
#: addons/web/static/src/xml/base.xml:0
msgid "Database:"
msgstr "Baza danych:"
#: addons/web/static/src/xml/base.xml:0
msgid "Master Password:"
msgstr "Hasło nadrzędne:"
#: addons/web/static/src/xml/base.xml:0
msgid "BACKUP DATABASE"
msgstr "ZAPISZ BAZĘ"
#: addons/web/static/src/xml/base.xml:0
msgid "RESTORE DATABASE"
msgstr "ODTWÓRZ BAZĘ"
#: addons/web/static/src/xml/base.xml:0
msgid "File:"
msgstr "Plik:"
#: addons/web/static/src/xml/base.xml:0
msgid "CHANGE MASTER PASSWORD"
msgstr "ZMIEŃ HASŁO NADRZĘDNE"
#: addons/web/static/src/xml/base.xml:0
msgid "New master password:"
msgstr "Nowe hasło nadrzędne:"
#: addons/web/static/src/xml/base.xml:0
msgid "Confirm new master password:"
msgstr "Potwierdź nowe hasło nadrzędne:"
#: addons/web/static/src/xml/base.xml:0
msgid "User:"
msgstr "Użytkownik:"
#: addons/web/static/src/xml/base.xml:0
msgid "Password:"
msgstr "Hasło:"
#: addons/web/static/src/xml/base.xml:0
msgid "Database"
msgstr "Baza danych"
#: addons/web/static/src/xml/base.xml:0
msgid "Login"
msgstr "Login"
#: addons/web/static/src/xml/base.xml:0
msgid "Bad username or password"
msgstr "Niepoprawna nazwa użytkownika lub hasło"
#: addons/web/static/src/xml/base.xml:0
msgid ""
"We think that daily job activities can be more intuitive, efficient, "
"automated, .. and even fun."
msgstr ""
"Sądzimy, że codzienne zadania mogą być bardziej intuicyjne, efektywne, "
"zautomatyzowan, ... a nawet przyjemne."
#: addons/web/static/src/xml/base.xml:0
msgid "OpenERP's vision to be:"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "Full featured"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid ""
"Today's enterprise challenges are multiple. We provide one module for each "
"need."
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "Open Source"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid ""
"To Build a great product, we rely on the knowledge of thousands of "
"contributors."
msgstr ""
"Przy budowie wielkiego produktu polegamy na wiedzy tysięcy społeczników."
#: addons/web/static/src/xml/base.xml:0
msgid "User Friendly"
msgstr "Przyjazne dla użytkownika"
#: addons/web/static/src/xml/base.xml:0
msgid ""
"In order to be productive, people need clean and easy to use interface."
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "("
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid ")"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "LOGOUT"
msgstr "WYLOGUJ"
#: addons/web/static/src/xml/base.xml:0
msgid "&laquo;"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "&raquo;"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "oe_secondary_menu_item"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "oe_secondary_submenu_item"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "Hide this tip"
msgstr "Ukryj tę wskazówkę"
#: addons/web/static/src/xml/base.xml:0
msgid "Disable all tips"
msgstr "Wyłącz wszystkie wskazówki"
#: addons/web/static/src/xml/base.xml:0
msgid "View#"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "Fields"
msgstr "Pola"
#: addons/web/static/src/xml/base.xml:0
msgid "View labels"
msgstr "Pokaż etykiety"
#: addons/web/static/src/xml/base.xml:0
msgid "Sidebar Relates"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "Field"
msgstr "Pole"
#: addons/web/static/src/xml/base.xml:0
msgid ":"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "Translate view"
msgstr "Przetłumacz widok"
#: addons/web/static/src/xml/base.xml:0
msgid "Translate sidebar"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "Delete"
msgstr "Usuń"
#: addons/web/static/src/xml/base.xml:0
msgid "First"
msgstr "Pierwsze"
#: addons/web/static/src/xml/base.xml:0
msgid "<"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid ">"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "Last"
msgstr "Ostatnie"
#: addons/web/static/src/xml/base.xml:0
msgid "♻"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "Save & Edit"
msgstr "Zapisz i edytuj"
#: addons/web/static/src/xml/base.xml:0
msgid "Create & Edit"
msgstr "Utwórz i edytuj"
#: addons/web/static/src/xml/base.xml:0
msgid "New"
msgstr "Nowy"
#: addons/web/static/src/xml/base.xml:0
msgid "Duplicate"
msgstr "Duplikuj"
#: addons/web/static/src/xml/base.xml:0
msgid "Readonly/Editable"
msgstr "Tylko odczyt/Edytowalne"
#: addons/web/static/src/xml/base.xml:0
msgid "<<"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "0"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "/"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid ">>"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "Add"
msgstr "Dodaj"
#: addons/web/static/src/xml/base.xml:0
msgid "Unhandled widget"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "?"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "#"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "Done"
msgstr "Wykonano"
#: addons/web/static/src/xml/base.xml:0
msgid "Open..."
msgstr "Otwórz..."
#: addons/web/static/src/xml/base.xml:0
msgid "Create..."
msgstr "Utwórz..."
#: addons/web/static/src/xml/base.xml:0
msgid "Search..."
msgstr "Wyszukaj..."
#: addons/web/static/src/xml/base.xml:0
msgid "..."
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "Uploading ..."
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "Select"
msgstr "Wybierz"
#: addons/web/static/src/xml/base.xml:0
msgid "Save As"
msgstr "Zapisz jako"
#: addons/web/static/src/xml/base.xml:0
msgid "Clear"
msgstr "Wyczyść"
#: addons/web/static/src/xml/base.xml:0
msgid "Advanced Filter"
msgstr "Zaawansowany filtr"
#: addons/web/static/src/xml/base.xml:0
msgid "-- Filters --"
msgstr "-- Filtry --"
#: addons/web/static/src/xml/base.xml:0
msgid "-- Actions --"
msgstr "-- Akcje --"
#: addons/web/static/src/xml/base.xml:0
msgid "Save Filter"
msgstr "Zapisz filtr"
#: addons/web/static/src/xml/base.xml:0
msgid "Manage Filters"
msgstr "Zarządzaj filtrami"
#: addons/web/static/src/xml/base.xml:0
msgid "Filter Name:"
msgstr "Nazwa filtra:"
#: addons/web/static/src/xml/base.xml:0
msgid "(Any existing filter with the same name will be replaced)"
msgstr "(Każdy filtr o tej samej nazwie zostanie zamazany)"
#: addons/web/static/src/xml/base.xml:0
msgid "Any of the following conditions must match"
msgstr "Jeden z tych warunków musi być spełniony"
#: addons/web/static/src/xml/base.xml:0
msgid "All the following conditions must match"
msgstr "Wszystkie warunki muszą być spełnione"
#: addons/web/static/src/xml/base.xml:0
msgid "None of the following conditions must match"
msgstr "Żadeń z tych warunków nie może być spełniony"
#: addons/web/static/src/xml/base.xml:0
msgid "Add condition"
msgstr "Dodaj warunek"
#: addons/web/static/src/xml/base.xml:0
msgid "and"
msgstr "i"
#: addons/web/static/src/xml/base.xml:0
msgid "Cancel"
msgstr "Anuluj"
#: addons/web/static/src/xml/base.xml:0
msgid "Save & New"
msgstr "Zapisz i nowy"
#: addons/web/static/src/xml/base.xml:0
msgid "Save & Close"
msgstr "Zapisz i zamknij"
#: addons/web/static/src/xml/base.xml:0
msgid "Export"
msgstr "Eksportuj"
#: addons/web/static/src/xml/base.xml:0
msgid ""
"This wizard will export all data that matches the current search criteria to "
"a CSV file.\n"
" You can export all data or only the fields that can be "
"reimported after modification."
msgstr ""
"Ten kreator wyeksportuje wszystkie dane, które spełniają bieżące kryteria "
"wyszukiwania, do pliku CSV.\n"
" Możesz eksportować wszystkie dane lub tylko pola, które mają być "
"importowane po zmianie."
#: addons/web/static/src/xml/base.xml:0
msgid "Export Type:"
msgstr "Typ eksportu:"
#: addons/web/static/src/xml/base.xml:0
msgid "Import Compatible Export"
msgstr "Eksport kompatybilny z importem"
#: addons/web/static/src/xml/base.xml:0
msgid "Export all Data"
msgstr "Eksportuj wszystkie dane"
#: addons/web/static/src/xml/base.xml:0
msgid "Export Formats"
msgstr "Format eksportu"
#: addons/web/static/src/xml/base.xml:0
msgid "Available fields"
msgstr "Dostępne pola"
#: addons/web/static/src/xml/base.xml:0
msgid "Fields to export"
msgstr "Pola do eksportu"
#: addons/web/static/src/xml/base.xml:0
msgid "Save fields list"
msgstr "Zapisz listę pól"
#: addons/web/static/src/xml/base.xml:0
msgid "Remove"
msgstr "Usuń"
#: addons/web/static/src/xml/base.xml:0
msgid "Remove All"
msgstr "Usuń wszystko"
#: addons/web/static/src/xml/base.xml:0
msgid "Name"
msgstr "Nazwa"
#: addons/web/static/src/xml/base.xml:0
msgid "&nbsp;"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "Save as:"
msgstr "Zapisz jako:"
#: addons/web/static/src/xml/base.xml:0
msgid "Ok"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "Saved exports:"
msgstr "Zapisane eksporty"
#: addons/web/static/src/xml/base.xml:0
msgid "Old Password:"
msgstr "Poprzednie hasło:"
#: addons/web/static/src/xml/base.xml:0
msgid "New Password:"
msgstr "Nowe hasło:"
#: addons/web/static/src/xml/base.xml:0
msgid "Confirm Password:"
msgstr "Potwierdź hasło:"
#: addons/web/static/src/xml/base.xml:0
msgid "Import"
msgstr "Importuj"
#: addons/web/static/src/xml/base.xml:0
msgid "1. Import a .CSV file"
msgstr "1. Importuj plik .CSV"
#: addons/web/static/src/xml/base.xml:0
msgid ""
"Select a .CSV file to import. If you need a sample of file to import,\n"
" you should use the export tool with the \"Import Compatible\" option."
msgstr ""
"Wybierz plik .CSV do importu. Jeśli chcesz zobaczyć przykład pliku do "
"importu,\n"
" powinieneś wyeksportować dane z opcją \"Kompatybilne z importem\"."
#: addons/web/static/src/xml/base.xml:0
msgid "CSV File:"
msgstr "Plik CSV:"
#: addons/web/static/src/xml/base.xml:0
msgid "2. Check your file format"
msgstr "2. Sprawdź format pliku"
#: addons/web/static/src/xml/base.xml:0
msgid "Import Options"
msgstr "Opcje importu"
#: addons/web/static/src/xml/base.xml:0
msgid "Does your file have titles?"
msgstr "Czy plik zawiera nazwy pól?"
#: addons/web/static/src/xml/base.xml:0
msgid "Separator:"
msgstr "Separator:"
#: addons/web/static/src/xml/base.xml:0
msgid "Delimiter:"
msgstr "Znak dziesiętny:"
#: addons/web/static/src/xml/base.xml:0
msgid "Encoding:"
msgstr "Kodowanie:"
#: addons/web/static/src/xml/base.xml:0
msgid "UTF-8"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "Latin 1"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "Lines to skip"
msgstr "Linie do pominięcia"
#: addons/web/static/src/xml/base.xml:0
msgid "The import failed due to:"
msgstr "Import się nie udał z powodu:"
#: addons/web/static/src/xml/base.xml:0
msgid "Here is a preview of the file we could not import:"
msgstr "Oto podgląd pliku, którego nie można zaimportować:"
#: addons/web/static/src/xml/base.xml:0
msgid "OpenERP Web"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "Version"
msgstr "Wersja"
#: addons/web/static/src/xml/base.xml:0
msgid "Copyright © 2011-TODAY OpenERP SA. All Rights Reserved."
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "OpenERP is a trademark of the"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "OpenERP SA Company"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "Licenced under the terms of"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "GNU Affero General Public License"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "About OpenERP"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid "OpenERP"
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid ""
"is a free enterprise-scale software system that is designed to boost\n"
" productivity and profit through data integration. It connects, "
"improves and\n"
" manages business processes in areas such as sales, finance, "
"supply chain,\n"
" project management, production, services, CRM, etc..."
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid ""
"The system is platform-independent, and can be installed on Windows, Mac OS "
"X,\n"
" and various Linux and other Unix-based distributions. Its "
"architecture enables\n"
" new functionality to be rapidly created, modifications to be "
"made to a\n"
" production system and migration to a new version to be "
"straightforward."
msgstr ""
#: addons/web/static/src/xml/base.xml:0
msgid ""
"Depending on your needs, OpenERP is available through a web or application "
"client."
msgstr ""
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web/static/src/js/view_form.js:355
msgid ""
@@ -0,0 +1,32 @@
# jQuery MD5 Plugin
## Usage
Create ([hex](http://en.wikipedia.org/wiki/Hexadecimal)-encoded) [MD5](http://en.wikipedia.org/wiki/MD5) hash of a given string value:
var md5 = $.md5('value');
Create ([hex](http://en.wikipedia.org/wiki/Hexadecimal)-encoded) [HMAC](http://en.wikipedia.org/wiki/HMAC)-MD5 hash of a given string value and key:
var md5 = $.md5('value', 'key');
Create raw [MD5](http://en.wikipedia.org/wiki/MD5) hash of a given string value:
var md5 = $.md5('value', null, true);
Create raw [HMAC](http://en.wikipedia.org/wiki/HMAC)-MD5 hash of a given string value and key:
var md5 = $.md5('value', 'key', true);
## Requirements
None.
If [jQuery](http://jquery.com/) is not available, the md5 function will be added to the global object:
var md5 = md5('value');
## License
Released under the [MIT license](http://creativecommons.org/licenses/MIT/).
## Source Code & Download
* Browse and checkout the [source code](https://github.com/blueimp/jQuery-MD5).
* [Download](https://github.com/blueimp/jQuery-MD5/archives/master) the project to add the plugin to your website.
@@ -0,0 +1,32 @@
jQuery MD5 Plugin
=================
Usage
-----
Create (hex-encoded) MD5 hash of a given string value:
var md5 = $.md5('value');
Create (hex-encoded) HMAC-MD5 hash of a given string value and key:
var md5 = $.md5('value', 'key');
Create raw MD5 hash of a given string value:
var md5 = $.md5('value', null, true);
Create raw HMAC-MD5 hash of a given string value and key:
var md5 = $.md5('value', 'key', true);
Requirements
------------
None.
If jQuery is not available, the md5 function will be added to the global object:
var md5 = md5('value');
License
-------
Released under the MIT license:
http://creativecommons.org/licenses/MIT/
Source Code & Download
----------------------
https://github.com/blueimp/jQuery-MD5
@@ -0,0 +1,269 @@
/*
* jQuery MD5 Plugin 1.2.1
* https://github.com/blueimp/jQuery-MD5
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://creativecommons.org/licenses/MIT/
*
* Based on
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for more info.
*/
/*jslint bitwise: true */
/*global unescape, jQuery */
(function ($) {
'use strict';
/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function safe_add(x, y) {
var lsw = (x & 0xFFFF) + (y & 0xFFFF),
msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 0xFFFF);
}
/*
* Bitwise rotate a 32-bit number to the left.
*/
function bit_rol(num, cnt) {
return (num << cnt) | (num >>> (32 - cnt));
}
/*
* These functions implement the four basic operations the algorithm uses.
*/
function md5_cmn(q, a, b, x, s, t) {
return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);
}
function md5_ff(a, b, c, d, x, s, t) {
return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function md5_gg(a, b, c, d, x, s, t) {
return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function md5_hh(a, b, c, d, x, s, t) {
return md5_cmn(b ^ c ^ d, a, b, x, s, t);
}
function md5_ii(a, b, c, d, x, s, t) {
return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
}
/*
* Calculate the MD5 of an array of little-endian words, and a bit length.
*/
function binl_md5(x, len) {
/* append padding */
x[len >> 5] |= 0x80 << ((len) % 32);
x[(((len + 64) >>> 9) << 4) + 14] = len;
var i, olda, oldb, oldc, oldd,
a = 1732584193,
b = -271733879,
c = -1732584194,
d = 271733878;
for (i = 0; i < x.length; i += 16) {
olda = a;
oldb = b;
oldc = c;
oldd = d;
a = md5_ff(a, b, c, d, x[i], 7, -680876936);
d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586);
c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819);
b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330);
a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897);
d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426);
c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341);
b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983);
a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416);
d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417);
c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);
b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);
a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);
d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);
c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);
b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);
a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510);
d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632);
c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713);
b = md5_gg(b, c, d, a, x[i], 20, -373897302);
a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691);
d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083);
c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);
b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848);
a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438);
d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690);
c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961);
b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501);
a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467);
d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784);
c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473);
b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);
a = md5_hh(a, b, c, d, x[i + 5], 4, -378558);
d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463);
c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);
b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);
a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060);
d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353);
c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632);
b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);
a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174);
d = md5_hh(d, a, b, c, x[i], 11, -358537222);
c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979);
b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189);
a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487);
d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);
c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520);
b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651);
a = md5_ii(a, b, c, d, x[i], 6, -198630844);
d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415);
c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);
b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055);
a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);
d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606);
c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);
b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799);
a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359);
d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);
c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380);
b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);
a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070);
d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259);
b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551);
a = safe_add(a, olda);
b = safe_add(b, oldb);
c = safe_add(c, oldc);
d = safe_add(d, oldd);
}
return [a, b, c, d];
}
/*
* Convert an array of little-endian words to a string
*/
function binl2rstr(input) {
var i,
output = '';
for (i = 0; i < input.length * 32; i += 8) {
output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF);
}
return output;
}
/*
* Convert a raw string to an array of little-endian words
* Characters >255 have their high-byte silently ignored.
*/
function rstr2binl(input) {
var i,
output = [];
output[(input.length >> 2) - 1] = undefined;
for (i = 0; i < output.length; i += 1) {
output[i] = 0;
}
for (i = 0; i < input.length * 8; i += 8) {
output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32);
}
return output;
}
/*
* Calculate the MD5 of a raw string
*/
function rstr_md5(s) {
return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));
}
/*
* Calculate the HMAC-MD5, of a key and some data (raw strings)
*/
function rstr_hmac_md5(key, data) {
var i,
bkey = rstr2binl(key),
ipad = [],
opad = [],
hash;
ipad[15] = opad[15] = undefined;
if (bkey.length > 16) {
bkey = binl_md5(bkey, key.length * 8);
}
for (i = 0; i < 16; i += 1) {
ipad[i] = bkey[i] ^ 0x36363636;
opad[i] = bkey[i] ^ 0x5C5C5C5C;
}
hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));
}
/*
* Convert a raw string to a hex string
*/
function rstr2hex(input) {
var hex_tab = '0123456789abcdef',
output = '',
x,
i;
for (i = 0; i < input.length; i += 1) {
x = input.charCodeAt(i);
output += hex_tab.charAt((x >>> 4) & 0x0F) +
hex_tab.charAt(x & 0x0F);
}
return output;
}
/*
* Encode a string as utf-8
*/
function str2rstr_utf8(input) {
return unescape(encodeURIComponent(input));
}
/*
* Take string arguments and return either raw or hex encoded strings
*/
function raw_md5(s) {
return rstr_md5(str2rstr_utf8(s));
}
function hex_md5(s) {
return rstr2hex(raw_md5(s));
}
function raw_hmac_md5(k, d) {
return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d));
}
function hex_hmac_md5(k, d) {
return rstr2hex(raw_hmac_md5(k, d));
}
$.md5 = function (string, key, raw) {
if (!key) {
if (!raw) {
return hex_md5(string);
} else {
return raw_md5(string);
}
}
if (!raw) {
return hex_hmac_md5(key, string);
} else {
return raw_hmac_md5(key, string);
}
};
}(typeof jQuery === 'function' ? jQuery : this));
@@ -0,0 +1,43 @@
<!DOCTYPE HTML>
<!--
/*
* jQuery MD5 Plugin Tests 1.1
* https://github.com/blueimp/jQuery-MD5
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://creativecommons.org/licenses/MIT/
*/
-->
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery MD5 Plugin Tests</title>
<link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css">
</head>
<body>
<h1 id="qunit-header">jQuery MD5 Plugin Tests</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script>
(function ($) {
'use strict';
var nojquery = /nojquery=true/.test(location.search);
$('<label><input type="checkbox">nojquery<\/label>').click(function () {
location.search = nojquery ? '' : '?nojquery=true';
}).appendTo('body').children(':first').attr('checked', nojquery);
if (nojquery) {
window.jQuery = null;
}
}(window.jQuery));
</script>
<script src="../jquery.md5.js"></script>
<script src="http://code.jquery.com/qunit/git/qunit.js"></script>
<script src="tests.js"></script>
</body>
</html>
@@ -0,0 +1,57 @@
/*
* jQuery MD5 Plugin Tests 1.1
* https://github.com/blueimp/jQuery-MD5
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://creativecommons.org/licenses/MIT/
*/
/*global jQuery, module, test, strictEqual */
(function ($) {
'use strict';
module('Hex-encoded MD5');
test('Creating hex-encoded MD5 hash of an ASCII value', function () {
strictEqual($.md5('value'), '2063c1608d6e0baf80249c42e2be5804');
});
test('Creating hex-encoded MD5 hash of an UTF-8 value', function () {
strictEqual($.md5('日本'), '4dbed2e657457884e67137d3514119b3');
});
module('Hex-encoded HMAC-MD5');
test('Creating hex-encoded HMAC-MD5 hash of an ASCII value and key', function () {
strictEqual($.md5('value', 'key'), '01433efd5f16327ea4b31144572c67f6');
});
test('Creating hex-encoded HMAC-MD5 hash of an UTF-8 value and key', function () {
strictEqual($.md5('日本', '日本'), 'c78b8c7357926981cc04740bd3e9d015');
});
module('Raw MD5');
test('Creating raw MD5 hash of an ASCII value', function () {
strictEqual($.md5('value', null, true), ' c\xc1`\x8dn\x0b\xaf\x80$\x9cB\xe2\xbeX\x04');
});
test('Creating raw MD5 hash of an UTF-8 value', function () {
strictEqual($.md5('日本', null, true), 'M\xbe\xd2\xe6WEx\x84\xe6q7\xd3QA\x19\xb3');
});
module('Raw HMAC-MD5');
test('Creating raw HMAC-MD5 hash of an ASCII value and key', function () {
strictEqual($.md5('value', 'key', true), '\x01C>\xfd_\x162~\xa4\xb3\x11DW,g\xf6');
});
test('Creating raw HMAC-MD5 hash of an UTF-8 value and key', function () {
strictEqual($.md5('日本', '日本', true), '\xc7\x8b\x8csW\x92i\x81\xcc\x04t\x0b\xd3\xe9\xd0\x15');
});
}(typeof jQuery === 'function' ? jQuery : this));
+47 -6
View File
@@ -159,7 +159,7 @@ body.openerp, .openerp textarea, .openerp input, .openerp select, .openerp optio
}
.db_container {
width: 15%;
width: 196px;
background: #666666;
}
@@ -801,13 +801,15 @@ label.error {
-moz-border-radius-topright: 7px;
border-top-right-radius: 7px;
}
.openerp .oe-listview table.oe-listview-content tfoot td:first-child,
.openerp .oe-listview table.oe-listview-content tfoot tr:last-child th:first-child,
.openerp .oe-listview table.oe-listview-content tfoot tr:last-child td:first-child,
.openerp .oe-listview table.oe-listview-content tbody:last-child tr:last-child th:first-child {
-webkit-border-bottom-left-radius: 7px;
-moz-border-radius-bottomleft: 7px;
border-bottom-left-radius: 7px;
}
.openerp .oe-listview table.oe-listview-content tfoot td:last-child,
.openerp .oe-listview table.oe-listview-content tfoot tr:last-child th:last-child,
.openerp .oe-listview table.oe-listview-content tfoot tr:last-child td:last-child,
.openerp .oe-listview table.oe-listview-content tbody:last-child tr:last-child td:last-child {
-webkit-border-bottom-right-radius: 7px;
-moz-border-radius-bottomright: 7px;
@@ -844,7 +846,7 @@ label.error {
.openerp .oe_frame.oe_forms {
clear: both;
}
.openerp table.oe_frame td {
.openerp table.oe_frame {
color: #4c4c4c;
}
.openerp td.oe_form_frame_cell {
@@ -872,7 +874,6 @@ label.error {
}
.openerp .oe_forms label.oe_label, .openerp .oe_forms label.oe_label_help {
text-align: right;
margin: 3px 0 0 10px;
}
.openerp label.oe_label_help span {
@@ -883,6 +884,18 @@ label.error {
top: -4px;
padding: 0 2px;
}
.openerp .oe_align_left {
text-align: left;
}
.openerp .oe_align_right {
text-align: right;
}
.openerp .oe_align_center {
text-align: center;
}
.openerp .oe_forms .oe_form_paragraph {
margin: 3px 0 0 0;
}
/* Inputs */
.openerp .oe_forms input[type="text"], .openerp .oe_forms input[type="password"], .openerp .oe_forms select, .openerp .oe_forms textarea {
@@ -1075,7 +1088,7 @@ label.error {
list-style: none;
}
.openerp .oe-view-manager-logs li:before {
content: '→ ';
content: '\2192 ';
}
.openerp .oe-view-manager-logs a {
text-decoration: none;
@@ -1408,3 +1421,31 @@ ul.oe-arrow-list li.oe-arrow-list-selected .oe-arrow-list-after {
border-color: rgba(0,0,0,0);
border-left-color: #B5B9FF;
}
.openerp .oe_view_editor {
border-collapse: collapse;
padding: 0;
align: left;
width: 100%;
}
.openerp .oe_view_editor_colum{
font-size: 90%;
font-weight: normal;
padding: 0;
border-bottom: 1px solid #CFCCCC;
}
.openerp .oe_view_editor_row:hover{
background-color: #F3F3F3;
}
.openerp .oe_view_editor_tree_grid{
text-align: left;
white-space: nowrap;
border-collapse: collapse;
width: 100%;
}
.openerp .oe_view_editor_tree_grid a:hover {
color: blue;
}
.openerp .oe_view_editor_tree_grid a {
display: block;
}
+16
View File
@@ -11,6 +11,22 @@
.openerp .oe_import_grid-row .oe_import_grid-cell {
border-bottom: 1px solid #E3E3E3;
}
.openerp .oe-import-no-result .oe-import-result {
display: none;
}
.openerp .oe-import fieldset {
cursor: pointer;
}
.openerp .oe-import fieldset legend:before {
content: '\25BC ';
}
.openerp .oe-import fieldset.oe-closed legend:before {
content: '\25B6 ';
}
.openerp .oe-import fieldset.oe-closed table {
display: none;
}
.openerp .separator.horizontal {
font-weight: bold;
border-bottom-width: 1px;
+1 -1
View File
@@ -59,7 +59,7 @@ openerp.web = function(instance) {
openerp.web.formats(instance);
openerp.web.chrome(instance);
openerp.web.data(instance);
var files = ["views","search","list","form","list_editable","web_mobile","view_tree","data_export","data_import"];
var files = ["views","search","list","form","list_editable","web_mobile","view_tree","data_export","data_import","view_editor"];
for(var i=0; i<files.length; i++) {
if(openerp.web[files[i]]) {
openerp.web[files[i]](instance);
+28 -14
View File
@@ -29,11 +29,11 @@ openerp.web.Notification = openerp.web.Widget.extend(/** @lends openerp.web.Not
warn: function(title, text) {
this.$element.notify('create', 'oe_notification_alert', {
title: title,
text: text,
text: text
}, {
expires: false,
expires: false
});
},
}
});
@@ -136,10 +136,10 @@ openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog#
}
});
openerp.web.CrashManager = openerp.web.SessionAware.extend({
init: function(parent) {
this._super((parent || {}).session);
this.session.on_rpc_error.add(this.on_rpc_error);
openerp.web.CrashManager = openerp.web.CallbackEnabled.extend({
init: function() {
this._super();
openerp.connection.on_rpc_error.add(this.on_rpc_error);
},
on_rpc_error: function(error) {
this.error = error;
@@ -195,10 +195,20 @@ openerp.web.Loading = openerp.web.Widget.extend(/** @lends openerp.web.Loading#
init: function(parent, element_id) {
this._super(parent, element_id);
this.count = 0;
this.blocked_ui = false;
this.session.on_rpc_request.add_first(this.on_rpc_event, 1);
this.session.on_rpc_response.add_last(this.on_rpc_event, -1);
},
on_rpc_event : function(increment) {
var self = this;
if (!this.count && increment === 1) {
// Block UI after 3s
this.long_running_timer = setTimeout(function () {
self.blocked_ui = true;
$.blockUI();
}, 3000);
}
this.count += increment;
if (this.count) {
//this.$element.html(QWeb.render("Loading", {}));
@@ -206,6 +216,12 @@ openerp.web.Loading = openerp.web.Widget.extend(/** @lends openerp.web.Loading#
this.$element.show();
this.widget_parent.$element.addClass('loading');
} else {
clearTimeout(this.long_running_timer);
// Don't unblock if blocked by somebody else
if (self.blocked_ui) {
this.blocked_ui = false;
$.unblockUI();
}
this.$element.fadeOut();
this.widget_parent.$element.removeClass('loading');
}
@@ -343,7 +359,7 @@ openerp.web.Database = openerp.web.Widget.extend(/** @lends openerp.web.Database
self.$option_id.find("form[name=create_db_form]").validate({
submitHandler: function (form) {
var fields = $(form).serializeArray();
$.blockUI({message:'<img src="/web/static/src/img/throbber2.gif">'});
$.blockUI();
self.rpc("/web/database/create", {'fields': fields}, function(result) {
if (result.error) {
$.unblockUI();
@@ -392,7 +408,7 @@ openerp.web.Database = openerp.web.Widget.extend(/** @lends openerp.web.Database
.html(QWeb.render("BackupDB", self))
.find("form[name=backup_db_form]").validate({
submitHandler: function (form) {
$.blockUI({message:'<img src="/web/static/src/img/throbber2.gif">'});
$.blockUI();
self.session.get_file({
form: form,
error: function (body) {
@@ -413,7 +429,7 @@ openerp.web.Database = openerp.web.Widget.extend(/** @lends openerp.web.Database
self.$option_id.find("form[name=restore_db_form]").validate({
submitHandler: function (form) {
$.blockUI({message:'<img src="/web/static/src/img/throbber2.gif">'});
$.blockUI();
$(form).ajaxSubmit({
url: '/web/database/restore',
type: 'POST',
@@ -943,17 +959,15 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie
this._super(null, element_id);
openerp.webclient = this;
QWeb.add_template("/web/static/src/xml/base.xml");
var params = {};
if(jQuery.param != undefined && jQuery.deparam(jQuery.param.querystring()).kitten != undefined) {
this.$element.addClass("kitten-mode-activated");
}
this.$element.html(QWeb.render("Interface", params));
this.notification = new openerp.web.Notification();
this.session = new openerp.web.Session();
this.notification = new openerp.web.Notification(this);
this.loading = new openerp.web.Loading(this,"oe_loading");
this.crashmanager = new openerp.web.CrashManager(this);
this.crashmanager = new openerp.web.CrashManager();
this.header = new openerp.web.Header(this);
this.login = new openerp.web.Login(this);
+33 -41
View File
@@ -237,8 +237,8 @@ openerp.web.Registry = openerp.web.Class.extend( /** @lends openerp.web.Registry
* registry was created.
*
* An object path is simply a dotted name from the openerp root to the
* object pointed to (e.g. ``"openerp.web.Session"`` for an OpenERP
* session object).
* object pointed to (e.g. ``"openerp.web.Connection"`` for an OpenERP
* connection object).
*
* @constructs openerp.web.Registry
* @param {Object} mapping a mapping of keys to object-paths
@@ -338,9 +338,9 @@ openerp.web.CallbackEnabled = openerp.web.Class.extend(/** @lends openerp.web.Ca
}
});
openerp.web.Session = openerp.web.CallbackEnabled.extend( /** @lends openerp.web.Session# */{
openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp.web.Connection# */{
/**
* @constructs openerp.web.Session
* @constructs openerp.web.Connection
* @extends openerp.web.CallbackEnabled
*
* @param {String} [server] JSON-RPC endpoint hostname
@@ -364,7 +364,9 @@ openerp.web.Session = openerp.web.CallbackEnabled.extend( /** @lends openerp.web
// TODO: session should have an optional name indicating that they'll
// be saved to (and revived from) cookies
this.name = 'session';
this.do_load_qweb(['/web/webclient/qweb']);
},
start: function() {
this.session_restore();
},
@@ -484,9 +486,11 @@ openerp.web.Session = openerp.web.CallbackEnabled.extend( /** @lends openerp.web
self.user_context = result.context;
self.db = result.db;
self.session_save();
self.on_session_valid();
return true;
}).then(success_callback);
},
login: function() { this.session_login.apply(this, arguments); },
/**
* Reloads uid and session_id from local storage, if they exist
*/
@@ -574,6 +578,7 @@ openerp.web.Session = openerp.web.CallbackEnabled.extend( /** @lends openerp.web
self.rpc('/web/webclient/jslist', {"mods": modules}, function(files) {
self.do_load_js(file_list.concat(files));
});
self.rpc('/web/webclient/qweblist', {"mods": modules}, self.do_load_qweb);
openerp._modules_loaded = true;
});
});
@@ -607,6 +612,12 @@ openerp.web.Session = openerp.web.CallbackEnabled.extend( /** @lends openerp.web
this.on_modules_loaded();
}
},
do_load_qweb: function(files) {
var self = this;
_.each(files, function(file) {
openerp.web.qweb.add_template(file);
});
},
on_modules_loaded: function() {
for(var j=0; j<this.module_list.length; j++) {
var mod = this.module_list[j];
@@ -713,36 +724,6 @@ openerp.web.Session = openerp.web.CallbackEnabled.extend( /** @lends openerp.web
}
});
openerp.web.SessionAware = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.SessionAware# */{
/**
* Utility class that any class is allowed to extend to easy common manipulations.
*
* It provides rpc calls, callback on all methods preceded by "on_" or "do_" and a
* logging facility.
*
* @constructs openerp.web.SessionAware
* @extends openerp.web.CallbackEnabled
*
* @param {openerp.web.Session} session
*/
init: function(session) {
this._super();
this.session = session;
},
/**
* Performs a JSON-RPC call
*
* @param {String} url endpoint url
* @param {Object} data RPC parameters
* @param {Function} success RPC call success callback
* @param {Function} error RPC call error callback
* @returns {jQuery.Deferred} deferred object for the RPC call
*/
rpc: function(url, data, success, error) {
return this.session.rpc(url, data, success, error);
}
});
/**
* Base class for all visual components. Provides a lot of functionalities helpful
* for the management of a part of the DOM.
@@ -753,8 +734,6 @@ openerp.web.SessionAware = openerp.web.CallbackEnabled.extend(/** @lends openerp
* destroyed too).
* - Insertion in DOM.
*
* Widget also extends SessionAware for ease of use.
*
* Guide to create implementations of the Widget class:
* ==============================================
*
@@ -795,7 +774,7 @@ openerp.web.SessionAware = openerp.web.CallbackEnabled.extend(/** @lends openerp
*
* That will kill the widget in a clean way and erase its content from the dom.
*/
openerp.web.Widget = openerp.web.SessionAware.extend(/** @lends openerp.web.Widget# */{
openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.Widget# */{
/**
* The name of the QWeb template that will be used for rendering. Must be
* redefined in subclasses or the default render() method can not be used.
@@ -814,7 +793,7 @@ openerp.web.Widget = openerp.web.SessionAware.extend(/** @lends openerp.web.Widg
* Construct the widget and set its parent if a parent is given.
*
* @constructs openerp.web.Widget
* @extends openerp.web.SessionAware
* @extends openerp.web.CallbackEnabled
*
* @param {openerp.web.Widget} parent Binds the current instance to the given Widget instance.
* When that widget is destroyed by calling stop(), the current instance will be
@@ -825,7 +804,8 @@ openerp.web.Widget = openerp.web.SessionAware.extend(/** @lends openerp.web.Widg
* for new components this argument should not be provided any more.
*/
init: function(parent, /** @deprecated */ element_id) {
this._super((parent || {}).session);
this._super();
this.session = openerp.connection;
// if given an element_id, try to get the associated DOM element and save
// a reference in this.$element. Else just generate a unique identifier.
this.element_id = element_id;
@@ -964,7 +944,7 @@ openerp.web.Widget = openerp.web.SessionAware.extend(/** @lends openerp.web.Widg
rpc: function(url, data, success, error) {
var def = $.Deferred().then(success, error);
var self = this;
this._super(url, data). then(function() {
openerp.connection.rpc(url, data). then(function() {
if (!self.widget_is_stopped)
def.resolve.apply(def, arguments);
}, function() {
@@ -1040,12 +1020,21 @@ openerp.web.TranslationDataBase = openerp.web.Class.extend(/** @lends openerp.we
}
});
if ($.blockUI) {
$.blockUI.defaults.baseZ = 1100;
$.blockUI.defaults.message = '<img src="/web/static/src/img/throbber2.gif">';
}
/** Configure default qweb */
openerp.web._t = new openerp.web.TranslationDataBase().build_translation_function();
openerp.web.qweb = new QWeb2.Engine();
openerp.web.qweb.debug = (window.location.search.indexOf('?debug') !== -1);
openerp.web.qweb.default_dict = {
'_' : _
}
openerp.web.qweb.format_text_node = function(s) {
// Note that 'this' is the Qweb Node of the text
var translation = this.node.parentElement.attributes['t-translation'];
var translation = this.node.parentNode.attributes['t-translation'];
if (translation && translation.value === 'off') {
return s;
}
@@ -1057,6 +1046,9 @@ openerp.web.qweb.format_text_node = function(s) {
return tr === ts ? s : tr;
}
/** Setup default connection */
openerp.connection = new openerp.web.Connection();
};
// vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax:
+8 -4
View File
@@ -32,7 +32,7 @@ openerp.web.DataGroup = openerp.web.Widget.extend( /** @lends openerp.web.DataG
* @constructs openerp.web.DataGroup
* @extends openerp.web.Widget
*
* @param {openerp.web.Session} session Current OpenERP session
* @param {openerp.web.Widget} parent widget
* @param {String} model name of the model managed by this DataGroup
* @param {Array} domain search domain for this DataGroup
* @param {Object} context context of the DataGroup's searches
@@ -785,11 +785,15 @@ openerp.web.ProxyDataSet = openerp.web.DataSetSearch.extend({
on_unlink: function(ids) {}
});
openerp.web.Model = openerp.web.SessionAware.extend({
init: function(session, model_name) {
this._super(session);
openerp.web.Model = openerp.web.CallbackEnabled.extend({
init: function(_, model_name) {
this._super();
this.model_name = model_name;
},
rpc: function() {
var c = openerp.connection;
return c.rpc.apply(c, arguments);
},
get_func: function(method_name) {
var self = this;
return function() {
+9 -2
View File
@@ -80,8 +80,8 @@ openerp.web.DataImport = openerp.web.Dialog.extend({
this.toggle_import_button(false);
this.$element.find('#csvfile').change(this.on_autodetect_data);
this.$element.find('fieldset').change(this.on_autodetect_data);
this.$element.find('fieldset legend').click(function() {
$(this).next().toggle();
this.$element.delegate('fieldset legend', 'click', function() {
$(this).parent().toggleClass('oe-closed');
});
this.ready.push(new openerp.web.DataSet(this, this.model).call(
'fields_get', [], function (fields) {
@@ -194,9 +194,11 @@ openerp.web.DataImport = openerp.web.Dialog.extend({
: with_headers ? results.records.slice(1)
: results.records
}));
this.$element.find('fieldset').addClass('oe-closed');
} else if (results['error']) {
result_node.append(QWeb.render('ImportView.error', {
'error': results['error']}));
this.$element.find('fieldset').removeClass('oe-closed');
} else if (results['success']) {
if (this.widget_parent.widget_parent.active_view == "list") {
this.widget_parent.reload_content();
@@ -204,6 +206,11 @@ openerp.web.DataImport = openerp.web.Dialog.extend({
this.stop();
return;
}
this.$element.find('form').removeClass('oe-import-no-result');
this.$element.delegate('.oe-m2o-drop-down-button', 'click', function () {
$(this).prev('input').focus();
});
var self = this;
this.ready.then(function () {
+2 -8
View File
@@ -27,14 +27,8 @@ openerp.web.format_value = function (value, descriptor, value_if_empty) {
return _.sprintf('%d', value);
case 'float':
var precision = descriptor.digits ? descriptor.digits[1] : 2;
var int_part = Math.floor(value);
var dec_part = _.sprintf(
'%.' + precision + 'f',
Math.abs(value) % 1).substring(2);
return _.sprintf('%d%s%s',
int_part,
openerp.web._t.database.parameters.decimal_point,
dec_part);
return _.sprintf('%.' + precision + 'f', value)
.replace('.', openerp.web._t.database.parameters.decimal_point);
case 'float_time':
return _.sprintf("%02d:%02d",
Math.floor(value),
+4 -4
View File
@@ -63,6 +63,7 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search
rows.push(row);
var filters = [];
_.each(items, function (item) {
if (item.attrs.invisible === '1') { return; }
if (filters.length && item.tag !== 'filter') {
row.push(
new openerp.web.search.FilterGroup(
@@ -432,6 +433,7 @@ openerp.web.search.Widget = openerp.web.Widget.extend( /** @lends openerp.web.se
* @param view the ancestor view of this widget
*/
init: function (view) {
this._super(view);
this.view = view;
},
/**
@@ -472,10 +474,8 @@ openerp.web.search.Widget = openerp.web.Widget.extend( /** @lends openerp.web.se
this._super();
},
render: function (defaults) {
return QWeb.render(
this.template, _.extend(this, {
defaults: defaults
}));
// FIXME
return this._super(_.extend(this, {defaults: defaults}));
}
});
openerp.web.search.add_expand_listener = function($root) {
+516
View File
@@ -0,0 +1,516 @@
openerp.web.view_editor = function(openerp) {
var QWeb = openerp.web.qweb;
openerp.web.ViewEditor = openerp.web.Widget.extend({
init: function(parent, element_id, dataset, view, options) {
this._super(parent);
this.element_id = element_id
this.parent = parent
this.dataset = dataset;
this.model = dataset.model;
this.xml_id = 0;
},
start: function() {
this.init_view_editor();
},
init_view_editor: function() {
var self = this;
var action = {
name:'ViewEditor',
context:this.session.user_context,
domain: [["model", "=", this.dataset.model]],
res_model : 'ir.ui.view',
views : [[false, 'list']],
type: 'ir.actions.act_window',
target: "current",
limit : 80,
auto_search : true,
flags: {
sidebar: false,
deletable: false,
views_switcher: false,
action_buttons:false,
search_view:false,
pager:false,
radio: true
},
};
this.view_edit_dialog = new openerp.web.Dialog(this, {
modal: true,
title: 'ViewEditor',
width: 750,
height: 500,
buttons: {
"Create": function(){
//to do
},
"Edit": function(){
self.xml_id=0;
self.get_data();
},
"Close": function(){
self.view_edit_dialog.close();
}
},
});
this.view_edit_dialog.start().open();
var action_manager = new openerp.web.ActionManager(this);
action_manager.appendTo(this.view_edit_dialog);
action_manager.do_action(action);
},
check_attr: function(xml, tag, level) {
var obj = {'child_id': [], 'id': this.xml_id++, 'level': level+1, 'att_list': [], 'name': ""};
var render_name = "<" + tag;
obj.att_list.push(tag);
$(xml).each(function() {
_.each(this.attributes, function(attrs){
if (tag != 'button') {
if (attrs.nodeName == "string" || attrs.nodeName == "name" || attrs.nodeName == "index") {
render_name += ' ' + attrs.nodeName + '=' + '"' + attrs.nodeValue + '"' ;
}
} else {
if (attrs.nodeName == "name") {
render_name += ' ' + attrs.nodeName + '=' + '"' + attrs.nodeValue + '"';
}
}
obj.att_list.push( [attrs.nodeName,attrs.nodeValue] );
});
render_name+= ">";
});
obj.name = render_name;
return obj;
},
save_object: function(val, parent_list, child_obj_list) {
var self = this;
var check_id = parent_list[0];
var p_list = parent_list.slice(1);
if (val.child_id.length != 0) {
_.each(val.child_id, function(val, key) {
if (val.id == check_id) {
if (p_list.length!=0) {
self.save_object(val, p_list, child_obj_list);
} else {
val.child_id = child_obj_list;
return false;
}
}
});
} else {
val.child_id = child_obj_list;
}
},
xml_node_create: function(xml, root, parent_list, parent_id, main_object){
var self = this;
var child_obj_list = [];
var children_list = $(xml).filter(root).children();
var parents = $(children_list[0]).parents().get();
_.each(children_list, function (child_node) {
child_obj_list.push(self.check_attr(child_node,child_node.tagName.toLowerCase(),parents.length));
});
if (children_list.length != 0) {
if (parents.length <= parent_list.length) {
parent_list.splice(parents.length - 1);
}
parent_list.push(parent_id);
self.save_object(main_object[0], parent_list.slice(1), child_obj_list);
}
for (var i = 0; i < children_list.length; i++) {
self.xml_node_create
(children_list[i], children_list[i].tagName.toLowerCase(),
parent_list, child_obj_list[i].id, main_object);
}
return main_object;
},
parse_xml: function(arch, view_id) {
var root = $(arch).filter(":first")[0];
var tag = root.tagName.toLowerCase();
var obj ={'child_id':[],'id':this.xml_id++,'level':0,'att_list':[],'name':"<view view_id='"+view_id+"'>"};
var root_object = this.check_attr(root,tag,0);
obj.child_id = this.xml_node_create(arch, tag, [], this.xml_id-1, [root_object], [])
return [obj];
},
get_data: function() {
var self = this;
var view_arch_list = [];
self.main_view_id =((this.view_edit_dialog.$element.find("input[name='radiogroup']:checked").parent()).parent()).attr('data-id');
var ve_dataset = new openerp.web.DataSet(this, 'ir.ui.view');
ve_dataset.read_ids([parseInt(self.main_view_id)], ['arch', 'type'], function (arch) {
one_object = self.parse_xml(arch[0].arch,self.main_view_id);
self.main_view_type = arch[0].type
view_arch_list.push({"view_id" : self.main_view_id, "arch" : arch[0].arch});
dataset = new openerp.web.DataSetSearch(self, 'ir.ui.view', null, null);
dataset.read_slice([], {domain : [['inherit_id','=', parseInt(self.main_view_id)]]}, function (result) {
_.each(result, function(res) {
view_arch_list.push({"view_id":res.id,"arch":res.arch});
self.inherit_view(one_object, res);
});
return self.edit_view({"main_object": one_object,
"parent_child_id": self.parent_child_list(one_object, []),
"arch": view_arch_list});
});
});
},
parent_child_list : function(one_object, p_list) {
var self = this;
_.each(one_object , function(element){
if(element.child_id.length != 0){
p_list.push({"key":element.id,"value":_.pluck(element.child_id, 'id')});
self.parent_child_list(element.child_id, p_list);
}
});
return p_list;
},
inherit_view : function(one_object, result) {
var self = this;
var root = $(result.arch).filter('*');
var xml_list = [];
if (root[0].tagName.toLowerCase() == "data") {
xml_list = $(root[0]).children();
} else {
xml_list.push(root[0]);
}
_.each(xml_list , function(xml){
var parent_id;
var check_list = [];
var xpath_object = self.parse_xml(xml,result.id);
if (xml.tagName.toLowerCase() == "xpath" ) {
var part_expr = _.without($(xml).attr('expr').split("/"),"");
_.each(part_expr,function(part){
check_list.push(_.without($.trim(part.replace(/[^a-zA-Z 0-9 _]+/g,'!')).split("!"),""));
});
} else {
var temp = [];
_.each(xpath_object[0].child_id[0].att_list, function(list){
if(!_.include(list, "position")){
temp.push(list);
}
});
check_list = [_.flatten(temp)];
}
self.full_path_search(check_list ,one_object ,xpath_object);
});
},
full_path_search: function(check_list ,val ,xpath_object) {
var self = this;
if(xpath_object.length!=0){
var check = check_list[0];
var obj;
switch (check.length) {
case 2:
if(parseInt(check[1])){
var list_1 = _.select(val,function(element){
var main_list = _.flatten(element.att_list);
return _.include(main_list, check[0]);
});
obj = val[_.indexOf(val,list_1[parseInt(check[1])-1])];
} else {
obj = _.detect(val, function(element){
var main_list = _.flatten(element.att_list);
return _.include(main_list, check[0]);
});
}
break;
case 3:
obj = _.detect(val,function(element){
var main_list = _.flatten(element.att_list);
check = _.uniq(check);
var insert = _.intersection(main_list,check);
if(insert.length == check.length ){return element;}
});
break;
case 1:
var list_1 = _.select(val,function(element){
var main_list = _.flatten(element.att_list);
return _.include(main_list, check[0]);
});
if(list_1.length != 0){
(check_list.length == 1)? obj = list_1[0] : check_list.shift();
}
break;
}
if(obj) {
check_list.shift();
if (check_list.length !=0){
self.full_path_search(check_list ,obj.child_id ,xpath_object);
} else {
var level = obj.level+1;
self.increase_level(xpath_object[0], level)
obj.child_id.push(xpath_object[0]);
xpath_object.pop();
return;
}
}
else {
_.each(val,function(element){
self.full_path_search(check_list ,element.child_id ,xpath_object);
});
}
}
},
increase_level: function(val, level) {
var self = this;
val.level = level;
_.each(val.child_id, function(val, key) {
self.increase_level(val, level + 1);
});
},
edit_view: function(one_object) {
var self = this;
this.edit_xml_dialog = new openerp.web.Dialog(this,{
modal: true,
title: 'View Editor',
width: 750,
height: 500,
buttons: {
"Inherited View": function(){
//todo
},
"Preview": function(){
var action = {
context:self.session.user_context,
res_model : self.model,
views : [[self.main_view_id, self.main_view_type]],
type: 'ir.actions.act_window',
target: "new",
flags: {
sidebar: false,
views_switcher: false,
action_buttons:false,
search_view:false,
pager:false,
},
};
var action_manager = new openerp.web.ActionManager(self);
action_manager.do_action(action);
},
"Close": function(){
self.edit_xml_dialog.close();
}
}
});
this.edit_xml_dialog.start().open();
this.edit_xml_dialog.$element.html(QWeb.render('view_editor', {
'data': one_object['main_object'],
}));
this.edit_xml_dialog.$element.find("tr[id^='viewedit-']").click(function() {
self.edit_xml_dialog.$element.find("tr[id^='viewedit-']").removeClass('ui-selected');
$(this).addClass('ui-selected');
});
this.edit_xml_dialog.$element.find("img[id^='parentimg-']").click(function() {
if ($(this).attr('src') == '/web/static/src/img/collapse.gif') {
$(this).attr('src', '/web/static/src/img/expand.gif');
self.on_expand(this);
} else {
$(this).attr('src', '/web/static/src/img/collapse.gif');
var id = this.id.split('-')[1];
self.on_collapse(this,one_object['parent_child_id'], one_object['main_object']);
}
});
this.edit_xml_dialog.$element.find("img[id^='side-']").click(function() {
var side = $(this).closest("tr[id^='viewedit-']")
var id_tr = (side.attr('id')).split('-')[1];
var img = side.find("img[id='parentimg-"+id_tr+"']").attr('src'); ;
var level = parseInt(side.attr('level'));
var list_shift =[];
var last_tr;
var cur_tr = side;
list_shift.push(side);
var next_tr;
var ls = side;
var view_id;
var view_xml_id;
while(1){
ls = ls.prev();
if((self.edit_xml_dialog.$element.find(ls).find('a').text()).search("view_id") != -1
&& parseInt(ls.attr('level')) < level){
view_id = parseInt(($(ls).find('a').text()).replace(/[^0-9]+/g,''));
view_xml_id = (ls.attr('id')).split('-')[1];
break;
}
}
switch (this.id) {
case "side-add":
break;
case "side-remove":
break;
case "side-edit":
break;
case "side-up":
while (1) {
var prev_tr = cur_tr.prev();
if(level >= parseInt(prev_tr.attr('level')) || prev_tr.length == 0) {
last_tr = prev_tr;
break;
}
cur_tr = prev_tr;
}
if (img) {
while (1) {
next_tr = side.next();
if ( parseInt(next_tr.attr('level')) <= level || next_tr.length == 0) {
break;
} else {
list_shift.push(next_tr);
side = next_tr;
}
}
}
if (last_tr.length != 0 && parseInt(last_tr.attr('level')) == level &&
(self.edit_xml_dialog.$element.find(last_tr).find('a').text()).search("view_id") == -1) {
_.each(list_shift, function(rec) {
$(last_tr).before(rec);
});
self.save_move_arch(one_object, view_id, view_xml_id, id_tr, level, "up");
}
break;
case "side-down":
if (img) {
while (1) {
next_tr = cur_tr.next();
if ( parseInt(next_tr.attr('level')) <= level || next_tr.length == 0) {
last_tr = next_tr;
break;
} else {
list_shift.push(next_tr);
cur_tr = next_tr;
}
}
}
else {
last_tr = cur_tr.next();
}
if((self.edit_xml_dialog.$element.find(last_tr).find('a').text()).search("view_id") != -1){
return;
}
if (last_tr.length != 0 && parseInt(last_tr.attr('level')) == level) {
var last_tr_id = (last_tr.attr('id')).split('-')[1];
img = last_tr.find("img[id='parentimg-" + last_tr_id + "']").attr('src');
if (img) {
self.edit_xml_dialog.$element.find("img[id='parentimg-" + last_tr_id + "']").
attr('src', '/web/static/src/img/expand.gif');
while (1) {
var next_tr = last_tr.next();
if (next_tr.attr('level') <= level || next_tr.length == 0) break;
next_tr.hide();
last_tr = next_tr;
}
}
list_shift.reverse();
_.each(list_shift, function(rec) {
$(last_tr).after(rec);
});
self.save_move_arch(one_object, view_id, view_xml_id, id_tr, level, "down");
}
break;
}
});
},
save_move_arch: function(one_object, view_id, view_xml_id, id_tr, level, move_direct){
var self = this;
var arch = _.detect(one_object['arch'],function(element){
return element.view_id == view_id;
});
var obj = self.get_view_object(view_xml_id, one_object['main_object'], []);
if(($(arch.arch).filter("data")).length != 0 && view_xml_id != 0){
var check_list = _.flatten(obj[0].child_id[0].att_list);
arch.arch = _.detect($(arch.arch).children(), function(xml_child){
var temp_obj = self.check_attr(xml_child, xml_child.tagName.toLowerCase());
var main_list = _.flatten(temp_obj.att_list);
check_list = _.uniq(check_list);
var insert = _.intersection(main_list,check_list);
if(insert.length == check_list.length ){return xml_child;}
});
}
return self.get_node(arch.arch, obj[0].child_id[0], parseInt(id_tr), [], parseInt(level),
parseInt(view_id), arch, move_direct);
},
get_view_object: function(view_xml_id, one_object,result){
var self = this;
if(result.length==0){
var check = _.detect(one_object , function(obj){
return view_xml_id==obj.id;
});
if(check){result.push(check);};
_.each(one_object, function(obj){
self.get_view_object(view_xml_id, obj.child_id, result);
});
}
return result;
},
get_node: function(arch1, obj, id, child_list, level, view_id, arch, move_direct){
var self = this;
var children_list = $(arch1).children();
var list_obj_xml = _.zip(children_list,obj.child_id);
if (id) {
if (obj.id == id) {
var id;
var parent = $(arch1).parents();
var index = _.indexOf(child_list, obj)
var re_insert_obj = child_list.splice(index, 1);
if (move_direct == "down") {
var next = $(arch1).next();
$(next).after(arch1);
child_list.splice(index+1, 0, re_insert_obj[0]);
} else {
var prev = $(arch1).prev();
$(prev).before(arch1);
child_list.splice(index-1, 0, re_insert_obj[0]);
}
parent = parent[parent.length-1];
var convert_to_utf = self.xml2Str(parent);
if (convert_to_utf) {
convert_to_utf = convert_to_utf.replace('xmlns="http://www.w3.org/1999/xhtml"', "");
convert_to_utf = '<?xml version="1.0"?>' + convert_to_utf;
arch.arch = convert_to_utf;
dataset = new openerp.web.DataSet(this, 'ir.ui.view');
dataset.write(parseInt(view_id),{"arch":convert_to_utf}, function(r) {
});
}
}
if (obj.level <= level) {
_.each(list_obj_xml, function(child_node) {
self.get_node(child_node[0], child_node[1], id, obj.child_id, level, view_id, arch, move_direct);
});
}
}
},
xml2Str: function(xmlNode) {
try {
return (new XMLSerializer()).serializeToString(xmlNode);
}
catch (e) {
try {
return xmlNode.xml;
}
catch (e) {
return false;
}
}
},
on_expand: function(expand_img){
var level = parseInt($(expand_img).closest("tr[id^='viewedit-']").attr('level'));
var cur_tr = $(expand_img).closest("tr[id^='viewedit-']");
while (1) {
var nxt_tr = cur_tr.next();
if (parseInt(nxt_tr.attr('level')) > level){
cur_tr = nxt_tr;
nxt_tr.hide();
} else return nxt_tr;
}
},
on_collapse: function(collapse_img, parent_child_id, id, main_object) {
var self = this;
var id = collapse_img.id.split('-')[1];
var datas = _.detect(parent_child_id,function(res) {
return res.key == id;
});
_.each(datas.value, function(rec) {
var tr = self.edit_xml_dialog.$element.find("tr[id='viewedit-"+rec+"']");
tr.find("img[id='parentimg-"+rec+"']").attr('src','/web/static/src/img/expand.gif');
tr.show();
});
}
});
};
+238 -94
View File
@@ -10,6 +10,7 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
* view should be displayed (if there is one active).
*/
searchable: false,
readonly : false,
form_template: "FormView",
identifier_prefix: 'formview-',
/**
@@ -37,7 +38,7 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
this.dirty_for_user = false;
this.default_focus_field = null;
this.default_focus_button = null;
this.registry = openerp.web.form.widgets;
this.registry = this.readonly ? openerp.web.form.readonly : openerp.web.form.widgets;
this.has_been_loaded = $.Deferred();
this.$form_header = null;
this.translatable_fields = [];
@@ -89,7 +90,7 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
this.fields_view = data;
var frame = new (this.registry.get_object('frame'))(this, this.fields_view.arch);
this.rendered = QWeb.render(this.form_template, { 'frame': frame, 'view': this });
this.rendered = QWeb.render(this.form_template, { 'frame': frame, 'widget': this });
}
this.$element.html(this.rendered);
_.each(this.widgets, function(w) {
@@ -101,21 +102,11 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
self.on_pager_action(action);
});
this.$form_header.find('button.oe_form_button_save').click(this.do_save);
this.$form_header.find('button.oe_form_button_cancel').click(this.do_cancel);
this.$form_header.find('button.oe_form_button_save').click(this.do_save_then_readonly);
this.$form_header.find('button.oe_form_button_new').click(this.on_button_new);
this.$form_header.find('button.oe_form_button_duplicate').click(this.on_button_duplicate);
this.$form_header.find('button.oe_form_button_toggle').click(function () {
self.translatable_fields = [];
self.widgets = {};
self.fields = {};
self.$form_header.find('button').unbind('click');
self.registry = self.registry === openerp.web.form.widgets
? openerp.web.form.readonly
: openerp.web.form.widgets;
self.on_loaded(self.fields_view);
self.reload();
});
this.$form_header.find('button.oe_form_button_delete').click(this.on_button_delete);
this.$form_header.find('button.oe_form_button_toggle').click(this.on_toggle_readonly);
if (this.options.sidebar && this.options.sidebar_id) {
this.sidebar = new openerp.web.Sidebar(this, this.options.sidebar_id);
@@ -127,6 +118,23 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
}
this.has_been_loaded.resolve();
},
on_toggle_readonly: function() {
var self = this;
self.translatable_fields = [];
self.widgets = {};
self.fields = {};
self.$form_header.find('button').unbind('click');
self.readonly = !self.readonly;
self.registry = self.readonly ? openerp.web.form.readonly : openerp.web.form.widgets;
self.on_loaded(self.fields_view);
return self.reload();
},
do_set_readonly: function() {
return this.readonly ? $.Deferred().resolve() : this.on_toggle_readonly();
},
do_set_editable: function() {
return !this.readonly ? $.Deferred().resolve() : this.on_toggle_readonly();
},
do_show: function () {
var promise;
if (this.dataset.index === null) {
@@ -162,6 +170,8 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
this.$form_header.find('.oe_form_on_update').show();
this.$form_header.find('button.oe_form_button_new').show();
}
this.$form_header.find('.oe_form_on_readonly').toggle(this.readonly);
this.$form_header.find('.oe_form_on_editable').toggle(!this.readonly);
this.dirty_for_user = false;
this.datarecord = record;
for (var f in this.fields) {
@@ -342,14 +352,16 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
$.when(this.has_been_loaded).then(function() {
if (self.can_be_discarded()) {
var keys = _.keys(self.fields_view.fields);
if (keys.length) {
self.dataset.default_get(keys).then(self.on_record_loaded).then(function() {
$.when(self.do_set_editable()).then(function() {
if (keys.length) {
self.dataset.default_get(keys).then(self.on_record_loaded).then(function() {
def.resolve();
});
} else {
self.on_record_loaded({});
def.resolve();
});
} else {
self.on_record_loaded({});
def.resolve();
}
}
});
}
});
return def.promise();
@@ -361,7 +373,20 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
if (self.can_be_discarded()) {
self.dataset.call('copy', [self.datarecord.id, {}, self.dataset.context]).then(function(new_id) {
return self.on_created({ result : new_id });
}).then(function() {
}).then(self.do_set_editable).then(function() {
def.resolve();
});
}
});
return def.promise();
},
on_button_delete: function() {
var self = this;
var def = $.Deferred();
$.when(this.has_been_loaded).then(function() {
if (self.can_be_discarded() && self.datarecord.id) {
self.dataset.unlink([self.datarecord.id]).then(function() {
self.on_pager_action('next');
def.resolve();
});
}
@@ -379,6 +404,9 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
* @param {Function} success callback on save success
* @param {Boolean} [prepend_on_create=false] if ``do_save`` creates a new record, should that record be inserted at the start of the dataset (by default, records are added at the end)
*/
do_save_then_readonly: function(success, prepend_on_create) {
return this.do_save(success, prepend_on_create).then(this.do_set_readonly);
},
do_save: function(success, prepend_on_create) {
var self = this;
var action = function() {
@@ -426,10 +454,6 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
this.mutating_lock = this.mutating_lock.pipe(action, action);
return this.mutating_lock;
},
switch_readonly: function() {
},
switch_editable: function() {
},
on_invalid: function() {
var msg = "<ul>";
_.each(this.fields, function(f) {
@@ -487,9 +511,6 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
on_action: function (action) {
console.debug('Executing action', action);
},
do_cancel: function () {
console.debug("Cancelling form");
},
reload: function() {
var self = this;
var act = function() {
@@ -715,6 +736,16 @@ openerp.web.form.Widget = openerp.web.Widget.extend(/** @lends openerp.web.form.
this.invisible = this.modifiers['invisible'] === true;
this.classname = 'oe_form_' + this.type;
this.align = parseFloat(this.node.attrs.align);
if (isNaN(this.align) || this.align === 1) {
this.align = 'right';
} else if (this.align === 0) {
this.align = 'left';
} else {
this.align = 'center';
}
this.width = this.node.attrs.width;
},
start: function() {
@@ -1044,8 +1075,7 @@ openerp.web.form.WidgetLabel = openerp.web.form.Widget.extend({
this._super(view, node);
// TODO fme: support for attrs.align
if (this.node.tag == 'label' && (this.node.attrs.colspan || (this.string && this.string.length > 32))) {
if (this.node.tag == 'label' && (this.align === 'left' || this.node.attrs.colspan || (this.string && this.string.length > 32))) {
this.template = "WidgetParagraph";
this.colspan = parseInt(this.node.attrs.colspan || 1, 10);
} else {
@@ -1170,6 +1200,10 @@ openerp.web.form.Field = openerp.web.form.Widget.extend(/** @lends openerp.web.f
openerp.web.form.FieldChar = openerp.web.form.Field.extend({
template: 'FieldChar',
init: function (view, node) {
this._super(view, node);
this.password = this.node.attrs.password === 'True' || this.node.attrs.password === '1';
},
start: function() {
this._super.apply(this, arguments);
this.$element.find('input').change(this.on_ui_change);
@@ -1419,11 +1453,7 @@ openerp.web.form.FieldBoolean = openerp.web.form.Field.extend({
start: function() {
var self = this;
this._super.apply(this, arguments);
this.$element.find('input').click(function() {
if ($(this).is(':checked') != self.value) {
self.on_ui_change();
}
});
this.$element.find('input').click(self.on_ui_change);
},
set_value: function(value) {
this._super.apply(this, arguments);
@@ -1632,6 +1662,11 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({
} else {
$("#" + self.cm_id + " .oe_m2o_menu_item_mandatory").addClass("oe-m2o-disabled-cm");
}
if (!self.readonly) {
$("#" + self.cm_id + " .oe_m2o_menu_item_noreadonly").removeClass("oe-m2o-disabled-cm");
} else {
$("#" + self.cm_id + " .oe_m2o_menu_item_noreadonly").addClass("oe-m2o-disabled-cm");
}
return true;
}, menuStyle: {width: "200px"}
});
@@ -1651,6 +1686,8 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({
}
});
this.$drop_down.click(function() {
if (self.readonly)
return;
if (self.$input.autocomplete("widget").is(":visible")) {
self.$input.autocomplete("close");
} else {
@@ -1811,7 +1848,7 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({
self.original_value = undefined;
self._change_int_ext_value(rval);
};
if(typeof(value) === "number") {
if (value && !(value instanceof Array)) {
var dataset = new openerp.web.DataSetStatic(this, this.field.relation, self.build_context());
dataset.name_get([value], function(data) {
real_set_value(data[0]);
@@ -1857,6 +1894,10 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({
},
focus: function () {
this.$input.focus();
},
update_dom: function() {
this._super.apply(this, arguments);
this.$input.attr('disabled', this.readonly);
}
});
@@ -1910,7 +1951,8 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({
multi_selection: false,
init: function(view, node) {
this._super(view, node);
this.is_started = $.Deferred();
this.is_loaded = $.Deferred();
this.initial_is_loaded = this.is_loaded;
this.is_setted = $.Deferred();
this.form_last_update = $.Deferred();
this.init_form_last_update = this.form_last_update;
@@ -1928,8 +1970,18 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({
self.on_ui_change();
});
this.is_setted.then(function() {
self.load_views();
});
},
is_readonly: function() {
return this.readonly || this.force_readonly;
},
load_views: function() {
var self = this;
var modes = this.node.attrs.mode;
modes = !!modes ? modes.split(",") : ["tree", "form"];
modes = !!modes ? modes.split(",") : ["tree"];
var views = [];
_.each(modes, function(mode) {
var view = {
@@ -1942,25 +1994,38 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({
}
if(view.view_type === "list") {
view.options.selectable = self.multi_selection;
if (self.is_readonly()) {
view.options.addable = null;
view.options.deletable = null;
}
} else if (view.view_type === "form") {
view.options.not_interactible_on_create = true;
}
views.push(view);
});
this.views = views;
this.viewmanager = new openerp.web.ViewManager(this, this.dataset, views);
this.viewmanager.registry = openerp.web.views.clone({
list: 'openerp.web.form.One2ManyListView',
form: 'openerp.web.form.One2ManyFormView'
form: 'openerp.web.FormView'
});
var once = $.Deferred().then(function() {
self.init_form_last_update.resolve();
});
var def = $.Deferred().then(function() {
self.initial_is_loaded.resolve();
});
this.viewmanager.on_controller_inited.add_last(function(view_type, controller) {
if (view_type == "list") {
controller.o2m = self;
if (self.is_readonly())
controller.set_editable(false);
} else if (view_type == "form") {
if (self.is_readonly()) {
controller.on_toggle_readonly();
$(controller.$element.find(".oe_form_buttons")[0]).children().remove();
}
controller.on_record_loaded.add_last(function() {
once.resolve();
});
@@ -1971,33 +2036,40 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({
} else if (view_type == "graph") {
self.reload_current_view()
}
self.is_started.resolve();
def.resolve();
});
this.viewmanager.on_mode_switch.add_first(function() {
self.save_form_view();
this.viewmanager.on_mode_switch.add_first(function(n_mode, b, c, d, e) {
$.when(self.save_form_view()).then(function() {
if(n_mode === "list")
setTimeout(function() {self.reload_current_view();}, 0);
});
});
this.is_setted.then(function() {
setTimeout(function () {
self.viewmanager.appendTo(self.$element);
}, 0);
});
return def;
},
reload_current_view: function() {
var self = this;
var view = self.viewmanager.views[self.viewmanager.active_view].controller;
if(self.viewmanager.active_view === "list") {
view.reload_content();
} else if (self.viewmanager.active_view === "form") {
if (this.dataset.index === null && this.dataset.ids.length >= 1) {
this.dataset.index = 0;
self.is_loaded = self.is_loaded.pipe(function() {
var view = self.viewmanager.views[self.viewmanager.active_view].controller;
if(self.viewmanager.active_view === "list") {
return view.reload_content();
} else if (self.viewmanager.active_view === "form") {
if (self.dataset.index === null && self.dataset.ids.length >= 1) {
self.dataset.index = 0;
}
var act = function() {
return view.do_show();
}
self.form_last_update = self.form_last_update.pipe(act, act);
return self.form_last_update;
} else if (self.viewmanager.active_view === "graph") {
return view.do_search(self.build_domain(), self.dataset.get_context(), []);
}
var act = function() {
return view.do_show();
}
this.form_last_update = this.form_last_update.pipe(act, act);;
} else if (self.viewmanager.active_view === "graph") {
view.do_search(this.build_domain(), this.dataset.get_context(), []);
}
});
},
set_value: function(value) {
value = value || [];
@@ -2054,9 +2126,7 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({
if (this.dataset.index === null && this.dataset.ids.length > 0) {
this.dataset.index = 0;
}
$.when(this.is_started).then(function() {
self.reload_current_view();
});
self.reload_current_view();
this.is_setted.resolve();
},
get_value: function() {
@@ -2120,7 +2190,18 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({
},
update_dom: function() {
this._super.apply(this, arguments);
this.$element.toggleClass('disabled', this.readonly);
var self = this;
if (this.previous_readonly !== this.readonly) {
this.previous_readonly = this.readonly;
if (this.viewmanager) {
this.is_loaded = this.is_loaded.pipe(function() {
self.viewmanager.stop();
return $.when(self.load_views()).then(function() {
self.reload_current_view();
});
});
}
}
}
});
@@ -2131,9 +2212,6 @@ openerp.web.form.One2ManyDataSet = openerp.web.BufferedDataSet.extend({
}
});
openerp.web.form.One2ManyFormView = openerp.web.FormView.extend({
});
openerp.web.form.One2ManyListView = openerp.web.ListView.extend({
do_add_record: function () {
if (this.options.editable) {
@@ -2172,7 +2250,8 @@ openerp.web.form.One2ManyListView = openerp.web.ListView.extend({
read_function: function() {
return self.o2m.dataset.read_ids.apply(self.o2m.dataset, arguments);
},
form_view_options: {'not_interactible_on_create':true}
form_view_options: {'not_interactible_on_create':true},
readonly: self.o2m.is_readonly()
});
pop.on_write.add(function(id, data) {
self.o2m.dataset.write(id, data, {}, function(r) {
@@ -2188,7 +2267,9 @@ openerp.web.form.FieldMany2Many = openerp.web.form.Field.extend({
init: function(view, node) {
this._super(view, node);
this.list_id = _.uniqueId("many2many");
this.is_started = $.Deferred();
this.is_loaded = $.Deferred();
this.initial_is_loaded = this.is_loaded;
this.is_setted = $.Deferred();
},
start: function() {
this._super.apply(this, arguments);
@@ -2200,18 +2281,10 @@ openerp.web.form.FieldMany2Many = openerp.web.form.Field.extend({
this.dataset.on_unlink.add_last(function(ids) {
self.on_ui_change();
});
this.list_view = new openerp.web.form.Many2ManyListView(this, this.dataset, false, {
'addable': 'Add',
'selectable': self.multi_selection
});
this.list_view.m2m_field = this;
this.list_view.on_loaded.add_last(function() {
self.is_started.resolve();
this.is_setted.then(function() {
self.load_view();
});
setTimeout(function () {
self.list_view.appendTo($("#" + self.list_id));
}, 0);
},
set_value: function(value) {
value = value || [];
@@ -2221,16 +2294,56 @@ openerp.web.form.FieldMany2Many = openerp.web.form.Field.extend({
this._super(value);
this.dataset.set_ids(value);
var self = this;
$.when(this.is_started).then(function() {
self.list_view.reload_content();
});
self.reload_content();
this.is_setted.resolve();
},
get_value: function() {
return [commands.replace_with(this.dataset.ids)];
},
validate: function() {
this.invalid = false;
// TODO niv
},
is_readonly: function() {
return this.readonly || this.force_readonly;
},
load_view: function() {
var self = this;
this.list_view = new openerp.web.form.Many2ManyListView(this, this.dataset, false, {
'addable': self.is_readonly() ? null : 'Add',
'deletable': self.is_readonly() ? false : true,
'selectable': self.multi_selection
});
this.list_view.m2m_field = this;
var loaded = $.Deferred();
this.list_view.on_loaded.add_last(function() {
self.initial_is_loaded.resolve();
loaded.resolve();
});
setTimeout(function () {
self.list_view.appendTo($("#" + self.list_id));
}, 0);
return loaded;
},
reload_content: function() {
var self = this;
this.is_loaded = this.is_loaded.pipe(function() {
return self.list_view.reload_content();
});
},
update_dom: function() {
this._super.apply(this, arguments);
var self = this;
if (this.previous_readonly !== this.readonly) {
this.previous_readonly = this.readonly;
if (this.list_view) {
this.is_loaded = this.is_loaded.pipe(function() {
self.list_view.stop();
return $.when(self.load_view()).then(function() {
self.reload_content();
});
});
}
}
}
});
@@ -2334,10 +2447,7 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope
this.searchview.stop();
}
this.searchview = new openerp.web.SearchView(this,
this.dataset, false, {
"selectable": !this.options.disable_multiple_selection,
"deletable": false
});
this.dataset, false, {});
this.searchview.on_search.add(function(domains, contexts, groupbys) {
if (self.initial_ids) {
self.do_search(domains.concat([[["id", "in", self.initial_ids]], self.domain]),
@@ -2364,7 +2474,9 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope
});
self.view_list = new openerp.web.form.SelectCreateListView(self,
self.dataset, false,
_.extend({'deletable': false}, self.options.list_view_options || {}));
_.extend({'deletable': false,
'selectable': !self.options.disable_multiple_selection
}, self.options.list_view_options || {}));
self.view_list.popup = self;
self.view_list.appendTo($("#" + self.element_id + "_view_list")).pipe(function() {
self.view_list.do_show();
@@ -2483,6 +2595,7 @@ openerp.web.form.FormOpenPopup = openerp.web.OldWidget.extend(/** @lends openerp
* - read_function
* - parent_view
* - form_view_options
* - readonly
*/
show_element: function(model, row_id, context, options) {
this.model = model;
@@ -2522,7 +2635,13 @@ openerp.web.form.FormOpenPopup = openerp.web.OldWidget.extend(/** @lends openerp
this.view_form.set_embedded_view(this.options.alternative_form_view);
}
this.view_form.appendTo(this.$element.find("#" + this.element_id + "_view_form"));
var once = $.Deferred().then(function() {
if (self.options.readonly) {
self.view_form.on_toggle_readonly();
}
});
this.view_form.on_loaded.add_last(function() {
once.resolve();
var $buttons = self.view_form.$element.find(".oe_form_buttons");
$buttons.html(QWeb.render("FormOpenPopup.form.buttons"));
var $nbutton = $buttons.find(".oe_formopenpopup-form-save");
@@ -2535,6 +2654,10 @@ openerp.web.form.FormOpenPopup = openerp.web.OldWidget.extend(/** @lends openerp
$cbutton.click(function() {
self.stop();
});
if (self.options.readonly) {
$nbutton.hide();
$cbutton.text(_t("Close"));
}
self.view_form.do_show();
});
this.dataset.on_write.add(this.on_write);
@@ -2817,17 +2940,21 @@ openerp.web.form.FieldStatus = openerp.web.form.Field.extend({
}
});
openerp.web.form.WidgetNotebookReadonly = openerp.web.form.WidgetNotebook.extend({
template: 'WidgetNotebook.readonly'
});
openerp.web.form.FieldReadonly = openerp.web.form.Field.extend({
});
openerp.web.form.FieldCharReadonly = openerp.web.form.FieldReadonly.extend({
template: 'FieldChar.readonly',
init: function(view, node) {
this._super(view, node);
this.password = this.node.attrs.password === 'True' || this.node.attrs.password === '1';
},
set_value: function (value) {
this._super.apply(this, arguments);
var show_value = openerp.web.format_value(value, this, '');
if (this.password) {
show_value = new Array(show_value.length + 1).join('*');
}
this.$element.find('div').text(show_value);
return show_value;
}
@@ -2855,7 +2982,7 @@ openerp.web.form.FieldUrlReadonly = openerp.web.form.FieldURIReadonly.extend({
});
openerp.web.form.FieldBooleanReadonly = openerp.web.form.FieldCharReadonly.extend({
set_value: function (value) {
this._super(value ? '\u2714' : '\u2718');
this._super(value ? '\u2611' : '\u2610');
}
});
openerp.web.form.FieldSelectionReadonly = openerp.web.form.FieldReadonly.extend({
@@ -2890,9 +3017,17 @@ openerp.web.form.FieldMany2OneReadonly = openerp.web.form.FieldCharReadonly.exte
self.update_dom();
self.on_value_changed();
var real_set_value = function(rval) {
self.$element.find('div').text(rval ? rval[1] : '');
self.value = rval;
var div = $(self.$element.find('div'));
div.html('<a href="javascript:void(0)"></a>');
var a = $(div.find("a"));
a.text(rval ? rval[1] : '');
a.click(function() {
var pop = new openerp.web.form.FormOpenPopup(self.view);
pop.show_element(self.field.relation, self.value[0],self.build_context(), {readonly:true});
});
};
if(typeof(value) === "number") {
if (value && !(value instanceof Array)) {
var dataset = new openerp.web.DataSetStatic(
this, this.field.relation, self.build_context());
dataset.name_get([value], function(data) {
@@ -2937,8 +3072,14 @@ openerp.web.form.widgets = new openerp.web.Registry({
'binary': 'openerp.web.form.FieldBinaryFile',
'statusbar': 'openerp.web.form.FieldStatus'
});
openerp.web.form.FieldMany2ManyReadonly = openerp.web.form.FieldMany2Many.extend({
force_readonly: true
});
openerp.web.form.FieldOne2ManyReadonly = openerp.web.form.FieldOne2Many.extend({
force_readonly: true
});
openerp.web.form.readonly = openerp.web.form.widgets.clone({
'notebook': 'openerp.web.form.WidgetNotebookReadonly',
'char': 'openerp.web.form.FieldCharReadonly',
'email': 'openerp.web.form.FieldEmailReadonly',
'url': 'openerp.web.form.FieldUrlReadonly',
@@ -2948,6 +3089,9 @@ openerp.web.form.readonly = openerp.web.form.widgets.clone({
'datetime': 'openerp.web.form.FieldCharReadonly',
'selection' : 'openerp.web.form.FieldSelectionReadonly',
'many2one': 'openerp.web.form.FieldMany2OneReadonly',
'many2many' : 'openerp.web.form.FieldMany2ManyReadonly',
'one2many' : 'openerp.web.form.FieldOne2ManyReadonly',
'one2many_list' : 'openerp.web.form.FieldOne2ManyReadonly',
'boolean': 'openerp.web.form.FieldBooleanReadonly',
'float': 'openerp.web.form.FieldCharReadonly',
'integer': 'openerp.web.form.FieldCharReadonly',
+53 -4
View File
@@ -11,7 +11,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
// whether the column headers should be displayed
'header': true,
// display addition button, with that label
'addable': _t("New"),
'addable': _t("Create"),
// whether the list view can be sorted, note that once a view has been
// sorted it can not be reordered anymore
'sortable': true,
@@ -201,8 +201,15 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
this.setup_columns(this.fields_view.fields, grouped);
this.$element.html(QWeb.render("ListView", this));
// Head hook
this.$element.find('.all-record-selector').click(function(){
self.$element.find('.oe-record-selector input').prop('checked',
self.$element.find('.all-record-selector').prop('checked') || false);
var selection = self.groups.get_selection();
$(self.groups).trigger(
'selected', [selection.ids, selection.records]);
});
this.$element.find('.oe-list-add')
.click(this.do_add_record)
.attr('disabled', grouped && this.options.editable);
@@ -424,10 +431,13 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
},
/**
* re-renders the content of the list view
*
* @returns {$.Deferred} promise to content reloading
*/
reload_content: function () {
var self = this;
this.records.reset();
var reloaded = $.Deferred();
this.$element.find('.oe-listview-content').append(
this.groups.render(function () {
if (self.dataset.index == null) {
@@ -438,7 +448,9 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
}
}
self.compute_aggregates();
reloaded.resolve();
}));
return reloaded.promise();
},
/**
* Handler for the result of eval_domain_and_context, actually perform the
@@ -512,6 +524,17 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView#
return field.name === name;
});
if (!action) { return; }
var c = new openerp.web.CompoundContext();
c.set_eval_context(_.extend({
active_id: id,
active_ids: [id],
active_model: this.dataset.model
}, this.records.get(id).toContext()));
if (action.context) {
c.add(action.context);
}
action.context = c;
this.do_execute_action(action, this.dataset, id, callback);
},
/**
@@ -1201,6 +1224,10 @@ openerp.web.ListView.Groups = openerp.web.Class.extend( /** @lends openerp.web.L
var options = { offset: page * limit, limit: limit };
//TODO xmo: investigate why we need to put the setTimeout
setTimeout(function() {dataset.read_slice(fields, options , function (records) {
// FIXME: ignominious hacks, parents (aka form view) should not send two ListView#reload_content concurrently
if (self.records.length) {
self.records.reset(null, {silent: true});
}
if (!self.datagroup.openable) {
view.configure_pager(dataset);
} else {
@@ -1430,6 +1457,25 @@ var Record = openerp.web.Class.extend(/** @lends Record# */{
}
return {data: form_data};
},
/**
* Converts the current record to a format expected by context evaluations
* (identical to record.attributes, except m2o fields are their integer
* value rather than a pair)
*/
toContext: function () {
var output = {}, attrs = this.attributes;
for(var k in attrs) {
var val = attrs[k];
if (typeof val !== 'object') {
output[k] = val;
} else if (val instanceof Array) {
output[k] = val[0];
} else {
throw new Error("Can't convert value " + val + " to context");
}
}
return output;
}
});
Record.include(Events);
@@ -1541,7 +1587,8 @@ var Collection = openerp.web.Class.extend(/** @lends Collection# */{
* @param {Array} [records]
* @returns this
*/
reset: function (records) {
reset: function (records, options) {
options = options || {};
_(this._proxies).each(function (proxy) {
proxy.reset();
});
@@ -1552,7 +1599,9 @@ var Collection = openerp.web.Class.extend(/** @lends Collection# */{
if (records) {
this.add(records);
}
this.trigger('reset', this);
if (!options.silent) {
this.trigger('reset', this);
}
return this;
},
/**
+64 -23
View File
@@ -78,6 +78,17 @@ openerp.web.list_editable = function (openerp) {
// tree/@editable takes priority on everything else if present.
this.options.editable = data.arch.attrs.editable || this.options.editable;
return this._super(data, grouped);
},
/**
* Ensures the editable list is saved (saves any pending edition if
* needed, or tries to)
*
* Returns a deferred to the end of the saving.
*
* @returns {$.Deferred}
*/
ensure_saved: function () {
return this.groups.ensure_saved();
}
});
@@ -86,6 +97,18 @@ openerp.web.list_editable = function (openerp) {
new_record: function () {
// TODO: handle multiple children
this.children[null].new_record();
},
/**
* Ensures descendant editable List instances are all saved if they have
* pending editions.
*
* @returns {$.Deferred}
*/
ensure_saved: function () {
return $.when.apply(null,
_.invoke(
_.values(this.children),
'ensure_saved'));
}
});
@@ -254,9 +277,11 @@ openerp.web.list_editable = function (openerp) {
* sibling if asked.
*
* @param {Boolean} [edit_next=false] should the next row become editable
* @returns {$.Deferred}
*/
save_row: function (edit_next) {
var self = this;
//noinspection JSPotentiallyInvalidConstructorUsage
var self = this, done = $.Deferred();
this.edition_form.do_save(function (result) {
if (result.created && !self.edition_id) {
self.records.add({id: result.result},
@@ -267,28 +292,44 @@ openerp.web.list_editable = function (openerp) {
next_record = self.records.at(
self.records.indexOf(edited_record) + 1);
self.handle_onwrite(self.edition_id);
self.cancel_pending_edition().then(function () {
$(self).trigger('saved', [self.dataset]);
if (!edit_next) {
return;
}
if (result.created) {
self.new_record();
return;
}
var next_record_id;
if (next_record) {
next_record_id = next_record.get('id');
self.dataset.index = _(self.dataset.ids)
.indexOf(next_record_id);
} else {
self.dataset.index = 0;
next_record_id = self.records.at(0).get('id');
}
self.edit_record(next_record_id);
});
}, this.options.editable === 'top');
$.when(
self.handle_onwrite(self.edition_id),
self.cancel_pending_edition().then(function () {
$(self).trigger('saved', [self.dataset]);
if (!edit_next) {
return;
}
if (result.created) {
self.new_record();
return;
}
var next_record_id;
if (next_record) {
next_record_id = next_record.get('id');
self.dataset.index = _(self.dataset.ids)
.indexOf(next_record_id);
} else {
self.dataset.index = 0;
next_record_id = self.records.at(0).get('id');
}
self.edit_record(next_record_id);
})).then(function () {
done.resolve();
});
}, this.options.editable === 'top').fail(function () {
done.reject();
});
return done.promise();
},
/**
* If the current list is being edited, ensures it's saved
*/
ensure_saved: function () {
if (this.edition) {
return this.save_row();
}
//noinspection JSPotentiallyInvalidConstructorUsage
return $.Deferred().resolve().promise();
},
/**
* Cancels the edition of the row for the current dataset index
+85 -59
View File
@@ -2,21 +2,21 @@
* OpenERP web library
*---------------------------------------------------------*/
openerp.web.views = function(db) {
openerp.web.views = function(session) {
var _t = db.web._t;
var _t = session.web._t;
/**
* Registry for all the client actions key: tag value: widget
*/
db.web.client_actions = new db.web.Registry();
session.web.client_actions = new session.web.Registry();
/**
* Registry for all the main views
*/
db.web.views = new db.web.Registry();
session.web.views = new session.web.Registry();
db.web.ActionManager = db.web.Widget.extend({
session.web.ActionManager = session.web.Widget.extend({
identifier_prefix: "actionmanager",
init: function(parent) {
this._super(parent);
@@ -93,20 +93,20 @@ db.web.ActionManager = db.web.Widget.extend({
ir_actions_act_window: function (action, on_close) {
if (action.target === 'new') {
if (this.dialog == null) {
this.dialog = new db.web.Dialog(this, { title: action.name, width: '80%' });
this.dialog = new session.web.Dialog(this, { title: action.name, width: '80%' });
if(on_close)
this.dialog.on_close.add(on_close);
this.dialog.start();
} else {
this.dialog_viewmanager.stop();
}
this.dialog_viewmanager = new db.web.ViewManagerAction(this, action);
this.dialog_viewmanager = new session.web.ViewManagerAction(this, action);
this.dialog_viewmanager.appendTo(this.dialog.$element);
this.dialog.open();
} else {
this.dialog_stop();
this.content_stop();
this.inner_viewmanager = new db.web.ViewManagerAction(this, action);
this.inner_viewmanager = new session.web.ViewManagerAction(this, action);
this.inner_viewmanager.appendTo(this.$element);
this.url_update(action);
}
@@ -124,7 +124,7 @@ db.web.ActionManager = db.web.Widget.extend({
if (this.dialog && action.context) {
var model = action.context.active_model;
if (model === 'base.module.upgrade' || model === 'base.setup.installer' || model === 'base.module.upgrade') {
db.webclient.do_reload();
session.webclient.do_reload();
}
}
this.dialog_stop();
@@ -140,7 +140,7 @@ db.web.ActionManager = db.web.Widget.extend({
},
ir_actions_client: function (action) {
this.content_stop();
var ClientWidget = db.web.client_actions.get_object(action.tag);
var ClientWidget = session.web.client_actions.get_object(action.tag);
(this.client_widget = new ClientWidget(this, action.params)).appendTo(this);
},
ir_actions_report_xml: function(action) {
@@ -164,12 +164,12 @@ db.web.ActionManager = db.web.Widget.extend({
}
});
db.web.ViewManager = db.web.Widget.extend(/** @lends db.web.ViewManager# */{
session.web.ViewManager = session.web.Widget.extend(/** @lends session.web.ViewManager# */{
identifier_prefix: "viewmanager",
template: "ViewManager",
/**
* @constructs db.web.ViewManager
* @extends db.web.Widget
* @constructs session.web.ViewManager
* @extends session.web.Widget
*
* @param parent
* @param dataset
@@ -185,10 +185,10 @@ db.web.ViewManager = db.web.Widget.extend(/** @lends db.web.ViewManager# */{
this.views_src = _.map(views, function(x) {return x instanceof Array? {view_id: x[0], view_type: x[1]} : x;});
this.views = {};
this.flags = this.flags || {};
this.registry = db.web.views;
this.registry = session.web.views;
},
render: function() {
return db.web.qweb.render(this.template, {
return session.web.qweb.render(this.template, {
self: this,
prefix: this.element_id,
views: this.views_src});
@@ -271,6 +271,10 @@ db.web.ViewManager = db.web.Widget.extend(/** @lends db.web.ViewManager# */{
}
}
}
$.when(view_promise).then(function () {
self.$element.find('.oe_view_title:first').text(
self.display_title());
});
return view_promise;
},
/**
@@ -284,7 +288,7 @@ db.web.ViewManager = db.web.Widget.extend(/** @lends db.web.ViewManager# */{
if (this.searchview) {
this.searchview.stop();
}
this.searchview = new db.web.SearchView(
this.searchview = new session.web.SearchView(
this, this.dataset,
view_id, search_defaults, this.flags.search_view === false);
@@ -331,16 +335,24 @@ db.web.ViewManager = db.web.Widget.extend(/** @lends db.web.ViewManager# */{
/**
* Called by children view after executing an action
*/
on_action_executed: function () {}
on_action_executed: function () {},
display_title: function () {
var view = this.views[this.active_view];
if (view) {
// ick
return view.controller.fields_view.arch.attrs.string;
}
return '';
}
});
db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.ViewManagerAction# */{
session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepnerp.web.ViewManagerAction# */{
template:"ViewManagerAction",
/**
* @constructs db.web.ViewManagerAction
* @extends db.web.ViewManager
* @constructs session.web.ViewManagerAction
* @extends session.web.ViewManager
*
* @param {db.web.ActionManager} parent parent object/widget
* @param {session.web.ActionManager} parent parent object/widget
* @param {Object} action descriptor for the action this viewmanager needs to manage its views.
*/
init: function(parent, action) {
@@ -350,7 +362,7 @@ db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.View
this._super(parent, null, action.views);
this.session = parent.session;
this.action = action;
var dataset = new db.web.DataSetSearch(this, action.res_model, action.context, action.domain);
var dataset = new session.web.DataSetSearch(this, action.res_model, action.context, action.domain);
if (action.res_id) {
dataset.ids.push(action.res_id);
dataset.index = 0;
@@ -400,12 +412,12 @@ db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.View
this.$element.find('.oe_get_xml_view').click(function () {
// TODO: add search view?
$('<pre>').text(db.web.json_node_to_xml(
$('<pre>').text(session.web.json_node_to_xml(
self.views[self.active_view].controller.fields_view.arch, true))
.dialog({ width: '95%'});
});
if (this.action.help && !this.flags.low_profile) {
var Users = new db.web.DataSet(self, 'res.users'),
var Users = new session.web.DataSet(self, 'res.users'),
header = this.$element.find('.oe-view-manager-header');
header.delegate('blockquote button', 'click', function() {
var $this = $(this);
@@ -444,6 +456,16 @@ db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.View
if (!self.action.name && fvg) {
self.$element.find('.oe_view_title').text(fvg.arch.attrs.string || fvg.name);
}
var $title = self.$element.find('.oe_view_title'),
$search_prefix = $title.find('span');
if (controller.searchable !== false) {
if (!$search_prefix.length) {
$title.prepend('<span>' + _t("Search:") + '</span>');
}
} else {
$search_prefix.remove();
}
});
},
shortcut_check : function(view) {
@@ -451,7 +473,7 @@ db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.View
var grandparent = this.widget_parent && this.widget_parent.widget_parent;
// display shortcuts if on the first view for the action
var $shortcut_toggle = this.$element.find('.oe-shortcut-toggle');
if (!(grandparent instanceof db.web.WebClient) ||
if (!(grandparent instanceof session.web.WebClient) ||
!(view.view_type === this.views_src[0].view_type
&& view.view_id === this.views_src[0].view_id)) {
$shortcut_toggle.hide();
@@ -488,7 +510,7 @@ db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.View
* Intercept do_action resolution from children views
*/
on_action_executed: function () {
return new db.web.DataSet(this, 'res.log')
return new session.web.DataSet(this, 'res.log')
.call('get', [], this.do_display_log);
},
/**
@@ -512,10 +534,13 @@ db.web.ViewManagerAction = db.web.ViewManager.extend(/** @lends oepnerp.web.View
return false;
});
});
},
display_title: function () {
return this.action.name;
}
});
db.web.Sidebar = db.web.Widget.extend({
session.web.Sidebar = session.web.Widget.extend({
init: function(parent, element_id) {
this._super(parent, element_id);
this.items = {};
@@ -524,7 +549,7 @@ db.web.Sidebar = db.web.Widget.extend({
start: function() {
this._super(this);
var self = this;
this.$element.html(db.web.qweb.render('Sidebar'));
this.$element.html(session.web.qweb.render('Sidebar'));
this.$element.find(".toggle-sidebar").click(function(e) {
self.do_toggle();
});
@@ -544,7 +569,7 @@ db.web.Sidebar = db.web.Widget.extend({
{
label: _t("Manage Views"),
callback: this.call_default_on_sidebar,
title: _t("Manage views of the current object"),
title: _t("Manage views of the current object")
}, {
label: _t("Edit Workflow"),
callback: this.call_default_on_sidebar,
@@ -553,7 +578,7 @@ db.web.Sidebar = db.web.Widget.extend({
}, {
label: _t("Customize Object"),
callback: this.call_default_on_sidebar,
title: _t("Manage views of the current object"),
title: _t("Manage views of the current object")
}
]);
@@ -561,10 +586,10 @@ db.web.Sidebar = db.web.Widget.extend({
this.add_items('other', [
{
label: _t("Import"),
callback: this.call_default_on_sidebar,
callback: this.call_default_on_sidebar
}, {
label: _t("Export"),
callback: this.call_default_on_sidebar,
callback: this.call_default_on_sidebar
}, {
label: _t("Translate"),
callback: this.call_default_on_sidebar,
@@ -601,10 +626,10 @@ db.web.Sidebar = db.web.Widget.extend({
if(!$section) {
section_id = _.uniqueId(this.element_id + '_section_' + code + '_');
var $section = $(db.web.qweb.render("Sidebar.section", {
var $section = $(session.web.qweb.render("Sidebar.section", {
section_id: section_id,
name: name,
classname: 'oe_sidebar_' + code,
classname: 'oe_sidebar_' + code
}));
$section.appendTo(this.$element.find('div.sidebar-actions'));
this.sections[code] = $section;
@@ -633,7 +658,7 @@ db.web.Sidebar = db.web.Widget.extend({
this.items[items[i].element_id] = items[i];
}
var $items = $(db.web.qweb.render("Sidebar.section.items", {items: items}));
var $items = $(session.web.qweb.render("Sidebar.section.items", {items: items}));
$items.find('a.oe_sidebar_action_a').click(function() {
var item = self.items[$(this).attr('id')];
@@ -687,7 +712,7 @@ db.web.Sidebar = db.web.Widget.extend({
}
});
db.web.TranslateDialog = db.web.Dialog.extend({
session.web.TranslateDialog = session.web.Dialog.extend({
dialog_title: _t("Translations"),
init: function(view) {
// TODO fme: should add the language to fields_view_get because between the fields view get
@@ -707,14 +732,14 @@ db.web.TranslateDialog = db.web.Dialog.extend({
this.translatable_fields_keys = _.map(this.view.translatable_fields || [], function(i) { return i.name });
this.languages = null;
this.languages_loaded = $.Deferred();
(new db.web.DataSetSearch(this, 'res.lang', this.view.dataset.get_context(),
(new session.web.DataSetSearch(this, 'res.lang', this.view.dataset.get_context(),
[['translatable', '=', '1']])).read_slice(['code', 'name'], { sort: 'id' }, this.on_languages_loaded);
},
start: function() {
var self = this;
this._super();
$.when(this.languages_loaded).then(function() {
self.$element.html(db.web.qweb.render('TranslateDialog', { widget: self }));
self.$element.html(session.web.qweb.render('TranslateDialog', { widget: self }));
self.$element.tabs();
if (!(self.view.translatable_fields && self.view.translatable_fields.length)) {
self.hide_tabs('fields');
@@ -819,7 +844,7 @@ db.web.TranslateDialog = db.web.Dialog.extend({
}
});
db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{
session.web.View = session.web.Widget.extend(/** @lends session.web.View# */{
template: "EmptyComponent",
set_default_options: function(options) {
this.options = options || {};
@@ -833,7 +858,7 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{
},
open_translate_dialog: function(field) {
if (!this.translate_dialog) {
this.translate_dialog = new db.web.TranslateDialog(this).start();
this.translate_dialog = new session.web.TranslateDialog(this).start();
}
this.translate_dialog.open(field);
},
@@ -845,7 +870,7 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{
* @param {String} [action_data.special=null] special action handlers (currently: only ``'cancel'``)
* @param {String} [action_data.type='workflow'] the action type, if present, one of ``'object'``, ``'action'`` or ``'workflow'``
* @param {Object} [action_data.context=null] additional action context, to add to the current context
* @param {db.web.DataSet} dataset a dataset object used to communicate with the server
* @param {session.web.DataSet} dataset a dataset object used to communicate with the server
* @param {Object} [record_id] the identifier of the object on which the action is to be applied
* @param {Function} on_closed callback to execute when dialog is closed or when the action does not generate any result (no new action)
*/
@@ -857,12 +882,12 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{
return self.widget_parent.on_action_executed.apply(null, arguments);
}
};
var context = new db.web.CompoundContext(dataset.get_context(), action_data.context || {});
var context = new session.web.CompoundContext(dataset.get_context(), action_data.context || {});
var handler = function (r) {
var action = r.result;
if (action && action.constructor == Object) {
var ncontext = new db.web.CompoundContext(context);
var ncontext = new session.web.CompoundContext(context);
if (record_id) {
ncontext.add({
active_id: record_id,
@@ -899,7 +924,7 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{
/**
* Directly set a view to use instead of calling fields_view_get. This method must
* be called before start(). When an embedded view is set, underlying implementations
* of db.web.View must use the provided view instead of any other one.
* of session.web.View must use the provided view instead of any other one.
*
* @param embedded_view A view.
*/
@@ -917,7 +942,8 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{
},
on_sidebar_manage_views: function() {
if (this.fields_view && this.fields_view.arch) {
$('<xmp>' + db.web.json_node_to_xml(this.fields_view.arch, true) + '</xmp>').dialog({ width: '95%', height: 600});
var view_editor = new session.web.ViewEditor(this, this.$element, this.dataset, this.fields_view.arch);
view_editor.start();
} else {
this.do_warn("Manage Views", "Could not find current view declaration");
}
@@ -929,11 +955,11 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{
console.log('Todo');
},
on_sidebar_import: function() {
var import_view = new db.web.DataImport(this, this.dataset);
var import_view = new session.web.DataImport(this, this.dataset);
import_view.start();
},
on_sidebar_export: function() {
var export_view = new db.web.DataExport(this, this.dataset);
var export_view = new session.web.DataExport(this, this.dataset);
export_view.start();
},
on_sidebar_translate: function() {
@@ -943,19 +969,19 @@ db.web.View = db.web.Widget.extend(/** @lends db.web.View# */{
}
});
db.web.json_node_to_xml = function(node, single_quote, indent) {
session.web.json_node_to_xml = function(node, human_readable, indent) {
// For debugging purpose, this function will convert a json node back to xml
// Maybe usefull for xml view editor
indent = indent || 0;
var sindent = (human_readable ? (new Array(indent + 1).join('\t')) : ''),
r = sindent + '<' + node.tag,
cr = human_readable ? '\n' : '';
if (typeof(node) === 'string') {
return node;
}
else if (typeof(node.tag) !== 'string' || !node.children instanceof Array || !node.attrs instanceof Object) {
return sindent + node;
} else if (typeof(node.tag) !== 'string' || !node.children instanceof Array || !node.attrs instanceof Object) {
throw("Node a json node");
}
indent = indent || 0;
var sindent = new Array(indent + 1).join('\t'),
r = sindent + '<' + node.tag;
for (var attr in node.attrs) {
var vattr = node.attrs[attr];
if (typeof(vattr) !== 'string') {
@@ -963,19 +989,19 @@ db.web.json_node_to_xml = function(node, single_quote, indent) {
vattr = JSON.stringify(vattr);
}
vattr = vattr.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
if (single_quote) {
if (human_readable) {
vattr = vattr.replace(/&quot;/g, "'");
}
r += ' ' + attr + '="' + vattr + '"';
}
if (node.children && node.children.length) {
r += '>\n';
r += '>' + cr;
var childs = [];
for (var i = 0, ii = node.children.length; i < ii; i++) {
childs.push(db.web.json_node_to_xml(node.children[i], single_quote, indent + 1));
childs.push(session.web.json_node_to_xml(node.children[i], human_readable, indent + 1));
}
r += childs.join('\n');
r += '\n' + sindent + '</' + node.tag + '>';
r += childs.join(cr);
r += cr + sindent + '</' + node.tag + '>';
return r;
} else {
return r + '/>';
+128 -66
View File
@@ -415,6 +415,9 @@
<tr>
<td class="view-manager-main-content">
<div class="oe-view-manager-header">
<h2 class="oe_view_title" t-if="self.flags.display_title !== false">
<t t-esc="self.display_title()"/>
</h2>
<div class="oe_vm_switch">
<t t-if="views.length != 1" t-foreach="views" t-as="view">
<button type="button" t-att-data-view-type="view.view_type">
@@ -452,9 +455,6 @@
<button t-if="self.session.debug" class="oe_get_xml_view">
View#<span></span>
</button>
<h2 class="oe_view_title" t-if="self.flags.display_title !== false">
<t t-if="self.flags.display_title !== false" t-esc="self.action.name"/>
</h2>
</t>
<t t-jquery=".oe-view-manager-header" t-operation="after">
<ul class="oe-view-manager-logs"></ul>
@@ -473,8 +473,6 @@
<h2><t t-esc="name"/></h2>
</div>
</t>
<t t-name="Sidebar.section.items">
<li t-foreach="items" t-as="item" t-att-class="item.classname">
<a class="oe_sidebar_action_a" t-att-id="item.element_id" t-att-title="item.title" href="#">
@@ -551,6 +549,7 @@
</span>
</td>
</tr>
<table t-name="ListView" class="oe-listview-content">
<t t-set="columns_count" t-value="visible_columns.length + (options.selectable ? 1 : 0) + (options.deletable ? 1 : 0)"/>
<thead class="ui-widget-header">
@@ -568,21 +567,7 @@
Delete
</button>
</td>
<th t-if="options.pager !== false" class="oe-list-pager">
<button type="button" disabled="disabled"
data-pager-action="first">First</button>
<button type="button" disabled="disabled"
data-pager-action="previous"
>&lt;</button>
<span class="oe-pager-state">
</span>
<button type="button" disabled="disabled"
data-pager-action="next">&gt;</button>
<button type="button" disabled="disabled"
data-pager-action="last">Last</button>
</th>
<t t-call="Listview.navigation.button"/>
</tr>
</table>
</th>
@@ -593,7 +578,8 @@
<t t-esc="column.string"/>
</th>
</t>
<th t-if="options.selectable" width="1"/>
<th t-if="options.selectable" width="1" >
<input type="checkbox" class="all-record-selector"/> </th>
<t t-foreach="columns" t-as="column">
<th t-if="!column.meta and column.invisible !== '1'" t-att-data-id="column.id"
t-att-class="((options.sortable and column.tag !== 'button') ? 'oe-sortable' : null)">
@@ -612,8 +598,26 @@
</td>
<td t-if="options.deletable"/>
</tr>
<tr>
<t t-call="Listview.navigation.button"/>
</tr>
</tfoot>
</table>
<th t-name="Listview.navigation.button" t-if="options.pager !== false"
class="oe-list-pager" t-att-colspan="columns_count">
<button type="button" disabled="disabled"
data-pager-action="first">First</button>
<button type="button" disabled="disabled"
data-pager-action="previous">&lt;</button>
<span class="oe-pager-state">
</span>
<button type="button" disabled="disabled"
data-pager-action="next">&gt;</button>
<button type="button" disabled="disabled"
data-pager-action="last">Last</button>
</th>
<t t-name="ListView.rows" t-foreach="records.length" t-as="index">
<t t-call="ListView.row">
<t t-set="record" t-value="records.at(index)"/>
@@ -628,9 +632,18 @@
</td>
</t>
<th t-if="options.selectable" class="oe-record-selector" width="1">
<input type="checkbox"/>
</th>
<t t-if="options.radio">
<th t-if="options.selectable" class="oe-record-selector" width="1">
<input type="radio" name ="radiogroup"/>
</th>
</t>
<t t-if="!options.radio">
<th t-if="options.selectable" class="oe-record-selector" width="1">
<input type="checkbox"/>
</th>
</t>
<t t-foreach="columns" t-as="column">
<t t-set="align" t-value="column.type === 'integer' or column.type == 'float'"/>
<td t-if="!column.meta and column.invisible !== '1'" t-att-title="column.help"
@@ -646,18 +659,20 @@
<t t-name="ListView.row.form">
<t t-raw="frame.render()"/>
</t>
<t t-name="FormView">
<div class="oe_form_header">
<div class="oe_form_buttons" t-if="view.options.action_buttons !== false">
<button type="button" class="oe_form_button_save">
<span class="oe_form_on_update">Save</span>
<span class="oe_form_on_create">Create</span>
<div class="oe_form_buttons" t-if="widget.options.action_buttons !== false">
<button type="button" class="oe_form_button_save oe_form_on_editable">Save</button>
<button type="button" class="oe_form_button_toggle">
<span class="oe_form_on_editable">Cancel</span>
<span class="oe_form_on_readonly">Edit</span>
</button>
<button type="button" class="oe_form_button_new">New</button>
<button type="button" class="oe_form_button_duplicate oe_form_on_update">Duplicate</button>
<button type="button" class="oe_form_button_toggle">Readonly/Editable</button>
<button type="button" class="oe_form_button_new oe_form_on_readonly">Create</button>
<button type="button" class="oe_form_button_duplicate oe_form_on_readonly">Duplicate</button>
<button type="button" class="oe_form_button_delete oe_form_on_readonly">Delete</button>
</div>
<div class="oe_form_pager" t-if="view.options.pager !== false">
<div class="oe_form_pager" t-if="widget.options.pager !== false">
<button type="button" data-pager-action="first">First</button>
<button type="button" data-pager-action="previous">&lt;&lt;</button>
@@ -740,12 +755,6 @@
<t t-call="WidgetFrame"/>
</div>
</t>
<t t-name="WidgetNotebook.readonly">
<t t-foreach="widget.pages" t-as="page">
<h3><t t-esc="page.string"/></h3>
<t t-raw="page.render()"/>
</t>
</t>
<t t-name="WidgetSeparator">
<div t-if="widget.orientation !== 'vertical'" t-att-class="'separator ' + widget.orientation">
<t t-esc="widget.string"/>
@@ -753,7 +762,7 @@
</t>
<t t-name="WidgetLabel">
<label t-att-for="widget.element_id"
t-att-class="'oe_label' + (widget.help ? '_help' : '')"
t-attf-class="oe_label#{widget.help ? '_help' : ''} oe_align_#{widget.align}"
t-att-title="widget.help">
<t t-esc="widget.string"/>
<span t-if="widget.help">?</span>
@@ -761,10 +770,10 @@
</label>
</t>
<t t-name="WidgetParagraph">
<p class="oe_form_paragraph"><t t-esc="widget.string"/></p>
<p t-attf-class="oe_form_paragraph oe_align_#{widget.align}"><t t-esc="widget.string"/></p>
</t>
<t t-name="FieldChar">
<input type="text" size="1"
<input t-att-type="widget.password ? 'password' : 'text'" size="1"
t-att-name="widget.name"
t-att-id="widget.element_id"
t-attf-class="field_#{widget.type}"
@@ -855,9 +864,9 @@
</t>
<t t-name="FieldMany2One.context_menu">
<ul>
<li t-att-id="widget.cm_id + '_open'" style="color:grey">Open...</li>
<li t-att-id="widget.cm_id + '_create'">Create...</li>
<li t-att-id="widget.cm_id + '_search'" class="oe_m2o_menu_item_mandatory">Search...</li>
<li t-att-id="widget.cm_id + '_open'" style="color:grey" class="oe_m2o_menu_item_mandatory">Open...</li>
<li t-att-id="widget.cm_id + '_create'" class="oe_m2o_menu_item_noreadonly">Create...</li>
<li t-att-id="widget.cm_id + '_search'" class="oe_m2o_menu_item_noreadonly">Search...</li>
<t t-set="i" t-value="0"/>
<t t-foreach="widget.related_entries" t-as="entry">
<li t-att-id="widget.cm_id + '_related_' + i" style="color:grey" class="oe_m2o_menu_item_mandatory">
@@ -1002,6 +1011,7 @@
<span t-if="widget.string"><t t-esc="widget.string"/></span>
</button>
</t>
<t t-name="SearchView">
<form class="oe_forms">
<t t-call="SearchView.render_lines"/>
@@ -1271,6 +1281,55 @@
.unwrap();
</t>
</t>
<t t-name="view_editor">
<table class="oe_view_editor">
<t t-call="view_editor.row"/>
</table>
</t>
<tr t-name="view_editor.row" class="oe_view_editor_row" t-att-id="'viewedit-' + rec.id" t-att-level="rec.level" t-foreach="data" t-as="rec">
<td class="oe_view_editor_colum" width="85%">
<table class="oe_view_editor_tree_grid">
<tr>
<td width="16px" t-att-style="'background-position: ' + 20*rec.level + 'px; padding-left: ' + 20*rec.level + 'px'">
<img t-if="rec.child_id.length" t-att-id="'parentimg-' + rec.id"
src="/web/static/src/img/collapse.gif" width="16" height="16" border="0"/>
</td>
<td style="cursor: pointer;">
<a style="text-decoration:none" href="javascript:void(0);"> <t t-esc="rec.name"/> </a>
</td>
</tr>
</table>
</td>
<td align="left" class="oe_view_editor_colum" width="15%">
<table width="100%">
<tr>
<td width="20%">
<img t-if="rec.att_list.length"
id="side-add" src="/web/static/src/img/icons/gtk-add.png" style="cursor: pointer;"/>
</td>
<td width="20%">
<img id="side-remove" src="/web/static/src/img/icons/gtk-remove.png" style="cursor: pointer;"/>
</td>
<td width="20%">
<img t-if="rec.att_list.length"
id="side-edit" src="/web/static/src/img/icons/gtk-edit.png" style="cursor: pointer;"/>
</td>
<td width="20%">
<img t-if="rec.att_list.length"
id="side-up" src="/web/static/src/img/icons/gtk-go-up.png" style="cursor: pointer;"/>
</td>
<td width="20%">
<img t-if="rec.att_list.length"
id="side-down" src="/web/static/src/img/icons/gtk-go-down.png" style="cursor: pointer;"/>
</td>
</tr>
</table>
</td>
<t t-if="rec.child_id.length">
<t t-set="data" t-value="rec.child_id"/>
<t t-call="view_editor.row"/>
</t>
</tr>
<t t-name="ExportView">
<a id="exportview" href="javascript: void(0)" style="text-decoration: none;color: #3D3D3D;">Export</a>
@@ -1405,7 +1464,8 @@
<a id="importview" href="javascript: void(0)" style="text-decoration: none;color: #3D3D3D;">Import</a>
</t>
<t t-name="ImportDataView">
<form name="import_data" id="import_data" action="" method="post" enctype="multipart/form-data">
<form name="import_data" id="import_data" action="" method="post" enctype="multipart/form-data"
class="oe-import oe-import-no-result">
<input type="hidden" name="session_id" t-att-value="session.session_id"/>
<h2 class="separator horizontal">1. Import a .CSV file</h2>
<p>Select a .CSV file to import. If you need a sample of file to import,
@@ -1415,11 +1475,11 @@
<label for="csvfile">CSV File:</label>
<input type="file" id="csvfile" size="50" name="csvfile"/>
</p>
<h2 class="separator horizontal">2. Check your file format</h2>
<div id="result"></div>
<fieldset>
<legend style="cursor:pointer;">Import Options</legend>
<table style="display:none">
<h2 class="separator horizontal oe-import-result">2. Check your file format</h2>
<div id="result" class="oe-import-result"></div>
<fieldset class="oe-closed oe-import-result">
<legend>Import Options</legend>
<table>
<tr>
<td colspan="4">
<label for="file_has_headers">Does your file have titles?</label>
@@ -1449,22 +1509,24 @@
</fieldset>
</form>
</t>
<table t-name="ImportView.result"
class="oe_import_grid" width="100%" style="margin: 5px 0;">
<tr t-if="headers" class="oe_import_grid-header">
<td t-foreach="headers" t-as="header" class="oe_import_grid-cell">
<t t-esc="header"/></td>
</tr>
<tr>
<td t-foreach="records[0]" t-as="column">
<input class="sel_fields"/>
</td>
</tr>
<tr t-foreach="records" t-as="record" class="oe_import_grid-row">
<td t-foreach="record" t-as="cell" class="oe_import_grid-cell">
<t t-esc="cell"/></td>
</tr>
</table>
<t t-name="ImportView.result">
<table class="oe_import_grid" width="100%" style="margin: 5px 0;">
<tr t-if="headers" class="oe_import_grid-header">
<td t-foreach="headers" t-as="header" class="oe_import_grid-cell">
<t t-esc="header"/></td>
</tr>
<tr>
<td t-foreach="records[0]" t-as="column">
<input class="sel_fields" placeholder="--- Don't Import ---"/><span class="oe-m2o-drop-down-button">
<img src="/web/static/src/img/down-arrow.png" /></span>
</td>
</tr>
<tr t-foreach="records" t-as="record" class="oe_import_grid-row">
<td t-foreach="record" t-as="cell" class="oe_import_grid-cell">
<t t-esc="cell"/></td>
</tr>
</table>
</t>
<t t-name="ImportView.error">
<p style="white-space:pre-line;">The import failed due to:<t t-esc="error.message"/></p>
<t t-if="error.preview">
+2
View File
@@ -39,6 +39,8 @@ $(document).ready(function () {
'1.000000');
equal(openerp.web.format_value(1, {type: 'float'}),
'1.00');
equal(openerp.web.format_value(-11.25, {type: 'float'}),
"-11.25");
});
test("parse_datetime", function () {
var val = openerp.web.str_to_datetime("2009-05-04 12:34:23");
+3
View File
@@ -11,5 +11,8 @@
"css": ['static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler.css',
'static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_ext.css'
],
'qweb' : [
"static/src/xml/*.xml",
],
'active': True
}
+22
View File
@@ -0,0 +1,22 @@
# Arabic translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:38+0200\n"
"PO-Revision-Date: 2011-11-03 15:02+0000\n"
"Last-Translator: kifcaliph <kifcaliph@hotmail.com>\n"
"Language-Team: Arabic <ar@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-04 05:32+0000\n"
"X-Generator: Launchpad (build 14231)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
msgstr "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-12 04:44+0000\n"
"X-Generator: Launchpad (build 14124)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n"
"X-Generator: Launchpad (build 14123)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-19 06:05+0000\n"
"X-Generator: Launchpad (build 14157)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n"
"X-Generator: Launchpad (build 14123)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n"
"X-Generator: Launchpad (build 14185)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-09 05:22+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n"
"X-Generator: Launchpad (build 14185)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_calendar/static/src/xml/web_calendar.xml:0
msgid "&nbsp;"
@@ -5,7 +5,6 @@
openerp.web_calendar = function(openerp) {
var _t = openerp.web._t;
var QWeb = openerp.web.qweb;
QWeb.add_template('/web_calendar/static/src/xml/web_calendar.xml');
openerp.web.views.add('calendar', 'openerp.web_calendar.CalendarView');
openerp.web_calendar.CalendarView = openerp.web.View.extend({
// Dhtmlx scheduler ?
+3
View File
@@ -7,5 +7,8 @@
'static/src/js/dashboard.js'
],
"css": ['static/src/css/dashboard.css'],
'qweb' : [
"static/src/xml/*.xml",
],
'active': True
}
+46
View File
@@ -0,0 +1,46 @@
# Arabic translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:39+0200\n"
"PO-Revision-Date: 2011-11-03 15:09+0000\n"
"Last-Translator: kifcaliph <kifcaliph@hotmail.com>\n"
"Language-Team: Arabic <ar@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-04 05:32+0000\n"
"X-Generator: Launchpad (build 14231)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
msgstr "إستعادة"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Undo"
msgstr "تراجع"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Add Widget"
msgstr "أضف أداة"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Change layout"
msgstr "تغيير المخطط"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Choose dashboard layout"
msgstr "اختر مخطط للعرض"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "progress:"
msgstr "التقدم:"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "%"
msgstr "%"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-12 04:44+0000\n"
"X-Generator: Launchpad (build 14124)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n"
"X-Generator: Launchpad (build 14123)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-19 06:05+0000\n"
"X-Generator: Launchpad (build 14157)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n"
"X-Generator: Launchpad (build 14123)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n"
"X-Generator: Launchpad (build 14185)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
+46
View File
@@ -0,0 +1,46 @@
# Polish translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:39+0200\n"
"PO-Revision-Date: 2011-11-04 16:28+0000\n"
"Last-Translator: Grzegorz Grzelak (OpenGLOBE.pl) <grzegorz@openglobe.pl>\n"
"Language-Team: Polish <pl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-05 06:04+0000\n"
"X-Generator: Launchpad (build 14231)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
msgstr "Przywróć"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Undo"
msgstr "Cofnij"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Add Widget"
msgstr "Dodaj kontrolkę"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Change layout"
msgstr "Zmień układ"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Choose dashboard layout"
msgstr "Wybierz układ konsoli"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "progress:"
msgstr "postęp:"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "%"
msgstr ""
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n"
"X-Generator: Launchpad (build 14185)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_dashboard/static/src/xml/web_dashboard.xml:0
msgid "Reset"
@@ -1,6 +1,5 @@
openerp.web_dashboard = function(openerp) {
var QWeb = openerp.web.qweb;
QWeb.add_template('/web_dashboard/static/src/xml/web_dashboard.xml');
if (!openerp.web_dashboard) {
/** @namespace */
@@ -468,7 +467,7 @@ openerp.web_dashboard.ApplicationTiles = openerp.web.View.extend({
[['name', '=', module_name], ['state', '=', 'uninstalled']]);
var Upgrade = new openerp.web.DataSet(this, 'base.module.upgrade');
$.blockUI({message:'<img src="/web/static/src/img/throbber2.gif">'});
$.blockUI();
Modules.read_slice(['id'], {}, function (records) {
if (!(records.length === 1)) { $.unblockUI(); return; }
Modules.call('state_update',
@@ -30,7 +30,7 @@
</t>
<t t-name="DashBoard.action">
<div t-att-data-id="action.attrs.name" class="oe-dashboard-action">
<h2 t-attf-class="oe-dashboard-action-header oe_view_title #{action.attrs.string ? '' : 'oe-dashboard-action-header-empty'}">
<h2 t-attf-class="oe-dashboard-action-header #{action.attrs.string ? '' : 'oe-dashboard-action-header-empty'}">
<input class="oe-dashboard-action-input" type="text" name="title" value="" style="display: none"/>
<t t-esc="action.attrs.string"/>
<t t-if="!action.attrs.string">&amp;nbsp;</t>
+38
View File
@@ -0,0 +1,38 @@
# Arabic translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:39+0200\n"
"PO-Revision-Date: 2011-11-08 05:50+0000\n"
"Last-Translator: Ahmad Khayyat <Unknown>\n"
"Language-Team: Arabic <ar@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-08 06:12+0000\n"
"X-Generator: Launchpad (build 14231)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
msgstr "أهلاً و مرحباً بك في OpenERP"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember to bookmark this page."
msgstr "لا تنس إدراج هذه الصفحة ضمن المفضلات"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember your login:"
msgstr "تذكر كلمة المرور"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Choose the first OpenERP Application you want to install.."
msgstr "اختر أول تطبيق OpenERP تود تثبيته"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Install"
msgstr "تثبيت"
+38
View File
@@ -0,0 +1,38 @@
# Danish translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:39+0200\n"
"PO-Revision-Date: 2011-10-11 14:02+0000\n"
"Last-Translator: Jonas Mortensen <Unknown>\n"
"Language-Team: Danish <da@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
msgstr "Velkommen til din nye OpenERP instans."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember to bookmark this page."
msgstr "Husk at tilføje denne side til dine favoritter."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember your login:"
msgstr "Husk dit log ind:"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Choose the first OpenERP Application you want to install.."
msgstr "Vælg den første OpenERP Applikation som du ønsker at installere."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Install"
msgstr "Installér"
+38
View File
@@ -0,0 +1,38 @@
# German translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:39+0200\n"
"PO-Revision-Date: 2011-10-10 12:40+0000\n"
"Last-Translator: Felix Schubert <Unknown>\n"
"Language-Team: German <de@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
msgstr "Willkommen zu Ihrer neuen OpenERP Instanz."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember to bookmark this page."
msgstr "Denken Sie daran ein Lesezeichen für diese Seite zu setzen."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember your login:"
msgstr "Anmeldung speichern"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Choose the first OpenERP Application you want to install.."
msgstr "Wählen Sie die erste OpenERP Anwendung die Sie installieren möchten."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Install"
msgstr "Installieren"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-19 06:05+0000\n"
"X-Generator: Launchpad (build 14157)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
+38
View File
@@ -0,0 +1,38 @@
# Spanish (Ecuador) translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:39+0200\n"
"PO-Revision-Date: 2011-10-07 16:00+0000\n"
"Last-Translator: Cristian Salamea (Gnuthink) <ovnicraft@gmail.com>\n"
"Language-Team: Spanish (Ecuador) <es_EC@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
msgstr "Bienvenido a tu nueva instancia de OpenERP"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember to bookmark this page."
msgstr "Recuerda marcar esta página"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember your login:"
msgstr "Recordar tu inicio de sesión"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Choose the first OpenERP Application you want to install.."
msgstr "Escoge la primea Aplicación OpenERP que deseas instalar..."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Install"
msgstr "Instalar"
+38
View File
@@ -0,0 +1,38 @@
# Estonian translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:39+0200\n"
"PO-Revision-Date: 2011-10-10 19:29+0000\n"
"Last-Translator: Aare Vesi <Unknown>\n"
"Language-Team: Estonian <et@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
msgstr ""
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember to bookmark this page."
msgstr ""
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember your login:"
msgstr ""
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Choose the first OpenERP Application you want to install.."
msgstr ""
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Install"
msgstr "Paigalda"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-24 05:18+0000\n"
"X-Generator: Launchpad (build 14185)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:09+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
+38
View File
@@ -0,0 +1,38 @@
# Italian translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:39+0200\n"
"PO-Revision-Date: 2011-10-08 13:41+0000\n"
"Last-Translator: Nicola Riolini - Micronaet <Unknown>\n"
"Language-Team: Italian <it@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
msgstr "Benvenuto nella nuova istanza di OpenERP"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember to bookmark this page."
msgstr "Ricordarsi di aggiungere ai preferiti questa pagina"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember your login:"
msgstr "Ricordare il proprio login:"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Choose the first OpenERP Application you want to install.."
msgstr "Scegliere la prima applicazione OpenERP che volete installare..."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Install"
msgstr "Installa"
+38
View File
@@ -0,0 +1,38 @@
# Dutch (Belgium) translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:39+0200\n"
"PO-Revision-Date: 2011-10-07 09:07+0000\n"
"Last-Translator: Niels Huylebroeck <Unknown>\n"
"Language-Team: Dutch (Belgium) <nl_BE@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
msgstr "Welkom bij uw nieuwe OpenERP."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember to bookmark this page."
msgstr "Gelieve een bookmark voor deze pagina te maken."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember your login:"
msgstr "Vergeet je login niet:"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Choose the first OpenERP Application you want to install.."
msgstr "Kies welke OpenERP Applicatie je wilt installeren..."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Install"
msgstr "Installeer"
+38
View File
@@ -0,0 +1,38 @@
# Polish translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:39+0200\n"
"PO-Revision-Date: 2011-11-04 16:30+0000\n"
"Last-Translator: Grzegorz Grzelak (OpenGLOBE.pl) <grzegorz@openglobe.pl>\n"
"Language-Team: Polish <pl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-05 06:04+0000\n"
"X-Generator: Launchpad (build 14231)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
msgstr "Witamy w twojej nowej instancji OpenERP."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember to bookmark this page."
msgstr "Pamiętaj o dodaniu tej strony do zakładek."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember your login:"
msgstr "Zapamiętaj twój login:"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Choose the first OpenERP Application you want to install.."
msgstr "Wybierz pierwszą aplikację OpenERP do instalacji."
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Install"
msgstr "Instaluj"
+38
View File
@@ -0,0 +1,38 @@
# Slovak translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:39+0200\n"
"PO-Revision-Date: 2011-11-01 13:27+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Slovak <sk@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-02 05:05+0000\n"
"X-Generator: Launchpad (build 14214)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
msgstr ""
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember to bookmark this page."
msgstr ""
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Remember your login:"
msgstr ""
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Choose the first OpenERP Application you want to install.."
msgstr ""
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Install"
msgstr ""
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_default_home/static/src/xml/web_default_home.xml:0
msgid "Welcome to your new OpenERP instance."
+3
View File
@@ -13,5 +13,8 @@
'css' : [
"static/src/css/base_diagram.css",
],
'qweb' : [
"static/src/xml/*.xml",
],
'active': True,
}
+1 -9
View File
@@ -93,7 +93,6 @@ class DiagramView(View):
n.update(
id=act['id'],
color='white',
shape='ellipse',
options={}
)
for color, expr in bgcolors.items():
@@ -107,12 +106,5 @@ class DiagramView(View):
for i, fld in enumerate(visible_node_fields):
n['options'][node_fields_string[i]] = act[fld]
#to relate m2o field of transition to corresponding o2m in activity
in_transition_field_id = fields.search([('relation', '=', connector), ('relation_field', '=', des_node), ('model', '=', node)], 0, 0, 0, req.session.context)
in_transition_field = fields.read(in_transition_field_id[0], ['name'], req.session.context)['name']
out_transition_field_id = fields.search([('relation', '=', connector), ('relation_field', '=', src_node), ('model', '=', node)], 0, 0, 0, req.session.context)
out_transition_field = fields.read(out_transition_field_id[0], ['name'], req.session.context)['name']
id_model = req.session.model(model).read([id],['name'], req.session.context)[0]['name']
return dict(nodes=nodes, conn=connectors, id_model = id_model)
return dict(nodes=nodes, conn=connectors, id_model=id_model)
+54
View File
@@ -0,0 +1,54 @@
# Arabic translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:39+0200\n"
"PO-Revision-Date: 2011-11-03 15:11+0000\n"
"Last-Translator: kifcaliph <kifcaliph@hotmail.com>\n"
"Language-Team: Arabic <ar@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-04 05:32+0000\n"
"X-Generator: Launchpad (build 14231)\n"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Node"
msgstr "طرف جديد"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Edge"
msgstr "حافة جديدة"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "Show Grid:"
msgstr "عرض الشبكة"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "First"
msgstr "الأول"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "<<"
msgstr ">>"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "0"
msgstr "0"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "/"
msgstr "/"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid ">>"
msgstr ">>"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "Last"
msgstr "الأخير"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-12 04:44+0000\n"
"X-Generator: Launchpad (build 14124)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Node"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n"
"X-Generator: Launchpad (build 14123)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Node"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-19 06:05+0000\n"
"X-Generator: Launchpad (build 14157)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Node"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Node"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-11 05:42+0000\n"
"X-Generator: Launchpad (build 14123)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Node"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Node"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-09 05:22+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Node"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-08 05:30+0000\n"
"X-Generator: Launchpad (build 14110)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Node"
+54
View File
@@ -0,0 +1,54 @@
# Polish translation for openerp-web
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
# This file is distributed under the same license as the openerp-web package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: openerp-web\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-10-07 10:39+0200\n"
"PO-Revision-Date: 2011-11-04 16:24+0000\n"
"Last-Translator: Grzegorz Grzelak (OpenGLOBE.pl) <grzegorz@openglobe.pl>\n"
"Language-Team: Polish <pl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-05 06:04+0000\n"
"X-Generator: Launchpad (build 14231)\n"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Node"
msgstr "Nowy węzeł"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Edge"
msgstr "Nowa linia"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "Show Grid:"
msgstr "Pokaż siatkę"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "First"
msgstr "Pierwsze"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "<<"
msgstr ""
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "0"
msgstr ""
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "/"
msgstr ""
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid ">>"
msgstr ""
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "Last"
msgstr "Ostatnie"
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-10-20 04:48+0000\n"
"X-Generator: Launchpad (build 14165)\n"
"X-Launchpad-Export-Date: 2011-11-01 05:10+0000\n"
"X-Generator: Launchpad (build 14197)\n"
#: addons/web_diagram/static/src/xml/base_diagram.xml:0
msgid "New Node"
@@ -71,7 +71,7 @@ Raphael.fn.connection = function (obj1, obj2, style) {
x3 = [0, 0, 0, 0, x4, x4, x4 - dx, x4 + dx][res[1]].toFixed(3),
y3 = [0, 0, 0, 0, y1 + dy, y1 - dy, y4, y4][res[1]].toFixed(3);
/* assemble path and arrow */
var path = ["M", x1.toFixed(3), y1.toFixed(3), "C", x2, y2, x3, y3, x4.toFixed(3), y4.toFixed(3)].join(",");
var path = ["M", x1.toFixed(3), y1.toFixed(3), "C", x2, y2, x3, y3, x4.toFixed(3), y4.toFixed(3)];
/* arrow */
if(style && style.directed) {
/* magnitude, length of the last path vector */
@@ -83,15 +83,16 @@ Raphael.fn.connection = function (obj1, obj2, style) {
{x:(norm(x4-x3)+norm(y4-y3)+x4).toFixed(3), y:(norm(y4-y3)+norm(x4-x3)+y4).toFixed(3)},
{x:(norm(x4-x3)-norm(y4-y3)+x4).toFixed(3), y:(norm(y4-y3)-norm(x4-x3)+y4).toFixed(3)}
];
path = path + ",M"+arr[0].x+","+arr[0].y+",L"+x4+","+y4+",L"+arr[1].x+","+arr[1].y;
path.push("M", arr[0].x, arr[0].y, "L", x4, y4, "L", arr[1].x, arr[1].y, "L", arr[0].x, arr[0].y);
}
var svgpath = path.join(' ');
/* function to be used for moving existent path(s), e.g. animate() or attr() */
var move = "attr";
/* applying path(s) */
edge.fg && edge.fg[move]({path:path})
|| (edge.fg = selfRef.path(path).attr({stroke: style && style.stroke || "#000", fill: "none"}).toBack());
edge.bg && edge.bg[move]({path:path})
|| style && style.fill && (edge.bg = style.fill.split && selfRef.path(path).attr({stroke: style.fill.split("|")[0], fill: "none", "stroke-width": style.fill.split("|")[1] || 3}).toBack());
edge.fg && edge.fg[move]({path:svgpath})
|| (edge.fg = selfRef.path(svgpath).attr({stroke: style && style.stroke || "#000", fill: "none"}).toBack());
edge.bg && edge.bg[move]({path:svgpath})
|| style && style.fill && (edge.bg = style.fill.split && selfRef.path(svgpath).attr({stroke: style.fill.split("|")[0], fill: "none", "stroke-width": style.fill.split("|")[1] || 3}).toBack());
/* setting label */
style && style.label
&& (edge.label && edge.label.attr({x:(x1+x4)/2, y:(y1+y4)/2})
@@ -160,13 +160,11 @@ Graph.Renderer.Raphael = function(element, graph, width, height) {
*/
this.isDrag = false;
this.dragger = function (e) {
if(e.detail < 2) {
this.dx = e.clientX;
this.dy = e.clientY;
selfRef.isDrag = this;
this.set && this.set.animate({"fill-opacity": .1}, 200) && this.set.toFront();
e.preventDefault && e.preventDefault();
}
this.dx = e.clientX;
this.dy = e.clientY;
selfRef.isDrag = this;
this.set && this.set.animate({"fill-opacity": .1}, 200);
e.preventDefault && e.preventDefault();
};
var d = document.getElementById(element);
@@ -378,6 +376,8 @@ Graph.Layout.Spring.prototype = {
},
layoutRepulsive: function(node1, node2) {
if (typeof node1 == 'undefined' || typeof node2 == 'undefined')
return;
var dx = node2.layoutPosX - node1.layoutPosX;
var dy = node2.layoutPosY - node1.layoutPosY;
var d2 = dx * dx + dy * dy;
File diff suppressed because one or more lines are too long
@@ -1,13 +1,3 @@
.openerp .diagram {
border: 1px solid #999;
-moz-border-radius: 8px;
-webkit-border-radius: 8px;
}
.openerp .show_grid {
background: url("/web_diagram/static/src/img/grid.jpg") repeat;
}
.openerp .oe_diagram_pager {
text-align: right;
white-space: nowrap;
+53 -36
View File
@@ -4,7 +4,6 @@
openerp.web_diagram = function (openerp) {
var QWeb = openerp.web.qweb;
QWeb.add_template('/web_diagram/static/src/xml/base_diagram.xml');
openerp.web.views.add('diagram', 'openerp.web.DiagramView');
openerp.web.DiagramView = openerp.web.View.extend({
searchable: false,
@@ -54,11 +53,6 @@ openerp.web.DiagramView = openerp.web.View.extend({
// New Node,Edge
this.$element.find('#new_node.oe_diagram_button_new').click(function(){self.add_edit_node(null, self.node);});
this.$element.find('#new_edge.oe_diagram_button_new').click(function(){self.add_edit_node(null, self.connector);});
this.$element.find('#toggle_grid').click(function() {
self.$element.find('.diagram').toggleClass('show_grid');
});
if(this.id) {
self.get_diagram_info();
@@ -113,8 +107,25 @@ openerp.web.DiagramView = openerp.web.View.extend({
this.get_diagram_info();
}
},
select_node: function (node, element) {
if (!this.selected_node) {
this.selected_node = node;
element.attr('stroke', 'red');
return;
}
// Re-click selected node, deselect it
if (node.id === this.selected_node.id) {
this.selected_node = null;
element.attr('stroke', 'black');
return;
}
this.add_edit_node(null, this.connector, {
act_from: this.selected_node.id,
act_to: node.id
});
},
draw_diagram: function(result) {
this.selected_node = null;
var diagram = new Graph();
this.active_model = result['id_model'];
@@ -125,34 +136,33 @@ openerp.web.DiagramView = openerp.web.View.extend({
//Custom logic
var self = this;
var renderer = function(r, n) {
var node;
var set;
var shape = n.node.shape;
if(shape == 'rectangle')
shape = 'rect';
node = r[shape](n.node.x, n.node.y).attr({
"fill": n.node.color
}).dblclick(function() {
self.add_edit_node(n.node.id, self.node);
});
set = r.set()
.push(node)
.push(
r.text(n.node.x, n.node.y, (n.label || n.id))
.attr({"cursor":"pointer"})
.dblclick(function() {
self.add_edit_node(n.node.id, self.node);
})
);
node.attr({cursor: "pointer"});
var shape = (n.node.shape === 'rectangle') ? 'rect' : 'ellipse';
if(shape == "ellipse")
node.attr({rx: "40", ry: "20"});
else if(shape == 'rect') {
var node = r[shape](n.node.x, n.node.y).attr({
"fill": n.node.color
});
var nodes = r.set(node, r.text(n.node.x, n.node.y, (n.label || n.id)))
.attr("cursor", "pointer")
.dblclick(function() {
self.add_edit_node(n.node.id, self.node);
})
.mousedown(function () { node.moved = false; })
.mousemove(function () { node.moved = true; })
.click(function () {
// Ignore click from move event
if (node.moved) { return; }
self.select_node(n.node, node);
});
if (shape === 'rect') {
node.attr({width: "60", height: "44"});
node.next.attr({"text-anchor": "middle", x: n.node.x + 20, y: n.node.y + 20});
} else {
node.attr({rx: "40", ry: "20"});
}
return set;
return nodes;
};
_.each(res_nodes, function(res_node) {
@@ -167,10 +177,7 @@ openerp.web.DiagramView = openerp.web.View.extend({
diagram.addEdge(connector['source'], connector['destination'], {directed : true, label: connector['signal']});
});
if ($('div#dia-canvas').children().length > 0) {
$('div#dia-canvas').children().remove();
}
self.$element.find('.diagram').empty();
var layouter = new Graph.Layout.Ordered(diagram);
var render_diagram = new Graph.Renderer.Raphael('dia-canvas', diagram, $('div#dia-canvas').width(), $('div#dia-canvas').height());
@@ -184,7 +191,8 @@ openerp.web.DiagramView = openerp.web.View.extend({
});
},
add_edit_node: function(id, model) {
add_edit_node: function(id, model, defaults) {
defaults = defaults || {};
var self = this;
if(!model)
@@ -253,6 +261,15 @@ openerp.web.DiagramView = openerp.web.View.extend({
});
});
}
if (!_.isEmpty(defaults)) {
form_controller.on_record_loaded.add_last(function () {
_(form_fields).each(function (field) {
if (!defaults[field]) { return; }
form_controller.fields[field].set_value(defaults[field]);
form_controller.fields[field].dirty = true;
});
});
}
},
on_pager_action: function(action) {
@@ -3,8 +3,6 @@
<div class="oe_diagram_header" t-att-id="element_id + '_header'">
<div class="oe_diagram_buttons">
<button type="button" id="new_node" class="oe_diagram_button_new">New Node</button>
<button type="button" id="new_edge" class="oe_diagram_button_new">New Edge</button>
<label>Show Grid:</label><input type="checkbox" id="toggle_grid" checked="checked"/>
</div>
<div class="oe_diagram_pager">
<button type="button" data-pager-action="first">First</button>
@@ -16,6 +14,6 @@
<button type="button" data-pager-action="last">Last</button>
</div>
</div>
<div id="dia-canvas" class="diagram show_grid" style="overflow: auto;"></div>
<div id="dia-canvas" class="diagram" style="overflow: auto;"></div>
</t>
</template>
+3
View File
@@ -9,5 +9,8 @@
'static/src/js/gantt.js'
],
"css": ['static/lib/dhtmlxGantt/codebase/dhtmlxgantt.css'],
'qweb' : [
"static/src/xml/*.xml",
],
'active': True
}
+40 -47
View File
@@ -3,7 +3,6 @@
*---------------------------------------------------------*/
openerp.web_gantt = function (openerp) {
var QWeb = openerp.web.qweb;
QWeb.add_template('/web_gantt/static/src/xml/web_gantt.xml');
openerp.web.views.add('gantt', 'openerp.web_gantt.GanttView');
openerp.web_gantt.GanttView = openerp.web.View.extend({
@@ -43,7 +42,7 @@ init: function(parent, dataset, view_id) {
this.name = this.fields_view.arch.attrs.string;
this.view_id = this.fields_view.view_id;
this.date_start = this.fields_view.arch.attrs.date_start;
this.date_delay = this.fields_view.arch.attrs.date_delay;
this.date_stop = this.fields_view.arch.attrs.date_stop;
@@ -71,7 +70,7 @@ init: function(parent, dataset, view_id) {
ganttChartControl.setImagePath("/web_gantt/static/lib/dhtmlxGantt/codebase/imgs/");
ganttChartControl.setEditable(true);
ganttChartControl.showTreePanel(true);
ganttChartControl.showContextMenu(true);
ganttChartControl.showContextMenu(false);
ganttChartControl.showDescTask(true,'d,s-f');
ganttChartControl.showDescProject(true,'n,d');
@@ -228,7 +227,7 @@ init: function(parent, dataset, view_id) {
var evt_date = "";
var evt_duration = "";
var evt_end_date = "";
var project_tree_field = [];
for (var i in final_events){
evt_id = final_events[i];
evt_date = all_events[evt_id]['evt'][2];
@@ -254,7 +253,7 @@ init: function(parent, dataset, view_id) {
self.render_events(all_events, 0);
}
for (var i in final_events){
for (var i in final_events) {
evt_id = final_events[i];
res = all_events[evt_id];
task=new GanttTaskInfo(res['evt'][0], res['evt'][1], res['evt'][2], res['evt'][3], res['evt'][4], "",res['evt'][6]);
@@ -278,8 +277,9 @@ init: function(parent, dataset, view_id) {
ganttChartControl.attachEvent("onTaskStartDrag", function(task) {self.on_drag_start(task);});
ganttChartControl.attachEvent("onTaskEndResize", function(task) {self.on_resize_drag_end(task, "resize");});
ganttChartControl.attachEvent("onTaskEndDrag", function(task) {self.on_resize_drag_end(task, "drag");});
ganttChartControl.attachEvent("onTaskDblClick", function(task) {self.open_popup(task);});
var taskdiv = jQuery("div.taskPanel").parent();
taskdiv.addClass('ganttTaskPanel');
taskdiv.prev().addClass('ganttDayPanel');
@@ -293,7 +293,7 @@ init: function(parent, dataset, view_id) {
self.set_width();
});
jQuery(window).bind('resize',function(){
jQuery(window).bind('resize',function() {
window.clearTimeout(ganttChartControl._resize_timer);
ganttChartControl._resize_timer = window.setTimeout(function(){
self.reload_gantt();
@@ -385,53 +385,46 @@ init: function(parent, dataset, view_id) {
},
open_popup : function(task) {
var self = this;
var event_id = task.getId();
if(event_id.toString().search("_") != -1)
return;
if(event_id) event_id = parseInt(event_id, 10);
var action_manager = new openerp.web.ActionManager(this);
var dialog = new openerp.web.Dialog(this, {
width: 800,
height: 600,
buttons : {
Cancel : function() {
$(this).dialog('destroy');
},
Save : function() {
var form_view = action_manager.inner_viewmanager.views.form.controller;
var action = {
"res_model": this.dataset.model,
"res_id": event_id,
"views":[[false,"form"]],
"type":"ir.actions.act_window",
"view_type":"form",
"view_mode":"form"
};
action.flags = {
search_view: false,
sidebar : false,
views_switcher : false,
pager: false
};
var element_id = _.uniqueId("act_window_dialog");
var dialog = jQuery('<div>', {
'id': element_id
}).dialog({
modal: true,
width: 'auto',
height: 'auto',
buttons: {
Cancel: function() {
$(this).dialog("destroy");
},
Save: function() {
var view_manager = action_manager.viewmanager;
var _dialog = this;
view_manager.views[view_manager.active_view].controller.do_save(function(r) {
$(_dialog).dialog("destroy");
self.reload_gantt();
})
}
form_view.do_save(function() {
self.get_events();
});
$(this).dialog('destroy');
}
}
}).start().open();
action_manager.appendTo(dialog.$element);
action_manager.do_action({
res_model : this.dataset.model,
res_id: event_id,
views : [[false, 'form']],
type : 'ir.actions.act_window',
auto_search : false,
flags : {
search_view: false,
sidebar : false,
views_switcher : false,
action_buttons : false,
pager: false
}
});
var action_manager = new openerp.web.ActionManager(this, element_id);
action_manager.start();
action_manager.do_action(action);
//Default_get
if(!event_id) action_manager.viewmanager.dataset.index = null;
},
on_drag_start : function(task){

Some files were not shown because too many files have changed in this diff Show More