diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index 27aca6fb9fa..cd19c730a3f 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -23,7 +23,6 @@ "version" : "1.1", "author" : "OpenERP SA", "category": 'Accounting & Finance', - 'complexity': "easy", "description": """ Accounting and Financial Management. ==================================== diff --git a/addons/account/account.py b/addons/account/account.py index 26af7a5f9bd..d501f35cbc7 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -893,7 +893,7 @@ class account_fiscalyear(osv.osv): 'date_start': fields.date('Start Date', required=True), 'date_stop': fields.date('End Date', required=True), 'period_ids': fields.one2many('account.period', 'fiscalyear_id', 'Periods'), - 'state': fields.selection([('draft','Open'), ('done','Closed')], 'State', readonly=True), + 'state': fields.selection([('draft','Open'), ('done','Closed')], 'Status', readonly=True), } _defaults = { 'state': 'draft', @@ -990,7 +990,7 @@ class account_period(osv.osv): 'date_start': fields.date('Start of Period', required=True, states={'done':[('readonly',True)]}), 'date_stop': fields.date('End of Period', required=True, states={'done':[('readonly',True)]}), 'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal Year', required=True, states={'done':[('readonly',True)]}, select=True), - 'state': fields.selection([('draft','Open'), ('done','Closed')], 'State', readonly=True, + 'state': fields.selection([('draft','Open'), ('done','Closed')], 'Status', readonly=True, help='When monthly periods are created. The state is \'Draft\'. At the end of monthly period it is in \'Done\' state.'), 'company_id': fields.related('fiscalyear_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True) } @@ -1117,7 +1117,7 @@ class account_journal_period(osv.osv): 'period_id': fields.many2one('account.period', 'Period', required=True, ondelete="cascade"), 'icon': fields.function(_icon_get, string='Icon', type='char', size=32), 'active': fields.boolean('Active', required=True, help="If the active field is set to False, it will allow you to hide the journal period without removing it."), - 'state': fields.selection([('draft','Draft'), ('printed','Printed'), ('done','Done')], 'State', required=True, readonly=True, + 'state': fields.selection([('draft','Draft'), ('printed','Printed'), ('done','Done')], 'Status', required=True, readonly=True, help='When journal period is created. The state is \'Draft\'. If a report is printed it comes to \'Printed\' state. When all transactions are done, it comes in \'Done\' state.'), 'fiscalyear_id': fields.related('period_id', 'fiscalyear_id', string='Fiscal Year', type='many2one', relation='account.fiscalyear'), 'company_id': fields.related('journal_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True) @@ -1264,7 +1264,7 @@ class account_move(osv.osv): 'ref': fields.char('Reference', size=64), 'period_id': fields.many2one('account.period', 'Period', required=True, states={'posted':[('readonly',True)]}), 'journal_id': fields.many2one('account.journal', 'Journal', required=True, states={'posted':[('readonly',True)]}), - 'state': fields.selection([('draft','Unposted'), ('posted','Posted')], 'State', required=True, readonly=True, + 'state': fields.selection([('draft','Unposted'), ('posted','Posted')], 'Status', required=True, readonly=True, help='All manually created new journal entries are usually in the state \'Unposted\', but you can set the option to skip that state on the related journal. In that case, they will be behave as journal entries automatically created by the system on document validation (invoices, bank statements...) and will be created in \'Posted\' state.'), 'line_id': fields.one2many('account.move.line', 'move_id', 'Entries', states={'posted':[('readonly',True)]}), 'to_check': fields.boolean('To Review', help='Check this box if you are unsure of that journal entry and if you want to note it as \'to be reviewed\' by an accounting expert.'), @@ -2350,7 +2350,7 @@ class account_subscription(osv.osv): 'period_total': fields.integer('Number of Periods', required=True), 'period_nbr': fields.integer('Period', required=True), 'period_type': fields.selection([('day','days'),('month','month'),('year','year')], 'Period Type', required=True), - 'state': fields.selection([('draft','Draft'),('running','Running'),('done','Done')], 'State', required=True, readonly=True), + 'state': fields.selection([('draft','Draft'),('running','Running'),('done','Done')], 'Status', required=True, readonly=True), 'lines_id': fields.one2many('account.subscription.line', 'subscription_id', 'Subscription Lines') } _defaults = { diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 5601179e0fc..51e3d2dbe85 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -153,7 +153,7 @@ class account_bank_statement(osv.osv): 'state': fields.selection([('draft', 'New'), ('open','Open'), # used by cash statements ('confirm', 'Closed')], - 'State', required=True, readonly="1", + 'Status', required=True, readonly="1", help='When new statement is created the state will be \'Draft\'.\n' 'And after getting confirmation from the bank it will be in \'Confirmed\' state.'), 'currency': fields.function(_currency, string='Currency', diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index d0f7579a86e..decf9c2aaa6 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -205,13 +205,14 @@ class account_invoice(osv.osv): ('proforma2','Pro-forma'), ('open','Open'), ('paid','Paid'), - ('cancel','Cancelled') + ('cancel','Cancelled'), ],'State', select=True, readonly=True, help=' * The \'Draft\' state is used when a user is encoding a new and unconfirmed Invoice. \ \n* The \'Pro-forma\' when invoice is in Pro-forma state,invoice does not have an invoice number. \ \n* The \'Open\' state is used when user create invoice,a invoice number is generated.Its in open state till user does not pay invoice. \ \n* The \'Paid\' state is set automatically when the invoice is paid. Its related journal entries may or may not be reconciled. \ \n* The \'Cancelled\' state is used when user cancel invoice.'), + 'sent': fields.boolean('Sent', readonly=True, help="It indicates that the invoice has been sent."), 'date_invoice': fields.date('Invoice Date', readonly=True, states={'draft':[('readonly',False)]}, select=True, help="Keep empty to use the current date"), 'date_due': fields.date('Due Date', states={'paid':[('readonly',True)], 'open':[('readonly',True)], 'close':[('readonly',True)]}, select=True, help="If you use payment terms, the due date will be computed automatically at the generation "\ @@ -273,7 +274,7 @@ class account_invoice(osv.osv): help="Remaining amount due."), 'payment_ids': fields.function(_compute_lines, relation='account.move.line', type="many2many", string='Payments'), 'move_name': fields.char('Journal Entry', size=64, readonly=True, states={'draft':[('readonly',False)]}), - 'user_id': fields.many2one('res.users', 'Salesman', readonly=True, states={'draft':[('readonly',False)]}), + 'user_id': fields.many2one('res.users', 'Salesperson', readonly=True, states={'draft':[('readonly',False)]}), 'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position', readonly=True, states={'draft':[('readonly',False)]}) } _defaults = { @@ -286,6 +287,7 @@ class account_invoice(osv.osv): 'check_total': 0.0, 'internal_number': False, 'user_id': lambda s, cr, u, c: u, + 'sent': False, } _sql_constraints = [ ('number_uniq', 'unique(number, company_id, journal_id, type)', 'Invoice Number must be unique per Company!'), @@ -366,6 +368,47 @@ class account_invoice(osv.osv): else: raise orm.except_orm(_('Unknown Error'), str(e)) + def invoice_print(self, cr, uid, ids, context=None): + ''' + This function prints the invoice and mark it as sent, so that we can see more easily the next step of the workflow + ''' + assert len(ids) == 1, 'This option should only be used for a single id at a time' + self.write(cr, uid, ids, {'sent': True}, context=context) + datas = { + 'ids': ids, + 'model': 'account.invoice', + 'form': self.read(cr, uid, ids[0], context=context) + } + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'account.invoice', + 'datas': datas, + 'nodestroy' : True + } + + def action_invoice_sent(self, cr, uid, ids, context=None): + ''' + This function opens a window to compose an email, with the edi invoice template message loaded by default + ''' + mod_obj = self.pool.get('ir.model.data') + template = mod_obj.get_object_reference(cr, uid, 'account', 'email_template_edi_invoice') + template_id = template and template[1] or False + res = mod_obj.get_object_reference(cr, uid, 'mail', 'email_compose_message_wizard_form') + res_id = res and res[1] or False + ctx = dict(context, active_model='account.invoice', active_id=ids[0]) + ctx.update({'mail.compose.template_id': template_id}) + return { + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'mail.compose.message', + 'views': [(res_id, 'form')], + 'view_id': res_id, + 'type': 'ir.actions.act_window', + 'target': 'new', + 'context': ctx, + 'nodestroy': True, + } + def confirm_paid(self, cr, uid, ids, context=None): if context is None: context = {} @@ -604,6 +647,7 @@ class account_invoice(osv.osv): 'move_name':False, 'internal_number': False, 'period_id': False, + 'sent': False, }) if 'date_invoice' not in default: default.update({ @@ -1307,7 +1351,7 @@ class account_invoice_line(osv.osv): _description = "Invoice Line" _columns = { 'name': fields.char('Description', size=256, required=True), - 'origin': fields.char('Origin', size=256, help="Reference of the document that produced this invoice."), + 'origin': fields.char('Source', size=256, help="Reference of the document that produced this invoice."), 'invoice_id': fields.many2one('account.invoice', 'Invoice Reference', ondelete='cascade', select=True), 'uos_id': fields.many2one('product.uom', 'Unit of Measure', ondelete='set null'), 'product_id': fields.many2one('product.product', 'Product', ondelete='set null'), @@ -1669,4 +1713,14 @@ class res_partner(osv.osv): res_partner() +class mail_message(osv.osv): + _name = 'mail.message' + _inherit = 'mail.message' + + def _postprocess_sent_message(self, cr, uid, message, context=None): + if message.model == 'account.invoice': + self.pool.get('account.invoice').write(cr, uid, [message.res_id], {'sent':True}, context=context) + return super(mail_message, self)._postprocess_sent_message(cr, uid, message=message, context=context) + +mail_message() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 6ea8bdab58d..bb46b0b20bb 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -144,8 +144,20 @@ form 2 -
- + +
+ @@ -19,7 +19,7 @@ diff --git a/addons/account_voucher/account_voucher_view.xml b/addons/account_voucher/account_voucher_view.xml index e519d23b09e..3b33143648b 100644 --- a/addons/account_voucher/account_voucher_view.xml +++ b/addons/account_voucher/account_voucher_view.xml @@ -40,8 +40,19 @@ account.voucher form -
- + +
+
-

Order :

+ +

Quotation :

+
+ +

Request for Quotation :

+
+ +

Order :

+
- + @@ -116,7 +124,7 @@ - +

Pay Online

diff --git a/addons/email_template/__openerp__.py b/addons/email_template/__openerp__.py index 10f5be678b8..dbe53b3d547 100644 --- a/addons/email_template/__openerp__.py +++ b/addons/email_template/__openerp__.py @@ -26,7 +26,6 @@ "author" : "OpenERP,OpenLabs", "website" : "http://openerp.com", "category" : "Marketing", - 'complexity': "expert", "depends" : ['mail'], "description": """ Email Templating (simplified version of the original Power Email by Openlabs) diff --git a/addons/email_template/i18n/ja.po b/addons/email_template/i18n/ja.po index ca2abdc61d3..60b491ad0c2 100644 --- a/addons/email_template/i18n/ja.po +++ b/addons/email_template/i18n/ja.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2012-02-08 00:36+0000\n" -"PO-Revision-Date: 2012-05-10 18:28+0000\n" -"Last-Translator: Raphael Collet (OpenERP) \n" +"PO-Revision-Date: 2012-05-25 04:53+0000\n" +"Last-Translator: Akira Hiyama \n" "Language-Team: Japanese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-05-11 05:11+0000\n" -"X-Generator: Launchpad (build 15225)\n" +"X-Launchpad-Export-Date: 2012-05-26 05:07+0000\n" +"X-Generator: Launchpad (build 15288)\n" #. module: email_template #: field:email.template,subtype:0 @@ -408,7 +408,7 @@ msgstr "Eメールを送信する (%s)" #: field:email.template,body_html:0 #: field:email_template.preview,body_html:0 msgid "Rich-text Contents" -msgstr "リッチテキストの内容" +msgstr "リッチテキストのコンテンツ" #. module: email_template #: field:email.template,copyvalue:0 diff --git a/addons/event/__openerp__.py b/addons/event/__openerp__.py index ea0e4316ef5..f1a9769f803 100644 --- a/addons/event/__openerp__.py +++ b/addons/event/__openerp__.py @@ -1,3 +1,4 @@ + # -*- coding: utf-8 -*- ############################################################################## # @@ -24,7 +25,6 @@ 'name': 'Events Organisation', 'version': '0.1', 'category': 'Tools', - 'complexity': "easy", 'description': """ Organization and management of Events. ====================================== @@ -39,7 +39,7 @@ Note that: Association / Configuration / Types of Events """, 'author': 'OpenERP SA', - 'depends': ['email_template'], + 'depends': ['email_template','google_map'], 'init_xml': [], 'update_xml': [ 'security/event_security.xml', diff --git a/addons/event/event.py b/addons/event/event.py index 93fbc563a68..f01caac175f 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -103,6 +103,14 @@ class event_event(osv.osv): if total_confirmed < self.event.register_min or total_confirmed > self.event.register_max and self.event.register_max!=0: raise osv.except_osv(_('Error!'),_("The total of confirmed registration for the event '%s' does not meet the expected minimum/maximum. You should maybe reconsider those limits before going further") % (self.event.name)) + def check_registration_limits_before(self, cr, uid, ids, no_of_registration, context=None): + for event in self.browse(cr, uid, ids, context=context): + available_seats = event.register_avail + if available_seats and no_of_registration > available_seats: + raise osv.except_osv(_('Warning!'),_("Only %d Seats are Available!") % (available_seats)) + elif available_seats == 0: + raise osv.except_osv(_('Warning!'),_("No Tickets Available!")) + def confirm_event(self, cr, uid, ids, context=None): register_pool = self.pool.get('event.registration') if self.event.email_confirmation_id: @@ -179,23 +187,22 @@ class event_event(osv.osv): 'register_current': fields.function(_get_register, string='Confirmed Registrations', multi='register_numbers'), 'register_avail': fields.function(_get_register, string='Available Registrations', multi='register_numbers',type='integer'), 'register_prospect': fields.function(_get_register, string='Unconfirmed Registrations', multi='register_numbers'), - 'register_attended': fields.function(_get_register, string='Attended Registrations', multi='register_numbers'), + 'register_attended': fields.function(_get_register, string='# of Participations', multi='register_numbers'), 'registration_ids': fields.one2many('event.registration', 'event_id', 'Registrations', readonly=False, states={'done': [('readonly', True)]}), 'date_begin': fields.datetime('Start Date', required=True, readonly=True, states={'draft': [('readonly', False)]}), 'date_end': fields.datetime('End Date', required=True, readonly=True, states={'draft': [('readonly', False)]}), 'state': fields.selection([ ('draft', 'Unconfirmed'), + ('cancel', 'Cancelled'), ('confirm', 'Confirmed'), - ('done', 'Done'), - ('cancel', 'Cancelled')], - 'State', readonly=True, required=True, + ('done', 'Done')], + 'Status', readonly=True, required=True, help='If event is created, the state is \'Draft\'.If event is confirmed for the particular dates the state is set to \'Confirmed\'. If the event is over, the state is set to \'Done\'.If event is cancelled the state is set to \'Cancelled\'.'), 'email_registration_id' : fields.many2one('email.template','Registration Confirmation Email', help='This field contains the template of the mail that will be automatically sent each time a registration for this event is confirmed.'), 'email_confirmation_id' : fields.many2one('email.template','Event Confirmation Email', help="If you set an email template, each participant will receive this email announcing the confirmation of the event."), 'full_name' : fields.function(_name_get_fnc, type="char", string='Name'), 'reply_to': fields.char('Reply-To Email', size=64, readonly=False, states={'done': [('readonly', True)]}, help="The email address of the organizer is likely to be put here, with the effect to be in the 'Reply-To' of the mails sent automatically at event or registrations confirmation. You can also put the email address of your mail gateway if you use one."), 'main_speaker_id': fields.many2one('res.partner','Main Speaker', readonly=False, states={'done': [('readonly', True)]}, help="Speaker who will be giving speech at the event."), - 'speaker_ids': fields.many2many('res.partner', 'event_speaker_rel', 'speaker_id', 'partner_id', 'Other Speakers', readonly=False, states={'done': [('readonly', True)]}), 'address_id': fields.many2one('res.partner','Location Address', readonly=False, states={'done': [('readonly', True)]}), 'speaker_confirmed': fields.boolean('Speaker Confirmed', readonly=False, states={'done': [('readonly', True)]}), 'country_id': fields.related('address_id', 'country_id', @@ -204,21 +211,23 @@ class event_event(osv.osv): 'company_id': fields.many2one('res.company', 'Company', required=False, change_default=True, readonly=False, states={'done': [('readonly', True)]}), 'is_subscribed' : fields.function(_subscribe_fnc, type="boolean", string='Subscribed'), } - _defaults = { 'state': 'draft', 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'event.event', context=c), 'user_id': lambda obj, cr, uid, context: uid, } - def subscribe_to_event(self, cr, uid, ids, context=None): register_pool = self.pool.get('event.registration') user_pool = self.pool.get('res.users') + num_of_seats = int(context.get('ticket', 1)) + self.check_registration_limits_before(cr, uid, ids, num_of_seats, context=context) user = user_pool.browse(cr, uid, uid, context=context) curr_reg_ids = register_pool.search(cr, uid, [('user_id', '=', user.id), ('event_id', '=' , ids[0])]) #the subscription is done with UID = 1 because in case we share the kanban view, we want anyone to be able to subscribe if not curr_reg_ids: - curr_reg_ids = [register_pool.create(cr, 1, {'event_id': ids[0] ,'email': user.user_email, 'name':user.name, 'user_id': user.id,})] + curr_reg_ids = [register_pool.create(cr, 1, {'event_id': ids[0] ,'email': user.user_email, 'name':user.name, 'user_id': user.id, 'nb_register': num_of_seats})] + else: + register_pool.write(cr, uid, curr_reg_ids, {'nb_register': num_of_seats}, context=context) return register_pool.confirm_registration(cr, 1, curr_reg_ids, context=context) def unsubscribe_to_event(self, cr, uid, ids, context=None): @@ -236,7 +245,6 @@ class event_event(osv.osv): _constraints = [ (_check_closing_date, 'Error ! Closing Date cannot be set before Beginning Date.', ['date_end']), ] - def onchange_event_type(self, cr, uid, ids, type_event, context=None): if type_event: type_info = self.pool.get('event.type').browse(cr,uid,type_event,context) @@ -257,7 +265,7 @@ class event_registration(osv.osv): _inherit = ['mail.thread','res.partner'] _columns = { 'id': fields.integer('ID'), - 'origin': fields.char('Origin', size=124,readonly=True,help="Name of the sale order which create the registration"), + 'origin': fields.char('Source', size=124,readonly=True,help="Name of the sale order which create the registration"), 'nb_register': fields.integer('Number of Participants', required=True, readonly=True, states={'draft': [('readonly', False)]}), 'event_id': fields.many2one('event.event', 'Event', required=True, readonly=True, states={'draft': [('readonly', False)]}), 'partner_id': fields.many2one('res.partner', 'Partner', states={'done': [('readonly', True)]}), @@ -271,9 +279,9 @@ class event_registration(osv.osv): 'user_id': fields.many2one('res.users', 'Attendee', states={'done': [('readonly', True)]}), 'company_id': fields.related('event_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True, states={'draft':[('readonly',False)]}), 'state': fields.selection([('draft', 'Unconfirmed'), - ('open', 'Confirmed'), ('cancel', 'Cancelled'), - ('done', 'Attended')], 'State', + ('open', 'Confirmed'), + ('done', 'Attended')], 'Status', size=16, readonly=True), } @@ -295,6 +303,11 @@ class event_registration(osv.osv): def registration_open(self, cr, uid, ids, context=None): """ Open Registration """ + event_obj = self.pool.get('event.event') + for register in self.browse(cr, uid, ids, context=context): + event_id = register.event_id.id + no_of_registration = register.nb_register + event_obj.check_registration_limits_before(cr, uid, [event_id], no_of_registration, context=context) res = self.confirm_registration(cr, uid, ids, context=context) self.mail_user(cr, uid, ids, context=context) return res @@ -384,5 +397,4 @@ class event_registration(osv.osv): event_registration() - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/event/event_demo.xml b/addons/event/event_demo.xml index 96bc64e12aa..81dad07b5e4 100644 --- a/addons/event/event_demo.xml +++ b/addons/event/event_demo.xml @@ -38,16 +38,16 @@ Opera of Verdi - - + + 50 350 Conference on ERP Business - - + + 200 diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index 38d963fff96..6c4fada6621 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -50,19 +50,51 @@ event.event form -
- - - - + +
+ - @@ -282,7 +288,7 @@ - + @@ -353,7 +359,18 @@ event.registration form -
+ +
+
Your Reference DateSalesmanSalesperson Payment terms
-