diff --git a/addons/board_association/i18n/el.po b/addons/board_association/i18n/el.po deleted file mode 100644 index 9ef871e24af..00000000000 --- a/addons/board_association/i18n/el.po +++ /dev/null @@ -1,71 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * board_association -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 5.0.0\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-06-24 01:15+0000\n" -"Last-Translator: Panayiotis Konstantinidis \n" -"Language-Team: nls@hellug.gr \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-25 03:46+0000\n" -"X-Generator: Launchpad (build Unknown)\n" -"X-Poedit-Country: GREECE\n" -"X-Poedit-Language: Greek\n" -"X-Poedit-SourceCharset: utf-8\n" - -#. module: board_association -#: model:ir.ui.menu,name:board_association.menu_board_associations_manager -msgid "Associations" -msgstr "Συνεταιρισμοί" - -#. module: board_association -#: model:ir.module.module,shortdesc:board_association.module_meta_information -msgid "Dashboard for Associations" -msgstr "Πίνακας για Συνεταιρισμούς" - -#. module: board_association -#: constraint:ir.ui.view:0 -msgid "Invalid XML for View Architecture!" -msgstr "Άκυρο XML για Αρχιτεκτονική Όψης!" - -#. module: board_association -#: view:board.board:0 -#: model:ir.actions.act_window,name:board_association.open_board_associations_manager -msgid "Association Dashboard" -msgstr "Πίνακας Συνεταιρισμών" - -#. module: board_association -#: view:board.board:0 -msgid "My tasks" -msgstr "Οι αναθέσεις μου" - -#. module: board_association -#: view:board.board:0 -msgid "New members" -msgstr "Νέα μέλη" - -#. module: board_association -#: view:board.board:0 -msgid "Unpaid Invoices" -msgstr "Απλήρωτα Τιμολόγια" - -#. module: board_association -#: constraint:ir.actions.act_window:0 -msgid "Invalid model name in the action definition." -msgstr "Λανθασμένο όνομα μοντέλου στον ορισμό ενέργειας" - -#. module: board_association -#: view:board.board:0 -msgid "Next Events" -msgstr "Επόμενα Συμβάντα" - -#. module: board_association -#: view:board.board:0 -msgid "Registrations by Events" -msgstr "Καταχωρήσεις ανά Συμβάν" diff --git a/addons/board_auction/i18n/el.po b/addons/board_auction/i18n/el.po deleted file mode 100644 index 990647cd866..00000000000 --- a/addons/board_auction/i18n/el.po +++ /dev/null @@ -1,125 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * board_auction -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 5.0.0\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-06-24 01:15+0000\n" -"Last-Translator: Panayiotis Konstantinidis \n" -"Language-Team: nls@hellug.gr \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-25 03:46+0000\n" -"X-Generator: Launchpad (build Unknown)\n" -"X-Poedit-Country: GREECE\n" -"X-Poedit-Language: Greek\n" -"X-Poedit-SourceCharset: utf-8\n" - -#. module: board_auction -#: constraint:ir.ui.view:0 -msgid "Invalid XML for View Architecture!" -msgstr "Invalid XML for View Architecture!" - -#. module: board_auction -#: view:board.board:0 -msgid "Objects by day" -msgstr "Αντικείμενα ανά Ημέρα" - -#. module: board_auction -#: view:board.board:0 -msgid "Objects statistics" -msgstr "Στατιστικά Αντικειμένων" - -#. module: board_auction -#: model:ir.ui.menu,name:board_auction.menu_board_auction_manager -msgid "Auction Manager" -msgstr "Υπεύθυνος Δημοπρασίας" - -#. module: board_auction -#: view:board.board:0 -msgid "Summary pointing by user" -msgstr "Περίληψη χτυπημάτων ανά χρήστη" - -#. module: board_auction -#: model:ir.ui.menu,name:board_auction.menu_board_auction -msgid "Auction Member" -msgstr "Μέλος Δημοπρασίας" - -#. module: board_auction -#: view:board.board:0 -msgid "My Latest Deposits" -msgstr "Οι Τελευταίες Καταθέσεις μου" - -#. module: board_auction -#: model:ir.actions.act_window,name:board_auction.open_board_auction -msgid "Auction member board" -msgstr "Πίνακας μέλους δημοπρασίας" - -#. module: board_auction -#: view:board.board:0 -msgid "Auction manager " -msgstr "Υπεύθυνος Δημοπρασίας " - -#. module: board_auction -#: model:ir.module.module,shortdesc:board_auction.module_meta_information -msgid "Board for Auction" -msgstr "Πίνακας Δημοπρασίας" - -#. module: board_auction -#: view:board.board:0 -msgid "Estimations/Adjudication" -msgstr "Εκτιμήσεις/Κατακυρώσεις" - -#. module: board_auction -#: view:board.board:0 -msgid "Total Adjudications" -msgstr "Σύνολο Κατακυρώσεων" - -#. module: board_auction -#: view:board.board:0 -msgid "Latest objects" -msgstr "Τελευταία αντικείμενα" - -#. module: board_auction -#: view:board.board:0 -msgid "Latest deposits" -msgstr "Τελευταίες καταθέσεις" - -#. module: board_auction -#: constraint:ir.actions.act_window:0 -msgid "Invalid model name in the action definition." -msgstr "Λανθασμένο όνομα μοντέλου στον ορισμό ενέργειας" - -#. module: board_auction -#: view:board.board:0 -msgid "Menu" -msgstr "Μενού" - -#. module: board_auction -#: view:board.board:0 -msgid "My objects By Day" -msgstr "Τα Ανικείμενά μου ανά Ημέρα" - -#. module: board_auction -#: view:board.board:0 -msgid "My board" -msgstr "Ο Πίνακάς μου" - -#. module: board_auction -#: model:ir.actions.act_window,name:board_auction.open_board_auction_manager -msgid "Auction manager board" -msgstr "Πίνακας Υπεύθυνου Δημοπρασίας" - -#. module: board_auction -#: view:board.board:0 -msgid "Min/Adj/Max" -msgstr "Ελαχ./Επικ./Μέγ." - -#. module: board_auction -#: view:board.board:0 -msgid "My Latest Objects" -msgstr "Τα Τελευταία μου Αντικείμενα" diff --git a/addons/board_crm_configuration/i18n/el.po b/addons/board_crm_configuration/i18n/el.po deleted file mode 100644 index 93c5529b516..00000000000 --- a/addons/board_crm_configuration/i18n/el.po +++ /dev/null @@ -1,122 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * board_crm_configuration -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 5.0.0\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-06-24 01:16+0000\n" -"Last-Translator: Panayiotis Konstantinidis \n" -"Language-Team: nls@hellug.gr \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-25 03:46+0000\n" -"X-Generator: Launchpad (build Unknown)\n" -"X-Poedit-Country: GREECE\n" -"X-Poedit-Language: Greek\n" -"X-Poedit-SourceCharset: utf-8\n" - -#. module: board_crm_configuration -#: model:ir.module.module,shortdesc:board_crm_configuration.module_meta_information -msgid "Dashboard for CRM Configuration" -msgstr "Πίνακας Ρυθμίσεων CRM" - -#. module: board_crm_configuration -#: view:board.board:0 -#: model:ir.ui.menu,name:board_crm_configuration.menu_board_statistics_dash -msgid "Statistics Dashboard" -msgstr "Πίνακας Στατιστικών Μεγεθών" - -#. module: board_crm_configuration -#: constraint:ir.ui.view:0 -msgid "Invalid XML for View Architecture!" -msgstr "Άκυρο XML για Αρχιτεκτονική Όψης!" - -#. module: board_crm_configuration -#: view:board.board:0 -#: model:ir.actions.act_window,name:board_crm_configuration.act_oppor_categ -msgid "Opportunities By Categories" -msgstr "Ευκαιρίες ανά Κατηγορίες" - -#. module: board_crm_configuration -#: view:board.board:0 -#: model:ir.actions.act_window,name:board_crm_configuration.act_my_cases -msgid "My Cases" -msgstr "Τα Θέματά μου" - -#. module: board_crm_configuration -#: model:ir.actions.act_window,name:board_crm_configuration.open_board_crm -msgid "CRM Dashboard" -msgstr "Πίνακας Αναφορών CRM" - -#. module: board_crm_configuration -#: view:board.board:0 -#: model:ir.ui.menu,name:board_crm_configuration.menu_board_crm -msgid "Connecting Dashboard" -msgstr "Σύνδεση Πινάκων Αναφορών" - -#. module: board_crm_configuration -#: view:board.board:0 -#: model:ir.actions.act_window,name:board_crm_configuration.act_leads_month_user -msgid "Leads Of The Month By User" -msgstr "Σύνδεσμοι Μηνός ανά Χρήστη" - -#. module: board_crm_configuration -#: view:board.board:0 -#: view:report.crm.case.section.stage:0 -msgid "Leads By Stage" -msgstr "Σύνδεσμοι ανά Στάδιο" - -#. module: board_crm_configuration -#: view:board.board:0 -msgid "My Meetings" -msgstr "Οι Συσκέψεις μου" - -#. module: board_crm_configuration -#: model:ir.ui.menu,name:board_crm_configuration.menu_board_crm_config -msgid "CRM Configuration" -msgstr "Ρυθμίσεις CRM" - -#. module: board_crm_configuration -#: view:board.board:0 -#: model:ir.actions.act_window,name:board_crm_configuration.act_jobs_categ -msgid "Jobs Requests Of The Month by Applied Job" -msgstr "Αιτήσεις Εργασίας του Μήνα ανά Θέση Αίτησης" - -#. module: board_crm_configuration -#: constraint:ir.actions.act_window:0 -msgid "Invalid model name in the action definition." -msgstr "Λανθασμένο όνομα μοντέλου στον ορισμό ενέργειας" - -#. module: board_crm_configuration -#: view:board.board:0 -msgid "My Sales Pipeline" -msgstr "Το Κανάλι Πωλήσεών μου" - -#. module: board_crm_configuration -#: view:report.crm.case.user:0 -msgid "Cases by User and Section" -msgstr "Θέματα ανά Χρήστη και Τμήμα" - -#. module: board_crm_configuration -#: view:board.board:0 -msgid "My Leads By Stage" -msgstr "Οι Σύνδεσμοί μου ανά Στάδιο" - -#. module: board_crm_configuration -#: view:report.crm.case.categ:0 -msgid "Cases by Sections and Categories" -msgstr "Θέματα ανά Τμήμα και Κατηγορίες" - -#. module: board_crm_configuration -#: model:ir.actions.act_window,name:board_crm_configuration.open_board_statistical_dash -msgid "CRM - Statistics Dashboard" -msgstr "CRM - Πίνακας Στατιστικών Μεγεθών" - -#. module: board_crm_configuration -#: view:board.board:0 -msgid "My Leads" -msgstr "Οι Σύνδεσμοί μου" diff --git a/addons/board_document/i18n/el.po b/addons/board_document/i18n/el.po deleted file mode 100644 index f2d2a47d093..00000000000 --- a/addons/board_document/i18n/el.po +++ /dev/null @@ -1,92 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * board_document -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 5.0.0\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-06-24 01:21+0000\n" -"Last-Translator: Panayiotis Konstantinidis \n" -"Language-Team: nls@hellug.gr \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-26 03:58+0000\n" -"X-Generator: Launchpad (build Unknown)\n" -"X-Poedit-Country: GREECE\n" -"X-Poedit-Language: Greek\n" -"X-Poedit-SourceCharset: utf-8\n" - -#. module: board_document -#: constraint:ir.ui.view:0 -msgid "Invalid XML for View Architecture!" -msgstr "Άκυρο XML για Αρχιτεκτονική Όψης!" - -#. module: board_document -#: view:board.board:0 -msgid "New Files" -msgstr "Νέα Αρχεία" - -#. module: board_document -#: model:ir.actions.act_window,name:board_document.open_board_document_manager -#: model:ir.ui.menu,name:board_document.menu_board_document_manager -msgid "Document Dashboard" -msgstr "Πίνακας Εγγραφών" - -#. module: board_document -#: view:board.board:0 -msgid "Wall of Shame" -msgstr "Τείχος της Ντροπής" - -#. module: board_document -#: view:board.board:0 -msgid "File Size by Month" -msgstr "Μέγεθος Αρχείων ανά Μήνα" - -#. module: board_document -#: view:board.board:0 -msgid "Files by Month" -msgstr "Αρχεία ανά Μήνα" - -#. module: board_document -#: model:ir.actions.act_window,name:board_document.open_board_document_manager1 -#: model:ir.ui.menu,name:board_document.menu_board_document_manager1 -msgid "Statistics by User" -msgstr "Στατιστικά ανά Χρήστη" - -#. module: board_document -#: view:board.board:0 -msgid "Files by Resource Type" -msgstr "Αρχεία ανά Τύπο Προέλευσης" - -#. module: board_document -#: constraint:ir.actions.act_window:0 -msgid "Invalid model name in the action definition." -msgstr "Λανθασμένο όνομα μοντέλου στον ορισμό ενέργειας" - -#. module: board_document -#: model:ir.module.module,shortdesc:board_document.module_meta_information -msgid "Dashboard for Document Management" -msgstr "Πίνακας Διαχείρισης Εγγραφών" - -#. module: board_document -#: view:board.board:0 -msgid "Files by Partner" -msgstr "Αρχεία ανά Συνεργάτη" - -#. module: board_document -#: model:ir.ui.menu,name:board_document.menu_board_document -msgid "Document" -msgstr "Έγγραφο" - -#. module: board_document -#: view:board.board:0 -msgid "Files by Users" -msgstr "Αρχεία ανά Χρήστη" - -#. module: board_document -#: view:board.board:0 -msgid "Document board" -msgstr "Πίνακας εγγράφου" diff --git a/addons/board_project/i18n/el.po b/addons/board_project/i18n/el.po deleted file mode 100644 index a51277747be..00000000000 --- a/addons/board_project/i18n/el.po +++ /dev/null @@ -1,142 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * board_project -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 5.0.0\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-06-24 01:22+0000\n" -"Last-Translator: Panayiotis Konstantinidis \n" -"Language-Team: nls@hellug.gr \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-26 03:57+0000\n" -"X-Generator: Launchpad (build Unknown)\n" -"X-Poedit-Country: GREECE\n" -"X-Poedit-Language: Greek\n" -"X-Poedit-SourceCharset: utf-8\n" - -#. module: board_project -#: view:board.board:0 -msgid "My project's planning" -msgstr "Σχεδιασμός Έργων μου" - -#. module: board_project -#: view:hr_timesheet_sheet.sheet:0 -#: model:ir.actions.act_window,name:board_project.act_hr_timesheet_sheet -msgid "Timesheets" -msgstr "Φύλλα Χρόνου Εργασίας" - -#. module: board_project -#: constraint:ir.actions.act_window:0 -msgid "Invalid model name in the action definition." -msgstr "Λανθασμένο όνομα μοντέλου στον ορισμό ενέργειας" - -#. module: board_project -#: view:board.board:0 -#: model:ir.actions.act_window,name:board_project.act_my_project -msgid "My projects" -msgstr "Τα Έργα μου" - -#. module: board_project -#: model:ir.actions.act_window,name:board_project.action_view_task_tree_deadline -msgid "My Task's Deadlines" -msgstr "Προθεσμίες Αναθέσεών μου" - -#. module: board_project -#: view:project.task:0 -msgid "My Tasks" -msgstr "Οι Αναθέσεις μου" - -#. module: board_project -#: view:board.board:0 -#: model:ir.actions.act_window,name:board_project.action_view_board_note_tree -msgid "Public Notes" -msgstr "Κοινοποιημένες Σημειώσεις" - -#. module: board_project -#: model:ir.actions.act_window,name:board_project.open_board_project -#: model:ir.ui.menu,name:board_project.menu_board_project -msgid "Project Dashboard" -msgstr "Πίνακας Έργων" - -#. module: board_project -#: model:ir.module.module,shortdesc:board_project.module_meta_information -msgid "Board for project users" -msgstr "Πίνακας Χρηστών Έργου" - -#. module: board_project -#: model:ir.actions.act_window,name:board_project.action_project_pipeline_user -msgid "Pipeline of tasks" -msgstr "Κανάλι Αναθέσεων" - -#. module: board_project -#: view:board.board:0 -msgid "My Planning" -msgstr "Ο Σχεδιασμός μου" - -#. module: board_project -#: view:board.board:0 -#: model:ir.actions.act_window,name:board_project.act_my_account -msgid "My accounts to invoice" -msgstr "Οι λογαριασμοί μου προς τιμολόγηση" - -#. module: board_project -#: model:ir.actions.act_window,name:board_project.open_board_project_manager -#: model:ir.ui.menu,name:board_project.menu_board_project_manager -msgid "Project Manager Dashboard" -msgstr "Πίνακας Αναφορών Διευθυντή Έργου" - -#. module: board_project -#: view:board.board:0 -msgid "My Deadlines" -msgstr "Οι Προθεσμίες μου" - -#. module: board_project -#: constraint:ir.ui.view:0 -msgid "Invalid XML for View Architecture!" -msgstr "Άκυρο XML για Αρχιτεκτονική Όψης!" - -#. module: board_project -#: view:board.board:0 -msgid "User's timesheets" -msgstr "Φύλλα χρόνου χρηστών" - -#. module: board_project -#: model:ir.ui.menu,name:board_project.next_id_86 -msgid "Project" -msgstr "Έργο" - -#. module: board_project -#: view:board.board:0 -msgid "Project manager board" -msgstr "Πίνακας διευθυντή έργου" - -#. module: board_project -#: view:board.board:0 -#: model:ir.actions.act_window,name:board_project.action_view_task_tree -msgid "My Open Tasks" -msgstr "Οι Ανοικτές Αναθέσεις μου" - -#. module: board_project -#: view:board.board:0 -msgid "My Board" -msgstr "Ο Πίνακάς μου" - -#. module: board_project -#: view:board.board:0 -msgid "My tasks board" -msgstr "Ο πίνακας αναθέσεών μου" - -#. module: board_project -#: view:board.board:0 -msgid "My user's pipeline" -msgstr "Το κανάλι μου" - -#. module: board_project -#: view:board.board:0 -msgid "My Timesheet" -msgstr "Το Φύλλο Χρόνου μου" diff --git a/addons/event/__init__.py b/addons/event/__init__.py index 55915834aa9..275c10657ff 100644 --- a/addons/event/__init__.py +++ b/addons/event/__init__.py @@ -21,5 +21,6 @@ import event import wizard +import report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/event/__openerp__.py b/addons/event/__openerp__.py index 17f04b5501e..c1f61bcff8f 100644 --- a/addons/event/__openerp__.py +++ b/addons/event/__openerp__.py @@ -37,7 +37,7 @@ Note that: - You can define new types of events in Events / Configuration / Types of Events - - You can access predefined reports about number of registration per event or per event category in : + - You can access predefined reports about number of registration per event or per event category in: Events / Reporting """, 'author': 'Tiny', @@ -46,15 +46,15 @@ 'update_xml': [ 'wizard/event_confirm_registration_view.xml', 'event_view.xml', + 'report/report_event_registration_view.xml', 'event_sequence.xml', 'security/event_security.xml', 'security/ir.model.access.csv', - 'wizard/event_registration_view.xml', - 'wizard/event_registrations_partner.xml', 'wizard/event_make_invoice_view.xml', 'board_association_view.xml', ], - 'demo_xml': ['event_demo.xml','board_association_demo.xml'], + 'demo_xml': ['event_demo.xml', 'board_association_demo.xml'], + 'test': ['test/test_event.yml'], 'installable': True, 'active': False, 'certificate': '0083059161581', diff --git a/addons/event/board_association_view.xml b/addons/event/board_association_view.xml index a1d94c72b87..aba85e420d0 100644 --- a/addons/event/board_association_view.xml +++ b/addons/event/board_association_view.xml @@ -12,8 +12,38 @@ --> - + view_mode="graph,tree" colspan="4"/>--> + + + Registration Event report + report.event.registration + graph + + + + + + + + + + + + Events On Registrations + report.event.registration + form + graph,tree + + + + + Next Events + ir.actions.act_window + event.event + form + tree,form + + associations @@ -27,7 +57,7 @@ - - + + + diff --git a/addons/event/event.py b/addons/event/event.py index 1354eac467c..6a02e44fa89 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -19,231 +19,166 @@ # ############################################################################## +from crm import crm from osv import fields, osv -import time +from tools.translate import _ import netsvc import pooler +import time import tools -from tools.translate import _ -from crm import crm -class event_type(osv.osv): +class event_type(osv.osv): + """ Event Type """ _name = 'event.type' - _description= 'Event type' + _description = __doc__ _columns = { 'name': fields.char('Event type', size=64, required=True), } + event_type() -class event(osv.osv): +class event_event(osv.osv): + """Event""" _name = 'event.event' - _description = 'Event' - _inherits = {'crm.case.section': 'section_id'} + _description = __doc__ + _inherit = 'crm.case.section' _order = 'date_begin' - def copy(self, cr, uid, id, default=None, context=None): - return super(event, self).copy(cr, uid, id, default={'code': self.pool.get('ir.sequence').get(cr, uid, 'event.event'), 'state': 'draft'}) + def copy(self, cr, uid, id, default=None, context=None): + """ Copy record of Given id + @param id: Id of Event Registration type record. + @param context: A standard dictionary for contextual values + """ + if not default: + default = {} + default.update({ + 'code': self.pool.get('ir.sequence').get(cr, uid, 'event.event'), + 'state': 'draft' + }) + return super(event_event, self).copy(cr, uid, id, default=default, context=context) - def button_draft(self, cr, uid, ids, context={}): - return self.write(cr, uid, ids, {'state': 'draft'}) + def button_draft(self, cr, uid, ids, context=None): + return self.write(cr, uid, ids, {'state': 'draft'}, context=context) - def button_cancel(self, cr, uid, ids, context={}): - return self.write(cr, uid, ids, {'state': 'cancel'}) + def button_cancel(self, cr, uid, ids, context=None): + return self.write(cr, uid, ids, {'state': 'cancel'}, context=context) - def button_done(self, cr, uid, ids, context={}): - return self.write(cr, uid, ids, {'state': 'done'}) + def button_done(self, cr, uid, ids, context=None): + return self.write(cr, uid, ids, {'state': 'done'}, context=context) - def button_confirm(self, cr, uid, ids, context={}): - for eve in self.browse(cr, uid, ids): - if eve.mail_auto_confirm: + def button_confirm(self, cr, uid, ids, context=None): + register_pool = self.pool.get('event.registration') + for event in self.browse(cr, uid, ids, context=context): + if event.mail_auto_confirm: #send reminder that will confirm the event for all the people that were already confirmed - reg_ids = self.pool.get('event.registration').search(cr, uid, [('event_id', '=', eve.id), ('state', 'not in', ['draft', 'cancel'])]) - if reg_ids: - self.pool.get('event.registration').mail_user_confirm(cr, uid, reg_ids) + reg_ids = register_pool.search(cr, uid, [ + ('event_id', '=', event.id), + ('state', 'not in', ['draft', 'cancel'])]) + register_pool.mail_user_confirm(cr, uid, reg_ids) + return self.write(cr, uid, ids, {'state': 'confirm'}) - def _get_register(self, cr, uid, ids, name, args, context=None): - res={} + + def _get_register(self, cr, uid, ids, fields, args, context=None): + """ + Get Confirm or uncofirm register value. + @param ids: List of Event registration type's id + @param fields: List of function fields(register_current and register_prospect). + @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): res[event.id] = {} - state = 'draft' - if name[0] == 'register_current': - state = 'open' - query = """SELECT sum(r.nb_register) - from event_registration r - where state=%s and event_id=%s""" - - cr.execute(query, (state, event.id, )) - res2 = cr.fetchone() - if res2 and res2[0]: - res[event.id][name[0]] = res2[0] - else: - res[event.id][name[0]] = 0 + for field in fields: + res[event.id][field] = False + state = [] + if 'register_current' in fields: + state.append('open') + if 'register_prospect' in fields: + state.append('draft') + + 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 - def write(self, cr, uid, ids, vals, *args, **kwargs): - res = super(event, self).write(cr, uid, ids, vals, *args, **kwargs) - if 'date_begin' in vals and vals['date_begin']: - for eve in self.browse(cr, uid, ids): + def write(self, cr, uid, ids, vals, context=None): + """ + Writes values in one or several fields. + @param ids: List of Event registration type's IDs + @param vals: dictionary with values to update. + @return: True + """ + register_pool = self.pool.get('event.registration') + res = super(event_event, self).write(cr, uid, ids, vals, context=context) + if vals.get('date_begin', False) or vals.get('mail_auto_confirm', False) or vals.get('mail_confirm', False): + for event in self.browse(cr, uid, ids, context=context): #change the deadlines of the registration linked to this event - reg_ids = self.pool.get('event.registration').search(cr, uid, [('event_id', '=', eve.id)]) - if reg_ids: - self.pool.get('event.registration').write(cr, uid, reg_ids, {'date_deadline': vals['date_begin']}) + register_values = {} + if vals.get('date_begin', False): + register_values['date_deadline'] = vals['date_begin'] - #change the description of the registration linked to this event - if 'mail_auto_confirm' in vals: - if vals['mail_auto_confirm']: - if 'mail_confirm' not in vals: - for eve in self.browse(cr, uid, ids): - vals['mail_confirm'] = eve.mail_confirm - else: - vals['mail_confirm']=False - if 'mail_confirm' in vals: - for eve in self.browse(cr, uid, ids): - reg_ids = self.pool.get('event.registration').search(cr, uid, [('event_id', '=', eve.id)]) - if reg_ids: - self.pool.get('event.registration').write(cr, uid, reg_ids, {'description': vals['mail_confirm']}) + #change the description of the registration linked to this event + if vals.get('mail_auto_confirm', False): + if vals['mail_auto_confirm']: + if 'mail_confirm' not in vals: + vals['mail_confirm'] = event.mail_confirm + else: + vals['mail_confirm'] = False + if 'mail_confirm' in vals: + register_values['description'] = vals['mail_confirm'] + + if register_values: + reg_ids = register_pool.search(cr, uid, [('event_id', '=', event.id)]) + register_pool.write(cr, uid, reg_ids, register_values) return res _columns = { - 'type': fields.many2one('event.type', 'Type'), - 'section_id': fields.many2one('crm.case.section', 'Case section', required=True), - 'register_max': fields.integer('Maximum Registrations'), - 'register_min': fields.integer('Minimum Registrations'), - 'register_current': fields.function(_get_register, method=True, string='Confirmed Registrations', multi='register_current'), - 'register_prospect': fields.function(_get_register, method=True, string='Unconfirmed Registrations', multi='register_prospect'), - 'date_begin': fields.datetime('Beginning date', required=True), - 'date_end': fields.datetime('Ending date', required=True), - 'state': fields.selection([('draft', 'Draft'), ('confirm', 'Confirmed'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, required=True, - help='If event is created, the state is \'Draft\'.\n If event is confirmed for the particular dates the state is set to \'Confirmed\'.\ + '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"), + 'register_min': fields.integer('Minimum Registrations', help="Providee Minimum Number of Registrations"), + 'register_current': fields.function(_get_register, method=True, string='Confirmed Registrations', multi='register_current', help="Total of Open Registrations"), + 'register_prospect': fields.function(_get_register, method=True, string='Unconfirmed Registrations', multi='register_prospect', help="Total of Prospect Registrations"), + 'date_begin': fields.datetime('Beginning date', required=True, help="Beginning Date of Event"), + 'date_end': fields.datetime('Closing date', required=True, help="Closing Date of Event"), + 'state': fields.selection([('draft', 'Draft'), ('confirm', 'Confirmed'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, required=True, help='If event is created, the state is \'Draft\'.\n If event is confirmed for the particular dates the state is set to \'Confirmed\'.\ \nIf the event is over, the state is set to \'Done\'.\n If event is cancelled the state is set to \'Cancelled\'.'), 'mail_auto_registr': fields.boolean('Mail Auto Register', help='Check this box if you want to use the automatic mailing for new registration'), 'mail_auto_confirm': fields.boolean('Mail Auto Confirm', help='Check this box if you want ot use the automatic confirmation emailing or the reminder'), '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), + '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") } _defaults = { - 'state': lambda *args: 'draft', + 'state': 'draft', 'code': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'event.event'), - 'user_id': lambda self, cr, uid, ctx: uid, + 'user_id': lambda obj, cr, uid, context: uid, } -event() +event_event() -class event_registration(osv.osv): - - def check_confirm(self, cr, uid, ids, context): - mod_obj = self.pool.get('ir.model.data') - current_registration = self.browse(cr, uid, [ids[0]])[0] - total_confirmed = current_registration.event_id.register_current + current_registration.nb_register - if total_confirmed <= current_registration.event_id.register_max or current_registration.event_id.register_max == 0: - self.write(cr, uid, [ids[0]], {'state': 'open'}, context=context) - self._history(cr, uid, [ids[0]], 'Open', history=True) - self.mail_user(cr, uid, [ids[0]]) - return True - else: - model_data_ids = mod_obj.search(cr, uid, [('model', '=', 'ir.ui.view'), ('name', '=', 'view_event_confirm_registration')], context=context) - resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id'] - context.update({'reg_id': ids[0]}) - return { - 'name': _('Confirm Registration'), - 'context': context, - 'view_type': 'form', - 'view_mode': 'tree,form', - 'res_model': 'event.confirm.registration', - 'views': [(resource_id, 'form')], - 'type': 'ir.actions.act_window', - 'target': 'new', - 'nodestroy': True - } - - def _history(self, cr, uid, ids, keyword, history=False, email=False, context={}): - for case in self.browse(cr, uid, ids): - data = { - 'name': keyword, - 'som': case.som.id, - 'canal_id': case.canal_id.id, - 'user_id': uid, - } - obj = self.pool.get('mailgate.message') - obj.create(cr, uid, data, context=context) - return True - - def button_reg_close(self, cr, uid, ids, *args): - self.write(cr, uid, ids, {'state': 'done', }) - self._history(cr, uid, ids, 'Done', history=True) - return True - - def button_reg_cancel(self, cr, uid, ids, *args): - self.write(cr, uid, ids, {'state': 'cancel', }) - self._history(cr, uid, ids, 'Cancel', history=True) - return True - - def create(self, cr, uid, *args, **argv): - event = self.pool.get('event.event').browse(cr, uid, args[0]['event_id'], None) - args[0]['section_id']= event.section_id.id - args[0]['date_deadline']= event.date_begin - args[0]['description']= event.mail_confirm - res = super(event_registration, self).create(cr, uid, *args, **argv) - self._history(cr, uid, [res], 'Created', history=True) - return res - - def write(self, cr, uid, *args, **argv): - if 'event_id' in args[1]: - event = self.pool.get('event.event').browse(cr, uid, args[1]['event_id'], None) - args[1]['section_id']= event.section_id.id - args[1]['date_deadline']= event.date_begin - args[1]['description']= event.mail_confirm - return super(event_registration, self).write(cr, uid, *args, **argv) - - def mail_user_confirm(self, cr, uid, ids): - reg_ids = self.browse(cr, uid, ids) - for reg_id in reg_ids: - src = reg_id.event_id.reply_to or False - dest = [] - if reg_id.email_from: - dest += [reg_id.email_from] - if reg_id.email_cc: - dest += [reg_id.email_cc] - if dest and src: - tools.email_send(src, dest, 'Auto Confirmation: '+'['+str(reg_id.id)+']'+' '+reg_id.name, reg_id.event_id.mail_confirm, openobject_id = str(reg_id.id)) - if not src: - raise osv.except_osv(_('Error!'), _('You must define a reply-to address in order to mail the participant. You can do this in the Mailing tab of your event. Note that this is also the place where you can configure your event to not send emails automaticly while registering')) - return False - - def mail_user(self, cr, uid, ids): - reg_ids = self.browse(cr, uid, ids) - for reg_id in reg_ids: - src = reg_id.event_id.reply_to or False - dest = [] - if reg_id.email_from: - dest += [reg_id.email_from] - if reg_id.email_cc: - dest += [reg_id.email_cc] - if reg_id.event_id.mail_auto_confirm or reg_id.event_id.mail_auto_registr: - if dest and src: - if reg_id.event_id.state in ['draft', 'fixed', 'open', 'confirm', 'running'] and reg_id.event_id.mail_auto_registr: - tools.email_send(src, dest, 'Auto Registration: '+'['+str(reg_id.id)+']'+' '+reg_id.name, reg_id.event_id.mail_registr, openobject_id = str(reg_id.id)) - if (reg_id.event_id.state in ['confirm', 'running']) and reg_id.event_id.mail_auto_confirm: - tools.email_send(src, dest, 'Auto Confirmation: '+'['+str(reg_id.id)+']'+' '+reg_id.name, reg_id.event_id.mail_confirm, openobject_id = str(reg_id.id)) - if not src: - raise osv.except_osv(_('Error!'), _('You must define a reply-to address in order to mail the participant. You can do this in the Mailing tab of your event. Note that this is also the place where you can configure your event to not send emails automaticly while registering')) - return False - - def _create_invoice_lines(self, cr, uid, ids, vals): - return self.pool.get('account.invoice.line').create(cr, uid, vals) +class event_registration(osv.osv): + """Event Registration""" _name= 'event.registration' - _description = 'Event Registration' + _description = __doc__ _inherit = 'crm.meeting' _columns = { - 'email_cc': fields.text('Watchers Emails', size=252 , help="These \ + 'email_cc': fields.text('CC', size=252 , help="These \ people will receive a copy of the future communication between partner \ -and users by email"), +and users by email"), 'nb_register': fields.integer('Number of Registration', readonly=True, states={'draft': [('readonly', False)]}), 'event_id': fields.many2one('event.event', 'Event Related', required=True), "partner_invoice_id": fields.many2one('res.partner', 'Partner Invoiced'), @@ -252,26 +187,223 @@ and users by email"), "badge_title": fields.char('Badge Title', size=128), "badge_name": fields.char('Badge Name', size=128), "badge_partner": fields.char('Badge Partner', size=128), - "invoice_label": fields.char("Label Invoice", size=128, required=True), + "event_product": fields.char("Product Name", size=128, required=True), "tobe_invoiced": fields.boolean("To be Invoiced"), "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), - 'canal_id': fields.many2one('res.partner.canal', 'Channel', help="The channels represent the different communication modes available with the customer." \ - " With each commercial opportunity, you can indicate the canall which is this opportunity source."), - 'som': fields.many2one('res.partner.som', 'State of Mind', help="The minds states allow to define a value scale which represents" \ - "the partner mentality in relation to our services.The scale has" \ - "to be created with a factor for each level from 0 (Very dissatisfied) to 10 (Extremely satisfied)."), } _defaults = { - 'nb_register': lambda *a: 1, - 'tobe_invoiced': lambda *a: True, - 'name': lambda *a: 'Registration', + 'nb_register': 1, + 'tobe_invoiced': True, + 'name': 'Registration', } + def _make_invoice(self, cr, uid, reg, lines, context=None): + """ Create Invoice from Invoice lines + @param reg : Object of event.registration + @param lines: ids of Invoice lines + """ + if context is None: + context = {} + inv_pool = self.pool.get('account.invoice') + inv_lines_pool = self.pool.get('account.invoice.line') + + val_invoice = inv_pool.onchange_partner_id(cr, uid, [], 'out_invoice', reg.partner_invoice_id.id, False, False) + val_invoice['value'].update({'partner_id': reg.partner_invoice_id.id}) + partner_address_id = val_invoice['value']['address_invoice_id'] + + value = inv_lines_pool.product_id_change(cr, uid, [], reg.event_id.product_id.id, uom =False, partner_id=reg.partner_invoice_id.id, fposition_id=reg.partner_invoice_id.property_account_position.id) + + l = inv_lines_pool.read(cr, uid, lines) + + val_invoice['value'].update({ + 'origin': reg.event_product, + 'reference': False, + 'invoice_line': [(6, 0, lines)], + 'comment': "", + }) + inv_id = inv_pool.create(cr, uid, val_invoice['value']) + inv_pool.button_compute(cr, uid, [inv_id]) + self._history(cr, uid, [reg], _('Invoiced')) + return inv_id + + def action_invoice_create(self, cr, uid, ids, grouped=False, date_inv = False, context=None): + """ Action of Create Invoice """ + res = False + invoices = {} + tax_ids=[] + + inv_lines_pool = self.pool.get('account.invoice.line') + inv_pool = self.pool.get('account.invoice') + product_pool = self.pool.get('product.product') + contact_pool = self.pool.get('res.partner.contact') + if not context: + context = {} + # If date was specified, use it as date invoiced, usefull when invoices are generated this month and put the + # last day of the last month as invoice date + if date_inv: + context['date_inv'] = date_inv + + for reg in self.browse(cr, uid, ids, context=context): + + val_invoice = inv_pool.onchange_partner_id(cr, uid, [], 'out_invoice', reg.partner_invoice_id.id, False, False) + + val_invoice['value'].update({'partner_id': reg.partner_invoice_id.id}) + partner_address_id = val_invoice['value']['address_invoice_id'] + + if not partner_address_id: + raise osv.except_osv(_('Error !'), + _("Registered partner doesn't have an address to make the invoice.")) + + value = inv_lines_pool.product_id_change(cr, uid, [], reg.event_id.product_id.id, uom =False, partner_id=reg.partner_invoice_id.id, fposition_id=reg.partner_invoice_id.property_account_position.id) + product = product_pool.browse(cr, uid, reg.event_id.product_id.id, context=context) + for tax in product.taxes_id: + tax_ids.append(tax.id) + + vals = value['value'] + c_name = reg.contact_id and ('-' + contact_pool.name_get(cr, uid, [reg.contact_id.id])[0][1]) or '' + vals.update({ + 'name': reg.event_product + '-' + c_name, + 'price_unit': reg.unit_price, + 'quantity': reg.nb_register, + 'product_id':reg.event_id.product_id.id, + 'invoice_line_tax_id': [(6, 0, tax_ids)], + }) + inv_line_ids = self._create_invoice_lines(cr, uid, [reg.id], vals) + invoices.setdefault(reg.partner_id.id, []).append((reg, inv_line_ids)) + + for val in invoices.values(): + if grouped: + res = self._make_invoice(cr, uid, val[0][0], [v for k , v in val], context=context) + + for k , v in val: + self.write(cr, uid, [k.id], {'state': 'done', 'invoice_id': res}, context=context) + + else: + for k , v in val: + res = self._make_invoice(cr, uid, k, [v], context=context) + self.write(cr, uid, [k.id], {'state': 'done', 'invoice_id': res}, context=context) + return res + + def check_confirm(self, cr, uid, ids, context=None): + """ + Check confirm event register on given id. + @param ids: List of Event registration's IDs + @param context: A standard dictionary for contextual values + @return: Dictionary value which open Confirm registration form. + """ + data_pool = self.pool.get('ir.model.data') + unconfirmed_ids = [] + for registration in self.browse(cr, uid, ids, context=context): + total_confirmed = registration.event_id.register_current + registration.nb_register + 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')) + else: + unconfirmed_ids.append(registration.id) + if unconfirmed_ids: + view_id = data_pool._get_id(cr, uid, 'event', 'view_event_confirm_registration') + view_data = data_pool.browse(cr, uid, view_id) + view_id = view_data.res_id + context['registration_ids'] = unconfirmed_ids + return { + 'name': _('Confirm Registration'), + 'context': context, + 'view_type': 'form', + 'view_mode': 'tree,form', + 'res_model': 'event.confirm.registration', + 'views': [(view_id, 'form')], + 'type': 'ir.actions.act_window', + 'target': 'new', + 'context': context, + 'nodestroy': True + } + return True + + def button_reg_close(self, cr, uid, ids, *args): + registrations = self.browse(cr, uid, ids) + self._history(cr, uid, registrations, _('Done')) + self.write(cr, uid, ids, {'state': 'done', 'date_closed': time.strftime('%Y-%m-%d %H:%M:%S')}) + return True + + def button_reg_cancel(self, cr, uid, ids, *args): + registrations = self.browse(cr, uid, ids) + self._history(cr, uid, registrations, _('Cancel')) + self.write(cr, uid, ids, {'state': 'cancel'}) + return True + + def create(self, cr, uid, values, context=None): + """ Overrides orm create method. + """ + event = self.pool.get('event.event').browse(cr, uid, values['event_id'], context=context) + + values['date_deadline']= event.date_begin + values['description']= event.mail_confirm + 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')) + return res + + def write(self, cr, uid, ids, values, context=None): + if 'event_id' in values: + event = self.pool.get('event.event').browse(cr, uid, values['event_id'], context=context) + 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): + """ + Send email to user + """ + if not context: + context = {} + + for reg_id in self.browse(cr, uid, ids): + src = reg_id.event_id.reply_to or False + dest = [] + if reg_id.email_from: + dest += [reg_id.email_from] + if reg_id.email_cc: + dest += [reg_id.email_cc] + if dest and src: + if confirm: + tools.email_send(src, dest, + _('Auto Confirmation: [%s] %s') %(reg_id.id, reg_id.name), + reg_id.event_id.mail_confirm, + openobject_id = reg_id.id) + elif reg_id.event_id.mail_auto_confirm or reg_id.event_id.mail_auto_registr: + if reg_id.event_id.state in ['draft', 'fixed', 'open', 'confirm', 'running'] and reg_id.event_id.mail_auto_registr: + tools.email_send(src, dest, + _('Auto Registration: [%s] %s') %(reg_id.id, reg_id.name), + reg_id.event_id.mail_registr, openobject_id = reg_id.id) + if (reg_id.event_id.state in ['confirm', 'running']) and reg_id.event_id.mail_auto_confirm: + tools.email_send(src, dest, + _('Auto Confirmation: [%s] %s') %(reg_id.id, reg_id.name), + reg_id.event_id.mail_confirm, openobject_id = reg_id.id) + + if not src: + raise osv.except_osv(_('Error!'), _('You must define a reply-to address in order to mail the participant. You can do this in the Mailing tab of your event. Note that this is also the place where you can configure your event to not send emails automaticly while registering')) + + return True + + def mail_user_confirm(self, cr, uid, ids, context=None): + """ + Send email to user + """ + return self.mail_user(cr, uid, ids, confirm=True, context=context) + + def _create_invoice_lines(self, cr, uid, ids, vals): + """ Create account Invoice line for Registration Id. + """ + return self.pool.get('account.invoice.line').create(cr, uid, vals) + def onchange_badge_name(self, cr, uid, ids, badge_name): + data ={} if not badge_name: return data @@ -279,9 +411,11 @@ and users by email"), return {'value': data} def onchange_contact_id(self, cr, uid, ids, contact, partner): + data ={} if not contact: return data + contact_id = self.pool.get('res.partner.contact').browse(cr, uid, contact) data['badge_name'] = contact_id.name data['badge_title'] = contact_id.title @@ -292,26 +426,27 @@ and users by email"), data['email_from'] = self.pool.get('res.partner.job').browse(cr, uid, job_ids[0]).email d = self.onchange_badge_name(cr, uid, ids, data['badge_name']) data.update(d['value']) - return {'value': data} def onchange_event(self, cr, uid, ids, event_id, partner_invoice_id): context={} if not event_id: - return {'value': {'unit_price': False , 'invoice_label': False }} + return {'value': {'unit_price': False, 'event_product': False}} data_event = self.pool.get('event.event').browse(cr, uid, event_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 , 'invoice_label': data_event.product_id.name}} + return {'value': {'unit_price': unit_price, 'event_product': data_event.product_id.name}} 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 , 'invoice_label': data_event.product_id.name}} - return {'value': {'unit_price': False, 'invoice_label': False}} - + return {'value': {'unit_price': unit_price, 'event_product': data_event.product_id.name}} + + return {'value': {'unit_price': False, 'event_product': False}} def onchange_partner_id(self, cr, uid, ids, part, event_id, email=False): + data={} data['badge_partner'] = data['contact_id'] = data['partner_invoice_id'] = data['email_from'] = data['badge_title'] = data['badge_name'] = False if not part: @@ -334,6 +469,7 @@ and users by email"), return {'value': data} def onchange_partner_invoice_id(self, cr, uid, ids, event_id, partner_invoice_id): + data={} context={} data['unit_price']=False @@ -351,80 +487,8 @@ and users by email"), return {'value': data} return {'value': data} - def onchange_categ_id(self, cr, uid, ids, categ, context={}): - if not categ: - return {'value': {}} - cat = self.pool.get('crm.case.categ').browse(cr, uid, categ, context).probability - return {'value': {'probability': cat}} - event_registration() - -class report_event_registration(osv.osv): - _name = "report.event.registration" - _description = "Events on registrations" - _auto = False - _columns = { - 'name': fields.char('Event', size=20), - 'date_begin': fields.datetime('Beginning date', required=True), - 'date_end': fields.datetime('Ending date', required=True), - 'draft_state': fields.integer('Draft Registration', size=20), - 'confirm_state': fields.integer('Confirm Registration', size=20), - 'register_max': fields.integer('Maximum Registrations'), - } - def init(self, cr): - cr.execute(""" - create or replace view report_event_registration as ( - select - e.id as id, - c.name as name, - e.date_begin as date_begin, - e.date_end as date_end, - (SELECT sum(c.nb_register) FROM event_registration c WHERE c.section_id=e.section_id and state in ('draft')) as draft_state, - (SELECT sum(c.nb_register) FROM event_registration c WHERE c.section_id=e.section_id and state in ('open')) as confirm_state, - e.register_max as register_max - from - event_event e,crm_case_section c - where - e.section_id=c.id - )""") - -report_event_registration() - -class report_event_type_registration(osv.osv): - _name = "report.event.type.registration" - _description = "Event type on registration" - _auto = False - _columns = { - 'name': fields.char('Event Type', size=20), - 'nbevent': fields.integer('Number Of Events'), - 'draft_state': fields.integer('Draft Registrations', size=20), - 'confirm_state': fields.integer('Confirm Registrations', size=20), - } - - - def init(self, cr): - cr.execute(""" - create or replace view report_event_type_registration as ( - select - count(t.id) as id, - t.name as name, - (select sum(c.nb_register) from event_registration c, event_event e where c.section_id=e.section_id and c.state='draft' and e.type=t.id ) as draft_state , - (select sum(c.nb_register) from event_registration c, event_event e where c.section_id=e.section_id and c.state='open' and e.type=t.id ) as confirm_state, - count(t.id) as nbevent - from - event_event e - inner join - crm_case_section c1 on (e.section_id=c1.id) - inner join - event_type t on (e.type=t.id) - group by - t.name,t.id - - )""") -report_event_type_registration() - - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/event/event_data.xml b/addons/event/event_data.xml index 37da989e12d..ebfe70e4c50 100644 --- a/addons/event/event_data.xml +++ b/addons/event/event_data.xml @@ -2,12 +2,5 @@ - - - - Events - - - diff --git a/addons/event/event_demo.xml b/addons/event/event_demo.xml index ad25a1dbfc1..1611febcf5e 100644 --- a/addons/event/event_demo.xml +++ b/addons/event/event_demo.xml @@ -58,7 +58,6 @@ 2008-01-01 19:00:00 2008-01-01 23:00:00 - 500 @@ -94,7 +93,6 @@ - 350 confirm @@ -107,7 +105,6 @@ 200 - True True done diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index bb9f7d0dec1..41c0fef5cfb 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -36,19 +36,8 @@ - - - Events by section - ir.actions.act_window - crm.case.section - - tree - - - - - + Events @@ -58,7 +47,7 @@
- + @@ -67,11 +56,12 @@ - + - + +