diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 9426d713188..decf9c2aaa6 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -201,17 +201,18 @@ class account_invoice(osv.osv): 'state': fields.selection([ ('draft','Draft'), - ('cancel','Cancelled'), ('proforma','Pro-forma'), ('proforma2','Pro-forma'), ('open','Open'), - ('paid','Paid') - ],'Status', select=True, readonly=True, + ('paid','Paid'), + ('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 "\ @@ -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({ @@ -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 f41aa77cf85..334a9927103 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -146,11 +146,11 @@
- @@ -19,7 +19,7 @@ diff --git a/addons/account_voucher/account_voucher_view.xml b/addons/account_voucher/account_voucher_view.xml index 349d4e70ed7..3b33143648b 100644 --- a/addons/account_voucher/account_voucher_view.xml +++ b/addons/account_voucher/account_voucher_view.xml @@ -43,7 +43,7 @@
-

Order :

+ +

Quotation :

+
+ +

Request for Quotation :

+
+ +

Order :

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

Pay Online

diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py index 80ab03f22e7..e85f0274d84 100644 --- a/addons/hr_evaluation/hr_evaluation.py +++ b/addons/hr_evaluation/hr_evaluation.py @@ -167,7 +167,6 @@ class hr_evaluation(osv.osv): ('done','Done'), ], 'Status', required=True, readonly=True), 'date_close': fields.date('Ending Date', select=True), - 'progress': fields.float("Progress"), } _defaults = { 'date': lambda *a: (parser.parse(datetime.now().strftime('%Y-%m-%d')) + relativedelta(months =+ 1)).strftime('%Y-%m-%d'), @@ -245,7 +244,6 @@ class hr_evaluation(osv.osv): return True def button_done(self,cr, uid, ids, context=None): - self.write(cr, uid, ids,{'progress': 1 * 100}, context=context) self.write(cr, uid, ids,{'state':'done', 'date_close': time.strftime('%Y-%m-%d')}, context=context) return True @@ -312,7 +310,6 @@ class hr_evaluation_interview(osv.osv): for id in self.browse(cr, uid, ids, context=context): flag = False wating_id = 0 - tot_done_req = 1 if not id.evaluation_id.id: raise osv.except_osv(_('Warning !'),_("You cannot start evaluation without Appraisal.")) records = hr_eval_obj.browse(cr, uid, [id.evaluation_id.id], context=context)[0].survey_request_ids @@ -322,11 +319,8 @@ class hr_evaluation_interview(osv.osv): continue if child.state != "done": flag = True - else: - tot_done_req += 1 if not flag and wating_id: self.survey_req_waiting_answer(cr, uid, [wating_id], context=context) - hr_eval_obj.write(cr, uid, [id.evaluation_id.id], {'progress': tot_done_req * 100 / len(records)}, context=context) self.write(cr, uid, ids, { 'state': 'done'}, context=context) return True diff --git a/addons/hr_evaluation/hr_evaluation_data.xml b/addons/hr_evaluation/hr_evaluation_data.xml index ec4b46f8a62..bf482d2fcd7 100644 --- a/addons/hr_evaluation/hr_evaluation_data.xml +++ b/addons/hr_evaluation/hr_evaluation_data.xml @@ -2,7 +2,7 @@ - Employee Appraisal + Self Appraisal 20 @@ -1157,37 +1157,11 @@ Once the form had been filled, the employee send it to his supervisor. - - - Send to Subordinates - - - - bottom-up - - - - - - - - - Send to Managers - - - - top-down - - - - - - Send to Employee - + self @@ -1196,19 +1170,6 @@ Once the form had been filled, the employee send it to his supervisor. - - - Final Interview With Manager - - - - final - - - - - - diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml index a8d0eee63f9..9611ec382e9 100644 --- a/addons/hr_evaluation/hr_evaluation_view.xml +++ b/addons/hr_evaluation/hr_evaluation_view.xml @@ -162,7 +162,7 @@