From 680c1231bd5bc3e6b68a3929644b30d29173de57 Mon Sep 17 00:00:00 2001 From: "rpa (Open ERP)" Date: Wed, 23 Jun 2010 11:13:14 +0530 Subject: [PATCH 01/21] [REVERT]: document: Reverted wrong changes in document in merge with trunk addons bzr revid: rpa@tinyerp.com-20100623054314-t3sb40ltid1sbadv --- addons/document/i18n/ru.po | 95 ++++++++++--------- .../document/wizard/document_configuration.py | 35 +++---- 2 files changed, 59 insertions(+), 71 deletions(-) diff --git a/addons/document/i18n/ru.po b/addons/document/i18n/ru.po index 59a51cb9666..7f05e84d881 100644 --- a/addons/document/i18n/ru.po +++ b/addons/document/i18n/ru.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-06-22 14:24+0000\n" -"Last-Translator: Чистый \n" +"PO-Revision-Date: 2010-04-13 05:32+0000\n" +"Last-Translator: grisha \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-06-23 03:53+0000\n" +"X-Launchpad-Export-Date: 2010-06-22 04:18+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: document @@ -36,6 +36,8 @@ msgstr "" msgid "" "The Object name must start with x_ and not contain any special character !" msgstr "" +"Название объекта должно начинаться с x_ и не должно содержать специальных " +"символов !" #. module: document #: field:ir.actions.report.xml,model_id:0 @@ -45,17 +47,17 @@ msgstr "" #. module: document #: constraint:document.directory:0 msgid "Error! You can not create recursive Directories." -msgstr "Ошибка! Вы не можете созадавать вложенные Директории." +msgstr "Ошибка! Вы не можете созадавать вложенные друг в друга директории." #. module: document #: model:ir.ui.menu,name:document.menu_document_configuration msgid "Document Configuration" -msgstr "Настройки документа" +msgstr "" #. module: document #: view:ir.attachment:0 msgid "Preview" -msgstr "Предварительный просмотр" +msgstr "Предпросмотр" #. module: document #: field:ir.attachment,store_method:0 @@ -82,7 +84,7 @@ msgstr "" #. module: document #: selection:document.directory,type:0 msgid "Other Resources" -msgstr "Другие ресурсы" +msgstr "" #. module: document #: field:document.directory,ressource_parent_type_id:0 @@ -102,7 +104,7 @@ msgstr "" #. module: document #: constraint:ir.actions.act_window:0 msgid "Invalid model name in the action definition." -msgstr "Недопустимое имя модели в определении действия." +msgstr "" #. module: document #: selection:document.directory,type:0 @@ -130,13 +132,13 @@ msgstr "" #. module: document #: field:document.directory,type:0 msgid "Type" -msgstr "Тип" +msgstr "" #. module: document #: model:ir.actions.act_window,name:document.action_document_directory_tree #: model:ir.ui.menu,name:document.menu_document_directories_tree msgid "Directorie's Structure" -msgstr "Структура папок" +msgstr "" #. module: document #: field:document.directory,parent_id:0 @@ -146,13 +148,13 @@ msgstr "" #. module: document #: view:ir.attachment:0 msgid "File Information" -msgstr "Информация о файле" +msgstr "" #. module: document #: field:document.directory,file_ids:0 #: view:ir.attachment:0 msgid "Files" -msgstr "Файлы" +msgstr "" #. module: document #: field:ir.attachment,store_fname:0 @@ -163,17 +165,17 @@ msgstr "" #: field:document.directory,write_uid:0 #: field:ir.attachment,write_uid:0 msgid "Last Modification User" -msgstr "Последние изменения пользователя" +msgstr "" #. module: document #: view:document.configuration.wizard:0 msgid "Configure" -msgstr "Настройка" +msgstr "" #. module: document #: field:document.directory,ressource_tree:0 msgid "Tree Structure" -msgstr "Древовидная структура" +msgstr "" #. module: document #: field:ir.attachment,title:0 @@ -190,7 +192,7 @@ msgstr "" #. module: document #: model:ir.model,name:document.model_document_directory_content msgid "Directory Content" -msgstr "Содержимое папки" +msgstr "" #. module: document #: help:document.directory,ressource_parent_type_id:0 @@ -202,28 +204,28 @@ msgstr "" #. module: document #: model:ir.ui.menu,name:document.menu_document msgid "Document Management" -msgstr "Управление документами" +msgstr "" #. module: document #: selection:ir.attachment,store_method:0 msgid "Link" -msgstr "Ссылка" +msgstr "" #. module: document #: view:document.directory:0 msgid "Directory Type" -msgstr "Тип папки" +msgstr "" #. module: document #: field:document.directory,group_ids:0 #: field:ir.attachment,group_ids:0 msgid "Groups" -msgstr "Группы" +msgstr "" #. module: document #: field:document.directory.content,report_id:0 msgid "Report" -msgstr "Отчёт" +msgstr "" #. module: document #: help:document.configuration.wizard,host:0 @@ -231,7 +233,6 @@ msgid "" "Put here the server address or IP. Keep localhost if you don't know what to " "write." msgstr "" -"Укажите адрес сервера или IP. Укажите localhost если не знаете что писать." #. module: document #: view:document.configuration.wizard:0 @@ -259,12 +260,12 @@ msgstr "" #. module: document #: view:document.directory:0 msgid "Definition" -msgstr "Описание" +msgstr "" #. module: document #: constraint:ir.ui.view:0 msgid "Invalid XML for View Architecture!" -msgstr "Неправильный XML для просмотра структуры!" +msgstr "Неправильный XML для просмотра архитектуры!" #. module: document #: model:ir.module.module,description:document.module_meta_information @@ -278,17 +279,17 @@ msgstr "" #. module: document #: field:document.directory,name:0 msgid "Name" -msgstr "Имя" +msgstr "" #. module: document #: field:document.directory.content.type,code:0 msgid "Extension" -msgstr "Расширение" +msgstr "" #. module: document #: selection:ir.attachment,store_method:0 msgid "Database" -msgstr "База данных" +msgstr "" #. module: document #: field:document.directory,content_ids:0 @@ -331,30 +332,30 @@ msgstr "" #. module: document #: view:ir.attachment:0 msgid "Attached To" -msgstr "Вложено в" +msgstr "" #. module: document #: selection:ir.attachment,store_method:0 msgid "Filesystem" -msgstr "Файловая система" +msgstr "" #. module: document #: field:document.directory,file_type:0 #: field:document.directory.content.type,name:0 #: field:ir.attachment,file_type:0 msgid "Content Type" -msgstr "Тип данных" +msgstr "" #. module: document #: view:document.directory:0 #: view:ir.attachment:0 msgid "Security" -msgstr "Безопасность" +msgstr "" #. module: document #: model:ir.ui.menu,name:document.menu_document_browse msgid "Browse Files Using FTP" -msgstr "Просмотр файлов используя FTP" +msgstr "" #. module: document #: field:document.directory,ressource_type_id:0 @@ -364,7 +365,7 @@ msgstr "" #. module: document #: view:ir.attachment:0 msgid "History" -msgstr "История" +msgstr "" #. module: document #: help:document.directory,ressource_type_id:0 @@ -376,33 +377,33 @@ msgstr "" #. module: document #: view:ir.attachment:0 msgid "Others Info" -msgstr "Дополнительная информация" +msgstr "" #. module: document #: field:document.directory,domain:0 msgid "Domain" -msgstr "Домен" +msgstr "" #. module: document #: field:document.directory,write_date:0 #: field:ir.attachment,write_date:0 msgid "Date Modified" -msgstr "Дата изменения" +msgstr "" #. module: document #: field:document.directory.content,suffix:0 msgid "Suffix" -msgstr "Суффикс" +msgstr "" #. module: document #: field:document.configuration.wizard,host:0 msgid "Server Address" -msgstr "Адрес сервера" +msgstr "" #. module: document #: model:ir.actions.url,name:document.action_document_browse msgid "Browse Files" -msgstr "Обзор файлов" +msgstr "" #. module: document #: field:document.directory.content,name:0 @@ -418,7 +419,7 @@ msgstr "" #. module: document #: field:document.directory,create_uid:0 msgid "Creator" -msgstr "Автор" +msgstr "" #. module: document #: view:document.directory:0 @@ -428,22 +429,22 @@ msgstr "" #. module: document #: field:document.directory.content,sequence:0 msgid "Sequence" -msgstr "Сортировать" +msgstr "" #. module: document #: model:ir.ui.menu,name:document.menu_document_files msgid "Search a File" -msgstr "Поиск файла" +msgstr "" #. module: document #: view:document.configuration.wizard:0 msgid "Auto Configure" -msgstr "Авто настройка" +msgstr "" #. module: document #: view:document.configuration.wizard:0 msgid "Cancel" -msgstr "Отмена" +msgstr "" #. module: document #: field:ir.attachment,partner_id:0 @@ -453,12 +454,12 @@ msgstr "" #. module: document #: view:document.directory:0 msgid "PDF Report" -msgstr "PDF Отчёт" +msgstr "" #. module: document #: field:document.directory.content,extension:0 msgid "Document Type" -msgstr "Тип документа" +msgstr "" #. module: document #: field:document.directory,child_ids:0 @@ -468,4 +469,4 @@ msgstr "" #. module: document #: view:document.directory:0 msgid "Contents" -msgstr "Содержание" +msgstr "" diff --git a/addons/document/wizard/document_configuration.py b/addons/document/wizard/document_configuration.py index c9e0e525dd4..e7966c2e3a4 100644 --- a/addons/document/wizard/document_configuration.py +++ b/addons/document/wizard/document_configuration.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,31 +15,23 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see +# along with this program. If not, see . # ############################################################################## from osv import osv, fields -from osv.orm import except_orm -from tools import config -import urlparse +from document_ftp import ftpserver +class document_configuration(osv.osv_memory): -import os - -class document_configuration_wizard(osv.osv_memory): - - _name='document.configuration.wizard' + _name='document.configuration' _description = 'Auto Directory Configuration' _inherit = 'res.config' _columns = { - 'host': fields.char('Address', size=64, - help="Server address or IP and port to which users should connect to for DMS access", - required=True), - } - - _defaults = { - 'host': config.get('ftp_server_host', 'localhost') + ':' + config.get('ftp_server_port', '8021'), + 'sale_order' : fields.boolean('Sale Order', help="Auto directory configuration for Sale Orders and Quotation with report."), + 'product' : fields.boolean('Product', help="Auto directory configuration for Products."), + 'project': fields.boolean('Project', help="Auto directory configuration for Projects."), } + def execute(self, cr, uid, ids, context=None): conf_id = ids and ids[0] or False @@ -125,10 +117,5 @@ class document_configuration_wizard(osv.osv_memory): 'ressource_type_id': mid[0], 'domain': '[]', 'ressource_tree': 1 - }) - - # Update the action for FTP browse. - aid = objid._get_id(cr, uid, 'document_ftp', 'action_document_browse') - aid = objid.browse(cr, uid, aid, context=context).res_id - self.pool.get('ir.actions.url').write(cr, uid, [aid], {'url': 'ftp://'+(conf.host or 'localhost:8021')+'/'}) -document_configuration_wizard() + }) +document_configuration() From d36d14ffbf75eae61bf38618ec0c889ff26fc638 Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Wed, 30 Jun 2010 19:50:51 +0530 Subject: [PATCH 02/21] [IMP]: assoication: add event_project boolean field. bzr revid: atp@tinyerp.co.in-20100630142051-9jdkc68gwwczz3ac --- addons/association/__openerp__.py | 2 +- addons/association/profile_association.py | 5 +---- addons/association/profile_association.xml | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/addons/association/__openerp__.py b/addons/association/__openerp__.py index 43f61ed2392..38d3f2e787e 100644 --- a/addons/association/__openerp__.py +++ b/addons/association/__openerp__.py @@ -26,7 +26,7 @@ 'category': 'Profile', 'description': """This module is to create Profile for Associates""", 'author': 'Tiny', - 'depends': ['membership', 'board_association'], + 'depends': ['membership', 'event'], 'update_xml': ['security/ir.model.access.csv', 'profile_association.xml'], 'demo_xml': [], 'installable': True, diff --git a/addons/association/profile_association.py b/addons/association/profile_association.py index 586ed3f8639..ab437baf2c8 100644 --- a/addons/association/profile_association.py +++ b/addons/association/profile_association.py @@ -22,7 +22,6 @@ from osv import fields, osv import pooler - class profile_association_config_install_modules_wizard(osv.osv_memory): _name='profile.association.config.install_modules_wizard' _inherit = 'res.config.installer' @@ -30,9 +29,7 @@ class profile_association_config_install_modules_wizard(osv.osv_memory): _columns = { 'hr_expense':fields.boolean('Expenses Tracking', help="Tracks the personal expenses process, from the employee expense encoding, to the reimbursement of the employee up to the reinvoicing to the final customer."), 'project':fields.boolean('Project Management'), - 'board_document':fields.boolean('Document Management', help= "The Document Management System of Open ERP allows you to store, browse, automatically index, search and preview all kind of documents (internal documents, printed reports, calendar system). It opens an FTP access for the users to easily browse association's document."), - 'segmentation':fields.boolean('Segmentation'), - 'crm_configuration' : fields.boolean('Partner Relation & Calendars'), + 'event_project':fields.boolean('Organization and management of events', help="This module allows you to create retro planning for managing your events."), 'project_gtd':fields.boolean('Getting Things Done', help="GTD is a methodology to efficiently organise yourself and your tasks. This module fully integrates GTD principle with OpenERP's project management."), 'wiki': fields.boolean('Wiki', diff --git a/addons/association/profile_association.xml b/addons/association/profile_association.xml index 0d0a65b3644..c1ee9e163fe 100644 --- a/addons/association/profile_association.xml +++ b/addons/association/profile_association.xml @@ -24,10 +24,10 @@ + + - - From ab3047a80a3490917c94efe67c5fc59ee74a3844 Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Wed, 30 Jun 2010 19:51:59 +0530 Subject: [PATCH 03/21] [IMP]: event: Add currency field.Improve registration view. bzr revid: atp@tinyerp.co.in-20100630142159-7vxbjdhqa5doya13 --- addons/event/__openerp__.py | 1 + addons/event/event.py | 49 ++++++-- addons/event/event_view.xml | 207 ++++++++++++++++++++----------- addons/event/test/test_event.yml | 13 +- addons/event/wizard/__init__.py | 1 + 5 files changed, 174 insertions(+), 97 deletions(-) diff --git a/addons/event/__openerp__.py b/addons/event/__openerp__.py index c1f61bcff8f..7cd7d4ae2c6 100644 --- a/addons/event/__openerp__.py +++ b/addons/event/__openerp__.py @@ -51,6 +51,7 @@ 'security/event_security.xml', 'security/ir.model.access.csv', 'wizard/event_make_invoice_view.xml', + 'wizard/partner_event_registration_view.xml', 'board_association_view.xml', ], 'demo_xml': ['event_demo.xml', 'board_association_demo.xml'], diff --git a/addons/event/event.py b/addons/event/event.py index 6a02e44fa89..b6af6d4f6ed 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -35,7 +35,6 @@ class event_type(osv.osv): _columns = { 'name': fields.char('Event type', size=64, required=True), } - event_type() class event_event(osv.osv): @@ -44,7 +43,14 @@ class event_event(osv.osv): _description = __doc__ _inherit = 'crm.case.section' _order = 'date_begin' - + + def _get_currency(self, cr, uid, context): + user = self.pool.get('res.users').browse(cr, uid, [uid])[0] + if user.company_id: + return user.company_id.currency_id.id + else: + return self.pool.get('res.currency').search(cr, uid, [('rate','=',1.0)])[0] + def copy(self, cr, uid, id, default=None, context=None): """ Copy record of Given id @param id: Id of Event Registration type record. @@ -57,6 +63,14 @@ class event_event(osv.osv): 'state': 'draft' }) return super(event_event, self).copy(cr, uid, id, default=default, context=context) + + def onchange_product(self, cr, uid, ids, product_id): + + if not product_id: + return {'value': {'unit_price': False}} + else: + unit_price=self.pool.get('product.product').price_get(cr, uid, [product_id])[product_id] + return {'value': {'unit_price': unit_price}} def button_draft(self, cr, uid, ids, context=None): return self.write(cr, uid, ids, {'state': 'draft'}, context=context) @@ -88,6 +102,7 @@ class event_event(osv.osv): @param context: A standard dictionary for contextual values @return: Dictionary of function fields value. """ + register_pool = self.pool.get('event.registration') res = {} for event in self.browse(cr, uid, ids, context): @@ -103,11 +118,11 @@ class event_event(osv.osv): reg_ids = register_pool.search(cr, uid, [ ('event_id', '=', event.id), ('state', 'in', state)]) + if 'register_current' in fields: res[event.id]['register_current'] = len(reg_ids) if 'register_prospect' in fields: res[event.id]['register_prospect'] = len(reg_ids) - return res @@ -142,6 +157,7 @@ class event_event(osv.osv): register_pool.write(cr, uid, reg_ids, register_values) return res + _columns = { 'type': fields.many2one('event.type', 'Type', help="Type of Event like Seminar, Exhibition, Conference, Training."), 'register_max': fields.integer('Maximum Registrations', help="Provide Maximun Number of Registrations"), @@ -157,15 +173,20 @@ class event_event(osv.osv): 'mail_registr': fields.text('Registration Email', help='This email will be sent when someone subscribes to the event.'), 'mail_confirm': fields.text('Confirmation Email', help="This email will be sent when the event gets confimed or when someone subscribes to a confirmed event. This is also the email sent to remind someone about the event."), 'product_id': fields.many2one('product.product', 'Product', required=True, help="Product which is provided cost of event. Invoice of event will be created with this Product."), - 'note': fields.text('Notes', help="Description or Summary of Event") + 'note': fields.text('Notes', help="Description or Summary of Event"), + 'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}), + "unit_price": fields.float('Cost'), + } _defaults = { 'state': 'draft', - 'code': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'event.event'), + # 'code': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'event.event'), 'user_id': lambda obj, cr, uid, context: uid, + 'currency_id': _get_currency, } + event_event() class event_registration(osv.osv): @@ -192,13 +213,16 @@ and users by email"), "invoice_id": fields.many2one("account.invoice", "Invoice"), 'date_closed': fields.datetime('Closed', readonly=True), 'ref': fields.reference('Reference', selection=crm._links_get, size=128), - 'ref2': fields.reference('Reference 2', selection=crm._links_get, size=128), + 'ref2': fields.reference('Reference 2', selection=crm._links_get, size=128), + 'message_ids': fields.one2many('mailgate.message', 'res_id', 'Messages', domain=[('history', '=', True),('model','=',_name)]), + 'log_ids': fields.one2many('mailgate.message', 'res_id', 'Logs', domain=[('history', '=', False),('model','=',_name)]), + 'currency_id': fields.many2one('res.currency', 'Currency', readonly=True), } - _defaults = { 'nb_register': 1, 'tobe_invoiced': True, 'name': 'Registration', + # 'currency_id': _get_currency, } def _make_invoice(self, cr, uid, reg, lines, context=None): @@ -302,7 +326,7 @@ and users by email"), if total_confirmed <= registration.event_id.register_max or registration.event_id.register_max == 0: self.write(cr, uid, [registration.id], {'state': 'open'}, context=context) self.mail_user(cr, uid, [registration.id]) - self._history(cr, uid, [registration.id], _('Open')) + self._history(cr, uid, [registration], _('Open')) else: unconfirmed_ids.append(registration.id) if unconfirmed_ids: @@ -343,6 +367,7 @@ and users by email"), values['date_deadline']= event.date_begin values['description']= event.mail_confirm + values['currency_id'] = event.currency_id.id res = super(event_registration, self).create(cr, uid, values, context=context) registrations = self.browse(cr, uid, [res], context=context) self._history(cr, uid, registrations, _('Created')) @@ -354,7 +379,6 @@ and users by email"), values['date_deadline']= event.date_begin values['description']= event.mail_confirm return super(event_registration, self).write(cr, uid, ids, values, context=context) - def mail_user(self, cr, uid, ids, confirm=False, context=None): """ @@ -434,14 +458,16 @@ and users by email"), return {'value': {'unit_price': False, 'event_product': False}} data_event = self.pool.get('event.event').browse(cr, uid, event_id) + context['currency_id'] = data_event.currency_id.id + if data_event.product_id: if not partner_invoice_id: unit_price=self.pool.get('product.product').price_get(cr, uid, [data_event.product_id.id], context=context)[data_event.product_id.id] - return {'value': {'unit_price': unit_price, 'event_product': data_event.product_id.name}} + return {'value': {'unit_price': unit_price, 'event_product': data_event.product_id.name, 'currency_id': data_event.currency_id.id}} data_partner = self.pool.get('res.partner').browse(cr, uid, partner_invoice_id) context.update({'partner_id': data_partner}) unit_price = self.pool.get('product.product')._product_price(cr, uid, [data_event.product_id.id], False, False, {'pricelist': data_partner.property_product_pricelist.id})[data_event.product_id.id] - return {'value': {'unit_price': unit_price, 'event_product': data_event.product_id.name}} + return {'value': {'unit_price': unit_price, 'event_product': data_event.product_id.name, 'currency_id': data_event.currency_id.id}} return {'value': {'unit_price': False, 'event_product': False}} @@ -489,6 +515,5 @@ and users by email"), event_registration() - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index 41c0fef5cfb..3bcc98b18ce 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -51,10 +51,12 @@ - + + + @@ -118,6 +120,33 @@ + + + event.event.calendar + event.event + calendar + + + + + + + + + + + + Event Graph + event.event + graph + + + + + + + + Events @@ -160,7 +189,7 @@ ir.actions.act_window event.event form - tree,form + tree,form,calendar,graph {"search_default_draft": "1"} @@ -170,9 +199,18 @@ name="Registration" res_model="event.registration" src_model="event.event" - view_mode="tree,form" + view_mode="tree,form,calendar,graph" domain="[('event_id', '=', active_id)]" view_type="form"/> + + @@ -203,29 +241,32 @@
+ - - - -