diff --git a/addons/web/common/openerplib/main.py b/addons/web/common/openerplib/main.py index 5cae9ce4636..773ea020d52 100644 --- a/addons/web/common/openerplib/main.py +++ b/addons/web/common/openerplib/main.py @@ -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): diff --git a/addons/web/po/ar.po b/addons/web/po/ar.po new file mode 100644 index 00000000000..0802e990ae5 --- /dev/null +++ b/addons/web/po/ar.po @@ -0,0 +1,698 @@ +# 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 , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-10-07 10:38+0200\n" +"PO-Revision-Date: 2011-11-04 16:13+0000\n" +"Last-Translator: kifcaliph \n" +"Language-Team: Arabic \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 "تحذير، تم تحرير السجل، تعديلاتك سيتم تجاهلها" + +#: addons/web/static/src/js/view_form.js:1659 +msgid "   Search More..." +msgstr "    مزيداً من البحث..." + +#: addons/web/static/src/js/view_form.js:1672 +#, python-format +msgid "   Create \"%s\"" +msgstr "   إنشاء \"%s\"" + +#: addons/web/static/src/js/view_form.js:1678 +msgid "   Create and Edit..." +msgstr "   إنشاء و تحرير..." + +#: 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 "«" +msgstr "«" + +#: addons/web/static/src/xml/base.xml:0 +msgid "»" +msgstr "»" + +#: 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 " " +msgstr " " + +#: 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 متاح من خلال تطبيق الويب أو البرنامج المحلي." diff --git a/addons/web/po/pl.po b/addons/web/po/pl.po new file mode 100644 index 00000000000..fde2196a73e --- /dev/null +++ b/addons/web/po/pl.po @@ -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 , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \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) \n" +"Language-Team: Polish \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 "   Search More..." +msgstr "   Szukaj dalej..." + +#: addons/web/static/src/js/view_form.js:1672 +#, python-format +msgid "   Create \"%s\"" +msgstr "   Utwórz \"%s\"" + +#: addons/web/static/src/js/view_form.js:1678 +msgid "   Create and Edit..." +msgstr "   Utwórz i edytuj..." + +#: 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 "«" +msgstr "" + +#: addons/web/static/src/xml/base.xml:0 +msgid "»" +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 " " +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 "" diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 237199d5472..603e2abb008 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -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 = []; @@ -101,10 +102,10 @@ 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_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) { @@ -123,11 +124,16 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# 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.readonly = !self.readonly; + self.registry = self.readonly ? openerp.web.form.readonly : openerp.web.form.widgets; self.on_loaded(self.fields_view); - self.reload(); + 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; @@ -164,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) { @@ -344,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(); @@ -363,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(); }); } @@ -381,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() { @@ -428,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 = "