diff --git a/addons/account/account.py b/addons/account/account.py index b050f43ad4e..5fc97a13697 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1027,6 +1027,33 @@ class account_move(osv.osv): _description = "Account Entry" _order = 'id desc' + def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80): + """ + Returns a list of tupples containing id, name, as internally it is called {def name_get} + result format : {[(id, name), (id, name), ...]} + + @param cr: A database cursor + @param user: ID of the user currently logged in + @param name: name to search + @param args: other arguments + @param operator: default operator is 'ilike', it can be changed + @param context: context arguments, like lang, time zone + @param limit: Returns first 'n' ids of complete result, default is 80. + + @return: Returns a list of tupples containing id and name + """ + + if not args: + args=[] + if not context: + context={} + ids = [] + + if name: + ids += self.search(cr, user, [('state','=','draft'), ('id','=',name)], limit=limit) + + return self.name_get(cr, user, ids, context=context) + def name_get(self, cursor, user, ids, context=None): if not len(ids): return [] @@ -2205,7 +2232,6 @@ class account_add_tmpl_wizard(osv.osv_memory): def _get_def_cparent(self, cr, uid, context): acc_obj=self.pool.get('account.account') tmpl_obj=self.pool.get('account.account.template') - #print "Searching for ",context tids=tmpl_obj.read(cr, uid, [context['tmpl_ids']], ['parent_id']) if not tids or not tids[0]['parent_id']: return False @@ -2247,7 +2273,6 @@ class account_add_tmpl_wizard(osv.osv_memory): # 'tax_ids': [(6,0,tax_ids)], todo!! 'company_id': company_id, } - # print "Creating:", vals new_account = acc_obj.create(cr, uid, vals) return {'type':'state', 'state': 'end' } diff --git a/addons/account/account_installer.xml b/addons/account/account_installer.xml index 479f9bf1c65..5b57ab130fd 100644 --- a/addons/account/account_installer.xml +++ b/addons/account/account_installer.xml @@ -1,14 +1,14 @@ - - account.installer.view + + account.installer.form account.installer form - Accounting Modules Installation + Accounting System Configuration @@ -54,37 +54,79 @@ - - - - - - - - - - - Accounting Modules Installation + + account.installer.modules.form + account.installer.modules + form + + + + + Extra Accounting Modules Installation + + + Install Extra Accounting Modules In Your Accounting System + + + From this screen, you can install extra accounting modules in your accounting system. Select the modules to directly install them. If you do not think you need any of these right now, you can easily install them later. + + + 23 + + + + + + + + + + + + + + + + + Accounting Chart Configuration ir.actions.act_window account.installer - + form form new - - + + Accounting Modules Installation + ir.actions.act_window + account.installer.modules + + form + form + new + + + + 3 onskip + + + 5 + always + + ir.actions.todo account_installer_action_replace @@ -92,7 +134,7 @@ - + diff --git a/addons/account/account_menuitem.xml b/addons/account/account_menuitem.xml index e5912a8b763..c8b0dd2c132 100644 --- a/addons/account/account_menuitem.xml +++ b/addons/account/account_menuitem.xml @@ -7,14 +7,14 @@ - - + + - + @@ -31,17 +31,17 @@ - + - + - + diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index d3dd4f1ee78..d122da7d19e 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -407,7 +407,7 @@ class account_move_line(osv.osv): 'debit': fields.float('Debit', digits_compute=dp.get_precision('Account')), 'credit': fields.float('Credit', digits_compute=dp.get_precision('Account')), 'account_id': fields.many2one('account.account', 'Account', required=True, ondelete="cascade", domain=[('type','<>','view'), ('type', '<>', 'closed')], select=2), - 'move_id': fields.many2one('account.move', 'Move', ondelete="cascade", states={'valid':[('readonly',True)]}, help="The move of this entry line.", select=2), + 'move_id': fields.many2one('account.move', 'Move', ondelete="cascade", help="The move of this entry line.", select=2), 'narration': fields.related('move_id','narration', type='text', relation='account.move', string='Narration'), 'ref': fields.char('Ref.', size=64), 'statement_id': fields.many2one('account.bank.statement', 'Statement', help="The bank statement used for bank reconciliation", select=1), @@ -560,7 +560,7 @@ class account_move_line(osv.osv): #if jt in ('sale', 'purchase_refund', 'bank', 'cash'): if jt in ('sale', 'purchase_refund'): val['account_id'] = self.pool.get('account.fiscal.position').map_account(cr, uid, part and part.property_account_position or False, id2) - elif jt in ('purchase', 'sale_refund', 'expense'): + elif jt in ('purchase', 'sale_refund', 'expense', 'bank', 'cash'): val['account_id'] = self.pool.get('account.fiscal.position').map_account(cr, uid, part and part.property_account_position or False, id1) if val.get('account_id', False): @@ -798,30 +798,30 @@ class account_move_line(osv.osv): return j+(p and (':'+p) or '') return False -# def onchange_date(self, cr, user, ids, date, context={}): -# """ -# Returns a dict that contains new values and context -# @param cr: A database cursor -# @param user: ID of the user currently logged in -# @param date: latest value from user input for field date -# @param args: other arguments -# @param context: context arguments, like lang, time zone -# @return: Returns a dict which contains new values, and context -# """ -# res = {} -# period_pool = self.pool.get('account.period') -# pids = period_pool.search(cr, user, [('date_start','<=',date), ('date_stop','>=',date)]) -# if pids: -# res.update({ -# 'period_id':pids[0] -# }) -# context.update({ -# 'period_id':pids[0] -# }) -# return { -# 'value':res, -# 'context':context, -# } + def onchange_date(self, cr, user, ids, date, context={}): + """ + Returns a dict that contains new values and context + @param cr: A database cursor + @param user: ID of the user currently logged in + @param date: latest value from user input for field date + @param args: other arguments + @param context: context arguments, like lang, time zone + @return: Returns a dict which contains new values, and context + """ + res = {} + period_pool = self.pool.get('account.period') + pids = period_pool.search(cr, user, [('date_start','<=',date), ('date_stop','>=',date)]) + if pids: + res.update({ + 'period_id':pids[0] + }) + context.update({ + 'period_id':pids[0] + }) + return { + 'value':res, + 'context':context, + } def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False, submenu=False): result = super(osv.osv, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu) @@ -882,20 +882,29 @@ class account_move_line(osv.osv): attrs = [] if field == 'debit': attrs.append('sum="Total debit"') + elif field == 'credit': attrs.append('sum="Total credit"') + elif field == 'account_tax_id': attrs.append('domain="[(\'parent_id\',\'=\',False)]"') attrs.append("context=\"{'journal_id':journal_id}\"") + elif field == 'account_id' and journal.id: attrs.append('domain="[(\'journal_id\', \'=\', '+str(journal.id)+'),(\'type\',\'<>\',\'view\'), (\'type\',\'<>\',\'closed\')]" on_change="onchange_account_id(account_id, partner_id)"') + elif field == 'partner_id': attrs.append('on_change="onchange_partner_id(move_id, partner_id, account_id, debit, credit, date, journal_id)"') + elif field == 'journal_id': attrs.append("context=\"{'journal_id':journal_id}\"") + elif field == 'statement_id': attrs.append("domain=\"[('state','!=','confirm'),('journal_id.type','=','bank')]\"") - + + elif field == 'date': + attrs.append('on_change="onchange_date(date)"') + if field in ('amount_currency', 'currency_id'): attrs.append('on_change="onchange_currency(account_id, amount_currency,currency_id, date, journal_id)"') diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index daf4ebcac26..68e9cc3ba7e 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1048,7 +1048,7 @@ - + Entry Lines @@ -1058,9 +1058,10 @@ - + + @@ -1073,8 +1074,8 @@ - - + + @@ -1377,29 +1378,29 @@ --> - - Journal Items - account.move.line - form - tree,form,graph - - - [('journal_id.type', 'in', ['sale', 'purchase_refund'])] - + + + + + + + + + - + - - Journal Items - account.move.line - form - tree,form,graph - - - [('journal_id.type', 'in', ['purchase', 'sale_refund'])] - + + + + + + + + + - + Entry Lines @@ -2416,22 +2417,22 @@ id="menu_action_account_fiscal_position_form_template" parent="account_template_folder" sequence="20"/> - - Journal Items - account.move.line - form - tree,form,graph - - - + + + + + + + + - + + + + + + + diff --git a/addons/account/installer.py b/addons/account/installer.py index cd613f7a6be..250fb5c782c 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -18,11 +18,13 @@ # along with this program. If not, see . # ############################################################################## + import time import datetime from dateutil.relativedelta import relativedelta from os.path import join as opj from operator import itemgetter + from tools.translate import _ from osv import fields, osv import netsvc @@ -55,25 +57,6 @@ class account_installer(osv.osv_memory): help="Installs localized accounting charts to match as closely as " "possible the accounting needs of your company based on your " "country."), - 'account_analytic_plans':fields.boolean('Multiple Analytic Plans', - help="Allows invoice lines to impact multiple analytic accounts " - "simultaneously."), - 'account_payment':fields.boolean('Suppliers Payment Management', - help="Streamlines invoice payment and creates hooks to plug " - "automated payment systems in."), - 'account_followup':fields.boolean('Followups Management', - help="Helps you generate reminder letters for unpaid invoices, " - "including multiple levels of reminding and customized " - "per-partner policies."), - 'account_asset':fields.boolean('Assets Management', - help="Enables asset management in the accounting application, " - "including asset categories and usage periods."), - 'account_voucher':fields.boolean('Voucher Management', - help="Account Voucher module includes all the basic requirements of " - "Voucher Entries for Bank, Cash, Sales, Purchase, Expanse, Contra, etc... "), - 'account_voucher_payment':fields.boolean('Voucher and Reconcile Management', - help="Extension Account Voucher module includes allows to link payment / receipt " - "entries with voucher, also automatically reconcile during the payment and receipt entries."), 'date_start': fields.date('Start Date', required=True), 'date_stop': fields.date('End Date', required=True), 'period':fields.selection([('month','Monthly'), ('3months','3 Monthly')], @@ -103,11 +86,6 @@ class account_installer(osv.osv_memory): return {} def generate_configurable_chart(self, cr, uid, ids, context=None): - mod_obj = self.pool.get('ir.model.data') - result = mod_obj._get_id(cr, uid, 'account', 'configurable_chart_template') - id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id'] - obj_multi = self.pool.get('account.chart.template').browse(cr, uid, id) - obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') @@ -116,6 +94,14 @@ class account_installer(osv.osv_memory): obj_fiscal_position_template = self.pool.get('account.fiscal.position.template') obj_fiscal_position = self.pool.get('account.fiscal.position') data_pool = self.pool.get('ir.model.data') + mod_obj = self.pool.get('ir.model.data') + + result = mod_obj._get_id(cr, uid, 'account', 'configurable_chart_template') + id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id'] + obj_multi = self.pool.get('account.chart.template').browse(cr, uid, id) + + if context is None: + context = {} company_id = self.pool.get('res.users').browse(cr, uid, [uid], context)[0].company_id seq_journal = True @@ -302,7 +288,7 @@ class account_installer(osv.osv_memory): data_id = mod_obj.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_sp_journal_view')]) data = mod_obj.browse(cr, uid, data_id[0]) view_id = data.res_id - + seq_id = obj_sequence.search(cr,uid,[('name','=','Account Journal')])[0] if seq_journal: @@ -405,10 +391,12 @@ class account_installer(osv.osv_memory): obj_ac_fp.create(cr, uid, vals_acc) def execute(self, cr, uid, ids, context=None): + if context is None: + context = {} super(account_installer, self).execute(cr, uid, ids, context=context) record = self.browse(cr, uid, ids, context=context)[0] - company_id = self.pool.get('res.users').browse(cr,uid,[uid],context)[0].company_id - for res in self.read(cr,uid,ids): + company_id = self.pool.get('res.users').browse(cr, uid, [uid], context)[0].company_id + for res in self.read(cr, uid, ids): if record.charts == 'configurable': mod_obj = self.pool.get('ir.model.data') fp = tools.file_open(opj('account','configurable_account_chart.xml')) @@ -501,20 +489,46 @@ class account_installer(osv.osv_memory): 'Installing chart of accounts %s'%chart) return modules | set([chart]) - account_installer() class account_bank_accounts_wizard(osv.osv_memory): _name='account.bank.accounts.wizard' _columns = { - 'acc_name':fields.char('Account Name.', size=64, required=True), - 'bank_account_id':fields.many2one('wizard.multi.charts.accounts', 'Bank Account', required=True), - 'currency_id':fields.many2one('res.currency', 'Currency'), - 'account_type':fields.selection([('cash','Cash'),('check','Check'),('bank','Bank')], 'Type', size=32), + 'acc_name': fields.char('Account Name.', size=64, required=True), + 'bank_account_id': fields.many2one('wizard.multi.charts.accounts', 'Bank Account', required=True), + 'currency_id': fields.many2one('res.currency', 'Currency'), + 'account_type': fields.selection([('cash','Cash'),('check','Check'),('bank','Bank')], 'Type', size=32), } _defaults = { 'currency_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.currency_id.id, } account_bank_accounts_wizard() + +class account_installer_modules(osv.osv_memory): + _name = 'account.installer.modules' + _inherit = 'res.config.installer' + _columns = { + # Accounting + 'account_analytic_plans':fields.boolean('Multiple Analytic Plans', + help="Allows invoice lines to impact multiple analytic accounts " + "simultaneously."), + 'account_payment':fields.boolean('Suppliers Payment Management', + help="Streamlines invoice payment and creates hooks to plug " + "automated payment systems in."), + 'account_followup':fields.boolean('Followups Management', + help="Helps you generate reminder letters for unpaid invoices, " + "including multiple levels of reminding and customized " + "per-partner policies."), + 'account_voucher':fields.boolean('Voucher Management', + help="Account Voucher module includes all the basic requirements of " + "Voucher Entries for Bank, Cash, Sales, Purchase, Expanse, Contra, etc... "), + 'account_voucher_payment':fields.boolean('Voucher and Reconcile Management', + help="Extension Account Voucher module includes allows to link payment / receipt " + "entries with voucher, also automatically reconcile during the payment and receipt entries."), + } + +account_installer_modules() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 35437fa019a..d3615e651d0 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -393,21 +393,23 @@ class account_invoice(osv.osv): p = self.pool.get('res.partner').browse(cr, uid, partner_id) if company_id: if p.property_account_receivable.company_id.id != company_id and p.property_account_payable.company_id.id != company_id: - rec_pro_id = self.pool.get('ir.property').search(cr,uid,[('name','=','property_account_receivable'),('res_id','=','res.partner,'+str(partner_id)+''),('company_id','=',company_id)]) - pay_pro_id = self.pool.get('ir.property').search(cr,uid,[('name','=','property_account_payable'),('res_id','=','res.partner,'+str(partner_id)+''),('company_id','=',company_id)]) + property_obj = self.pool.get('ir.property') + rec_pro_id = property_obj.search(cr,uid,[('name','=','property_account_receivable'),('res_id','=','res.partner,'+str(partner_id)+''),('company_id','=',company_id)]) + pay_pro_id = property_obj.search(cr,uid,[('name','=','property_account_payable'),('res_id','=','res.partner,'+str(partner_id)+''),('company_id','=',company_id)]) if not rec_pro_id: - rec_pro_id = self.pool.get('ir.property').search(cr,uid,[('name','=','property_account_receivable'),('company_id','=',company_id)]) + rec_pro_id = property_obj.search(cr,uid,[('name','=','property_account_receivable'),('company_id','=',company_id)]) if not pay_pro_id: - pay_pro_id = self.pool.get('ir.property').search(cr,uid,[('name','=','property_account_payable'),('company_id','=',company_id)]) - rec_line_data = self.pool.get('ir.property').read(cr,uid,rec_pro_id,['name','value','res_id']) - pay_line_data = self.pool.get('ir.property').read(cr,uid,pay_pro_id,['name','value','res_id']) + pay_pro_id = property_obj.search(cr,uid,[('name','=','property_account_payable'),('company_id','=',company_id)]) + rec_line_data = property_obj.read(cr,uid,rec_pro_id,['name','value','res_id']) + pay_line_data = property_obj.read(cr,uid,pay_pro_id,['name','value','res_id']) rec_res_id = rec_line_data and int(rec_line_data[0]['value'].split(',')[1]) or False pay_res_id = pay_line_data and int(pay_line_data[0]['value'].split(',')[1]) or False if not rec_res_id and not pay_res_id: raise osv.except_osv(_('Configration Error !'), _('Can not find account chart for this company, Please Create account.')) - rec_obj_acc=self.pool.get('account.account').browse(cr, uid, [rec_res_id]) - pay_obj_acc=self.pool.get('account.account').browse(cr, uid, [pay_res_id]) + account_obj = self.pool.get('account.account') + rec_obj_acc = account_obj.browse(cr, uid, [rec_res_id]) + pay_obj_acc = account_obj.browse(cr, uid, [pay_res_id]) p.property_account_receivable = rec_obj_acc[0] p.property_account_payable = pay_obj_acc[0] @@ -487,17 +489,18 @@ class account_invoice(osv.osv): partner_obj = self.pool.get('res.partner').browse(cr,uid,part_id) if partner_obj.property_account_payable and partner_obj.property_account_receivable: if partner_obj.property_account_payable.company_id.id != company_id and partner_obj.property_account_receivable.company_id.id != company_id: - rec_pro_id = self.pool.get('ir.property').search(cr, uid, [('name','=','property_account_receivable'),('res_id','=','res.partner,'+str(part_id)+''),('company_id','=',company_id)]) - pay_pro_id = self.pool.get('ir.property').search(cr, uid, [('name','=','property_account_payable'),('res_id','=','res.partner,'+str(part_id)+''),('company_id','=',company_id)]) + property_obj = self.pool.get('ir.property') + rec_pro_id = property_obj.search(cr, uid, [('name','=','property_account_receivable'),('res_id','=','res.partner,'+str(part_id)+''),('company_id','=',company_id)]) + pay_pro_id = property_obj.search(cr, uid, [('name','=','property_account_payable'),('res_id','=','res.partner,'+str(part_id)+''),('company_id','=',company_id)]) if not rec_pro_id: - rec_pro_id = self.pool.get('ir.property').search(cr, uid, [('name','=','property_account_receivable'),('company_id','=',company_id)]) + rec_pro_id = property_obj.search(cr, uid, [('name','=','property_account_receivable'),('company_id','=',company_id)]) if not pay_pro_id: - pay_pro_id = self.pool.get('ir.property').search(cr, uid, [('name','=','property_account_payable'),('company_id','=',company_id)]) - rec_line_data = self.pool.get('ir.property').read(cr, uid, rec_pro_id, ['name','value','res_id']) - pay_line_data = self.pool.get('ir.property').read(cr, uid, pay_pro_id, ['name','value','res_id']) + pay_pro_id = property_obj.search(cr, uid, [('name','=','property_account_payable'),('company_id','=',company_id)]) + rec_line_data = property_obj.read(cr, uid, rec_pro_id, ['name','value','res_id']) + pay_line_data = property_obj.read(cr, uid, pay_pro_id, ['name','value','res_id']) rec_res_id = rec_line_data and int(rec_line_data[0]['value'].split(',')[1]) or False pay_res_id = pay_line_data and int(pay_line_data[0]['value'].split(',')[1]) or False - if not rec_res_id and not rec_res_id: + if not rec_res_id and not pay_res_id: raise osv.except_osv(_('Configration Error !'), _('Can not find account chart for this company, Please Create account.')) if type in ('out_invoice', 'out_refund'): @@ -505,13 +508,14 @@ class account_invoice(osv.osv): else: acc_id = pay_res_id val= {'account_id': acc_id} + account_obj = self.pool.get('account.account') if ids: if company_id: inv_obj = self.browse(cr,uid,ids) for line in inv_obj[0].invoice_line: if line.account_id: if line.account_id.company_id.id != company_id: - result_id = self.pool.get('account.account').search(cr, uid, [('name','=',line.account_id.name),('company_id','=',company_id)]) + result_id = account_obj.search(cr, uid, [('name','=',line.account_id.name),('company_id','=',company_id)]) if not result_id: raise osv.except_osv(_('Configration Error !'), _('Can not find account chart for this company in invoice line account, Please Create account.')) @@ -519,7 +523,7 @@ class account_invoice(osv.osv): else: if invoice_line: for inv_line in invoice_line: - obj_l = self.pool.get('account.account').browse(cr, uid, inv_line[2]['account_id']) + obj_l = account_obj.browse(cr, uid, inv_line[2]['account_id']) if obj_l.company_id.id != company_id: raise osv.except_osv(_('Configration Error !'), _('invoice line account company is not match with invoice company.')) @@ -1281,20 +1285,23 @@ class account_invoice_line(osv.osv): else: return {'value': {'price_unit': 0.0, 'categ_id': False}, 'domain':{'product_uom':[]}} part = self.pool.get('res.partner').browse(cr, uid, partner_id) - fpos = fposition_id and self.pool.get('account.fiscal.position').browse(cr, uid, fposition_id) or False + fpos_obj = self.pool.get('account.fiscal.position') + fpos = fposition_id and fpos_obj.browse(cr, uid, fposition_id) or False if part.lang: context.update({'lang': part.lang}) result = {} res = self.pool.get('product.product').browse(cr, uid, product, context=context) - + if company_id: - in_pro_id = self.pool.get('ir.property').search(cr, uid, [('name','=','property_account_income'),('res_id','=','product.template,'+str(res.product_tmpl_id.id)+''),('company_id','=',company_id)]) + property_obj = self.pool.get('ir.property') + account_obj = self.pool.get('account.account') + in_pro_id = property_obj.search(cr, uid, [('name','=','property_account_income'),('res_id','=','product.template,'+str(res.product_tmpl_id.id)+''),('company_id','=',company_id)]) if not in_pro_id: - in_pro_id = self.pool.get('ir.property').search(cr, uid, [('name','=','property_account_income_categ'),('res_id','=','product.template,'+str(res.categ_id.id)+''),('company_id','=',company_id)]) - exp_pro_id = self.pool.get('ir.property').search(cr, uid, [('name','=','property_account_expense'),('res_id','=','product.template,'+str(res.product_tmpl_id.id)+''),('company_id','=',company_id)]) + in_pro_id = property_obj.search(cr, uid, [('name','=','property_account_income_categ'),('res_id','=','product.template,'+str(res.categ_id.id)+''),('company_id','=',company_id)]) + exp_pro_id = property_obj.search(cr, uid, [('name','=','property_account_expense'),('res_id','=','product.template,'+str(res.product_tmpl_id.id)+''),('company_id','=',company_id)]) if not exp_pro_id: - exp_pro_id = self.pool.get('ir.property').search(cr, uid, [('name','=','property_account_expense_categ'),('res_id','=','product.template,'+str(res.categ_id.id)+''),('company_id','=',company_id)]) + exp_pro_id = property_obj.search(cr, uid, [('name','=','property_account_expense_categ'),('res_id','=','product.template,'+str(res.categ_id.id)+''),('company_id','=',company_id)]) if not in_pro_id: in_acc = res.product_tmpl_id.property_account_income @@ -1304,7 +1311,7 @@ class account_invoice_line(osv.osv): else: app_acc_in = in_acc_cate else: - app_acc_in = self.pool.get('account.account').browse(cr, uid, in_pro_id)[0] + app_acc_in = account_obj.browse(cr, uid, in_pro_id)[0] if not exp_pro_id: ex_acc = res.product_tmpl_id.property_account_expense ex_acc_cate = res.categ_id.property_account_expense_categ @@ -1313,7 +1320,7 @@ class account_invoice_line(osv.osv): else: app_acc_exp = ex_acc_cate else: - app_acc_exp = self.pool.get('account.account').browse(cr, uid, exp_pro_id)[0] + app_acc_exp = account_obj.browse(cr, uid, exp_pro_id)[0] if not in_pro_id and not exp_pro_id: in_acc = res.product_tmpl_id.property_account_income in_acc_cate = res.categ_id.property_account_income_categ @@ -1329,13 +1336,13 @@ class account_invoice_line(osv.osv): # app_acc_in = self.pool.get('account.account').browse(cr,uid,in_pro_id)[0] # app_acc_exp = self.pool.get('account.account').browse(cr,uid,exp_pro_id)[0] if app_acc_in.company_id.id != company_id and app_acc_exp.company_id.id != company_id: - in_res_id=self.pool.get('account.account').search(cr, uid, [('name','=',app_acc_in.name),('company_id','=',company_id)]) - exp_res_id=self.pool.get('account.account').search(cr, uid, [('name','=',app_acc_exp.name),('company_id','=',company_id)]) + in_res_id = account_obj.search(cr, uid, [('name','=',app_acc_in.name),('company_id','=',company_id)]) + exp_res_id = account_obj.search(cr, uid, [('name','=',app_acc_exp.name),('company_id','=',company_id)]) if not in_res_id and not exp_res_id: raise osv.except_osv(_('Configration Error !'), _('Can not find account chart for this company, Please Create account.')) - in_obj_acc=self.pool.get('account.account').browse(cr, uid, in_res_id) - exp_obj_acc=self.pool.get('account.account').browse(cr, uid, exp_res_id) + in_obj_acc = account_obj.browse(cr, uid, in_res_id) + exp_obj_acc = account_obj.browse(cr, uid, exp_res_id) if in_acc or ex_acc: res.product_tmpl_id.property_account_income = in_obj_acc[0] res.product_tmpl_id.property_account_expense = exp_obj_acc[0] @@ -1344,26 +1351,26 @@ class account_invoice_line(osv.osv): res.categ_id.property_account_expense_categ = exp_obj_acc[0] if type in ('out_invoice','out_refund'): - a = res.product_tmpl_id.property_account_income.id + a = res.product_tmpl_id.property_account_income.id if not a: a = res.categ_id.property_account_income_categ.id else: - a = res.product_tmpl_id.property_account_expense.id + a = res.product_tmpl_id.property_account_expense.id if not a: a = res.categ_id.property_account_expense_categ.id - a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, a) + a = fpos_obj.map_account(cr, uid, fpos, a) if a: result['account_id'] = a - taxep=None + taxep = None tax_obj = self.pool.get('account.tax') if type in ('out_invoice', 'out_refund'): taxes = res.taxes_id and res.taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a).tax_ids or False) - tax_id = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, taxes) + tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes) else: taxes = res.supplier_taxes_id and res.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a).tax_ids or False) - tax_id = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, taxes) + tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes) if type in ('in_invoice', 'in_refund'): to_update = self.product_id_change_unit_price_inv(cr, uid, tax_id, price_unit or res.standard_price, qty, address_invoice_id, product, partner_id, context=context) result.update(to_update) @@ -1380,11 +1387,10 @@ class account_invoice_line(osv.osv): if res2 : domain = {'uos_id':[('category_id','=',res2 )]} - prod_pool=self.pool.get('product.product') result['categ_id'] = res.categ_id.id res_final = {'value':result, 'domain':domain} - if not company_id and not currency_id: + if not company_id or not currency_id: return res_final company = self.pool.get('res.company').browse(cr, uid, company_id) diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv index c43a1edebeb..890d4f505ea 100644 --- a/addons/account/security/ir.model.access.csv +++ b/addons/account/security/ir.model.access.csv @@ -38,7 +38,6 @@ "access_account_invoice_uinvoice","account.invoice","model_account_invoice","account.group_account_invoice",1,1,1,1 "access_account_invoice_line_uinvoice","account.invoice.line","model_account_invoice_line","account.group_account_invoice",1,1,1,1 "access_account_invoice_tax_uinvoice","account.invoice.tax","model_account_invoice_tax","account.group_account_invoice",1,1,1,1 -"access_account_analytic_line_uinvoice","account.analytic.line","model_account_analytic_line","account.group_account_manager",1,0,0,0 "access_account_move_uinvoice","account.move","model_account_move","account.group_account_invoice",1,0,0,0 "access_account_move_line_uinvoice","account.move.line invoice","model_account_move_line","account.group_account_invoice",1,1,1,1 "access_account_move_reconcile_uinvoice","account.move.reconcile","model_account_move_reconcile","account.group_account_invoice",1,1,1,1 @@ -155,3 +154,7 @@ "access_res_partner_address_invoice","res.partner.address invoice","base.model_res_partner_address","account.group_account_invoice",1,1,1,1 "access_account_invoice_line_system","account.invoice.line system","model_account_invoice_line","base.group_system",1,0,0,0 "access_account_analytic_accountant","account.analytic.account accountant","analytic.model_account_analytic_account","account.group_account_user",1,1,1,1 +"access_account_account_type_invoice","account.account.type invoice","model_account_account_type","account.group_account_invoice",1,1,1,1 +"access_report_account_receivable_invoice","report.account.receivable.invoice","model_report_account_receivable","account.group_account_invoice",1,1,1,1 +"access_report_account_receivable_user","report.account.receivable.user","model_report_account_receivable","account.group_account_user",1,1,1,1 +"access_account_sequence_fiscal_year_invoice","account.sequence.fiscalyear invoice","model_account_sequence_fiscalyear","account.group_account_invoice",1,1,1,1 diff --git a/addons/account/test/account_fiscalyear_close.yml b/addons/account/test/account_fiscalyear_close.yml index fa4f24effc1..5af4787c6a6 100644 --- a/addons/account/test/account_fiscalyear_close.yml +++ b/addons/account/test/account_fiscalyear_close.yml @@ -48,7 +48,6 @@ - !record {model: account.move.journal, id: account_move_journal_0}: journal_id: account.sales_journal - period_id: account_period_jan11 - I clicked on Open Journal Button to check the entries diff --git a/addons/account/wizard/account_journal_select_view.xml b/addons/account/wizard/account_journal_select_view.xml index f5df24fa585..348218dd04d 100644 --- a/addons/account/wizard/account_journal_select_view.xml +++ b/addons/account/wizard/account_journal_select_view.xml @@ -8,11 +8,11 @@ form - - + + - - + + diff --git a/addons/account/wizard/account_move_journal.py b/addons/account/wizard/account_move_journal.py index 142ade01737..92e8f23da49 100644 --- a/addons/account/wizard/account_move_journal.py +++ b/addons/account/wizard/account_move_journal.py @@ -26,23 +26,82 @@ import tools class account_move_journal(osv.osv_memory): _name = "account.move.journal" _description = "Move journal" - _columns = { - 'journal_id': fields.many2one('account.journal', 'Journal', required=True), - 'period_id': fields.many2one('account.period', 'Period', required=True), - } def _get_period(self, cr, uid, context={}): - """Return default account period value""" + """ + Return default account period value + """ ids = self.pool.get('account.period').find(cr, uid, context=context) period_id = False if len(ids): period_id = ids[0] return period_id - _defaults = { - 'period_id': _get_period - } + def _get_journal(self, cr, uid, context={}): + """ + Return journal based on the journal type + """ + journal_id = False + + journal_pool = self.pool.get('account.journal') + if context.get('journal_type', False): + jids = journal_pool.search(cr, uid, [('type','=', context.get('journal_type'))]) + journal_id = jids[0] + + return journal_id + + def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): + """ + Returns views and fields for current model where view will depend on {view_type}. + @param cr: A database cursor + @param user: ID of the user currently logged in + @param view_id: list of fields, which required to read signatures + @param view_type: defines a view type. it can be one of (form, tree, graph, calender, gantt, search, mdx) + @param context: context arguments, like lang, time zone + @param toolbar: contains a list of reports, wizards, and links related to current model + + @return: Returns a dict that contains definition for fields, views, and toolbars + """ + + res = super(account_move_journal, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar, submenu) + + if not view_id: + return res + + period_pool = self.pool.get('account.period') + journal_pool = self.pool.get('account.journal') + + journal_id = self._get_journal(cr, uid, context) + period_id = self._get_period(cr, uid, context) + + journal = False + if journal_id: + journal = journal_pool.read(cr, uid, [journal_id], ['name'])[0]['name'] + else: + journal = "All" + + period = False + if period_id: + period = period_pool.browse(cr, uid, [period_id], ['name'])[0]['name'] + + view = """ + + + + + + + + + + """ % (str(journal), str(period)) + + res.update({ + 'arch':view + }) + return res + def action_open_window(self, cr, uid, ids, context=None): """ This function Open action move line window on given period and Journal/Payment Mode @@ -50,48 +109,60 @@ class account_move_journal(osv.osv_memory): @param uid: the current user’s ID for security checks, @param ids: account move journal’s ID or list of IDs @return: dictionary of Open action move line window on given period and Journal/Payment Mode - """ - jp = self.pool.get('account.journal.period') - mod_obj = self.pool.get('ir.model.data') + + period_pool = self.pool.get('account.journal.period') + data_pool = self.pool.get('ir.model.data') + journal_pool = self.pool.get('account.journal') + if context is None: context = {} - data = self.read(cr, uid, ids, ['journal_id', 'period_id'], context=context)[0] - cr.execute('select id,name from ir_ui_view where model=%s and type=%s', ('account.move.line', 'form')) - view_res = cr.fetchone() - journal_id = data['journal_id'] - period_id = data['period_id'] - - ids = jp.search(cr, uid, [('journal_id', '=', journal_id), \ - ('period_id', '=', period_id)],context=context) - - if not len(ids): - name = self.pool.get('account.journal').read(cr, uid, [journal_id])[0]['name'] - state = self.pool.get('account.period').read(cr, uid, [period_id])[0]['state'] - if state == 'done': - raise osv.except_osv(_('UserError'), _('This period is already closed !')) - company = self.pool.get('account.period').read(cr, uid, [period_id])[0]['company_id'][0] - jp.create(cr, uid, {'name': name, 'period_id': period_id, 'journal_id': journal_id, 'company_id': company},context=context) - - ids = jp.search(cr, uid, [('journal_id', '=', journal_id), ('period_id', '=', period_id)],context=context) - jp = jp.browse(cr, uid, ids, context=context)[0] - name = (jp.journal_id.code or '') + ':' + (jp.period_id.code or '') - - result = mod_obj._get_id(cr, uid, 'account', 'view_account_move_line_filter') - res = mod_obj.read(cr, uid, result, ['res_id'],context=context) + + journal_id = self._get_journal(cr, uid, context) + period_id = self._get_period(cr, uid, context) + name = _("Journal Items") + if journal_id: + ids = period_pool.search(cr, uid, [('journal_id', '=', journal_id), ('period_id', '=', period_id)], context=context) + + if not len(ids): + journal = journal_pool.browse(cr, uid, journal_id) + period = self.pool.get('account.period').browse(cr, uid, period_id) + + name = journal.name + state = period.state + + if state == 'done': + raise osv.except_osv(_('UserError'), _('This period is already closed !')) + + company = period.company_id.id + res = { + 'name': name, + 'period_id': period_id, + 'journal_id': journal_id, + 'company_id': company + } + period_pool.create(cr, uid, res,context=context) + + ids = period_pool.search(cr, uid, [('journal_id', '=', journal_id), ('period_id', '=', period_id)],context=context) + period = period_pool.browse(cr, uid, ids[0], context=context) + name = (period.journal_id.code or '') + ':' + (period.period_id.code or '') + + result = data_pool._get_id(cr, uid, 'account', 'view_account_move_line_filter') + res_id = data_pool.browse(cr, uid, result, context=context).res_id + return { - 'domain': "[('journal_id','=',%d), ('period_id','=',%d)]" % (journal_id, period_id), +# 'domain': str([('journal_id', '=', journal_id), ('period_id', '=', period_id)]), 'name': name, 'view_type': 'form', - 'view_mode': 'tree,form', + 'view_mode': 'tree,form,graph', 'res_model': 'account.move.line', - 'view_id': view_res, - 'context': "{'journal_id': %d, 'period_id': %d}" % (journal_id, period_id), + 'view_id': False, + 'context': "{'journal_id': %d, 'search_default_journal_id':%d, 'search_default_period_id':%d}" % (journal_id, journal_id, period_id), 'type': 'ir.actions.act_window', - 'search_view_id': res['res_id'] - } - + 'search_view_id': res_id + } + account_move_journal() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/account_move_journal_view.xml b/addons/account/wizard/account_move_journal_view.xml index d766153a9b4..fbc160f9eb4 100644 --- a/addons/account/wizard/account_move_journal_view.xml +++ b/addons/account/wizard/account_move_journal_view.xml @@ -2,40 +2,72 @@ - + account.move.journal.form account.move.journal form - - - - - - - - - - - + - - Entries by Line + + Journal Items account.move.journal form - tree,form - - new + + {'journal_type':'sale'} + new + + + + + Journal Refund Items + account.move.journal + form + + {'journal_type':'purchase_refund'} + new + + + + + Journal Items + account.move.journal + form + + {'journal_type':'purchase'} + new + + + + + Journal Refund Items + account.move.journal + form + + {'journal_type':'sale_refund'} + new + + + + + Journal Items + account.move.journal + form + + {'journal_type':'bank'} + new - - - - - + - \ No newline at end of file + diff --git a/addons/account/wizard/account_report_aged_partner_balance_view.xml b/addons/account/wizard/account_report_aged_partner_balance_view.xml index 4db605bdb1b..8bb3a43938c 100644 --- a/addons/account/wizard/account_report_aged_partner_balance_view.xml +++ b/addons/account/wizard/account_report_aged_partner_balance_view.xml @@ -37,7 +37,7 @@ {'record_id':active_id} new - Aged Partner Balance is a more detailed report of your receivables by intervals. When opening that report, Open ERP asks for the name of the company, the fiscal period and the size of the interval to be analyzed (in days). Open ERP then calculates a table of credit balance by period. So if you request an interval of 30 days OpenERP generates an analysis of creditors for the past month, past two months, and so on. + Aged Partner Balance is a more detailed report of your receivables by intervals. When opening that report, OpenERP asks for the name of the company, the fiscal period and the size of the interval to be analyzed (in days). OpenERP then calculates a table of credit balance by period. So if you request an interval of 30 days OpenERP generates an analysis of creditors for the past month, past two months, and so on. form - - - - - + + + + + + - - + + @@ -28,7 +29,7 @@ form form new - This menu print a VAT declaration based on invoices or payments. You can select one or several periods of the fiscal year. Information required for a tax declaration is automatically generated by Open ERP from invoices (or payments, in some countries). This data is updated in real time. That’s very useful because it enables you to preview at any time the tax that you owe at the start and end of the month or quarter. + This menu print a VAT declaration based on invoices or payments. You can select one or several periods of the fiscal year. Information required for a tax declaration is automatically generated by OpenERP from invoices (or payments, in some countries). This data is updated in real time. That’s very useful because it enables you to preview at any time the tax that you owe at the start and end of the month or quarter. \n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 10:07+0000\n" +"PO-Revision-Date: 2010-08-12 06:37+0000\n" "Last-Translator: ub121 \n" "Language-Team: Mongolian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-08-12 03:59+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account_analytic_default diff --git a/addons/account_budget/i18n/tr.po b/addons/account_budget/i18n/tr.po index 1cdc870c0c0..9fec99bacd1 100644 --- a/addons/account_budget/i18n/tr.po +++ b/addons/account_budget/i18n/tr.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 04:36+0000\n" +"PO-Revision-Date: 2010-08-12 05:19+0000\n" "Last-Translator: OpenERP Administrators \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-08-12 04:05+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account_budget diff --git a/addons/account_followup/i18n/lt.po b/addons/account_followup/i18n/lt.po index d32de4a622f..beb6f1a2f0b 100644 --- a/addons/account_followup/i18n/lt.po +++ b/addons/account_followup/i18n/lt.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 05:34+0000\n" +"PO-Revision-Date: 2010-08-12 05:26+0000\n" "Last-Translator: Fabien (Open ERP) \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-08-12 03:50+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account_followup diff --git a/addons/account_followup/security/ir.model.access.csv b/addons/account_followup/security/ir.model.access.csv index 3e62e778b7c..ccf257b3ecf 100644 --- a/addons/account_followup/security/ir.model.access.csv +++ b/addons/account_followup/security/ir.model.access.csv @@ -1,5 +1,4 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_account_followup_stat","account_followup.stat","model_account_followup_stat","account.group_account_user",1,0,0,0 "access_account_followup_followup","account_followup.followup","model_account_followup_followup","base.group_system",1,1,1,1 "access_account_followup_followup_line","account_followup.followup.line","model_account_followup_followup_line","account.group_account_user",1,0,0,0 "access_account_followup_stat_manager","account_followup.stat.manager","model_account_followup_stat","account.group_account_manager",1,1,1,1 @@ -7,3 +6,4 @@ "access_account_followup_followup_line_manager","account_followup.followup.line.manager","model_account_followup_followup_line","account.group_account_manager",1,1,1,1 "access_account_followup_followup_line_system","account_followup.followup.line system","model_account_followup_followup_line","base.group_system",1,1,1,1 "access_account_followup_followup_accountant","account_followup.followup user","model_account_followup_followup","account.group_account_user",1,0,0,0 +"access_account_followup_stat_invoice","account_followup.stat.invoice","model_account_followup_stat","account.group_account_invoice",1,1,1,1 diff --git a/addons/account_payment/security/ir.model.access.csv b/addons/account_payment/security/ir.model.access.csv index 168083eb9de..fca15213f1d 100644 --- a/addons/account_payment/security/ir.model.access.csv +++ b/addons/account_payment/security/ir.model.access.csv @@ -11,3 +11,5 @@ "access_payment_order_system","payment.order system","model_payment_order","base.group_system",1,0,0,0 "access_payment_mode_system","payment.mode system","model_payment_mode","base.group_system",1,1,1,1 "access_payment_type_system","payment.type system","model_payment_type","base.group_system",1,1,1,1 +"access_payment_order_invoice","payment.order invoice","model_payment_order","account.group_account_invoice",1,1,1,1 +"access_payment_line_invoice","payment.line invoice","model_payment_line","account.group_account_invoice",1,1,1,1 diff --git a/addons/account_report/i18n/tr.po b/addons/account_report/i18n/tr.po index 2536a295789..acd4ac77db7 100644 --- a/addons/account_report/i18n/tr.po +++ b/addons/account_report/i18n/tr.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 05:27+0000\n" +"PO-Revision-Date: 2010-08-12 05:19+0000\n" "Last-Translator: Fabien (Open ERP) \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-08-12 03:43+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account_report diff --git a/addons/account_tax_include/account_tax_include_view.xml b/addons/account_tax_include/account_tax_include_view.xml index 32aea6802d1..4c103cd0d50 100644 --- a/addons/account_tax_include/account_tax_include_view.xml +++ b/addons/account_tax_include/account_tax_include_view.xml @@ -58,7 +58,7 @@ - + diff --git a/addons/association/profile_association.xml b/addons/association/profile_association.xml index 88a8c2940d0..6aaea67dd0b 100644 --- a/addons/association/profile_association.xml +++ b/addons/association/profile_association.xml @@ -9,7 +9,7 @@ - Install Extra Modules + Association Profile Configuration diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index 27b68003aa2..7bb7d61d8ee 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -378,7 +378,6 @@ property or property parameter."), } _defaults = { 'state': 'needs-action', - 'user_id': lambda self, cr, uid, ctx: uid, 'role': 'req-participant', 'rsvp': True, 'cutype': 'individual', @@ -419,7 +418,11 @@ property or property parameter."), event.add('location').value = event_obj.location if event_obj.rrule: event.add('rrule').value = event_obj.rrule - if event_obj.user_id or event_obj.organizer_id: + if event_obj.organizer: + event_org = event.add('organizer') + event_org.params['CN'] = [event_obj.organizer] + event_org.value = 'MAILTO:' + (event_obj.organizer) + elif event_obj.user_id or event_obj.organizer_id: event_org = event.add('organizer') organizer = event_obj.organizer_id if not organizer: @@ -1111,6 +1114,7 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\ 'vtimezone': fields.related('user_id', 'context_tz', type='char', size=24, \ string='Timezone', store=True), 'user_id': fields.many2one('res.users', 'Responsible', states={'done': [('readonly', True)]}), + 'organizer': fields.char("Organizer", size=256, states={'done': [('readonly', True)]}), # Map with Organizer Attribure of VEvent. 'organizer_id': fields.many2one('res.users', 'Organizer', states={'done': [('readonly', True)]}), 'freq': fields.selection([('None', 'No Repeat'), \ ('secondly', 'Secondly'), \ @@ -1147,6 +1151,14 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\ 'active': fields.boolean('Active', help="If the active field is set to \ true, it will allow you to hide the event alarm information without removing it.") } + def default_organizer(self, cr, uid, context=None): + user_pool = self.pool.get('res.users') + user = user_pool.browse(cr, uid, uid, context=context) + res = user.name + if user.user_email: + res += " <%s>" %(user.user_email) + return res + _defaults = { 'state': 'tentative', 'class': 'public', @@ -1156,7 +1168,7 @@ true, it will allow you to hide the event alarm information without removing it. 'interval': 1, 'active': 1, 'user_id': lambda self, cr, uid, ctx: uid, - 'organizer_id': lambda self, cr, uid, ctx: uid, + 'organizer': default_organizer, } def open_event(self, cr, uid, ids, context=None): @@ -1199,33 +1211,6 @@ true, it will allow you to hide the event alarm information without removing it. return value - def modify_this(self, cr, uid, event_id, defaults, real_date, context=None, *args): - """Modifies only one event record out of virtual recurrent events - and creates new event as a specific instance of a Recurring Event", - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param event_id: Id of Recurring Event - @param real_date: Date of event recurrence that is being modified - @param context: A standard dictionary for contextual values - @param *args: Get Tupple Value - """ - - event_id = base_calendar_id2real_id(event_id) - datas = self.read(cr, uid, event_id, context=context) - defaults.update({ - 'recurrent_uid': base_calendar_id2real_id(datas['id']), - 'recurrent_id': defaults.get('date') or real_date, - 'rrule_type': 'none', - 'rrule': '' - }) - exdate = datas['exdate'] and datas['exdate'].split(',') or [] - if real_date and defaults.get('date'): - exdate.append(real_date) - self.write(cr, uid, event_id, {'exdate': ','.join(exdate)}, context=context) - new_id = self.copy(cr, uid, event_id, default=defaults, context=context) - return new_id - def modify_all(self, cr, uid, event_ids, defaults, context=None, *args): """ Modifies the recurring event @@ -1235,7 +1220,6 @@ true, it will allow you to hide the event alarm information without removing it. @param context: A standard dictionary for contextual values @return: True """ - for event_id in event_ids: event_id = base_calendar_id2real_id(event_id) @@ -1270,9 +1254,10 @@ true, it will allow you to hide the event alarm information without removing it. else: ids = select result = [] + recur_dict = [] if ids and (base_start_date or base_until_date): - cr.execute("select m.id, m.rrule, m.date, m.date_deadline, \ - m.exdate, m.exrule from " + self._table + \ + cr.execute("select m.id, m.rrule, m.date, m.date_deadline, m.duration, \ + m.exdate, m.exrule, m.recurrent_id, m.recurrent_uid from " + self._table + \ " m where m.id in ("\ + ','.join(map(lambda x: str(x), ids))+")") @@ -1293,8 +1278,16 @@ true, it will allow you to hide the event alarm information without removing it. if until_date and (event_date > until_date): continue idval = real_id2base_calendar_id(data['id'], data['date']) - result.append(idval) - count += 1 + if not data['recurrent_id']: + result.append(idval) + count += 1 + else: + ex_id = real_id2base_calendar_id(data['recurrent_uid'], data['recurrent_id']) + ls = base_calendar_id2real_id(ex_id, with_date=data and data.get('duration', 0) or 0) + if not isinstance(ls, (str, int, long)) and len(ls) >= 2: + if ls[1] == data['recurrent_id']: + result.append(idval) + recur_dict.append(ex_id) else: exdate = data['exdate'] and data['exdate'].split(',') or [] rrule_str = data['rrule'] @@ -1329,7 +1322,7 @@ true, it will allow you to hide the event alarm information without removing it. result.append(idval) count += 1 if result: - ids = result + ids = list(set(result)-set(recur_dict)) if isinstance(select, (str, int, long)): return ids and ids[0] or False return ids @@ -1390,7 +1383,6 @@ true, it will allow you to hide the event alarm information without removing it. return rrule_string - def search(self, cr, uid, args, offset=0, limit=100, order=None, context=None, count=False): """ @@ -1424,8 +1416,6 @@ true, it will allow you to hide the event alarm information without removing it. return self.get_recurrent_ids(cr, uid, res, start_date, until_date, limit) - - def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True): """ Overrides orm write method. @@ -1444,22 +1434,27 @@ true, it will allow you to hide the event alarm information without removing it. else: select = ids new_ids = [] + res = False for event_id in select: + real_event_id = base_calendar_id2real_id(event_id) if len(str(event_id).split('-')) > 1: data = self.read(cr, uid, event_id, ['date', 'date_deadline', \ 'rrule', 'duration']) if data.get('rrule'): - real_date = data.get('date') - data.update(vals) - new_id = self.modify_this(cr, uid, event_id, data, \ - real_date, context) + vals.update({ + 'recurrent_uid': real_event_id, + 'recurrent_id': data.get('date'), + 'rrule_type': 'none', + 'rrule': '' + }) + new_id = self.copy(cr, uid, real_event_id, default=vals, context=context) context.update({'active_id': new_id, 'active_ids': [new_id]}) continue - event_id = base_calendar_id2real_id(event_id) - if not event_id in new_ids: - new_ids.append(event_id) + if not real_event_id in new_ids: + new_ids.append(real_event_id) - res = super(calendar_event, self).write(cr, uid, new_ids, vals, context=context) + if new_ids: + res = super(calendar_event, self).write(cr, uid, new_ids, vals, context=context) if (vals.has_key('alarm_id') or vals.has_key('base_calendar_alarm_id'))\ or (vals.has_key('date') or vals.has_key('duration') or vals.has_key('date_deadline')): # change alarm details @@ -1559,13 +1554,12 @@ true, it will allow you to hide the event alarm information without removing it. continue event_id, date_new = event_id.split('-') event_id = [int(event_id)] - for record in self.read(cr, uid, event_id, ['date', 'rrule', 'exdate']): + for record in self.read(cr, uid, event_id, ['date', 'rrule', 'exdate'], context=context): if record['rrule']: # Remove one of the recurrent event - date_new = time.strftime("%Y-%m-%d %H:%M:%S", \ + date_new = time.strftime("%Y%m%dT%H%M%S", \ time.strptime(date_new, "%Y%m%d%H%M%S")) - exdate = (record['exdate'] and (record['exdate'] + ',') or '') + ''.join((re.compile('\d')).findall(date_new)) + 'Z' - res = self.write(cr, uid, event_id, {'exdate': exdate}) + res = self.write(cr, uid, event_id, {'exdate': date_new}) else: res = super(calendar_event, self).unlink(cr, uid, event_id) self.pool.get('res.alarm').do_alarm_unlink(cr, uid, event_id, self._name) diff --git a/addons/base_calendar/wizard/base_calendar_invite_attendee_view.xml b/addons/base_calendar/wizard/base_calendar_invite_attendee_view.xml index bea5ea66a84..494787bbf97 100644 --- a/addons/base_calendar/wizard/base_calendar_invite_attendee_view.xml +++ b/addons/base_calendar/wizard/base_calendar_invite_attendee_view.xml @@ -10,6 +10,7 @@ form + diff --git a/addons/base_setup/__init__.py b/addons/base_setup/__init__.py index efdcfe16135..1fa2e7c6557 100644 --- a/addons/base_setup/__init__.py +++ b/addons/base_setup/__init__.py @@ -47,7 +47,7 @@ class base_setup_config_choice(osv.osv_memory): user_obj = self.pool.get('res.users') user_ids = user_obj.search(cr, uid, []) users = user_obj.browse(cr, uid, user_ids) - user_str = '\n'.join(map(lambda x: ' - %s: %s / %s' % (x.name, x.login, x.password), users)) + user_str = '\n'.join(map(lambda x: ' - %s:\n\t\tLogin: %s \n\t\tPassword:%s' % (x.name, x.login, x.password), users)) return _('The following users have been installed : \n')+ user_str _columns = { diff --git a/addons/base_setup/base_setup_data.xml b/addons/base_setup/base_setup_data.xml index f8f38bc644f..eabeef61334 100644 --- a/addons/base_setup/base_setup_data.xml +++ b/addons/base_setup/base_setup_data.xml @@ -6,7 +6,7 @@ base.setup.config form - + @@ -15,7 +15,7 @@ - + diff --git a/addons/base_setup/gtk_contact_form.xml b/addons/base_setup/gtk_contact_form.xml index f03d8f6cc9d..660187a8ce0 100644 --- a/addons/base_setup/gtk_contact_form.xml +++ b/addons/base_setup/gtk_contact_form.xml @@ -25,7 +25,7 @@ - + diff --git a/addons/caldav/caldav_node.py b/addons/caldav/caldav_node.py index b931b0f0328..c6e21c46e77 100644 --- a/addons/caldav/caldav_node.py +++ b/addons/caldav/caldav_node.py @@ -71,8 +71,8 @@ class node_calendar_collection(nodes.node_dir): where = [('collection_id','=',self.dir_id)] ext = False if name and name.endswith('.ics'): - name = name[-4] - ext = '.ics' + name = name[:-4] + ext = True if name: where.append(('name','=',name)) if not domain: @@ -81,15 +81,16 @@ class node_calendar_collection(nodes.node_dir): fil_obj = dirobj.pool.get('basic.calendar') ids = fil_obj.search(cr,uid,where,context=ctx) res = [] - for calender in fil_obj.browse(cr, uid, ids, context=ctx): - if not ext: - res.append(node_calendar(calender.name, self, self.context, calender)) - else: - res.append(res_node_calendar(name, self, self.context, calender)) + for cal in fil_obj.browse(cr, uid, ids, context=ctx): + if (not name) or not ext: + res.append(node_calendar(cal.name, self, self.context, cal)) + if (not name) or ext: + res.append(res_node_calendar(cal.name+'.ics', self, self.context, cal)) + # May be both of them! return res def _get_dav_owner(self, cr): - # Todo? + # Todo? return False def _get_ttag(self, cr): @@ -205,7 +206,15 @@ class node_calendar(nodes.node_class): if name: if name.endswith('.ics'): name = name[:-4] - where.append(('id','=',int(name))) + try: + where.append(('id','=',int(name))) + except ValueError: + # if somebody requests any other name than the ones we + # generate (non-numeric), it just won't exist + # FIXME: however, this confuses Evolution (at least), which + # thinks the .ics node hadn't been saved. + return [] + if not domain: domain = [] #for opr1, opt, opr2 in domain: @@ -224,9 +233,21 @@ class node_calendar(nodes.node_class): Return the node_* created """ # we ignore the path, it will be re-generated automatically + fil_obj = self.context._dirobj.pool.get('basic.calendar') + ctx = self.context.context.copy() + ctx.update(self.dctx) + uid = self.context.uid + res = self.set_data(cr, data) - - # TODO: use the res to create at least one node + + if res and len(res): + # We arbitrarily construct only the first node of the data + # that have been imported. ICS may have had more elements, + # but only one node can be returned here. + assert isinstance(res[0], (int, long)) + fnodes = fil_obj.get_calendar_objects(cr, uid, [self.calendar_id], self, + domain=[('id','=',res[0])], context=ctx) + return fnodes[0] return None diff --git a/addons/caldav/caldav_view.xml b/addons/caldav/caldav_view.xml index 9184a0aadd2..2e9719efead 100644 --- a/addons/caldav/caldav_view.xml +++ b/addons/caldav/caldav_view.xml @@ -74,37 +74,45 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/addons/caldav/calendar.py b/addons/caldav/calendar.py index 04bcd6eaa22..b4f7c03e5aa 100644 --- a/addons/caldav/calendar.py +++ b/addons/caldav/calendar.py @@ -83,7 +83,61 @@ def openobjectid2uid(cr, uidval, oomodel): value = 'OpenObject-%s_%s@%s' % (oomodel, uidval, cr.dbname) return value -def get_attribute_mapping(cr, uid, calname, context={}): +def mailto2str(arg): + """Take a dict of mail and convert to string. + """ + ret = [] + if isinstance(arg, dict): + args = [arg,] + else: + args = arg + + for ard in args: + rstr = ard.get('name','') + if ard.get('company',False): + rstr += ' (%s)' % ard.get('company') + if ard.get('email'): + rstr += ' <%s>' % ard.get('email') + ret.append(rstr) + return ', '.join(ret) + +def str2mailto(emailstr, multi=False): + """Split one email string to a dict of name, company, mail parts + + @param multi Return an array, recognize comma-sep + """ + # TODO: move to tools or sth. + mege = re.compile(r'([^\(\<]+) *(\((.*?)\))? *(\< ?(.*?) ?\>)? ?(\((.*?)\))? *$') + + mailz= [emailstr,] + retz = [] + if multi: + mailz = emailstr.split(',') + + for mas in mailz: + m = mege.match(mas.strip()) + if not m: + # one of the rare non-matching strings is "sad" :( + # retz.append({ 'name': mas.strip() }) + # continue + raise ValueError("Invalid email address %r" % mas) + rd = { 'name': m.group(1).strip(), + 'email': m.group(5), } + if m.group(2): + rd['company'] = m.group(3).strip() + elif m.group(6): + rd['company'] = m.group(7).strip() + + if rd['name'].startswith('"') and rd['name'].endswith('"'): + rd['name'] = rd['name'][1:-1] + retz.append(rd) + + if multi: + return retz + else: + return retz[0] + +def get_attribute_mapping(cr, uid, calname, context=None): """ Attribute Mapping with Basic calendar fields and lines @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @@ -220,6 +274,10 @@ class CalDAV(object): self.__attribute__[name][type] = None return True + def format_date_tz(self, date, tz=None): + format = tools.DEFAULT_SERVER_DATETIME_FORMAT + return tools.server_to_local_timestamp(date, format, format, tz) + def parse_ics(self, cr, uid, child, cal_children=None, context=None): """ parse calendaring and scheduling information @param self: The object pointer @@ -228,9 +286,16 @@ class CalDAV(object): @param context: A standard dictionary for contextual values """ att_data = [] + exdates = [] + _server_tzinfo = pytz.timezone(tools.get_server_timezone()) + for cal_data in child.getChildren(): if cal_data.name.lower() == 'organizer': - self.ical_set(cal_data.name.lower(), {'name': cal_data.params.get('CN') and cal_data.params.get('CN')[0]}, 'value') + dmail = { 'name': cal_data.params.get('CN', ['',])[0], + 'email': cal_data.value.replace('MAILTO:',''), + # TODO: company? + } + self.ical_set(cal_data.name.lower(), mailto2str(dmail), 'value') continue if cal_data.name.lower() == 'attendee': ctx = context.copy() @@ -249,13 +314,20 @@ class CalDAV(object): self.ical_set(cal_data.name.lower(), vals, 'value') continue if cal_data.name.lower() == 'exdate': - exval = map(lambda x: str(x), cal_data.value) - self.ical_set(cal_data.name.lower(), ','.join(exval), 'value') + exdates += cal_data.value + exvals = [] + for exdate in exdates: + exvals.append(datetime.fromtimestamp(time.mktime(exdate.utctimetuple())).strftime('%Y%m%dT%H%M%S')) + self.ical_set(cal_data.name.lower(), ','.join(exvals), 'value') continue if cal_data.name.lower() in self.__attribute__: - if cal_data.params.get('X-VOBJ-ORIGINAL-TZID'): - self.ical_set('vtimezone', cal_data.params.get('X-VOBJ-ORIGINAL-TZID'), 'value') + # since we do convert, do we also need to save the original tzid? + # self.ical_set('vtimezone', cal_data.params.get('X-VOBJ-ORIGINAL-TZID'), 'value') + + date_local = cal_data.value.astimezone(_server_tzinfo) + self.ical_set(cal_data.name.lower(), date_local, 'value') + continue self.ical_set(cal_data.name.lower(), cal_data.value, 'value') vals = map_data(cr, uid, self, context=context) return vals @@ -272,6 +344,8 @@ class CalDAV(object): timezones = [] for data in datas: tzval = None + exfield = None + exdates = [] vevent = ical.add(name) for field in self.__attribute__.keys(): map_field = self.ical_get(field, 'field') @@ -305,30 +379,53 @@ class CalDAV(object): alarm_obj = self.pool.get('basic.calendar.alarm') vevent = alarm_obj.export_cal(cr, uid, model, \ data[map_field][0], vevent, context=ctx) - elif field == 'vtimezone' and data[map_field] and data[map_field] not in timezones: + elif field == 'vtimezone' and data[map_field]: tzval = data[map_field] - tz_obj = self.pool.get('basic.calendar.timezone') - ical = tz_obj.export_cal(cr, uid, None, \ - data[map_field], ical, context=context) - timezones.append(data[map_field]) + if tzval not in timezones: + tz_obj = self.pool.get('basic.calendar.timezone') + ical = tz_obj.export_cal(cr, uid, None, \ + data[map_field], ical, context=context) + timezones.append(data[map_field]) + if exfield: + exfield.params['TZID'] = [tzval.title()] + exdates_updated = [] + for exdate in exdates: + date1 = (datetime.strptime(exdate, "%Y%m%dT%H%M%S")).strftime('%Y-%m-%d %H:%M:%S') + dest_date = self.format_date_tz(date1, tzval.title()) + ex_date = (datetime.strptime(dest_date, "%Y-%m-%d %H:%M:%S")).strftime('%Y%m%dT%H%M%S') + exdates_updated.append(ex_date) + exfield.value = map(parser.parse, exdates_updated) elif field == 'organizer' and data[map_field]: + organizer = str2mailto(data[map_field]) event_org = vevent.add('organizer') - organizer_id = data[map_field][0] - user_obj = self.pool.get('res.users') - organizer = user_obj.browse(cr, uid, organizer_id, context=context) - event_org.params['CN'] = [organizer.name] - event_org.value = 'MAILTO:' + (organizer.user_email or organizer.name) + event_org.params['CN'] = [organizer['name']] + event_org.value = 'MAILTO:' + (organizer.get('email') or '') + # TODO: company? elif data[map_field]: if map_type in ("char", "text"): if field in ('exdate'): - vevent.add(field).value = map(parser.parse, (data[map_field]).split(',')) + exfield = vevent.add(field) + exdates = (data[map_field]).split(',') + if tzval: + exfield.params['TZID'] = [tzval.title()] + exdates_updated = [] + for exdate in exdates: + date1 = (datetime.strptime(exdate, "%Y%m%dT%H%M%S")).strftime('%Y-%m-%d %H:%M:%S') + dest_date = self.format_date_tz(date1, tzval.title()) + ex_date = (datetime.strptime(dest_date, "%Y-%m-%d %H:%M:%S")).strftime('%Y%m%dT%H%M%S') + exdates_updated.append(ex_date) + exdates = exdates_updated + exfield.value = map(parser.parse, exdates) else: vevent.add(field).value = tools.ustr(data[map_field]) elif map_type in ('datetime', 'date') and data[map_field]: dtfield = vevent.add(field) - dtfield.value = parser.parse(data[map_field]) if tzval: + dest_date = self.format_date_tz(data[map_field], tzval.title()) dtfield.params['TZID'] = [tzval.title()] + dtfield.value = parser.parse(dest_date) + else: + dtfield.value = parser.parse(data[map_field]) elif map_type == "timedelta": vevent.add(field).value = timedelta(hours=data[map_field]) elif map_type == "many2one": @@ -344,7 +441,7 @@ class CalDAV(object): vevent.add(field).value = key1 return vevent - def check_import(self, cr, uid, vals, context={}): + def check_import(self, cr, uid, vals, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @@ -352,7 +449,8 @@ class CalDAV(object): @param vals: Get Values @param context: A standard dictionary for contextual values """ - + if not context: + context = {} ids = [] model_obj = self.pool.get(context.get('model')) recur_pool = {} @@ -379,8 +477,8 @@ class CalDAV(object): event_id = model_obj.create(cr, uid, val) recur_pool[u_id] = event_id ids.append(event_id) - except Exception, e: - raise osv.except_osv(('Error !'), (str(e))) + except Exception: + raise return ids def export_cal(self, cr, uid, datas, vobj=None, context=None): @@ -451,6 +549,7 @@ class Calendar(CalDAV, osv.osv): 'line_ids': fields.one2many('basic.calendar.lines', 'calendar_id', 'Calendar Lines'), 'create_date': fields.datetime('Created Date', readonly=True), 'write_date': fields.datetime('Modifided Date', readonly=True), + 'description': fields.text("description"), } def get_calendar_objects(self, cr, uid, ids, parent=None, domain=None, context=None): @@ -467,7 +566,7 @@ class Calendar(CalDAV, osv.osv): continue if line.name in ('valarm', 'attendee'): continue - line_domain = eval(line.domain) + line_domain = eval(line.domain or '[]') line_domain += domain if ctx_res_id: line_domain += [('id','=',ctx_res_id)] @@ -497,7 +596,7 @@ class Calendar(CalDAV, osv.osv): continue if line.name in ('valarm', 'attendee'): continue - domain = eval(line.domain) + domain = eval(line.domain or '[]') if ctx_res_id: domain += [('id','=',ctx_res_id)] mod_obj = self.pool.get(line.object_id.model) @@ -580,7 +679,7 @@ class basic_calendar_line(osv.osv): 'domain': lambda *a: '[]', } - def create(self, cr, uid, vals, context={}): + def create(self, cr, uid, vals, context=None): """ create calendar's line @param self: The object pointer @param cr: the current row, from the database cursor, @@ -662,7 +761,7 @@ class basic_calendar_fields(osv.osv): raise osv.except_osv(_('Warning !'), _('Please provide proper configuration of "%s" in Calendar Lines' % (name))) return True - def create(self, cr, uid, vals, context={}): + def create(self, cr, uid, vals, context=None): """ Create Calendar's fields @param self: The object pointer @param cr: the current row, from the database cursor, @@ -739,7 +838,7 @@ class Event(CalDAV, osv.osv_memory): 'dtend': None, # Use: O-1, Type: DATE-TIME, Specifies the date and time that a calendar component ends. } - def export_cal(self, cr, uid, datas, vobj='vevent', context={}): + def export_cal(self, cr, uid, datas, vobj='vevent', context=None): """ Export calendar @param self: The object pointer @param cr: the current row, from the database cursor, @@ -792,7 +891,7 @@ class ToDo(CalDAV, osv.osv_memory): 'rrule': None, } - def export_cal(self, cr, uid, datas, vobj='vevent', context={}): + def export_cal(self, cr, uid, datas, vobj='vevent', context=None): """ Export Calendar @param self: The object pointer @param cr: the current row, from the database cursor, @@ -842,7 +941,7 @@ class Timezone(CalDAV, osv.osv_memory): 'x-prop': None, # Use: O-n, Type: Text, } - def get_name_offset(self, cr, uid, tzid, context={}): + def get_name_offset(self, cr, uid, tzid, context=None): """ Get Name Offset value @param self: The object pointer @param cr: the current row, from the database cursor, @@ -859,7 +958,7 @@ class Timezone(CalDAV, osv.osv_memory): realoffset = (val < 0 and ('-' + realoffset) or ('+' + realoffset)) return (mydt.tzname(), realoffset) - def export_cal(self, cr, uid, model, tzid, ical, context={}): + def export_cal(self, cr, uid, model, tzid, ical, context=None): """ Export Calendar @param self: The object pointer @param cr: the current row, from the database cursor, @@ -867,7 +966,8 @@ class Timezone(CalDAV, osv.osv_memory): @param model: Get Model's name @param context: A standard dictionary for contextual values """ - + if not context: + context = {} ctx = context.copy() ctx.update({'model': model}) cal_tz = ical.add('vtimezone') @@ -876,7 +976,8 @@ class Timezone(CalDAV, osv.osv_memory): tzname, offset = self.get_name_offset(cr, uid, tzid) tz_std.add("TZOFFSETFROM").value = offset tz_std.add("TZOFFSETTO").value = offset - tz_std.add("DTSTART").value = datetime.now() # TODO + #TODO: Get start date for timezone + tz_std.add("DTSTART").value = datetime.strptime('1970-01-01 00:00:00', '%Y-%m-%d %H:%M:%S') tz_std.add("TZNAME").value = tzname return ical @@ -915,7 +1016,7 @@ class Alarm(CalDAV, osv.osv_memory): 'x-prop': None, } - def export_cal(self, cr, uid, model, alarm_id, vevent, context={}): + def export_cal(self, cr, uid, model, alarm_id, vevent, context=None): """ Export Calendar @param self: The object pointer @param cr: the current row, from the database cursor, @@ -924,7 +1025,8 @@ class Alarm(CalDAV, osv.osv_memory): @param alarm_id: Get Alarm's Id @param context: A standard dictionary for contextual values """ - + if not context: + context = {} valarm = vevent.add('valarm') alarm_object = self.pool.get(model) alarm_data = alarm_object.read(cr, uid, alarm_id, []) @@ -1035,7 +1137,7 @@ class Attendee(CalDAV, osv.osv_memory): vals = map_data(cr, uid, self, context=context) return vals - def export_cal(self, cr, uid, model, attendee_ids, vevent, context={}): + def export_cal(self, cr, uid, model, attendee_ids, vevent, context=None): """ Export Calendar @param self: The object pointer @param cr: the current row, from the database cursor, @@ -1044,7 +1146,8 @@ class Attendee(CalDAV, osv.osv_memory): @param attendee_ids: Get Attendee's Id @param context: A standard dictionary for contextual values """ - + if not context: + context = {} attendee_object = self.pool.get(model) ctx = context.copy() ctx.update({'model': model}) diff --git a/addons/caldav/wizard/calendar_event_export.py b/addons/caldav/wizard/calendar_event_export.py index 0be54df9f56..ea90686b347 100644 --- a/addons/caldav/wizard/calendar_event_export.py +++ b/addons/caldav/wizard/calendar_event_export.py @@ -33,19 +33,20 @@ class calendar_event_export(osv.osv_memory): Export Calendar Event. """ - def default_get(self, cr, uid, fields, context): + def default_get(self, cr, uid, fields, context=None): """ Get Default value for Name field. """ + if not context: + context = {} model = context.get('model', 'basic.calendar') model_obj = self.pool.get(model) - calendar = model_obj.export_cal(cr, uid, context['active_ids'], context) res = super(calendar_event_export, self).default_get( cr, uid, fields, context=context) name = 'OpenERP %s.ics' % (model_obj._description) if 'name' in fields: res.update({'name': name}) if 'file_path' in fields: - calendar = model_obj.export_cal(cr, uid, context['active_ids'], context) + calendar = model_obj.export_cal(cr, uid, context['active_ids'], context=context) res.update({'file_path': base64.encodestring(calendar)}) return res diff --git a/addons/crm/crm_meeting_view.xml b/addons/crm/crm_meeting_view.xml index 3c04006447f..af843666435 100644 --- a/addons/crm/crm_meeting_view.xml +++ b/addons/crm/crm_meeting_view.xml @@ -107,7 +107,7 @@ - + diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml index d93d90135e0..a1d02c5e33a 100644 --- a/addons/crm/crm_opportunity_view.xml +++ b/addons/crm/crm_opportunity_view.xml @@ -6,6 +6,7 @@ Opportunities crm.lead form + 10 diff --git a/addons/crm/i18n/fi.po b/addons/crm/i18n/fi.po index 7a2e7128721..141c85bf59c 100644 --- a/addons/crm/i18n/fi.po +++ b/addons/crm/i18n/fi.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2010-01-05 05:59+0000\n" -"PO-Revision-Date: 2010-08-11 05:39+0000\n" +"PO-Revision-Date: 2010-08-12 05:43+0000\n" "Last-Translator: OpenERP Administrators \n" "Language-Team: Finnish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-08-12 03:47+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: crm diff --git a/addons/crm/i18n/pl.po b/addons/crm/i18n/pl.po index af61185ff7a..c61c8754744 100644 --- a/addons/crm/i18n/pl.po +++ b/addons/crm/i18n/pl.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2010-01-05 05:59+0000\n" -"PO-Revision-Date: 2010-08-11 05:13+0000\n" +"PO-Revision-Date: 2010-08-12 05:43+0000\n" "Last-Translator: OpenERP Administrators \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-08-12 03:48+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: crm diff --git a/addons/crm_caldav/crm_caldav.py b/addons/crm_caldav/crm_caldav.py index 3c3e8b8ae2e..a9430a47225 100644 --- a/addons/crm_caldav/crm_caldav.py +++ b/addons/crm_caldav/crm_caldav.py @@ -27,7 +27,7 @@ from datetime import datetime class crm_meeting(osv.osv): _inherit = 'crm.meeting' - def export_cal(self, cr, uid, ids, context={}): + def export_cal(self, cr, uid, ids, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @@ -35,14 +35,16 @@ class crm_meeting(osv.osv): @param ids: List of CRM Meeting’s IDs @param context: A standard dictionary for contextual values """ - + if not context: + context = {} ids = map(lambda x: base_calendar.base_calendar_id2real_id(x), ids) - event_data = self.read(cr, uid, ids) + event_data = self.read(cr, uid, ids, context=context) event_obj = self.pool.get('basic.calendar.event') - ical = event_obj.export_cal(cr, uid, event_data, context={'model': self._name}) + context.update({'model': self._name}) + ical = event_obj.export_cal(cr, uid, event_data, context=context) return ical.serialize() - def import_cal(self, cr, uid, data, data_id=None, context={}): + def import_cal(self, cr, uid, data, data_id=None, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @@ -51,12 +53,13 @@ class crm_meeting(osv.osv): @param data_id: calendar's Id @param context: A standard dictionary for contextual values """ - + if not context: + context = {} event_obj = self.pool.get('basic.calendar.event') vals = event_obj.import_cal(cr, uid, data, context=context) return self.check_import(cr, uid, vals, context=context) - def check_import(self, cr, uid, vals, context={}): + def check_import(self, cr, uid, vals, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @@ -64,6 +67,8 @@ class crm_meeting(osv.osv): @param vals: Get Values @param context: A standard dictionary for contextual values """ + if not context: + context = {} ids = [] model_obj = self.pool.get(context.get('model')) recur_pool = {} @@ -96,8 +101,8 @@ class crm_meeting(osv.osv): event_id = model_obj.create(cr, uid, val) recur_pool[u_id] = event_id ids.append(event_id) - except Exception, e: - raise osv.except_osv(('Error !'), (str(e))) + except Exception: + raise return ids crm_meeting() diff --git a/addons/crm_caldav/crm_caldav_data.xml b/addons/crm_caldav/crm_caldav_data.xml index 3b74eef123c..692b7e7389e 100644 --- a/addons/crm_caldav/crm_caldav_data.xml +++ b/addons/crm_caldav/crm_caldav_data.xml @@ -32,7 +32,7 @@ - + field diff --git a/addons/document/content_index.py b/addons/document/content_index.py index d6012e60091..e3b37914f8c 100644 --- a/addons/document/content_index.py +++ b/addons/document/content_index.py @@ -98,7 +98,9 @@ class indexer(object): def _doIndexFile(self,fpath): raise NhException("Content not handled here") - + + def __repr__(self): + return "" %(self.__module__, self.__class__.__name__) def mime_match(mime, mdict): @@ -128,7 +130,7 @@ class contentIndex(object): f = True if f: - self.__logger.debug('Register content indexer: %s', obj) + self.__logger.debug('Register content indexer: %r', obj) if not f: raise Exception("Your indexer should at least suport a mimetype or extension") diff --git a/addons/document/directory_content.py b/addons/document/directory_content.py index bec4f25e45d..685df7910f3 100644 --- a/addons/document/directory_content.py +++ b/addons/document/directory_content.py @@ -18,16 +18,13 @@ # along with this program. If not, see . # ############################################################################## -import base64 from osv import osv, fields -from osv.orm import except_orm -import urlparse import netsvc -import os +# import os import nodes -import StringIO +# import StringIO class document_directory_content_type(osv.osv): _name = 'document.directory.content.type' @@ -83,7 +80,7 @@ class document_directory_content(osv.osv): tname = '' if content.include_name: content_name = node.displayname or '' - obj = node.context._dirobj.pool.get(model) + # obj = node.context._dirobj.pool.get(model) if content_name: tname = (content.prefix or '') + content_name + (content.suffix or '') + (content.extension or '') else: diff --git a/addons/document/directory_report.py b/addons/document/directory_report.py index a4cd2f45068..657fd39d9a9 100644 --- a/addons/document/directory_report.py +++ b/addons/document/directory_report.py @@ -20,13 +20,7 @@ # ############################################################################## -import base64 - from osv import osv, fields -from osv.orm import except_orm -import urlparse - -import os class ir_action_report_xml(osv.osv): _name="ir.actions.report.xml" diff --git a/addons/document/document.py b/addons/document/document.py index c62f62da2d9..46cf6d189c1 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -22,16 +22,10 @@ import base64 from osv import osv, fields -import urlparse import os -import pooler -import netsvc -from osv.orm import except_orm -#import StringIO - -from psycopg2 import Binary +# from psycopg2 import Binary #from tools import config import tools from tools.translate import _ diff --git a/addons/document/document_directory.py b/addons/document/document_directory.py index f5b9202fc8e..18544b54eac 100644 --- a/addons/document/document_directory.py +++ b/addons/document/document_directory.py @@ -19,11 +19,8 @@ # ############################################################################## -import base64 from osv import osv, fields -from osv.orm import except_orm -import urlparse import os import nodes @@ -141,30 +138,6 @@ class document_directory(osv.osv): _parent(dir_id, path) return path - def ol_get_resource_path(self, cr, uid, dir_id, res_model, res_id): - # this method will be used in process module - # to be need test and Improvement if resource dir has parent resource (link resource) - path=[] - def _parent(dir_id,path): - parent=self.browse(cr, uid, dir_id) - if parent.parent_id and not parent.ressource_parent_type_id: - _parent(parent.parent_id.id,path) - path.append(parent.name) - else: - path.append(parent.name) - return path - - directory=self.browse(cr,uid,dir_id) - model_ids=self.pool.get('ir.model').search(cr, uid, [('model','=',res_model)]) - if directory: - _parent(dir_id,path) - path.append(self.pool.get(directory.ressource_type_id.model).browse(cr, uid, res_id).name) - #user=self.pool.get('res.users').browse(cr,uid,uid) - #return "ftp://%s:%s@localhost:%s/%s/%s"%(user.login,user.password,config.get('ftp_server_port',8021),cr.dbname,'/'.join(path)) - # No way we will return the password! - return "ftp://user:pass@host:port/test/this" - return False - def _check_recursion(self, cr, uid, ids): level = 100 while len(ids): @@ -178,8 +151,9 @@ class document_directory(osv.osv): _constraints = [ (_check_recursion, 'Error! You can not create recursive Directories.', ['parent_id']) ] + def __init__(self, *args, **kwargs): - res = super(document_directory, self).__init__(*args, **kwargs) + super(document_directory, self).__init__(*args, **kwargs) #self._cache = {} def onchange_content_id(self, cr, uid, ids, ressource_type_id): @@ -223,31 +197,8 @@ class document_directory(osv.osv): """ try to locate the node in uri, Return a tuple (node_dir, remaining_path) """ - return (nodes.node_database(context=ncontext), uri) + return (nodes.node_database(context=ncontext), uri) - def old_code(): - if not uri: - return node_database(cr, uid, context=context) - turi = tuple(uri) - node = node_class(cr, uid, '/', False, context=context, type='database') - for path in uri[:]: - if path: - node = node.child(path) - if not node: - return False - oo = node.object and (node.object._name, node.object.id) or False - oo2 = node.object2 and (node.object2._name, node.object2.id) or False - return node - - def ol_get_childs(self, cr, uid, uri, context={}): - node = self.get_object(cr, uid, uri, context) - if uri: - children = node.children() - else: - children= [node] - result = map(lambda node: node.path_get(), children) - return result - def copy(self, cr, uid, id, default=None, context=None): if not default: default ={} diff --git a/addons/document/document_storage.py b/addons/document/document_storage.py index 419d6c03e37..0ecc01941b4 100644 --- a/addons/document/document_storage.py +++ b/addons/document/document_storage.py @@ -37,7 +37,6 @@ from osv.orm import except_orm import random import string import pooler -import netsvc import nodes from content_index import cntIndex @@ -189,7 +188,7 @@ class nodefd_db(StringIO, nodes.node_descriptor): # we now open a *separate* cursor, to update the data. # FIXME: this may be improved, for concurrency handling par = self._get_parent() - uid = par.context.uid + # uid = par.context.uid cr = pooler.get_db(par.context.dbname).cursor() try: if self.mode in ('w', 'w+', 'r+'): @@ -227,7 +226,7 @@ class nodefd_db(StringIO, nodes.node_descriptor): " WHERE id = %s", (out, len(data), par.file_id)) cr.commit() - except Exception, e: + except Exception: logging.getLogger('document.storage').exception('Cannot update db file #%d for close:', par.file_id) raise finally: @@ -262,7 +261,7 @@ class nodefd_db64(StringIO, nodes.node_descriptor): # we now open a *separate* cursor, to update the data. # FIXME: this may be improved, for concurrency handling par = self._get_parent() - uid = par.context.uid + # uid = par.context.uid cr = pooler.get_db(par.context.dbname).cursor() try: if self.mode in ('w', 'w+', 'r+'): @@ -288,18 +287,18 @@ class nodefd_db64(StringIO, nodes.node_descriptor): cr.execute('UPDATE ir_attachment SET db_datas = %s::bytea, file_size=%s, ' \ 'index_content = %s, file_type = %s ' \ 'WHERE id = %s', - (base64.encodestring(out), len(out), icont_u, mime, par.file_id)) + (base64.encodestring(data), len(data), icont_u, mime, par.file_id)) elif self.mode == 'a': - out = self.getvalue() + data = self.getvalue() # Yes, we're obviously using the wrong representation for storing our # data as base64-in-bytea cr.execute("UPDATE ir_attachment " \ "SET db_datas = encode( (COALESCE(decode(encode(db_datas,'escape'),'base64'),'') || decode(%s, 'base64')),'base64')::bytea , " \ " file_size = COALESCE(file_size, 0) + %s " \ " WHERE id = %s", - (base64.encodestring(out), len(out), par.file_id)) + (base64.encodestring(data), len(data), par.file_id)) cr.commit() - except Exception, e: + except Exception: logging.getLogger('document.storage').exception('Cannot update db file #%d for close:', par.file_id) raise finally: @@ -500,7 +499,7 @@ class document_storage(osv.osv): # try to fix their directory. if ira.file_size: self._doclog.warning("ir.attachment #%d does not have a filename, trying the name." %ira.id) - sfname = ira.name + # sfname = ira.name fpath = os.path.join(boo.path,ira.store_fname or ira.name) if os.path.exists(fpath): return file(fpath,'rb').read() @@ -695,7 +694,7 @@ class document_storage(osv.osv): store_fname = os.path.join(*store_path) return { 'name': new_name, 'datas_fname': new_name, 'store_fname': store_fname } else: - raise TypeError("No %s storage" % boo.type) + raise TypeError("No %s storage" % sbro.type) def simple_move(self, cr, uid, file_node, ndir_bro, context=None): """ A preparation for a file move. @@ -734,7 +733,7 @@ class document_storage(osv.osv): fname = fil_bo.store_fname if not fname: return ValueError("Tried to rename a non-stored file") - path = storage_bo.path + path = sbro.path oldpath = os.path.join(path, fname) for ch in ('*', '|', "\\", '/', ':', '"', '<', '>', '?', '..'): @@ -751,7 +750,7 @@ class document_storage(osv.osv): os.rename(oldpath, newpath) return { 'name': new_name, 'datas_fname': new_name, 'store_fname': new_name } else: - raise TypeError("No %s storage" % boo.type) + raise TypeError("No %s storage" % sbro.type) document_storage() diff --git a/addons/document/nodes.py b/addons/document/nodes.py index 228f104574d..cf590dafdad 100644 --- a/addons/document/nodes.py +++ b/addons/document/nodes.py @@ -19,17 +19,14 @@ # ############################################################################## -# import base64 -# import StringIO -from osv import osv, fields -from osv.orm import except_orm # import urlparse import pooler from tools.safe_eval import safe_eval import errno -import os +# import os import time +import logging from StringIO import StringIO @@ -44,6 +41,8 @@ from StringIO import StringIO # root: if we are at the first directory of a ressource # +logger = logging.getLogger('doc2.nodes') + def _str2time(cre): """ Convert a string with time representation (from db) into time (float) @@ -902,9 +901,8 @@ class node_res_obj(node_class): def get_dav_eprop(self, cr, ns, prop): if ns != 'http://groupdav.org/' or prop != 'resourcetype': - print "Who asked for %s:%s?" % (ns, prop) + logger.warning("Who asked for %s:%s?" % (ns, prop)) return None - res = {} cntobj = self.context._dirobj.pool.get('document.directory.content') uid = self.context.uid ctx = self.context.context.copy() @@ -1374,11 +1372,11 @@ class nodefd_content(StringIO, node_descriptor): if self.mode in ('w', 'w+', 'r+'): data = self.getvalue() cntobj = par.context._dirobj.pool.get('document.directory.content') - cntobj.process_write(cr, uid, parent, data, ctx) + cntobj.process_write(cr, uid, par, data, par.context.context) elif self.mode == 'a': raise NotImplementedError cr.commit() - except Exception, e: + except Exception: logging.getLogger('document.content').exception('Cannot update db content #%d for close:', par.cnt_id) raise finally: diff --git a/addons/document/test_cindex.py b/addons/document/test_cindex.py index 267e0497950..d7ae7c4d160 100644 --- a/addons/document/test_cindex.py +++ b/addons/document/test_cindex.py @@ -35,7 +35,7 @@ for fname in args: for line in res[:5]: print line except Exception,e: - import traceback,sys + import traceback tb_s = reduce(lambda x, y: x+y, traceback.format_exception( sys.exc_type, sys.exc_value, sys.exc_traceback)) diff --git a/addons/document_ftp/ftpserver/abstracted_fs.py b/addons/document_ftp/ftpserver/abstracted_fs.py index 2ddfcc2bb7d..952b75d49e1 100644 --- a/addons/document_ftp/ftpserver/abstracted_fs.py +++ b/addons/document_ftp/ftpserver/abstracted_fs.py @@ -1,9 +1,8 @@ # -*- encoding: utf-8 -*- + import os import time from tarfile import filemode -import StringIO -import base64 import logging import errno @@ -12,12 +11,11 @@ import fnmatch import pooler import netsvc -import os + from service import security from osv import osv #from document.nodes import node_res_dir, node_res_obj from document.nodes import get_node_context -import stat def _get_month_name(month): month=int(month) @@ -165,7 +163,7 @@ class abstracted_fs(object): return ret except EnvironmentError: raise - except Exception,e: + except Exception: self._log.exception('Cannot create item %s at node %s', objname, repr(node)) raise OSError(1, 'Operation not permited.') @@ -177,7 +175,7 @@ class abstracted_fs(object): try: res = node.open_data(cr, mode) cr.commit() - except TypeError, e: + except TypeError: raise IOError(errno.EINVAL, "No data") return res @@ -188,12 +186,11 @@ class abstracted_fs(object): name. Unlike mkstemp it returns an object with a file-like interface. """ - raise NotImplementedError + raise NotImplementedError # TODO text = not 'b' in mode # for unique file , maintain version if duplicate file if dir: - # TODO cr = dir.cr uid = dir.uid pool = pooler.get_pool(node.context.dbname) @@ -234,7 +231,7 @@ class abstracted_fs(object): cdir = node.create_child_collection(cr, basename) self._log.debug("Created child dir: %r", cdir) cr.commit() - except Exception,e: + except Exception: self._log.exception('Cannot create dir "%s" at node %s', basename, repr(node)) raise OSError(1, 'Operation not permited.') @@ -405,7 +402,7 @@ class abstracted_fs(object): cr.commit() except EnvironmentError: raise - except Exception, err: + except Exception: self._log.exception('Cannot rename "%s" to "%s" at "%s"', src, datacr[2], datacr[1]) raise OSError(1,'Operation not permited.') diff --git a/addons/document_ftp/ftpserver/ftpserver.py b/addons/document_ftp/ftpserver/ftpserver.py index 692abc4aef4..0ca322fca12 100644 --- a/addons/document_ftp/ftpserver/ftpserver.py +++ b/addons/document_ftp/ftpserver/ftpserver.py @@ -121,15 +121,9 @@ import tempfile import warnings import random import stat +from collections import deque from tarfile import filemode -try: - import pwd - import grp -except ImportError: - pwd = grp = None - - LOG_ACTIVE = True __all__ = ['proto_cmds', 'Error', 'log', 'logline', 'logerror', 'DummyAuthorizer', @@ -192,24 +186,6 @@ proto_cmds = { } -# hack around format_exc function of traceback module to grant -# backward compatibility with python < 2.4 -if not hasattr(traceback, 'format_exc'): - try: - import cStringIO as StringIO - except ImportError: - import StringIO - - def _format_exc(): - f = StringIO.StringIO() - traceback.print_exc(file=f) - data = f.getvalue() - f.close() - return data - - traceback.format_exc = _format_exc - - def _strerror(err): """A wrap around os.strerror() which may be not available on all platforms (e.g. pythonCE). @@ -590,16 +566,6 @@ class ActiveDTP(asyncore.dispatcher): self.cmd_channel.respond("425 Can't connect to specified address.") self.close() - -try: - from collections import deque -except ImportError: - # backward compatibility with Python < 2.4 by replacing deque with a list - class deque(list): - def appendleft(self, obj): - list.insert(self, 0, obj) - - class DTPHandler(asyncore.dispatcher): """Class handling server-data-transfer-process (server-DTP, see RFC-959) managing data-transfer operations involving sending @@ -1227,21 +1193,9 @@ class AbstractedFS: if not nlinks: # non-posix system, let's use a bogus value nlinks = 1 size = st.st_size # file size - if pwd and grp: - # get user and group name, else just use the raw uid/gid - try: - uname = pwd.getpwuid(st.st_uid).pw_name - except KeyError: - uname = st.st_uid - try: - gname = grp.getgrgid(st.st_gid).gr_name - except KeyError: - gname = st.st_gid - else: - # on non-posix systems the only chance we use default - # bogus values for owner and group - uname = "owner" - gname = "group" + uname = st.st_uid or "owner" + gname = st.st_gid or "group" + # stat.st_mtime could fail (-1) if last mtime is too old # in which case we return the local time as last mtime try: @@ -1438,7 +1392,7 @@ class FTPHandler(asynchat.async_chat): """ try: asynchat.async_chat.__init__(self, conn=conn) # python2.5 - except TypeError, e: + except TypeError: asynchat.async_chat.__init__(self, sock=conn) # python2.6 self.server = server self.remote_ip, self.remote_port = self.socket.getpeername()[:2] @@ -1469,13 +1423,10 @@ class FTPHandler(asynchat.async_chat): # mlsx facts attributes self.current_facts = ['type', 'perm', 'size', 'modify'] - if os.name == 'posix': - self.current_facts.append('unique') + self.current_facts.append('unique') self.available_facts = self.current_facts[:] - if pwd and grp: - self.available_facts += ['unix.mode', 'unix.uid', 'unix.gid'] - if os.name == 'nt': - self.available_facts.append('create') + self.available_facts += ['unix.mode', 'unix.uid', 'unix.gid'] + self.available_facts.append('create') # dtp attributes self.data_server = None @@ -1866,7 +1817,7 @@ class FTPHandler(asynchat.async_chat): self.respond('%s %s.' % (str(ret_code), why)) raise FTPExceptionSent(why) - except Exception, e: + except Exception, err: cmdname = function.__name__ try: logerror(traceback.format_exc()) @@ -2003,7 +1954,7 @@ class FTPHandler(asynchat.async_chat): assert len(octs) == 4 for x in octs: assert 0 <= x <= 255 - except (AssertionError, ValueError, OverflowError), err: + except (AssertionError, ValueError, OverflowError): self.respond("501 Invalid EPRT format.") else: self._make_eport(ip, port) diff --git a/addons/document_ftp/wizard/ftp_browse.py b/addons/document_ftp/wizard/ftp_browse.py index d033302f22a..37aba5158f1 100644 --- a/addons/document_ftp/wizard/ftp_browse.py +++ b/addons/document_ftp/wizard/ftp_browse.py @@ -20,8 +20,9 @@ ############################################################################## from osv import osv, fields -from tools.translate import _ +# from tools.translate import _ from document_ftp import ftpserver + class document_ftp_browse(osv.osv_memory): _name = 'document.ftp.browse' _description = 'Document FTP Browse' @@ -35,8 +36,8 @@ class document_ftp_browse(osv.osv_memory): if 'url' in fields: user_pool = self.pool.get('res.users') current_user = user_pool.browse(cr, uid, uid, context=context) - dir_pool = self.pool.get('document.directory') - data_pool = self.pool.get('ir.model.data') + # dir_pool = self.pool.get('document.directory') + data_pool = self.pool.get('ir.model.data') aid = data_pool._get_id(cr, uid, 'document_ftp', 'action_document_browse') aid = data_pool.browse(cr, uid, aid, context=context).res_id ftp_url = self.pool.get('ir.actions.url').browse(cr, uid, aid, context=context) @@ -50,12 +51,12 @@ class document_ftp_browse(osv.osv_memory): def browse_ftp(self, cr, uid, ids, context): data_id = ids and ids[0] or False - data = self.browse(cr, uid, data_id, context) + data = self.browse(cr, uid, data_id, context) final_url = data.url return { 'type': 'ir.actions.act_url', 'url':final_url, 'target': 'new' } + document_ftp_browse() - diff --git a/addons/document_ftp/wizard/ftp_configuration.py b/addons/document_ftp/wizard/ftp_configuration.py index 40926bdf7c9..0522e0348b8 100644 --- a/addons/document_ftp/wizard/ftp_configuration.py +++ b/addons/document_ftp/wizard/ftp_configuration.py @@ -19,14 +19,8 @@ # ############################################################################## -import base64 - from osv import osv, fields -from osv.orm import except_orm from tools import config -import urlparse - -import os class document_ftp_configuration(osv.osv_memory): @@ -46,10 +40,10 @@ class document_ftp_configuration(osv.osv_memory): def execute(self, cr, uid, ids, context=None): conf = self.browse(cr, uid, ids[0], context) - dir_pool = self.pool.get('document.directory') - data_pool = self.pool.get('ir.model.data') + data_pool = self.pool.get('ir.model.data') # Update the action for FTP browse. aid = data_pool._get_id(cr, uid, 'document_ftp', 'action_document_browse') aid = data_pool.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_ftp_configuration() diff --git a/addons/document_ics/document_ics_config_wizard.py b/addons/document_ics/document_ics_config_wizard.py index ca7c9f02eb0..611c804a62c 100644 --- a/addons/document_ics/document_ics_config_wizard.py +++ b/addons/document_ics/document_ics_config_wizard.py @@ -54,25 +54,16 @@ class document_ics_crm_wizard(osv.osv_memory): _columns = { 'name':fields.char('Name', size=64), - 'meeting': fields.boolean('Calendar of Meetings', help="Manages the calendar \ - of meetings of the users."), - 'lead': fields.boolean('Leads', help="Allows you to track and manage leads \ - which are pre-sales requests or contacts, the very first contact with a customer request."), - 'opportunity': fields.boolean('Business Opportunities', help="Tracks identified \ - business opportunities for your sales pipeline."), - 'jobs': fields.boolean('Jobs Hiring Process', help="Helps you to organise the jobs\ - hiring process: evaluation, meetings, email integration..."), - 'document_ics':fields.boolean('Shared Calendar', help=" Will allow you to synchronise \ - your OpenERP calendars with your phone, outlook, Sunbird, ical, ..."), - 'bugs': fields.boolean('Bug Tracking', help="Used by companies to track bugs and \ - support requests on software"), + 'meeting': fields.boolean('Calendar of Meetings', help="Manages the calendar of meetings of the users."), + 'lead': fields.boolean('Leads', help="Allows you to track and manage leads which are pre-sales requests or contacts, the very first contact with a customer request."), + 'opportunity': fields.boolean('Business Opportunities', help="Tracks identified business opportunities for your sales pipeline."), + 'jobs': fields.boolean('Jobs Hiring Process', help="Helps you to organise the jobs hiring process: evaluation, meetings, email integration..."), + 'document_ics':fields.boolean('Shared Calendar', help=" Will allow you to synchronise your Open ERP calendars with your phone, outlook, Sunbird, ical, ..."), + 'bugs': fields.boolean('Bug Tracking', help="Used by companies to track bugs and support requests on software"), 'helpdesk': fields.boolean('Helpdesk', help="Manages an Helpdesk service."), - 'fund': fields.boolean('Fund Raising Operations', help="This may help associations in \ - their fund raising process and tracking."), - 'claims': fields.boolean('Claims', help="Manages the supplier and customers claims,\ - including your corrective or preventive actions."), - 'phonecall': fields.boolean('Phone Calls', help="Helps you to encode the result of \ - a phone call or to plan a list of phone calls to process."), + 'fund': fields.boolean('Fund Raising Operations', help="This may help associations in their fund raising process and tracking."), + 'claims': fields.boolean('Claims', help="Manages the supplier and customers claims,including your corrective or preventive actions."), + 'phonecall': fields.boolean('Phone Calls', help="Helps you to encode the result of a phone call or to plan a list of phone calls to process."), } _defaults = { 'meeting': lambda *args: True, diff --git a/addons/document_webdav/dav_fs.py b/addons/document_webdav/dav_fs.py index af8738ef0da..5d641cb39c0 100644 --- a/addons/document_webdav/dav_fs.py +++ b/addons/document_webdav/dav_fs.py @@ -129,6 +129,7 @@ class openerp_dav_handler(dav_interface): raise default_exc(err.strerror) except Exception,e: import traceback + if cr: cr.close() self.parent.log_error("Cannot %s: %s", opname, str(e)) self.parent.log_message("Exc: %s",traceback.format_exc()) raise default_exc("Operation failed") @@ -522,7 +523,6 @@ class openerp_dav_handler(dav_interface): def put(self, uri, data, content_type=None): """ put the object into the filesystem """ self.parent.log_message('Putting %s (%d), %s'%( misc.ustr(uri), data and len(data) or 0, content_type)) - parent='/'.join(uri.split('/')[:-1]) cr, uid, pool,dbname, uri2 = self.get_cr(uri) if not dbname: if cr: cr.close() @@ -535,20 +535,44 @@ class openerp_dav_handler(dav_interface): objname = uri2[-1] ext = objname.find('.') >0 and objname.split('.')[1] or False + ret = None if not node: dir_node = self.uri2object(cr, uid, pool, uri2[:-1]) if not dir_node: cr.close() raise DAV_NotFound('Parent folder not found') - self._try_function(dir_node.create_child, (cr, objname, data), + newchild = self._try_function(dir_node.create_child, (cr, objname, data), "create %s" % objname, cr=cr) + if not newchild: + cr.commit() + cr.close() + raise DAV_Error(400, "Failed to create resource") + + uparts=urlparse.urlparse(uri) + fileloc = '/'.join(newchild.full_path()) + if isinstance(fileloc, unicode): + fileloc = fileloc.encode('utf-8') + # the uri we get is a mangled one, where the davpath has been removed + davpath = self.parent.get_davpath() + + surl = '%s://%s' % (uparts[0], uparts[1]) + uloc = urllib.quote(fileloc) + hurl = False + if uri != ('/'+uloc) and uri != (surl + '/' + uloc): + hurl = '%s%s/%s/%s' %(surl, davpath, dbname, uloc) + etag = False + try: + etag = str(newchild.get_etag(cr)) + except Exception, e: + self.parent.log_error("Cannot get etag for node: %s" % e) + ret = (hurl, etag) else: self._try_function(node.set_data, (cr, data), "save %s" % objname, cr=cr) cr.commit() cr.close() - return 201 + return ret def rmcol(self,uri): """ delete a collection """ diff --git a/addons/document_webdav/webdav.py b/addons/document_webdav/webdav.py index 1fd530cbdca..10a7f9db4e6 100644 --- a/addons/document_webdav/webdav.py +++ b/addons/document_webdav/webdav.py @@ -24,8 +24,15 @@ import xml.dom.minidom domimpl = xml.dom.minidom.getDOMImplementation() import urlparse import urllib -from DAV import utils -from DAV.propfind import PROPFIND +from osv import osv + +try: + from DAV import utils + from DAV.propfind import PROPFIND +except ImportError: + raise osv.except_osv('PyWebDAV Import Error!','Please install PyWebDAV \ +from http://code.google.com/p/pywebdav/downloads/detail?name=PyWebDAV-0.9.4.tar.gz&can=2&q=/') + import tools diff --git a/addons/document_webdav/webdav_server.py b/addons/document_webdav/webdav_server.py index 34c255a2b3e..8a83e25456d 100644 --- a/addons/document_webdav/webdav_server.py +++ b/addons/document_webdav/webdav_server.py @@ -214,14 +214,21 @@ class DAVHandler(HttpOptions, FixSendError, DAVRequestHandler): return self.send_status(ec) headers = {} + etag = None + if location and isinstance(location, tuple): + etag = location[1] + location = location[0] + # note that we have allowed for > 2 elems if location: headers['Location'] = location - - try: - etag = dc.get_prop(location or uri, "DAV:", "getetag") - headers['ETag'] = etag - except: - pass + else: + try: + if not etag: + etag = dc.get_prop(location or uri, "DAV:", "getetag") + if etag: + headers['ETag'] = str(etag) + except Exception: + pass self.send_body(None, '201', 'Created', '', headers=headers) diff --git a/addons/email_template/email_template_account_view.xml b/addons/email_template/email_template_account_view.xml index 6ef2d04e57f..d164645aca7 100644 --- a/addons/email_template/email_template_account_view.xml +++ b/addons/email_template/email_template_account_view.xml @@ -2,8 +2,8 @@ - - + + @@ -96,8 +96,8 @@ - + diff --git a/addons/event/__openerp__.py b/addons/event/__openerp__.py index 0d8bd245db1..fdf64388a19 100644 --- a/addons/event/__openerp__.py +++ b/addons/event/__openerp__.py @@ -24,7 +24,7 @@ 'name': 'Event', 'version': '0.1', 'category': 'Generic Modules/Association', - 'description': """Organization and management of events. + 'description': """Oraganization and management of Event. This module allow you * to manage your events and their registrations diff --git a/addons/hr/__init__.py b/addons/hr/__init__.py index b2396739116..769e894f1bb 100644 --- a/addons/hr/__init__.py +++ b/addons/hr/__init__.py @@ -26,5 +26,4 @@ import installer import report import wizard -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr/__openerp__.py b/addons/hr/__openerp__.py index ef54e39bc14..70c91fbe362 100755 --- a/addons/hr/__openerp__.py +++ b/addons/hr/__openerp__.py @@ -19,7 +19,6 @@ # ############################################################################## - { "name": "Human Resources", "version": "1.1", @@ -34,7 +33,7 @@ """, 'author': 'OpenERP SA', 'website': 'http://www.openerp.com', - 'depends': ['base', 'process', 'resource','board'], + 'depends': ['resource', 'board'], 'init_xml': [], 'update_xml': [ 'security/hr_security.xml', @@ -55,4 +54,4 @@ 'active': False, 'certificate': '0086710558965', } -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr/hr.py b/addons/hr/hr.py index fcd6d57148d..0ec2ddb3eae 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -129,7 +129,7 @@ class hr_employee(osv.osv): 'parent_id': fields.related('department_id', 'manager_id', relation='hr.employee', string='Manager', type='many2one', store=True, select=True), 'category_ids': fields.many2many('hr.employee.category', 'employee_category_rel','category_id','emp_id','Category'), 'child_ids': fields.one2many('hr.employee', 'parent_id', 'Subordinates'), - 'resource_id': fields.many2one('resource.resource', 'Resource', ondelete='cascade'), + 'resource_id': fields.many2one('resource.resource', 'Resource', ondelete='cascade', required=True), 'coach_id': fields.many2one('hr.employee', 'Coach'), 'job_id': fields.many2one('hr.job', 'Job'), 'photo': fields.binary('Photo') diff --git a/addons/hr/hr_department.py b/addons/hr/hr_department.py index 0bc0b56d42d..fb9dcb4966b 100644 --- a/addons/hr/hr_department.py +++ b/addons/hr/hr_department.py @@ -19,7 +19,7 @@ # ############################################################################## -from osv import fields,osv +from osv import fields, osv import tools class hr_department(osv.osv): diff --git a/addons/hr/i18n/pl.po b/addons/hr/i18n/pl.po index c69626cc2a7..590f5f3f1ac 100644 --- a/addons/hr/i18n/pl.po +++ b/addons/hr/i18n/pl.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-07 09:39+0000\n" +"PO-Revision-Date: 2010-08-12 05:47+0000\n" "Last-Translator: OpenERP Administrators \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-08-12 04:03+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: hr diff --git a/addons/hr/i18n/tr.po b/addons/hr/i18n/tr.po index 1bec0496291..7a82cd7d70b 100644 --- a/addons/hr/i18n/tr.po +++ b/addons/hr/i18n/tr.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 05:46+0000\n" +"PO-Revision-Date: 2010-08-12 05:30+0000\n" "Last-Translator: adsiz_1029@hotmail.com \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-08-12 04:03+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: hr diff --git a/addons/hr_attendance/__openerp__.py b/addons/hr_attendance/__openerp__.py index 383f1dfa8b1..68eb3c20258 100644 --- a/addons/hr_attendance/__openerp__.py +++ b/addons/hr_attendance/__openerp__.py @@ -30,10 +30,10 @@ actions(Sign in/Sign out) performed by them. """, 'author': 'OpenERP SA', - 'depends': ['base', 'hr'], + 'depends': ['hr'], 'update_xml': [ 'security/hr_security.xml', - 'security/ir.model.access.csv', + 'security/ir.model.access.csv', 'hr_attendance_view.xml', 'hr_attendance_wizard.xml', 'hr_attendance_report.xml', diff --git a/addons/hr_attendance/hr_attendance.py b/addons/hr_attendance/hr_attendance.py index 938df72d4e9..842fe409d12 100644 --- a/addons/hr_attendance/hr_attendance.py +++ b/addons/hr_attendance/hr_attendance.py @@ -34,6 +34,7 @@ class hr_action_reason(osv.osv): _defaults = { 'action_type': 'sign_in', } + hr_action_reason() def _employee_get(obj, cr, uid, context=None): @@ -59,7 +60,7 @@ class hr_attendance(osv.osv): _columns = { 'name': fields.datetime('Date', required=True, select=1), 'action': fields.selection([('sign_in', 'Sign In'), ('sign_out', 'Sign Out'), ('action','Action')], 'Action', required=True), - 'action_desc': fields.many2one("hr.action.reason", "Action reason", domain="[('action_type', '=', action)]", help='Specifies the reason for Signing In/Signing Out in case of extra hours.'), + 'action_desc': fields.many2one("hr.action.reason", "Action Reason", domain="[('action_type', '=', action)]", help='Specifies the reason for Signing In/Signing Out in case of extra hours.'), 'employee_id': fields.many2one('hr.employee', "Employee's Name", required=True, select=True), 'day': fields.function(_day_compute, method=True, type='char', string='Day', store=True, select=1, size=32), } @@ -86,6 +87,7 @@ class hr_attendance(osv.osv): _constraints = [(_altern_si_so, 'Error: Sign in (resp. Sign out) must follow Sign out (resp. Sign in)', ['action'])] _order = 'name desc' + hr_attendance() class hr_employee(osv.osv): @@ -144,16 +146,14 @@ class hr_employee(osv.osv): raise osv.except_osv(_('Warning'), _('You tried to %s with a date anterior to another event !\nTry to contact the administrator to correct attendances.')%(warning_sign,)) res = {'action': type, 'employee_id': emp['id']} - if dt: res['name'] = dt id = obj_attendance.create(cr, uid, res, context=context) if type != 'action': return id - return True hr_employee() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_attendance/wizard/hr_attendance_bymonth.py b/addons/hr_attendance/wizard/hr_attendance_bymonth.py index f66e7892601..8c41fefcaa6 100644 --- a/addons/hr_attendance/wizard/hr_attendance_bymonth.py +++ b/addons/hr_attendance/wizard/hr_attendance_bymonth.py @@ -29,11 +29,11 @@ class hr_attendance_bymonth(osv.osv_memory): _columns = { 'month': fields.selection([(1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December')], 'Month', required=True), 'year': fields.integer('Year', required=True) - } + } _defaults = { 'month': time.gmtime()[1], 'year': time.gmtime()[0], - } + } def print_report(self, cr, uid, ids, context=None): if context is None: @@ -42,13 +42,13 @@ class hr_attendance_bymonth(osv.osv_memory): 'ids': [], 'model': 'hr.employee', 'form': self.read(cr, uid, ids)[0] - } + } return { 'type': 'ir.actions.report.xml', 'report_name': 'hr.attendance.bymonth', 'datas': datas, - } + } hr_attendance_bymonth() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_attendance/wizard/hr_attendance_byweek.py b/addons/hr_attendance/wizard/hr_attendance_byweek.py index 175ebf8a228..e2b071de66a 100644 --- a/addons/hr_attendance/wizard/hr_attendance_byweek.py +++ b/addons/hr_attendance/wizard/hr_attendance_byweek.py @@ -28,11 +28,11 @@ class hr_attendance_byweek(osv.osv_memory): _columns = { 'init_date': fields.date('Starting Date', required=True), 'end_date': fields.date('Ending Date', required=True) - } + } _defaults = { 'init_date': time.strftime('%Y-%m-%d'), 'end_date': time.strftime('%Y-%m-%d'), - } + } def print_report(self, cr, uid, ids, context=None): if context is None: @@ -41,12 +41,12 @@ class hr_attendance_byweek(osv.osv_memory): 'ids': [], 'model': 'hr.employee', 'form': self.read(cr, uid, ids)[0] - } + } return { 'type': 'ir.actions.report.xml', 'report_name': 'hr.attendance.allweeks', 'datas': datas, - } + } hr_attendance_byweek() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_attendance/wizard/hr_attendance_error.py b/addons/hr_attendance/wizard/hr_attendance_error.py index 449fc4ca5c2..24109b11496 100644 --- a/addons/hr_attendance/wizard/hr_attendance_error.py +++ b/addons/hr_attendance/wizard/hr_attendance_error.py @@ -31,12 +31,12 @@ class hr_attendance_error(osv.osv_memory): 'init_date': fields.date('Starting Date', required=True), 'end_date': fields.date('Ending Date', required=True), 'max_delay': fields.integer('Max. Delay (Min)', required=True) - } + } _defaults = { 'init_date': time.strftime('%Y-%m-%d'), 'end_date': time.strftime('%Y-%m-%d'), 'max_delay': 120, - } + } def print_report(self, cr, uid, ids, context=None): if context is None: @@ -59,13 +59,13 @@ class hr_attendance_error(osv.osv_memory): 'ids': [], 'model': 'hr.employee', 'form': data_error - } + } return { 'type': 'ir.actions.report.xml', 'report_name': 'hr.attendance.error', 'datas': datas, - } + } hr_attendance_error() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_attendance/wizard/hr_attendance_sign_in_out.py b/addons/hr_attendance/wizard/hr_attendance_sign_in_out.py index 635c25940e1..09f9f9364c5 100644 --- a/addons/hr_attendance/wizard/hr_attendance_sign_in_out.py +++ b/addons/hr_attendance/wizard/hr_attendance_sign_in_out.py @@ -192,4 +192,4 @@ class hr_sign_in_out(osv.osv_memory): hr_sign_in_out() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py index 21ca0423c9a..b4743a7ffdc 100644 --- a/addons/hr_evaluation/hr_evaluation.py +++ b/addons/hr_evaluation/hr_evaluation.py @@ -286,7 +286,7 @@ class hr_evaluation_interview(osv.osv): _inherits = {'survey.request': 'request_id'} _description = 'Evaluation Interview' _columns = { - 'request_id': fields.many2one('survey.request','Request_id', ondelete='cascade'), + 'request_id': fields.many2one('survey.request','Request_id', ondelete='cascade', required=True), 'user_to_review_id': fields.many2one('hr.employee', 'Employee to Interview'), 'evaluation_id': fields.many2one('hr_evaluation.evaluation', 'Evaluation Type'), } diff --git a/addons/hr_expense/i18n/pt_BR.po b/addons/hr_expense/i18n/pt_BR.po index 7d83ac03342..e9bfecc90c8 100644 --- a/addons/hr_expense/i18n/pt_BR.po +++ b/addons/hr_expense/i18n/pt_BR.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 05:42+0000\n" +"PO-Revision-Date: 2010-08-12 05:43+0000\n" "Last-Translator: Fabien (Open ERP) \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-08-12 04:01+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: hr_expense diff --git a/addons/hr_holidays/i18n/zh_CN.po b/addons/hr_holidays/i18n/zh_CN.po index 15d14f0f3e4..9584b076841 100644 --- a/addons/hr_holidays/i18n/zh_CN.po +++ b/addons/hr_holidays/i18n/zh_CN.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 05:42+0000\n" +"PO-Revision-Date: 2010-08-12 05:42+0000\n" "Last-Translator: Black Jack \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-08-12 04:02+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: hr_holidays diff --git a/addons/hr_timesheet/hr_timesheet.py b/addons/hr_timesheet/hr_timesheet.py index ec6fbc2d1fc..e1abfe275bd 100644 --- a/addons/hr_timesheet/hr_timesheet.py +++ b/addons/hr_timesheet/hr_timesheet.py @@ -43,7 +43,7 @@ class hr_analytic_timesheet(osv.osv): _inherits = {'account.analytic.line': 'line_id'} _order = "id desc" _columns = { - 'line_id' : fields.many2one('account.analytic.line', 'Analytic line', ondelete='cascade'), + 'line_id' : fields.many2one('account.analytic.line', 'Analytic line', ondelete='cascade', required=True), 'partner_id': fields.related('account_id', 'partner_id', type='many2one', string='Partner Id', relation='account.analytic.account', store=True), } @@ -160,4 +160,4 @@ class hr_analytic_timesheet(osv.osv): }} hr_analytic_timesheet() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_timesheet_invoice/i18n/tr.po b/addons/hr_timesheet_invoice/i18n/tr.po index 2d68d94969d..4b5dba45fb3 100644 --- a/addons/hr_timesheet_invoice/i18n/tr.po +++ b/addons/hr_timesheet_invoice/i18n/tr.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 04:42+0000\n" +"PO-Revision-Date: 2010-08-12 06:09+0000\n" "Last-Translator: Fabien (Open ERP) \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-08-12 03:59+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: hr_timesheet_invoice diff --git a/addons/hr_timesheet_sheet/i18n/lt.po b/addons/hr_timesheet_sheet/i18n/lt.po index d6ed693227a..43d7a908968 100644 --- a/addons/hr_timesheet_sheet/i18n/lt.po +++ b/addons/hr_timesheet_sheet/i18n/lt.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 05:14+0000\n" +"PO-Revision-Date: 2010-08-12 05:43+0000\n" "Last-Translator: OpenERP Administrators \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-08-12 03:59+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: hr_timesheet_sheet diff --git a/addons/idea/__openerp__.py b/addons/idea/__openerp__.py index 28ab76e8d5e..b376f35b0c2 100644 --- a/addons/idea/__openerp__.py +++ b/addons/idea/__openerp__.py @@ -36,12 +36,13 @@ 'depends': ['base'], 'init_xml': [], 'update_xml': [ + 'security/idea_security.xml', + 'security/ir.model.access.csv', 'wizard/idea_post_vote_view.xml', 'idea_view.xml', 'idea_workflow.xml', 'report/report_vote_view.xml', - 'security/idea_security.xml', - 'security/ir.model.access.csv', + ], 'demo_xml': [ "idea_data.xml" diff --git a/addons/idea/idea_view.xml b/addons/idea/idea_view.xml index 1020e2d03c1..97f48e5b6f6 100644 --- a/addons/idea/idea_view.xml +++ b/addons/idea/idea_view.xml @@ -383,7 +383,7 @@ + id="menu_idea_vote_stat" action="action_idea_vote_stat" groups="base.group_tool_manager,base.group_tool_user,base.group_system"/> diff --git a/addons/idea/report/report_vote_view.xml b/addons/idea/report/report_vote_view.xml index b78c8c0648c..bdd3ce133c1 100644 --- a/addons/idea/report/report_vote_view.xml +++ b/addons/idea/report/report_vote_view.xml @@ -84,7 +84,7 @@ {'search_default_User':1,'group_by_no_leaf':1,'group_by':[]} - + diff --git a/addons/idea/security/idea_security.xml b/addons/idea/security/idea_security.xml index 29afc0c875f..2bdad417c2f 100644 --- a/addons/idea/security/idea_security.xml +++ b/addons/idea/security/idea_security.xml @@ -13,10 +13,10 @@ Sales / User - + Tools / Manager - + Tools / User diff --git a/addons/idea/security/ir.model.access.csv b/addons/idea/security/ir.model.access.csv index cd6f56cf60e..dae5127cc90 100644 --- a/addons/idea/security/ir.model.access.csv +++ b/addons/idea/security/ir.model.access.csv @@ -9,14 +9,17 @@ "access_report_vote","report.vote","model_report_vote","base.group_user",1,1,1,1 "access_idea_idea_sale_salesman","idea.idea.sale","model_idea_idea","base.group_sale_salesman",1,1,1,1 "access_idea_vote_sale_salesman","idea.vote.sale","model_idea_vote","base.group_sale_salesman",1,1,1,1 -"access_idea_category_user","idea.category user","model_idea_category","base.group_survey_user",1,1,1,1 -"access_idea_idea_user","idea.idea user","model_idea_idea","base.group_survey_user",1,1,1,1 -"access_idea_vote_user","idea.vote user","model_idea_vote","base.group_survey_user",1,1,1,1 -"access_idea_category_manager","idea.category manager","model_idea_category","base.group_survey_manager",1,0,0,0 -"access_idea_idea_manager","idea.idea manager","model_idea_idea","base.group_survey_manager",1,0,0,0 -"access_idea_vote_manager","idea.vote manager","model_idea_vote","base.group_survey_manager",1,0,0,0 -"access_idea_vote_stat_user","idea.vote.stat user","model_idea_vote_stat","base.group_survey_user",1,1,1,1 -"access_idea_comment_user","idea.comment user","model_idea_comment","base.group_survey_user",1,1,1,1 -"access_report_vote_manager","report.vote manager","model_report_vote","base.group_survey_manager",1,1,1,1 +"access_idea_category_user","idea.category user","model_idea_category","base.group_tool_user",1,1,1,1 +"access_idea_idea_user","idea.idea user","model_idea_idea","base.group_tool_user",1,1,1,1 +"access_idea_vote_user","idea.vote user","model_idea_vote","base.group_tool_user",1,1,1,1 +"access_idea_category_manager","idea.category manager","model_idea_category","base.group_tool_manager",1,0,0,0 +"access_idea_idea_manager","idea.idea manager","model_idea_idea","base.group_tool_manager",1,0,0,0 +"access_idea_vote_manager","idea.vote manager","model_idea_vote","base.group_tool_manager",1,0,0,0 +"access_idea_vote_stat_user","idea.vote.stat user","model_idea_vote_stat","base.group_tool_user",1,1,1,1 +"access_idea_comment_user","idea.comment user","model_idea_comment","base.group_tool_user",1,1,1,1 +"access_report_vote_manager","report.vote manager","model_report_vote","base.group_tool_manager",1,1,1,1 "access_idea_idea_system","idea.idea system","model_idea_idea","base.group_system",1,0,0,0 "access_idea_vote_system","idea.vote system","model_idea_vote","base.group_system",1,0,0,0 +"access_report_vote_system","report.vote system","model_report_vote","base.group_system",1,0,0,0 +"access_idea_vote_stat_manager","idea.vote.stat manager","model_idea_vote_stat","base.group_tool_manager",1,1,1,1 +"access_idea_vote_stat_system","idea.vote.stat system","model_idea_vote_stat","base.group_system",1,1,1,1 diff --git a/addons/lunch/security/ir.model.access.csv b/addons/lunch/security/ir.model.access.csv index 5d5ab895aa0..e27fba4530f 100644 --- a/addons/lunch/security/ir.model.access.csv +++ b/addons/lunch/security/ir.model.access.csv @@ -6,14 +6,16 @@ "access_lunch_order","lunch.order","model_lunch_order","base.group_user",1,1,1,1 "access_report_lunch_amount","report.lunch.amount","model_report_lunch_amount","base.group_user",1,1,1,1 "access_lunch_order_sale_salesman","lunch.order.sale","model_lunch_order","base.group_sale_salesman",1,1,1,1 -"access_lunch_order_user","lunch.order user","model_lunch_order","base.group_survey_user",1,1,1,1 -"access_lunch_order_manager","lunch.order manager","model_lunch_order","base.group_survey_manager",1,0,0,0 -"access_lunch_cashmove_user","lunch.cashmove user","model_lunch_cashmove","base.group_survey_user",1,1,1,1 -"access_lunch_cashmove_manager","lunch.cashmove manager","model_lunch_cashmove","base.group_survey_manager",1,0,0,0 -"access_report_lunch_amount_manager","report.lunch.amount manager","model_report_lunch_amount","base.group_survey_manager",1,1,1,1 +"access_lunch_order_user","lunch.order user","model_lunch_order","base.group_tool_user",1,1,1,1 +"access_lunch_order_manager","lunch.order manager","model_lunch_order","base.group_tool_manager",1,0,0,0 +"access_lunch_cashmove_user","lunch.cashmove user","model_lunch_cashmove","base.group_tool_user",1,1,1,1 +"access_lunch_cashmove_manager","lunch.cashmove manager","model_lunch_cashmove","base.group_tool_manager",1,0,0,0 +"access_report_lunch_amount_manager","report.lunch.amount manager","model_report_lunch_amount","base.group_tool_manager",1,1,1,1 "access_lunch_category_system","lunch.category system","model_lunch_category","base.group_system",1,1,1,1 "access_lunch_product_system","lunch.product system","model_lunch_product","base.group_system",1,1,1,1 "access_lunch_cashbox_system","lunch.cashbox system","model_lunch_cashbox","base.group_system",1,1,1,1 "access_lunch_order_system","lunch.order system","model_lunch_order","base.group_system",1,0,0,0 "access_lunch_cashmove_system","lunch.cashmove system","model_lunch_cashmove","base.group_system",1,0,0,0 -"access_report_lunch_order_manager","report.lunch.order manager","model_report_lunch_order","base.group_survey_manager",1,1,1,1 +"access_report_lunch_order_manager","report.lunch.order manager","model_report_lunch_order","base.group_tool_manager",1,1,1,1 +"access_lunch_product_user","lunch.product user","model_lunch_product","base.group_tool_user",1,1,1,1 +"access_lunch_cashbox_user","lunch.cashbox user","model_lunch_cashbox","base.group_tool_user",1,1,1,1 diff --git a/addons/lunch/security/lunch_security.xml b/addons/lunch/security/lunch_security.xml index c87ace64801..6c3559fa138 100644 --- a/addons/lunch/security/lunch_security.xml +++ b/addons/lunch/security/lunch_security.xml @@ -5,10 +5,10 @@ Sales / User - + Tools / Manager - + Tools / User diff --git a/addons/mail_gateway/mail_gateway.py b/addons/mail_gateway/mail_gateway.py index c2e1da843ca..6bae5c3e64d 100644 --- a/addons/mail_gateway/mail_gateway.py +++ b/addons/mail_gateway/mail_gateway.py @@ -44,6 +44,28 @@ class mailgate_thread(osv.osv): 'message_ids': fields.one2many('mailgate.message', 'res_id', 'Messages', readonly=True), } + def copy(self, cr, uid, id, default=None, context=None): + """ + Overrides orm copy method. + @param self: the object pointer + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param id: Id of mailgate thread + @param default: Dictionary of default values for copy. + @param context: A standard dictionary for contextual values + """ + if context is None: + context = {} + if default is None: + default = {} + + default.update({ + 'message_ids': [], + 'date_closed': False, + 'date_open': False + }) + return super(mailgate_thread, self).copy(cr, uid, id, default, context=context) + def message_new(self, cr, uid, msg, context): raise Exception, _('Method is not implemented') @@ -83,7 +105,7 @@ class mailgate_thread(osv.osv): @param email_cc: Comma-Separated list of Carbon Copy Emails To addresse if any @param email_bcc: Comma-Separated list of Blind Carbon Copy Emails To addresses if any @param email_date: Email Date string if different from now, in server Timezone - @param details: Description, Ddtails of case history if any + @param details: Description, Details of case history if any @param atach: Attachment sent in email @param context: A standard dictionary for contextual values""" if context is None: diff --git a/addons/marketing_campaign/security/ir.model.access.csv b/addons/marketing_campaign/security/ir.model.access.csv index 903ca7ac72a..ae5cad3d706 100644 --- a/addons/marketing_campaign/security/ir.model.access.csv +++ b/addons/marketing_campaign/security/ir.model.access.csv @@ -8,3 +8,6 @@ "access_marketing_campaign_workitem_all","marketing.campaign.workitem","model_marketing_campaign_workitem","base.group_user",1,0,0,0 "access_email_template_user","email.template","model_email_template","base.res_groups_email_template_admin",1,1,1,1 "access_email_template_account_user","email_template.account.user","email_template.model_email_template_account","base.res_groups_email_template_admin",1,1,1,1 +"access_marketing_campaign_system","marketing.campaign system","model_marketing_campaign","base.group_system",1,0,0,0 +"access_marketing_campaign_segment_system","marketing.campaign.segment system","model_marketing_campaign_segment","base.group_system",1,0,0,0 +"access_marketing_campaign_workitem_system","marketing.campaign.workitem system","model_marketing_campaign_workitem","base.group_system",1,0,0,0 diff --git a/addons/marketing_campaign_crm_demo/marketing_campaign_demo.xml b/addons/marketing_campaign_crm_demo/marketing_campaign_demo.xml index 6b78a82c977..88b12552d60 100644 --- a/addons/marketing_campaign_crm_demo/marketing_campaign_demo.xml +++ b/addons/marketing_campaign_crm_demo/marketing_campaign_demo.xml @@ -41,13 +41,13 @@ - Hello,Thanks for generous interest you have shown in the open ERP.Regards,OpenERP Team, + Hello,Thanks for generous interest you have shown in the openERP.Regards,OpenERP Team, mako For OpenERP OnDemand Free Trial 2010 crm.lead - Propose to subscribe to the Open ERP Discovery Day on May 2010 + Propose to subscribe to the OpenERP Discovery Day on May 2010 info@tinyerp.com @@ -55,46 +55,46 @@ Hello,We have very good offer that might suit you. - We propose you to subscribe to the Open ERP Discovery Day on May 2010. + We propose you to subscribe to the OpenERP Discovery Day on May 2010. If any further information required kindly revert back. We really appreciate your co-operation on this. Regards,OpenERP Team, mako - For Open ERP Discovery Day on May 2010 + For OpenERP Discovery Day on May 2010 crm.lead - Thanks for subscribing to the Open ERP Discovery Day + Thanks for subscribing to the OpenERP Discovery Day info@tinyerp.com - Hello,Thanks for showing intrest and for subscribing to the Open ERP Discovery Day. + Hello,Thanks for showing intrest and for subscribing to the OpenERP Discovery Day. If any further information required kindly revert back. I really appreciate your co-operation on this. Regards,OpenERP Team, mako - For Open ERP Discovery Day + For OpenERP Discovery Day crm.lead - Thanks for buying the Open ERP book + Thanks for buying the OpenERP book info@tinyerp.com - Hello,Thanks for showing intrest and buying the Open ERP book. + Hello,Thanks for showing intrest and buying the OpenERP book. If any further information required kindly revert back. I really appreciate your co-operation on this. Regards,OpenERP Team, mako - For Open ERP book + For OpenERP book crm.lead @@ -203,20 +203,20 @@ - Propose to subscribe to the Open ERP Discovery Day on May 2010 + Propose to subscribe to the OpenERP Discovery Day on May 2010 - Thanks for subscribing to the Open ERP Discovery Day + Thanks for subscribing to the OpenERP Discovery Day - Propose to buy the Open ERP Book + Propose to buy the OpenERP Book @@ -225,7 +225,7 @@ - Thanks for buying the Open ERP book + Thanks for buying the OpenERP book diff --git a/addons/mrp/i18n/sv.po b/addons/mrp/i18n/sv.po index dd1b71fc766..da62ad620b2 100644 --- a/addons/mrp/i18n/sv.po +++ b/addons/mrp/i18n/sv.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-03 08:27+0000\n" -"Last-Translator: mga (Open ERP) \n" +"PO-Revision-Date: 2010-08-12 08:01+0000\n" +"Last-Translator: Anders Eriksson (Mobila System) \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-08-12 03:44+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: mrp @@ -47,13 +47,13 @@ msgstr "Felaktigt namn för modell i händelsedefinitionen." #. module: mrp #: field:mrp.bom.revision,indice:0 msgid "Revision" -msgstr "" +msgstr "Revision" #. module: mrp #: model:ir.actions.wizard,name:mrp.wiz_mrp_proc2 #: model:ir.ui.menu,name:mrp.menu_wiz_mrp_proc2 msgid "Compute Stock Minimum Rules Only" -msgstr "" +msgstr "Beräkna minsta lagersaldo regler" #. module: mrp #: model:ir.actions.act_window,name:mrp.mrp_procurement_action5 @@ -80,7 +80,7 @@ msgstr "" #. module: mrp #: field:mrp.production,picking_id:0 msgid "Packing list" -msgstr "" +msgstr "Packlista" #. module: mrp #: model:process.node,name:mrp.process_node_stock0 @@ -97,7 +97,7 @@ msgstr "Ursprung" #: model:ir.ui.menu,name:mrp.menu_mrp_configuration #: view:res.company:0 msgid "Configuration" -msgstr "Konfiguration" +msgstr "Inställningar" #. module: mrp #: field:mrp.production,name:0 @@ -144,7 +144,7 @@ msgstr "" #. module: mrp #: view:mrp.procurement:0 msgid "Product & Location" -msgstr "" +msgstr "Produkt och lagerplats" #. module: mrp #: view:res.company:0 @@ -166,7 +166,7 @@ msgstr "Be om nya produkter" #. module: mrp #: model:ir.ui.menu,name:mrp.menu_mrp_reordering msgid "Automatic Procurements" -msgstr "" +msgstr "Automatiska anskaffningar" #. module: mrp #: wizard_field:change_production_qty,confirm,product_qty:0 @@ -174,7 +174,7 @@ msgstr "" #: field:mrp.production,product_qty:0 #: field:mrp.production.product.line,product_qty:0 msgid "Product Qty" -msgstr "Produktkvantitet" +msgstr "Produkt antal" #. module: mrp #: field:mrp.production,move_lines:0 @@ -209,12 +209,12 @@ msgstr "" #. module: mrp #: view:mrp.workcenter:0 msgid "Analytic Accounting" -msgstr "" +msgstr "Objektsredovisning" #. module: mrp #: model:process.node,note:mrp.process_node_servicemts0 msgid "Do nothing" -msgstr "Gör inget" +msgstr "Gör ingenting" #. module: mrp #: rml:mrp.production.order:0 @@ -229,7 +229,7 @@ msgstr "" #. module: mrp #: selection:mrp.workcenter.load,init,measure_unit:0 msgid "Amount in hours" -msgstr "" +msgstr "Antal i timmar" #. module: mrp #: field:mrp.production,product_lines:0 @@ -254,7 +254,7 @@ msgstr "" #. module: mrp #: field:mrp.bom,position:0 msgid "Internal Ref." -msgstr "" +msgstr "Intern ref." #. module: mrp #: view:mrp.procurement:0 @@ -301,7 +301,7 @@ msgstr "" #: model:ir.ui.menu,name:mrp.menu_mrp_production_action #: view:mrp.production:0 msgid "Production Orders" -msgstr "" +msgstr "Tillverkningsorder" #. module: mrp #: rml:bom.structure:0 @@ -309,7 +309,7 @@ msgstr "" #: rml:mrp.production.order:0 #: wizard_field:product.product.procurement,init,qty:0 msgid "Quantity" -msgstr "Kvantitet" +msgstr "Antal" #. module: mrp #: selection:mrp.procurement,priority:0 @@ -351,7 +351,7 @@ msgstr "Detaljer" #. module: mrp #: model:process.process,name:mrp.process_process_procurementprocess0 msgid "Procurement Process" -msgstr "" +msgstr "Anskaffningsprocess" #. module: mrp #: field:mrp.production,date_planned_date:0 @@ -373,7 +373,7 @@ msgstr "" #. module: mrp #: rml:mrp.production.order:0 msgid "Bill Of Material" -msgstr "" +msgstr "Materiallista" #. module: mrp #: help:mrp.routing,location_id:0 @@ -391,7 +391,7 @@ msgstr "Reservation" #. module: mrp #: model:ir.actions.act_window,name:mrp.action2 msgid "Bill of Materials Structure" -msgstr "" +msgstr "Materialstruktur" #. module: mrp #: wizard_field:product.product.procurement,init,product_id:0 @@ -490,12 +490,12 @@ msgstr "" #. module: mrp #: field:mrp.procurement,message:0 msgid "Latest error" -msgstr "" +msgstr "Senaste fel" #. module: mrp #: field:mrp.bom,bom_lines:0 msgid "BoM Lines" -msgstr "" +msgstr "Materialliste rader" #. module: mrp #: field:mrp.workcenter,time_start:0 @@ -515,7 +515,7 @@ msgstr "" #. module: mrp #: constraint:mrp.bom:0 msgid "Error ! You can not create recursive BoM." -msgstr "" +msgstr "Fel! Du kan inte använda rekursiva materiallistor" #. module: mrp #: model:process.transition,note:mrp.process_transition_stockmts0 @@ -526,7 +526,7 @@ msgstr "" #. module: mrp #: field:res.company,manufacturing_lead:0 msgid "Manufacturity Lead Time" -msgstr "" +msgstr "Tillverkningsledtid" #. module: mrp #: model:ir.actions.act_window,name:mrp.mrp_procurement_action4 @@ -537,7 +537,7 @@ msgstr "" #. module: mrp #: selection:mrp.procurement,state:0 msgid "Ready" -msgstr "Redo" +msgstr "Klar" #. module: mrp #: view:mrp.routing:0 @@ -656,23 +656,23 @@ msgstr "" #. module: mrp #: field:stock.warehouse.orderpoint,product_min_qty:0 msgid "Min Quantity" -msgstr "" +msgstr "Minsta antal" #. module: mrp #: view:mrp.production:0 msgid "Production orders" -msgstr "" +msgstr "Tillverkningsorder" #. module: mrp #: field:mrp.bom,child_complete_ids:0 #: field:mrp.bom,child_ids:0 msgid "BoM Hyerarchy" -msgstr "" +msgstr "Strukturhierarki" #. module: mrp #: view:mrp.procurement:0 msgid "Procurement Lines" -msgstr "" +msgstr "Anskaffningsrader" #. module: mrp #: model:process.transition,note:mrp.process_transition_servicemts0 @@ -709,7 +709,7 @@ msgstr "Ändring" #. module: mrp #: field:mrp.bom,type:0 msgid "BoM Type" -msgstr "" +msgstr "Strukturtyp" #. module: mrp #: selection:mrp.procurement,state:0 @@ -747,7 +747,7 @@ msgstr "" #. module: mrp #: view:mrp.production:0 msgid "Production done" -msgstr "" +msgstr "Produktion avslutad" #. module: mrp #: rml:bom.structure:0 @@ -772,7 +772,7 @@ msgstr "" #. module: mrp #: field:mrp.bom,bom_id:0 msgid "Parent BoM" -msgstr "" +msgstr "Överliggande struktur" #. module: mrp #: view:mrp.procurement:0 diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index d2079df4503..0e69dd3b4e8 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -53,7 +53,7 @@ class mrp_workcenter(osv.osv): help="Complete this only if you want automatic analytic accounting entries on production orders."), 'costs_journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal'), 'costs_general_account_id': fields.many2one('account.account', 'General Account', domain=[('type','<>','view')]), - 'resource_id': fields.many2one('resource.resource','Resource',ondelete='cascade'), + 'resource_id': fields.many2one('resource.resource','Resource', ondelete='cascade', required=True), } _defaults = { 'capacity_per_cycle': 1.0, diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index b145de3b352..cc62bfb5aa3 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -769,7 +769,7 @@ {'search_default_Current':1} - Manufacturing Orders describe the operations that need to be carried out and the raw materials usage for each stage of production. You use specifications (bills of materials) to work out the raw material requirements and the manufacturing orders needed for the finished products. Once the bills of materials have been defined, Open ERP becomes capable of automatically deciding on the manufacturing route depending on the needs of the company. + Manufacturing Orders describe the operations that need to be carried out and the raw materials usage for each stage of production. You use specifications (bills of materials) to work out the raw material requirements and the manufacturing orders needed for the finished products. Once the bills of materials have been defined, OpenERP becomes capable of automatically deciding on the manufacturing route depending on the needs of the company. @@ -780,7 +780,7 @@ form gantt,tree,form,calendar,graph [('state','in',('ready','confirmed','in_production'))] - Manufacturing Orders describe the operations that need to be carried out and the raw materials usage for each stage of production. You use specifications (bills of materials or BoM) to work out the raw material requirements and the manufacturing orders needed for the finished products. Once the bills of materials have been defined, Open ERP becomes capable of automatically deciding on the manufacturing route depending on the needs of the company. + Manufacturing Orders describe the operations that need to be carried out and the raw materials usage for each stage of production. You use specifications (bills of materials or BoM) to work out the raw material requirements and the manufacturing orders needed for the finished products. Once the bills of materials have been defined, OpenERP becomes capable of automatically deciding on the manufacturing route depending on the needs of the company. diff --git a/addons/mrp_jit/i18n/sv.po b/addons/mrp_jit/i18n/sv.po index 569310776bb..e7116de9ef5 100644 --- a/addons/mrp_jit/i18n/sv.po +++ b/addons/mrp_jit/i18n/sv.po @@ -7,16 +7,16 @@ 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: 2009-04-10 14:08+0000\n" -"Last-Translator: <>\n" +"PO-Revision-Date: 2010-08-12 07:10+0000\n" +"Last-Translator: Anders Eriksson (Mobila System) \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-08-12 04:07+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: mrp_jit #: model:ir.module.module,shortdesc:mrp_jit.module_meta_information msgid "MRP JIT" -msgstr "" +msgstr "MRP JIT" diff --git a/addons/mrp_repair/i18n/pt_BR.po b/addons/mrp_repair/i18n/pt_BR.po index 09a63128099..385f5b88df4 100644 --- a/addons/mrp_repair/i18n/pt_BR.po +++ b/addons/mrp_repair/i18n/pt_BR.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-03 08:06+0000\n" -"Last-Translator: mga (Open ERP) \n" +"PO-Revision-Date: 2010-08-12 14:06+0000\n" +"Last-Translator: Guilherme Santos \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-08-12 04:06+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: mrp_repair @@ -25,7 +25,7 @@ msgstr "" #: field:mrp.repair.fee,repair_id:0 #: field:mrp.repair.line,repair_id:0 msgid "Repair Order Ref" -msgstr "" +msgstr "Referência da Ordem" #. module: mrp_repair #: field:mrp.repair.line,move_id:0 @@ -45,12 +45,12 @@ msgstr "Valor sem impostos" #. module: mrp_repair #: field:mrp.repair,state:0 msgid "Repair State" -msgstr "" +msgstr "Estado do Reparo" #. module: mrp_repair #: rml:repair.order:0 msgid "Printing Date" -msgstr "" +msgstr "Data de impressão" #. module: mrp_repair #: field:mrp.repair.fee,product_uom_qty:0 @@ -61,7 +61,7 @@ msgstr "Quantidade" #. module: mrp_repair #: view:mrp.repair:0 msgid "Set to Draft" -msgstr "" +msgstr "Definir como Rascunho" #. module: mrp_repair #: selection:mrp.repair,state:0 @@ -71,40 +71,40 @@ msgstr "" #. module: mrp_repair #: field:mrp.repair,address_id:0 msgid "Delivery Address" -msgstr "" +msgstr "Endereço de Entrega" #. module: mrp_repair #: view:mrp.repair:0 msgid "Make Invoice" -msgstr "" +msgstr "Faturar" #. module: mrp_repair #: field:mrp.repair.fee,price_subtotal:0 #: field:mrp.repair.line,price_subtotal:0 msgid "Subtotal" -msgstr "Sub-total" +msgstr "Subtotal" #. module: mrp_repair #: rml:repair.order:0 msgid "Invoice address :" -msgstr "Endereço de faturamento" +msgstr "Endereço de Faturamento :" #. module: mrp_repair #: field:mrp.repair,guarantee_limit:0 msgid "Guarantee limit" -msgstr "" +msgstr "Limite de garantia" #. module: mrp_repair #: field:mrp.repair,amount_tax:0 #: field:mrp.repair.fee,tax_id:0 #: field:mrp.repair.line,tax_id:0 msgid "Taxes" -msgstr "" +msgstr "Impostos" #. module: mrp_repair #: rml:repair.order:0 msgid "Net Total :" -msgstr "" +msgstr "Total Líquido" #. module: mrp_repair #: rml:repair.order:0 @@ -114,27 +114,27 @@ msgstr "" #. module: mrp_repair #: view:mrp.repair:0 msgid "Operations" -msgstr "" +msgstr "Operações" #. module: mrp_repair #: field:mrp.repair,move_id:0 msgid "Move" -msgstr "" +msgstr "Movimento" #. module: mrp_repair #: model:ir.actions.act_window,name:mrp_repair.action_repair_order_tree msgid "Repair Orders" -msgstr "Ordens de Serviços" +msgstr "Ordens de Reparo" #. module: mrp_repair #: model:ir.actions.report.xml,name:mrp_repair.report_mrp_repair msgid "Quotation / Order" -msgstr "" +msgstr "Cotação / Ordem" #. module: mrp_repair #: view:mrp.repair:0 msgid "Extra Info" -msgstr "" +msgstr "Info. Extra" #. module: mrp_repair #: field:mrp.repair,partner_id:0 @@ -145,39 +145,39 @@ msgstr "Parceiro" #: model:ir.actions.act_window,name:mrp_repair.action_repair_quotation_tree #: model:ir.ui.menu,name:mrp_repair.menu_repair_quotation msgid "Repairs in quotation" -msgstr "Ordens de Serviços em Orçamento" +msgstr "Reparos em cotação" #. module: mrp_repair #: selection:mrp.repair,state:0 #: selection:mrp.repair.line,state:0 msgid "Confirmed" -msgstr "" +msgstr "Confirmado" #. module: mrp_repair #: view:mrp.repair:0 msgid "Recreate Invoice" -msgstr "" +msgstr "Recriar Fatura" #. module: mrp_repair #: view:mrp.repair:0 msgid "Repairs order" -msgstr "" +msgstr "Ordens de Reparo" #. module: mrp_repair #: rml:repair.order:0 msgid "Repair Order N° :" -msgstr "" +msgstr "Ordem de Reparo N° :" #. module: mrp_repair #: field:mrp.repair,prodlot_id:0 #: rml:repair.order:0 msgid "Lot Number" -msgstr "Numero do Lote" +msgstr "Número do Lote" #. module: mrp_repair #: selection:mrp.repair,state:0 msgid "Under Repair" -msgstr "" +msgstr "Em Reparo" #. module: mrp_repair #: field:mrp.repair,fees_lines:0 @@ -197,33 +197,33 @@ msgstr "" #. module: mrp_repair #: selection:mrp.repair,state:0 msgid "To be Invoiced" -msgstr "" +msgstr "Para ser Faturado" #. module: mrp_repair #: rml:repair.order:0 msgid "Shipping address :" -msgstr "" +msgstr "Endereço de Entrega :" #. module: mrp_repair #: view:mrp.repair:0 msgid "Start Repair" -msgstr "" +msgstr "Iniciar Reparo" #. module: mrp_repair #: field:mrp.repair.line,product_uom_qty:0 msgid "Quantity (UoM)" -msgstr "" +msgstr "Quantidade (UdM)" #. module: mrp_repair #: field:mrp.repair.fee,to_invoice:0 #: field:mrp.repair.line,to_invoice:0 msgid "To Invoice" -msgstr "" +msgstr "Faturar" #. module: mrp_repair #: model:ir.ui.menu,name:mrp_repair.menu_repair_order msgid "Repairs" -msgstr "" +msgstr "Reparos" #. module: mrp_repair #: field:mrp.repair,picking_id:0 @@ -238,29 +238,29 @@ msgstr "Total :" #. module: mrp_repair #: field:mrp.repair,pricelist_id:0 msgid "Pricelist" -msgstr "" +msgstr "Lista de Preços" #. module: mrp_repair #: help:mrp.repair,state:0 msgid "Gives the state of the Repair Order" -msgstr "" +msgstr "Dá o estado da Ordem de Reparo" #. module: mrp_repair #: view:mrp.repair:0 #: field:mrp.repair,quotation_notes:0 msgid "Quotation Notes" -msgstr "" +msgstr "Observações da Cotação" #. module: mrp_repair #: model:ir.actions.act_window,name:mrp_repair.action_repair_progress_tree #: model:ir.ui.menu,name:mrp_repair.menu_repair_progress msgid "Repairs in progress" -msgstr "" +msgstr "Reparo em andamento" #. module: mrp_repair #: constraint:ir.ui.view:0 msgid "Invalid XML for View Architecture!" -msgstr "XML inválido para Arquitetura da View" +msgstr "Invalid XML for View Architecture!" #. module: mrp_repair #: help:mrp.repair,guarantee_limit:0 @@ -274,7 +274,7 @@ msgstr "" #. module: mrp_repair #: view:mrp.repair:0 msgid "Repair Line" -msgstr "" +msgstr "Linha do Reparo" #. module: mrp_repair #: rml:repair.order:0 @@ -284,12 +284,12 @@ msgstr "N° :" #. module: mrp_repair #: field:mrp.repair,invoice_method:0 msgid "Invoice Method" -msgstr "" +msgstr "Método de Faturamento" #. module: mrp_repair #: field:mrp.repair,repaired:0 msgid "Repaired" -msgstr "Consertado" +msgstr "Reparado" #. module: mrp_repair #: wizard_field:mrp.repair.make_invoice,init,group:0 @@ -300,101 +300,100 @@ msgstr "" #: field:mrp.repair.fee,invoice_line_id:0 #: field:mrp.repair.line,invoice_line_id:0 msgid "Invoice Line" -msgstr "" +msgstr "Linha da Fatura" #. module: mrp_repair #: view:mrp.repair:0 msgid "Total amount" -msgstr "" +msgstr "Valor total" #. module: mrp_repair #: selection:mrp.repair.line,state:0 msgid "Canceled" -msgstr "" +msgstr "Cancelado" #. module: mrp_repair #: selection:mrp.repair,invoice_method:0 msgid "Before Repair" -msgstr "" +msgstr "Antes de ser Reparado" #. module: mrp_repair #: field:mrp.repair,location_id:0 msgid "Current Location" -msgstr "" +msgstr "Local Atual" #. module: mrp_repair #: wizard_button:mrp.repair.cancel,display,yes:0 msgid "Yes" -msgstr "" +msgstr "Sim" #. module: mrp_repair #: field:mrp.repair,invoiced:0 #: field:mrp.repair.fee,invoiced:0 #: field:mrp.repair.line,invoiced:0 msgid "Invoiced" -msgstr "" +msgstr "Faturado" #. module: mrp_repair #: wizard_button:mrp.repair.cancel,display,end:0 msgid "No" -msgstr "" +msgstr "Não" #. module: mrp_repair #: wizard_view:mrp.repair.make_invoice,init:0 #: wizard_button:mrp.repair.make_invoice,init,invoice:0 msgid "Create invoices" -msgstr "" +msgstr "Criar faturas" #. module: mrp_repair #: selection:mrp.repair.line,type:0 #: rml:repair.order:0 msgid "Add" -msgstr "" +msgstr "Adicionar" #. module: mrp_repair #: selection:mrp.repair.line,state:0 msgid "Draft" -msgstr "" +msgstr "Rascunho" #. module: mrp_repair #: model:ir.actions.act_window,name:mrp_repair.action_repair_order_form #: model:ir.ui.menu,name:mrp_repair.menu_repair_form msgid "New Repair" -msgstr "" +msgstr "Novo Reparo" #. module: mrp_repair #: constraint:ir.model:0 msgid "" "The Object name must start with x_ and not contain any special character !" msgstr "" -"O nome do objeto precisa iniciar com x_ e não conter nenhum caracter " -"especial!" +"The Object name must start with x_ and not contain any special character !" #. module: mrp_repair #: field:mrp.repair,amount_untaxed:0 msgid "Untaxed Amount" -msgstr "" +msgstr "Valor sem Impostos" #. module: mrp_repair #: field:mrp.repair.line,state:0 msgid "Status" -msgstr "" +msgstr "Situação" #. module: mrp_repair #: rml:repair.order:0 msgid "Guarantee Limit" -msgstr "" +msgstr "Limite de Garantia" #. module: mrp_repair #: field:mrp.repair,product_id:0 #: rml:repair.order:0 msgid "Product to Repair" -msgstr "" +msgstr "Produto para Reparar" #. module: mrp_repair #: help:mrp.repair,pricelist_id:0 msgid "The pricelist comes from the selected partner, by default." -msgstr "" +msgstr "A tabela de preços vem do parceiro selecionado, por padrão." #. module: mrp_repair #: wizard_view:mrp.repair.cancel,display:0 @@ -402,69 +401,71 @@ msgid "" "This operation will cancel the Repair process, but will not cancel it's " "Invoice. Do you want to continue?" msgstr "" +"Esta operação irá cancelar o processo de reparação, mas não irá cancelar " +"a(s) fatura(s). Você deseja continuar?" #. module: mrp_repair #: selection:mrp.repair,state:0 msgid "Quotation" -msgstr "" +msgstr "Cotação" #. module: mrp_repair #: view:mrp.repair:0 msgid "Compute" -msgstr "" +msgstr "Calcular" #. module: mrp_repair #: view:mrp.repair:0 msgid "Confirm Repair" -msgstr "" +msgstr "Confirmar Reparo" #. module: mrp_repair #: rml:repair.order:0 msgid "Repair Quotation" -msgstr "" +msgstr "Cotação do Reparo" #. module: mrp_repair #: view:mrp.repair:0 msgid "End Repair" -msgstr "" +msgstr "Finalizar Reparo" #. module: mrp_repair #: view:mrp.repair:0 msgid "History" -msgstr "" +msgstr "Histórico" #. module: mrp_repair #: model:ir.model,name:mrp_repair.model_mrp_repair msgid "Repairs Order" -msgstr "" +msgstr "Ordens de Reparo" #. module: mrp_repair #: model:ir.actions.act_window,name:mrp_repair.action_repair_ready_tree #: model:ir.ui.menu,name:mrp_repair.menu_repair_ready msgid "Repairs Ready to Start" -msgstr "" +msgstr "Reparo Pronto para Iniciar" #. module: mrp_repair #: view:mrp.repair:0 msgid "Qty" -msgstr "" +msgstr "Qtd" #. module: mrp_repair #: selection:mrp.repair,state:0 #: selection:mrp.repair.line,state:0 msgid "Done" -msgstr "" +msgstr "Concluído" #. module: mrp_repair #: model:ir.actions.act_window,name:mrp_repair.action_repair_2binvoiced_tree #: model:ir.ui.menu,name:mrp_repair.menu_repair_2binvoiced msgid "Repairs to be invoiced" -msgstr "" +msgstr "Reparos a serem faturados" #. module: mrp_repair #: field:mrp.repair,invoice_id:0 msgid "Invoice" -msgstr "" +msgstr "Nota Fiscal" #. module: mrp_repair #: view:mrp.repair:0 @@ -475,32 +476,32 @@ msgstr "" #: selection:mrp.repair,state:0 #: wizard_button:mrp.repair.make_invoice,init,end:0 msgid "Cancel" -msgstr "" +msgstr "Cancelado" #. module: mrp_repair #: field:mrp.repair.line,location_dest_id:0 msgid "Dest. Location" -msgstr "" +msgstr "Local de Destino" #. module: mrp_repair #: rml:repair.order:0 msgid "Operation Line(s)" -msgstr "" +msgstr "Linhas de Operação(s)" #. module: mrp_repair #: model:ir.model,name:mrp_repair.model_mrp_repair_line msgid "Repair Operations Lines" -msgstr "" +msgstr "Linhas de Operações do Reparo" #. module: mrp_repair #: field:mrp.repair,location_dest_id:0 msgid "Delivery Location" -msgstr "" +msgstr "Local de Entrega" #. module: mrp_repair #: model:ir.module.module,shortdesc:mrp_repair.module_meta_information msgid "Products Repairs Module" -msgstr "" +msgstr "Módulo de Reparos de Produtos" #. module: mrp_repair #: help:mrp.repair,invoice_method:0 @@ -509,41 +510,44 @@ msgid "" "selected is different from 'No Invoice', it also allow you to select the " "pricelist and invoicing address." msgstr "" +"Este campo permite que você mude o fluxo de trabalho(Workflow) da Ordem de " +"Reparo. Se o valor selecionado for diferente de 'Não Faturar', você poderá " +"selecionar a Lista de Preços e o endereço de Faturamento." #. module: mrp_repair #: field:mrp.repair.fee,price_unit:0 #: field:mrp.repair.line,price_unit:0 #: rml:repair.order:0 msgid "Unit Price" -msgstr "" +msgstr "Preço Unitário" #. module: mrp_repair #: wizard_view:mrp.repair.make_invoice,init:0 msgid "Do you really want to create the invoices ?" -msgstr "" +msgstr "Você realmente deseja criar as faturas ?" #. module: mrp_repair #: field:mrp.repair.fee,name:0 #: field:mrp.repair.line,name:0 #: rml:repair.order:0 msgid "Description" -msgstr "" +msgstr "Descrição" #. module: mrp_repair #: field:mrp.repair,operations:0 msgid "Operation Lines" -msgstr "" +msgstr "Linhas de Operação" #. module: mrp_repair #: field:mrp.repair.fee,product_id:0 #: field:mrp.repair.line,product_id:0 msgid "Product" -msgstr "" +msgstr "Produto" #. module: mrp_repair #: view:mrp.repair:0 msgid "Invoice Corrected" -msgstr "" +msgstr "Fatura Corrigida" #. module: mrp_repair #: help:mrp.repair,deliver_bool:0 @@ -553,118 +557,125 @@ msgid "" "that you can select the locations in the Info tab, if you have the extended " "view." msgstr "" +"Marque esta caixa se você deseja gerenciar a entrega uma vez que o produto " +"seja reparado. Se marcado, será criado uma embalagem com o produto " +"selecionado. Observe que você pode selecionar os locais na aba de " +"Informações, se você tiver a interface configurada para 'Visão " +"ampliada(Extended view)'." #. module: mrp_repair #: field:mrp.repair.line,type:0 msgid "Type" -msgstr "" +msgstr "Tipo" #. module: mrp_repair #: rml:repair.order:0 msgid "Price" -msgstr "" +msgstr "Preço" #. module: mrp_repair #: field:mrp.repair,deliver_bool:0 msgid "Deliver" -msgstr "" +msgstr "Entregar" #. module: mrp_repair #: view:mrp.repair:0 #: field:mrp.repair,internal_notes:0 msgid "Internal Notes" -msgstr "" +msgstr "Notas Internas" #. module: mrp_repair #: rml:repair.order:0 msgid "Taxes:" -msgstr "" +msgstr "Impostos:" #. module: mrp_repair #: model:ir.actions.wizard,name:mrp_repair.wizard_mrp_repair_make_invoice msgid "Make invoices" -msgstr "" +msgstr "Faça faturas" #. module: mrp_repair #: field:mrp.repair,name:0 msgid "Repair Ref" -msgstr "" +msgstr "Ref do Reparo" #. module: mrp_repair #: view:mrp.repair:0 msgid "UoM" -msgstr "" +msgstr "UdM" #. module: mrp_repair #: selection:mrp.repair.line,type:0 #: rml:repair.order:0 msgid "Remove" -msgstr "" +msgstr "Remover" #. module: mrp_repair #: wizard_view:mrp.repair.cancel,display:0 msgid "Cancel Repair...??" -msgstr "" +msgstr "Cancelar Reparo...??" #. module: mrp_repair #: field:mrp.repair.fee,product_uom:0 #: field:mrp.repair.line,product_uom:0 msgid "Product UoM" -msgstr "" +msgstr "UdM do Produto" #. module: mrp_repair #: field:mrp.repair,partner_invoice_id:0 msgid "Invoicing Address" -msgstr "" +msgstr "Endereço de Faturamento" #. module: mrp_repair #: selection:mrp.repair,invoice_method:0 msgid "After Repair" -msgstr "" +msgstr "Depois de ser Reparado" #. module: mrp_repair #: view:mrp.repair:0 msgid "Invoicing" -msgstr "" +msgstr "Faturamento" #. module: mrp_repair #: field:mrp.repair.line,location_id:0 msgid "Source Location" -msgstr "" +msgstr "Local de Origem" #. module: mrp_repair #: view:mrp.repair:0 msgid "Quality" -msgstr "" +msgstr "Qualidade" #. module: mrp_repair #: model:ir.actions.wizard,name:mrp_repair.action_cancel_repair #: view:mrp.repair:0 msgid "Cancel Repair" -msgstr "" +msgstr "Cancelar Reparo" #. module: mrp_repair #: selection:mrp.repair,invoice_method:0 msgid "No Invoice" -msgstr "" +msgstr "Não Faturar" #. module: mrp_repair #: view:mrp.repair:0 msgid "States" -msgstr "" +msgstr "Status" #. module: mrp_repair #: help:mrp.repair,partner_id:0 msgid "" "This field allow you to choose the parner that will be invoiced and delivered" msgstr "" +"Este campo permite que você escolha o Parceiro para qual será Faturado e " +"Entregue" #. module: mrp_repair #: field:mrp.repair,amount_total:0 msgid "Total" -msgstr "" +msgstr "Total" #. module: mrp_repair #: selection:mrp.repair,state:0 msgid "Ready to Repair" -msgstr "" +msgstr "Pronto para Reparar" diff --git a/addons/mrp_repair/i18n/tr.po b/addons/mrp_repair/i18n/tr.po index 33c51ec8c36..c3eba255e32 100644 --- a/addons/mrp_repair/i18n/tr.po +++ b/addons/mrp_repair/i18n/tr.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 04:57+0000\n" +"PO-Revision-Date: 2010-08-12 06:10+0000\n" "Last-Translator: Fabien (Open ERP) \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-08-12 04:06+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: mrp_repair diff --git a/addons/olap_crm/olap_crm.xml b/addons/olap_crm/olap_crm.xml index 619e133e609..a430db8fc67 100644 --- a/addons/olap_crm/olap_crm.xml +++ b/addons/olap_crm/olap_crm.xml @@ -7,7 +7,7 @@ CUSTOM CUBE FOR CRM --> - Open ERP CRM Database + OpenERP CRM Database crm postgres postgres diff --git a/addons/outlook/README b/addons/outlook/README new file mode 100644 index 00000000000..404f2121c6a --- /dev/null +++ b/addons/outlook/README @@ -0,0 +1,31 @@ +OpenERP Outlook PLUG-IN Installation Guide + +Pre requirements : +====================================================================================== +1.Python 2.6+ . python can be downloaded from http://www.python.org/download/releases/ . +2.Python for Windows extensions - PyWin32 this module for python must be installed for appropriate version of the Python. It can be downloaded from http://sourceforge.net/projects/pywin32/files/ or http://starship.python.net/crew/mhammond/win32/ + +How to install openerp-outlook plug-in? +====================================================================================== +1.Open your Python installation directory (e.g.: C:\Python26). +2.Create folder named “openerp-outlook-plugin”. +3.Extract your zip file “outlook-plugin.zip” to the folder. +4.Open the folder outlook-plugin. +5.And Run “Register-plugin.bat” file. +6.Run Outlook and Check addin has been registered. +7.Tools->OpenERP Configuration and test your connection. +8.See User Guide for More. + +How to uninstall openerp-outlook plug-in? +===================================================================================== +1.Open the folder outlook-plugin. +2.And Run “Unregister-plugin.bat” file. + +Note : Plug In has been successfully tested with MS Office 2003 and MS Offcie 2007. + + +Enjoy Archiving your Outlook E-mails to OpenERP. + + + + diff --git a/addons/outlook/plugin/Register-plugin.bat b/addons/outlook/plugin/openerp-outlook-plugin/Register-plugin.bat similarity index 100% rename from addons/outlook/plugin/Register-plugin.bat rename to addons/outlook/plugin/openerp-outlook-plugin/Register-plugin.bat diff --git a/addons/outlook/plugin/Unregister-plugin.bat b/addons/outlook/plugin/openerp-outlook-plugin/Unregister-plugin.bat similarity index 100% rename from addons/outlook/plugin/Unregister-plugin.bat rename to addons/outlook/plugin/openerp-outlook-plugin/Unregister-plugin.bat diff --git a/addons/outlook/plugin/addin.py b/addons/outlook/plugin/openerp-outlook-plugin/addin.py similarity index 100% rename from addons/outlook/plugin/addin.py rename to addons/outlook/plugin/openerp-outlook-plugin/addin.py diff --git a/addons/outlook/plugin/chilkat.py b/addons/outlook/plugin/openerp-outlook-plugin/chilkat.py similarity index 100% rename from addons/outlook/plugin/chilkat.py rename to addons/outlook/plugin/openerp-outlook-plugin/chilkat.py diff --git a/addons/outlook/plugin/dialogs/__init__.py b/addons/outlook/plugin/openerp-outlook-plugin/dialogs/__init__.py similarity index 100% rename from addons/outlook/plugin/dialogs/__init__.py rename to addons/outlook/plugin/openerp-outlook-plugin/dialogs/__init__.py diff --git a/addons/outlook/plugin/dialogs/dialog_map.py b/addons/outlook/plugin/openerp-outlook-plugin/dialogs/dialog_map.py similarity index 100% rename from addons/outlook/plugin/dialogs/dialog_map.py rename to addons/outlook/plugin/openerp-outlook-plugin/dialogs/dialog_map.py diff --git a/addons/outlook/plugin/dialogs/dlgcore.py b/addons/outlook/plugin/openerp-outlook-plugin/dialogs/dlgcore.py similarity index 100% rename from addons/outlook/plugin/dialogs/dlgcore.py rename to addons/outlook/plugin/openerp-outlook-plugin/dialogs/dlgcore.py diff --git a/addons/outlook/plugin/dialogs/dlgutils.py b/addons/outlook/plugin/openerp-outlook-plugin/dialogs/dlgutils.py similarity index 100% rename from addons/outlook/plugin/dialogs/dlgutils.py rename to addons/outlook/plugin/openerp-outlook-plugin/dialogs/dlgutils.py diff --git a/addons/outlook/plugin/dialogs/opt_processors.py b/addons/outlook/plugin/openerp-outlook-plugin/dialogs/opt_processors.py similarity index 100% rename from addons/outlook/plugin/dialogs/opt_processors.py rename to addons/outlook/plugin/openerp-outlook-plugin/dialogs/opt_processors.py diff --git a/addons/outlook/plugin/dialogs/processors.py b/addons/outlook/plugin/openerp-outlook-plugin/dialogs/processors.py similarity index 100% rename from addons/outlook/plugin/dialogs/processors.py rename to addons/outlook/plugin/openerp-outlook-plugin/dialogs/processors.py diff --git a/addons/outlook/plugin/dialogs/resources/OpenERP_Logo.bmp b/addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/OpenERP_Logo.bmp similarity index 100% rename from addons/outlook/plugin/dialogs/resources/OpenERP_Logo.bmp rename to addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/OpenERP_Logo.bmp diff --git a/addons/outlook/plugin/dialogs/resources/__init__.py b/addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/__init__.py similarity index 100% rename from addons/outlook/plugin/dialogs/resources/__init__.py rename to addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/__init__.py diff --git a/addons/outlook/plugin/dialogs/resources/dialogs.h b/addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/dialogs.h similarity index 100% rename from addons/outlook/plugin/dialogs/resources/dialogs.h rename to addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/dialogs.h diff --git a/addons/outlook/plugin/dialogs/resources/dialogs.py b/addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/dialogs.py similarity index 100% rename from addons/outlook/plugin/dialogs/resources/dialogs.py rename to addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/dialogs.py diff --git a/addons/outlook/plugin/dialogs/resources/dialogs.rc b/addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/dialogs.rc similarity index 100% rename from addons/outlook/plugin/dialogs/resources/dialogs.rc rename to addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/dialogs.rc diff --git a/addons/outlook/plugin/dialogs/resources/openerp_logo.png b/addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/openerp_logo.png similarity index 100% rename from addons/outlook/plugin/dialogs/resources/openerp_logo.png rename to addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/openerp_logo.png diff --git a/addons/outlook/plugin/dialogs/resources/openerp_logo1.bmp b/addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/openerp_logo1.bmp similarity index 100% rename from addons/outlook/plugin/dialogs/resources/openerp_logo1.bmp rename to addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/openerp_logo1.bmp diff --git a/addons/outlook/plugin/dialogs/resources/rc2py.py b/addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/rc2py.py similarity index 100% rename from addons/outlook/plugin/dialogs/resources/rc2py.py rename to addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/rc2py.py diff --git a/addons/outlook/plugin/dialogs/resources/rcparser.py b/addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/rcparser.py similarity index 100% rename from addons/outlook/plugin/dialogs/resources/rcparser.py rename to addons/outlook/plugin/openerp-outlook-plugin/dialogs/resources/rcparser.py diff --git a/addons/outlook/plugin/eml.py b/addons/outlook/plugin/openerp-outlook-plugin/eml.py similarity index 100% rename from addons/outlook/plugin/eml.py rename to addons/outlook/plugin/openerp-outlook-plugin/eml.py diff --git a/addons/outlook/plugin/manager.py b/addons/outlook/plugin/openerp-outlook-plugin/manager.py similarity index 100% rename from addons/outlook/plugin/manager.py rename to addons/outlook/plugin/openerp-outlook-plugin/manager.py diff --git a/addons/outlook/plugin/tiny_xmlrpc.py b/addons/outlook/plugin/openerp-outlook-plugin/tiny_xmlrpc.py similarity index 100% rename from addons/outlook/plugin/tiny_xmlrpc.py rename to addons/outlook/plugin/openerp-outlook-plugin/tiny_xmlrpc.py diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py index 39d3a294bc7..09865f668a9 100644 --- a/addons/point_of_sale/pos.py +++ b/addons/point_of_sale/pos.py @@ -291,7 +291,7 @@ class pos_order(osv.osv): 'sale_manager': fields.many2one('res.users', 'Salesman Manager'), 'amount_tax': fields.function(_amount_all, method=True, string='Taxes', digits_compute=dp.get_precision('Point Of Sale'), multi='all'), 'amount_total': fields.function(_amount_total, method=True, string='Total'), - 'amount_paid': fields.function(_amount_all, 'Paid', states={'draft': [('readonly', False)]}, readonly=True, method=True, digits_compute=dp.get_precision('Point Of Sale'), multi='all'), + 'amount_paid': fields.function(_amount_all, string='Paid', states={'draft': [('readonly', False)]}, readonly=True, method=True, digits_compute=dp.get_precision('Point Of Sale'), multi='all'), 'amount_return': fields.function(_amount_all, 'Returned', method=True, digits_compute=dp.get_precision('Point Of Sale'), multi='all'), 'lines': fields.one2many('pos.order.line', 'order_id', 'Order Lines', states={'draft': [('readonly', False)]}, readonly=True), 'price_type': fields.selection([ diff --git a/addons/point_of_sale/pos_view.xml b/addons/point_of_sale/pos_view.xml index a4b81a471b1..945eba6d2bd 100644 --- a/addons/point_of_sale/pos_view.xml +++ b/addons/point_of_sale/pos_view.xml @@ -202,7 +202,7 @@ form tree,form - [('state','!=', 'invoiced')] + [('state','not in', ('invoiced','done')),('invoice_id','=',False)] {"search_default_user_id":uid} diff --git a/addons/point_of_sale/report/pos_payment_report_date.py b/addons/point_of_sale/report/pos_payment_report_date.py index c17ac694fae..1bf23cd6d9b 100644 --- a/addons/point_of_sale/report/pos_payment_report_date.py +++ b/addons/point_of_sale/report/pos_payment_report_date.py @@ -55,7 +55,7 @@ class pos_payment_report_date(report_sxw.rml_parse): "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \ "and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s and po.user_id IN %s " \ ,(dt1,dt2,tuple(form['user_id']))) - res=self.cr.fetchone()[0] + res=self.cr.fetchone()[0] or 0.0 return res diff --git a/addons/point_of_sale/statement_view.xml b/addons/point_of_sale/statement_view.xml index 9598efbbaf3..ba23cad7ead 100644 --- a/addons/point_of_sale/statement_view.xml +++ b/addons/point_of_sale/statement_view.xml @@ -22,15 +22,16 @@ - + - + />--> Cash Register diff --git a/addons/point_of_sale/wizard/pos_payment.xml b/addons/point_of_sale/wizard/pos_payment.xml index ad71d177357..910cf2df0b3 100644 --- a/addons/point_of_sale/wizard/pos_payment.xml +++ b/addons/point_of_sale/wizard/pos_payment.xml @@ -12,7 +12,7 @@ form - + @@ -20,7 +20,7 @@ - + diff --git a/addons/process/i18n/tr.po b/addons/process/i18n/tr.po index b8b479486f2..ee3674bac01 100644 --- a/addons/process/i18n/tr.po +++ b/addons/process/i18n/tr.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 05:14+0000\n" +"PO-Revision-Date: 2010-08-12 05:43+0000\n" "Last-Translator: Fabien (Open ERP) \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-08-12 03:50+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: process diff --git a/addons/procurement/procurement_view.xml b/addons/procurement/procurement_view.xml index 11c1287152c..a8afe304ece 100644 --- a/addons/procurement/procurement_view.xml +++ b/addons/procurement/procurement_view.xml @@ -140,7 +140,7 @@ form tree,form [('state','=','exception')] - For each customer order line or raw materials in a manufacturing order, there is a procurement form . In normal system use, procurement orders are automatically generated by Open ERP. But if there are configuration problems, the system can remain blocked by a procurement without generating a corresponding document. It is a procurement exception. Some problems are link to timing and will be correct automatically by the system. If there is no procurement rule, the exception must be corrected manually. + For each customer order line or raw materials in a manufacturing order, there is a procurement form . In normal system use, procurement orders are automatically generated by OpenERP. But if there are configuration problems, the system can remain blocked by a procurement without generating a corresponding document. It is a procurement exception. Some problems are link to timing and will be correct automatically by the system. If there is no procurement rule, the exception must be corrected manually. diff --git a/addons/product/i18n/mn.po b/addons/product/i18n/mn.po index ff35582b85b..cb49b312fe5 100644 --- a/addons/product/i18n/mn.po +++ b/addons/product/i18n/mn.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 14:31+0000\n" +"PO-Revision-Date: 2010-08-13 04:40+0000\n" "Last-Translator: ub121 \n" "Language-Team: Mongolian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-08-12 03:56+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: product @@ -44,7 +44,7 @@ msgstr "Үйлчилгээ" msgid "" "Determine if the product is visible in the list of products within a " "selection from a purchase order line." -msgstr "" +msgstr "Худалдан авах захиалгын жагсаалтад энэ бараа харагдах эсэхий заана." #. module: product #: help:product.supplierinfo,name:0 @@ -67,6 +67,8 @@ msgid "" "The minimal quantity to purchase for this supplier, expressed in the default " "unit of measure." msgstr "" +"Энэ нийлүүлэгчээс худалдан авалт хийх хамгийн бага хэмжээ, үндсэн хэмжих " +"нэгжээр илэрхийлэгдсэн." #. module: product #: field:product.template,weight_net:0 @@ -79,6 +81,8 @@ msgid "" "Quantities of products that are planned to arrive in selected locations or " "all internal if none have been selected." msgstr "" +"Сонгосон эсвэл бүх дотоод байрлал (сонголт байхгүй бол) дээр ирэхээр " +"төлөвлөгдсөн барааны тоо ширхэг." #. module: product #: help:product.product,virtual_available:0 @@ -87,6 +91,9 @@ msgid "" "internal if none have been selected. Computed as: Real Stock - Outgoing + " "Incoming." msgstr "" +"Сонгосон эсвэл бүх дотоод байрлал (сонголт байхгүй бол) дээрх энэ барааны " +"ирээдүйн үлдэгдэл. Ирээдүйн үлдэгдэл = Бодид үлдэгдэл - Гарч байгаа + Ирж " +"байгаа." #. module: product #: field:product.packaging,width:0 @@ -99,26 +106,28 @@ msgid "" "Set a template if this rule only apply to a template of product. Keep empty " "for all products" msgstr "" +"Хэрэв энэ дүрэм зөвхөн барааны загварт үйлчлэх бол уг загварыг сонгоно. Бүх " +"бараанд хамаатай бол хоосон орхино." #. module: product #: field:product.template,procure_method:0 msgid "Procure Method" -msgstr "" +msgstr "Нийлүүлэх арга" #. module: product #: constraint:ir.actions.act_window:0 msgid "Invalid model name in the action definition." -msgstr "" +msgstr "Үйлдлийн тодорхойлолтод буруу моделийн нэр байна." #. module: product #: model:process.process,name:product.process_process_productprocess0 msgid "Product Process" -msgstr "" +msgstr "Бараа боловсруулах" #. module: product #: help:product.price.type,field:0 msgid "Associated field in the product form." -msgstr "" +msgstr "Барааны дэлгэц дээр харгалзах талбар." #. module: product #: selection:product.template,cost_method:0 @@ -133,7 +142,7 @@ msgstr "Пакетын өндөр" #. module: product #: view:product.pricelist:0 msgid "Products Price List" -msgstr "" +msgstr "Барааны үнийн жагсаалт" #. module: product #: model:product.category,name:product.cat1 @@ -143,12 +152,12 @@ msgstr "Зарж болох" #. module: product #: model:product.template,name:product.product_product_26_product_template msgid "Kit Keyboard + Mouse" -msgstr "" +msgstr "Kit гар + Хулгана" #. module: product #: field:product.price.type,name:0 msgid "Price Name" -msgstr "" +msgstr "Үнийн нэр" #. module: product #: field:product.product,price:0 @@ -168,7 +177,7 @@ msgstr "Түрээслэж болох" #. module: product #: field:product.product,lst_price:0 msgid "List Price" -msgstr "" +msgstr "Нэрлэсэн үнэ" #. module: product #: model:ir.actions.act_window,name:product.product_price_type_action @@ -192,6 +201,7 @@ msgid "" "Base price for computing the customer price. Sometimes called the catalog " "price." msgstr "" +"Хэрэглэгчийн үнийг гаргах суурь үнэ. Заримдаа каталоги үнэ гэж нэрлэгддэг." #. module: product #: field:pricelist.partnerinfo,min_quantity:0 @@ -201,27 +211,27 @@ msgstr "Тоо ширхэг" #. module: product #: model:product.template,name:product.product_product_cpu3_product_template msgid "Processor AMD Athlon XP 2200+" -msgstr "" +msgstr "Processor AMD Athlon XP 2200+" #. module: product #: help:product.price.type,name:0 msgid "Name of this kind of price." -msgstr "" +msgstr "Энэ төрлийн үнийн нэр" #. module: product #: help:product.pricelist.version,date_start:0 msgid "Starting date for this pricelist version to be valid." -msgstr "" +msgstr "Үнийн хувилбар хэрэгжиж эхлэх огноо." #. module: product #: field:product.product,incoming_qty:0 msgid "Incoming" -msgstr "" +msgstr "Ирж байгаа" #. module: product #: selection:product.template,procure_method:0 msgid "Make to Stock" -msgstr "" +msgstr "Агуулахад хийх" #. module: product #: view:product.product:0 @@ -232,7 +242,7 @@ msgstr "Жин" #. module: product #: model:product.template,name:product.product_product_fan2_product_template msgid "Silent fan" -msgstr "" +msgstr "Чимээгүй сэнс" #. module: product #: help:product.template,supply_method:0 @@ -240,27 +250,29 @@ msgid "" "Produce will generate production order or tasks, according to the product " "type. Purchase will trigger purchase orders when requested." msgstr "" +"Барааны төрөлд зааснаар Үйлдвэрлэх гэдэг нь үйлдвэрлэх захиалга үүсгэнэ. " +"Худалдан авах гэдэг нь шаардлагатай үед худалдан авах захиалга үүсгэнэ." #. module: product #: model:process.transition,note:product.process_transition_supplierofproduct0 msgid "You can see the list of suppliers for that product." -msgstr "" +msgstr "Тухайн барааны нийлүүлэгчдийн жагсаалтыг харж болно." #. module: product #: help:product.packaging,rows:0 msgid "The number of layer on a palet or box" -msgstr "" +msgstr "Палет эсвэл хайраг дэх давхаргын тоо" #. module: product #: model:product.pricelist.type,name:product.pricelist_type_sale #: field:res.partner,property_product_pricelist:0 msgid "Sale Pricelist" -msgstr "" +msgstr "Борлуулах үнэ" #. module: product #: field:product.pricelist.item,base_pricelist_id:0 msgid "If Other Pricelist" -msgstr "" +msgstr "Хэрэв өөр үнийн жагсаалт бол" #. module: product #: model:ir.actions.act_window,name:product.product_normal_action @@ -278,6 +290,9 @@ msgid "" "Rounding is applied after the discount and before the surcharge.\n" "To have prices that end in 9.99, set rounding 10, surcharge -0.01" msgstr "" +"Энэ утгаар үржүүлж үнийг тогтооно.\n" +"Үнийн хөнгөлөлт болон нэмэлтийн дараа тоймлолт хийгдэнэ.\n" +"9.99 үнийг гаргаж авахын тулд тоймлолт нь 10, нэмэлт нь -0.01 байна." #. module: product #: view:product.pricelist.item:0 @@ -292,13 +307,13 @@ msgstr "Ирээдүйн үлдэгдэл" #. module: product #: selection:product.template,mes_type:0 msgid "Fixed" -msgstr "" +msgstr "Тогтсон" #. module: product #: model:ir.actions.act_window,name:product.product_uom_categ_form_action #: model:ir.ui.menu,name:product.menu_product_uom_categ_form_action msgid "Units of Measure Categories" -msgstr "" +msgstr "Хэмжих нэгжийн ангилал" #. module: product #: help:product.pricelist.item,product_id:0 @@ -306,24 +321,26 @@ msgid "" "Set a product if this rule only apply to one product. Keep empty for all " "products" msgstr "" +"Энэ дүрэм зөвхөн нэг бараанд үйлчлэх бол уг барааг сонгоно. Хэрэв бүх " +"бараанд хамаатай бол хоосон орхино." #. module: product #: model:ir.model,name:product.model_product_pricelist_type #: field:product.pricelist,type:0 #: view:product.pricelist.type:0 msgid "Pricelist Type" -msgstr "" +msgstr "Үнийн жагсаалтын төрөл" #. module: product #: view:product.product:0 #: view:product.template:0 msgid "Base Prices" -msgstr "" +msgstr "Суурь үнэ" #. module: product #: model:ir.ui.menu,name:product.menu_price msgid "Prices Computations" -msgstr "" +msgstr "Үнийн тооцоолол" #. module: product #: field:product.pricelist.item,name:0 @@ -348,12 +365,12 @@ msgstr "Алдаа! Рекурсив ангилал үүсгэж болохгү #. module: product #: field:product.template,uom_id:0 msgid "Default UoM" -msgstr "" +msgstr "Үндсэн хэмжих нэгж" #. module: product #: field:product.template,produce_delay:0 msgid "Manufacturing Lead Time" -msgstr "" +msgstr "Үйлдвэрлэлийн хүлээлт" #. module: product #: field:product.supplierinfo,pricelist_ids:0 @@ -364,17 +381,17 @@ msgstr "Нийлүүлэгчийн үнийн жагсаалт" #: view:product.packaging:0 #: view:product.product:0 msgid "Pallet Dimension" -msgstr "" +msgstr "Палетын хэмжээ" #. module: product #: field:product.pricelist.item,base:0 msgid "Based on" -msgstr "" +msgstr "Суурь" #. module: product #: model:product.template,name:product.product_product_24_product_template msgid "Keyboard" -msgstr "" +msgstr "Гар" #. module: product #: field:product.supplierinfo,name:0 @@ -384,7 +401,7 @@ msgstr "Харилцагч" #. module: product #: field:product.template,sale_delay:0 msgid "Customer Lead Time" -msgstr "" +msgstr "Хэрэглэгчийн хүлээлт" #. module: product #: model:product.template,name:product.product_product_25_product_template @@ -398,11 +415,14 @@ msgid "" "at the end of the year), Average Price: the cost price is recomputed at each " "reception of products." msgstr "" +"Стандарт үнэ: өртөг тогтмол байх бөгөөд тодорхой хугацааны эцэст (ихэвчлэн " +"жилийн эцэст) өөрчлөнө, Дундаж үнэ: бараа хүлээн авах бүрт өртөгийг " +"тооцоолно." #. module: product #: field:product.pricelist,name:0 msgid "Pricelist Name" -msgstr "" +msgstr "Үнийн жагсаалтын нэр" #. module: product #: field:product.template,seller_ids:0 @@ -422,7 +442,7 @@ msgstr "Шинэ бараа үүсгэх" #. module: product #: help:product.pricelist.item,name:0 msgid "Explicit rule name for this pricelist line." -msgstr "" +msgstr "Энэ мөрөнд таарах тодорхой нэр." #. module: product #: view:product.pricelist.item:0 @@ -442,12 +462,12 @@ msgstr "Процессор AMD Athlon XP 1800+" #. module: product #: selection:product.template,state:0 msgid "In Production" -msgstr "" +msgstr "Үйлдвэрлэх шатанд" #. module: product #: field:product.category,child_id:0 msgid "Child Categories" -msgstr "" +msgstr "Дэд ангиллууд" #. module: product #: model:product.category,name:product.product_category_accessories @@ -462,13 +482,13 @@ msgstr "Урьтамж" #. module: product #: model:product.template,name:product.product_product_20_product_template msgid "HDD on demand" -msgstr "" +msgstr "HDD on demand" #. module: product #: field:product.uom,factor_inv:0 #: field:product.uom,factor_inv_data:0 msgid "Factor" -msgstr "" +msgstr "Фактор" #. module: product #: wizard_button:product.price_list,init,price:0 @@ -494,7 +514,7 @@ msgstr "ҮнийнЖагсаалт" #: view:product.product:0 #: view:product.template:0 msgid "UOM" -msgstr "" +msgstr "Хэмжих нэгж" #. module: product #: model:product.uom,name:product.product_uom_unit @@ -506,7 +526,7 @@ msgstr "Ш" #: model:ir.ui.menu,name:product.menu_product_pricelist_action2 #: model:ir.ui.menu,name:product.menu_product_pricelist_main msgid "Pricelists" -msgstr "" +msgstr "Үнийн жагсаалт" #. module: product #: field:product.supplierinfo,product_name:0 @@ -517,12 +537,12 @@ msgstr "Харилцагчийн барааны нэр" #: view:product.product:0 #: view:product.template:0 msgid "Miscelleanous" -msgstr "" +msgstr "Бусад" #. module: product #: help:product.pricelist.item,base:0 msgid "The mode for computing the price for this rule." -msgstr "" +msgstr "Энэ дүрмийн үнэ тооцоолох горим." #. module: product #: model:ir.actions.act_window,name:product.product_uom_form_action @@ -535,7 +555,7 @@ msgstr "Хэмжих нэгж" #. module: product #: field:product.product,partner_ref:0 msgid "Customer ref" -msgstr "" +msgstr "Үйлчлүүлэгч" #. module: product #: field:product.supplierinfo,qty:0 @@ -545,7 +565,7 @@ msgstr "Хамгийн бага тоо" #. module: product #: model:product.category,name:product.product_category_pc msgid "PC" -msgstr "" +msgstr "PC" #. module: product #: help:product.template,seller_delay:0 @@ -558,22 +578,22 @@ msgstr "" #. module: product #: field:product.template,seller_delay:0 msgid "Supplier Lead Time" -msgstr "" +msgstr "Нийлүүлэгчийн хүлээлт" #. module: product #: model:product.pricelist.version,name:product.ver0 msgid "Default Public Pricelist Version" -msgstr "" +msgstr "Үндсэн Үнийн хувилбар" #. module: product #: field:product.pricelist.type,key:0 msgid "Key" -msgstr "" +msgstr "Түлхүүр" #. module: product #: field:product.pricelist.item,price_version_id:0 msgid "Price List Version" -msgstr "" +msgstr "Үнийн хувилбар" #. module: product #: view:product.pricelist.item:0 @@ -585,13 +605,13 @@ msgstr "" msgid "" "This pricelist will be used, instead of the default one, " "for sales to the current partner" -msgstr "" +msgstr "Харилцагчийн борлуулалтад энэ үнийн жагсаалт ашиглагдана." #. module: product #: model:ir.model,name:product.model_product_pricelist #: view:product.supplierinfo:0 msgid "Pricelist" -msgstr "" +msgstr "Үнийн жагсаалт" #. module: product #: selection:product.template,type:0 @@ -601,7 +621,7 @@ msgstr "Зарцуулж болох" #. module: product #: help:product.price.type,currency_id:0 msgid "The currency the field is expressed in." -msgstr "" +msgstr "Илэрхийлэгдэх валют" #. module: product #: help:product.template,weight:0 @@ -624,21 +644,22 @@ msgid "" "Determine if the product can be visible in the list of product within a " "selection from a sale order line." msgstr "" +"Борлуулах захиалгын барааны жагсаалтад энэ бараа харагдах эсэхийг заана." #. module: product #: constraint:product.template:0 msgid "Error: UOS must be in a different category than the UOM" -msgstr "" +msgstr "Алдаа: Борлуулах нэгжийн ангилал хэмжих нэгжийнхээс өөр байх ёстой" #. module: product #: field:product.category,parent_id:0 msgid "Parent Category" -msgstr "" +msgstr "Эцэг ангилал" #. module: product #: selection:product.template,state:0 msgid "In Development" -msgstr "" +msgstr "Хөгжүүлэлтийн шатанд" #. module: product #: help:product.pricelist.type,key:0 @@ -653,6 +674,8 @@ msgid "" "Quantities of products that are planned to leave in selected locations or " "all internal if none have been selected." msgstr "" +"Сонгосон эсвэл бүх дотоод (сонголт хийгээгүй) байрлалаас гарахаар " +"төлөвлөгдсөн барааны тоо хэмжээ." #. module: product #: field:product.packaging,weight:0 @@ -666,23 +689,26 @@ msgid "" "supplying. 'Make to Order': When needed, purchase or produce for the " "procurement request." msgstr "" +"'Агуулахад хийх': хэрэгтэй үед агуулахаас авдаг эсвэл агуулахад ирэхийг " +"хүлээдэг. 'Захиалга хийх': хэрэгтэй үед худалдан авах эсвэл үйлдвэрлэх " +"захиалга өгдөг." #. module: product #: view:product.product:0 #: view:product.template:0 msgid "Procurement" -msgstr "" +msgstr "Татан авалт" #. module: product #: model:ir.actions.act_window,name:product.product_category_action #: model:ir.ui.menu,name:product.menu_product_category_action msgid "Products by Category" -msgstr "" +msgstr "Бараа, ангиллаар" #. module: product #: model:product.template,name:product.product_product_hdd1_product_template msgid "HDD Seagate 7200.8 80GB" -msgstr "" +msgstr "HDD Seagate 7200.8 80GB" #. module: product #: help:product.pricelist.version,active:0 @@ -691,11 +717,14 @@ msgid "" "not overlaps with original version. You should change the dates and " "reactivate the pricelist" msgstr "" +"Хувилбарууд давхардвал эх хувилбартай огнооны хувьд огтлолцохгүй болгох " +"үүднээс идэвхигүй төлөвт оруулна. Та үнийн хувилбарын огноог засаж дахин " +"идэвхжүүлэх ёстой." #. module: product #: model:product.template,name:product.product_product_hdd3_product_template msgid "HDD Seagate 7200.8 160GB" -msgstr "" +msgstr "HDD Seagate 7200.8 160GB" #. module: product #: view:product.product:0 @@ -715,12 +744,12 @@ msgstr "Раак" #. module: product #: field:product.uom,category_id:0 msgid "UoM Category" -msgstr "" +msgstr "Хэмжих нэгжийн ангилал" #. module: product #: selection:product.ul,type:0 msgid "Pack" -msgstr "" +msgstr "Савлагаа" #. module: product #: field:product.product,ean13:0 @@ -752,7 +781,7 @@ msgstr "Жин" #. module: product #: model:product.template,name:product.product_product_22_product_template msgid "Processor on demand" -msgstr "" +msgstr "Processor on demand" #. module: product #: help:product.supplierinfo,product_name:0 @@ -760,21 +789,23 @@ msgid "" "Name of the product for this partner, will be used when printing a request " "for quotation. Keep empty to use the internal one." msgstr "" +"Үнийн санал асуух үед хэвлэгдэх нийлүүлэгчийн барааны нэр. Хэрэв дотоод нэр " +"ашиглах бол хоосон орхино." #. module: product #: field:product.template,supply_method:0 msgid "Supply method" -msgstr "" +msgstr "Түгээх арга" #. module: product #: model:product.category,name:product.product_category_11 msgid "IT components kits" -msgstr "" +msgstr "IT эд ангиуд" #. module: product #: view:product.uom.categ:0 msgid "Units of Measure categories" -msgstr "" +msgstr "Хэмжих нэгжийн ангилал" #. module: product #: field:product.category,sequence:0 @@ -786,7 +817,7 @@ msgstr "Дараалал" #. module: product #: view:product.supplierinfo:0 msgid "Supplier Information" -msgstr "" +msgstr "Нийлүүлэгчийн мэдээлэл" #. module: product #: model:ir.actions.act_window,name:product.product_ul_form_action @@ -807,18 +838,18 @@ msgstr "Валют" #. module: product #: model:product.template,name:product.product_product_cpu_gen_product_template msgid "Regular processor config" -msgstr "" +msgstr "Энгийн процессор" #. module: product #: view:product.product:0 #: view:product.template:0 msgid "Descriptions" -msgstr "" +msgstr "Тайлбар" #. module: product #: model:process.transition,name:product.process_transition_supplierofproduct0 msgid "Suppliers of Product" -msgstr "" +msgstr "Барааны нийлүүлэгчид" #. module: product #: field:product.pricelist.version,date_start:0 @@ -828,19 +859,19 @@ msgstr "Эхлэл огноо" #. module: product #: view:res.partner:0 msgid "Sales Properties" -msgstr "" +msgstr "Борлуулалтын шинжүүд" #. module: product #: help:product.product,qty_available:0 msgid "" "Current quantities of products in selected locations or all internal if none " "have been selected." -msgstr "" +msgstr "Сонгосон эсвэл бүх байрлал дээрх барааны тоо хэмжээ." #. module: product #: model:product.template,name:product.product_product_pc1_product_template msgid "Basic PC" -msgstr "" +msgstr "Үндсэн PC" #. module: product #: field:product.template,loc_row:0 @@ -856,12 +887,12 @@ msgstr "Ангилал" #: help:product.pricelist.item,min_quantity:0 msgid "" "The rule only applies if the partner buys/sells more than this quantity." -msgstr "" +msgstr "Харилцагч зөвхөн энэ хэмжээнээс илүүг зарах/авах үед дүрэм үйлчилнэ." #. module: product #: model:product.template,name:product.product_product_ram_product_template msgid "DDR 256MB PC400" -msgstr "" +msgstr "DDR 256MB PC400" #. module: product #: field:product.product,qty_available:0 @@ -879,11 +910,12 @@ msgid "" "Unit of Measure of a category can be converted between each others in the " "same category." msgstr "" +"Хэмжих нэгж нь тухайн ангилал дотроо өөр нэгж рүү хөрвүүлэгдэж болно." #. module: product #: model:ir.model,name:product.model_product_uom msgid "Product Unit of Measure" -msgstr "" +msgstr "Барааны хэмжих нэгж" #. module: product #: field:product.template,sale_ok:0 @@ -893,23 +925,24 @@ msgstr "Зарж болох" #. module: product #: model:product.template,name:product.product_product_23_product_template msgid "Complete PC With Peripherals" -msgstr "" +msgstr "Иж бүрэн PC" #. module: product #: constraint:product.template:0 msgid "" "Error: The default UOM and the purchase UOM must be in the same category." msgstr "" +"Алдаа: Үндсэн нэгж худалдан авах нэгж хоёул нэг ангилалд хамаарах ёстой." #. module: product #: model:product.template,name:product.product_product_mb2_product_template msgid "Mainboard ASUStek A7V8X-X" -msgstr "" +msgstr "ASUStek A7V8X-X эх хавтан" #. module: product #: field:product.uom,factor:0 msgid "Rate" -msgstr "" +msgstr "Харьцаа" #. module: product #: view:product.pricelist.item:0 @@ -919,17 +952,17 @@ msgstr "" #. module: product #: field:product.uom,rounding:0 msgid "Rounding Precision" -msgstr "" +msgstr "Тоймлох нарийвчлал" #. module: product #: help:product.packaging,width:0 msgid "The width of the package" -msgstr "" +msgstr "Пакетын өргөн" #. module: product #: field:product.packaging,qty:0 msgid "Quantity by Package" -msgstr "" +msgstr "Пакетаархи тоо" #. module: product #: help:product.template,uos_id:0 @@ -938,46 +971,49 @@ msgid "" "management. For example, in food industries, you will manage a stock of ham " "but invoice in Kg. Keep empty to use the default UOM." msgstr "" +"Хоёр хэмжих нэгж ашигладаг компаниудад хэрэглэгдэнэ. Жишээлбэл, хүнсний " +"үйлдвэрлэлд, агуулахдаа гулуузаар хэмжих боловч хэрэглэгчээс Кг-аар " +"нэхэмжлэнэ. Үндсэн хэмжих нэгжийг ашиглах бол хоосон орхино." #. module: product #: view:product.product:0 #: view:product.template:0 msgid "Procurement & Locations" -msgstr "" +msgstr "Татан авалт & Байршил" #. module: product #: view:product.product:0 #: view:product.template:0 #: field:product.template,state:0 msgid "Status" -msgstr "" +msgstr "Байдал" #. module: product #: field:product.product,outgoing_qty:0 msgid "Outgoing" -msgstr "" +msgstr "Гарч байгаа" #. module: product #: selection:product.template,supply_method:0 msgid "Buy" -msgstr "" +msgstr "Худалдаж авах" #. module: product #: model:ir.model,name:product.model_product_pricelist_version #: view:product.pricelist:0 #: view:product.pricelist.version:0 msgid "Pricelist Version" -msgstr "" +msgstr "Үнийн хувилбар" #. module: product #: field:product.pricelist.item,price_round:0 msgid "Price Rounding" -msgstr "" +msgstr "Үнэ тоймлолт" #. module: product #: model:product.price.type,name:product.list_price msgid "Public Price" -msgstr "" +msgstr "Нийтийн үнэ" #. module: product #: field:product.pricelist.item,price_max_margin:0 @@ -987,12 +1023,12 @@ msgstr "" #. module: product #: view:res.partner:0 msgid "Sales & Purchases" -msgstr "" +msgstr "Борлуулалт & Худалдан авалт" #. module: product #: model:product.category,name:product.product_category_10 msgid "IT components" -msgstr "" +msgstr "IT эд ангиуд" #. module: product #: help:product.packaging,weight_ul:0 @@ -1378,7 +1414,7 @@ msgstr "" #. module: product #: model:process.node,note:product.process_node_supplier0 msgid "Product suppliers, with their product name, price, etc." -msgstr "" +msgstr "Барааны нийлүүлэгчид, барааны нэр, үнэ зэрэг." #. module: product #: model:ir.model,name:product.model_product_price_type @@ -1408,7 +1444,7 @@ msgstr "Эзлэхүүн" #: view:product.template:0 #: field:product.template,description:0 msgid "Description" -msgstr "" +msgstr "Тодорхойлолт" #. module: product #: field:product.packaging,ean:0 @@ -1419,12 +1455,12 @@ msgstr "" #: view:product.product:0 #: view:product.template:0 msgid "Product Description" -msgstr "" +msgstr "Барааны тодорхойлолт" #. module: product #: view:product.pricelist.item:0 msgid " ) + " -msgstr "" +msgstr " ) + " #. module: product #: help:product.template,sale_delay:0 @@ -1437,22 +1473,22 @@ msgstr "" #. module: product #: model:ir.model,name:product.model_product_uom_categ msgid "Product uom categ" -msgstr "" +msgstr "Барааны хэмжих нэгжийн ангилал" #. module: product #: wizard_field:product.price_list,init,qty3:0 msgid "Quantity-3" -msgstr "" +msgstr "Тоо-3" #. module: product #: model:product.ul,name:product.product_ul_box msgid "Box 20x20x40" -msgstr "" +msgstr "20x20x40 хайрцаг" #. module: product #: selection:product.template,supply_method:0 msgid "Produce" -msgstr "" +msgstr "Үйлдвэрлэх" #. module: product #: selection:product.template,procure_method:0 @@ -1497,13 +1533,13 @@ msgstr "Үүр" #. module: product #: field:product.pricelist.version,date_end:0 msgid "End Date" -msgstr "" +msgstr "Төгсгөл огноо" #. module: product #: model:ir.actions.act_window,name:product.product_category_action_form #: model:ir.ui.menu,name:product.menu_product_category_action_form msgid "Products Categories" -msgstr "" +msgstr "Барааны ангилал" #. module: product #: field:product.product,packaging:0 @@ -1528,6 +1564,8 @@ msgid "" "Coefficient to convert UOM to UOS\n" " uom = uos * coeff" msgstr "" +"Хэмжих нэгжийг зарах нэгж рүү хөрвүүлэх коэффициент\n" +" uom = uos * coeff" #. module: product #: field:product.template,purchase_ok:0 @@ -1558,7 +1596,7 @@ msgstr "Өртөг тооцох арга" #: view:product.packaging:0 #: view:product.product:0 msgid "Palletization" -msgstr "" +msgstr "Палетжуулах" #. module: product #: view:product.product:0 @@ -1569,7 +1607,7 @@ msgstr "Үнэ & Нийлүүлэгч" #. module: product #: help:product.packaging,weight:0 msgid "The weight of a full of products palet or box." -msgstr "" +msgstr "Палет эсвэл хайрцагын бүтэн жин." #. module: product #: selection:product.template,state:0 @@ -1587,6 +1625,8 @@ msgid "" "The coefficient for the formula:\n" "1 (base unit) = coeff (this unit). Rate = 1 / Factor." msgstr "" +"Дараахь томъёоны коэффициент:\n" +"1 (суурь нэгж) = коэфф (энэ нэгж). Харьцаа = 1 / Фактор." #. module: product #: help:product.template,weight_net:0 @@ -1596,7 +1636,7 @@ msgstr "Цэвэр жин кг-аар." #. module: product #: model:product.template,name:product.product_product_tow1_product_template msgid "ATX Mid-size Tower" -msgstr "" +msgstr "ATX Mid-size Tower" #. module: product #: field:product.supplierinfo,delay:0 @@ -1608,12 +1648,12 @@ msgstr "Хүргэлтийн хүлээлт" #: model:ir.ui.menu,name:product.menu_product_pricelist_action #: field:product.pricelist,version_id:0 msgid "Pricelist Versions" -msgstr "" +msgstr "Үнийн хувилбар" #. module: product #: field:product.packaging,weight_ul:0 msgid "Empty Package Weight" -msgstr "" +msgstr "Хоосон пакетын жин" #. module: product #: field:product.template,list_price:0 @@ -1632,7 +1672,7 @@ msgstr "" #. module: product #: wizard_field:product.price_list,init,qty1:0 msgid "Quantity-1" -msgstr "" +msgstr "Тоо-1" #. module: product #: field:product.packaging,length:0 @@ -1642,7 +1682,7 @@ msgstr "Урт" #. module: product #: model:product.category,name:product.cat2 msgid "Private" -msgstr "" +msgstr "Хувийн" #. module: product #: help:product.supplierinfo,delay:0 @@ -1658,6 +1698,8 @@ msgid "" "Default Unit of Measure used for purchase orders. It must in the same " "category than the default unit of measure." msgstr "" +"Худалдан авалтад хэрэглэх үндсэн хэмжих нэгж. Энэ нь үндсэн хэмжих нэгжийн " +"ангилалтай адил байх ёстой." #. module: product #: constraint:product.product:0 @@ -1667,7 +1709,7 @@ msgstr "Алдаа: Буруу зураасан код" #. module: product #: field:product.pricelist.item,min_quantity:0 msgid "Min. Quantity" -msgstr "" +msgstr "Хамгийн бага тоо" #. module: product #: help:product.pricelist.item,categ_id:0 @@ -1675,6 +1717,8 @@ msgid "" "Set a category of product if this rule only apply to products of a category " "and his childs. Keep empty for all products" msgstr "" +"Энэ дүрэм үйлчлэх барааны ангиллыг сонгоно. Хэрэв бүх бараанд хамаатай бол " +"хоосон орхино." #. module: product #: model:ir.actions.report.xml,name:product.report_product_label diff --git a/addons/product/i18n/pt_BR.po b/addons/product/i18n/pt_BR.po index b46884b3f64..5dd4e399aa2 100644 --- a/addons/product/i18n/pt_BR.po +++ b/addons/product/i18n/pt_BR.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev_rc3\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 05:42+0000\n" +"PO-Revision-Date: 2010-08-12 06:09+0000\n" "Last-Translator: OpenERP Administrators \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-08-12 03:57+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: product diff --git a/addons/product/i18n/tr.po b/addons/product/i18n/tr.po index 1799a8d95f8..683c746aa46 100644 --- a/addons/product/i18n/tr.po +++ b/addons/product/i18n/tr.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev_rc3\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 05:13+0000\n" +"PO-Revision-Date: 2010-08-12 05:44+0000\n" "Last-Translator: Angel Spy \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-08-12 03:57+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: product diff --git a/addons/product/product.py b/addons/product/product.py index 8029f8309d3..c984de70b27 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -429,7 +429,7 @@ class product_product(osv.osv): 'default_code' : fields.char('Reference', size=64), 'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the product without removing it."), 'variants': fields.char('Variants', size=64), - 'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=False), + 'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=True, ondelete="cascade"), 'ean13': fields.char('EAN13', size=13), 'packaging' : fields.one2many('product.packaging', 'product_id', 'Logistical Units', help="Gives the different ways to package the same product. This has no impact on the picking order and is mainly used if you use the EDI module."), 'price_extra': fields.float('Variant Price Extra', digits_compute=dp.get_precision('Sale Price')), diff --git a/addons/product_margin/i18n/pt_BR.po b/addons/product_margin/i18n/pt_BR.po index 9bc8077094a..8f8a5cf0481 100644 --- a/addons/product_margin/i18n/pt_BR.po +++ b/addons/product_margin/i18n/pt_BR.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 05:39+0000\n" +"PO-Revision-Date: 2010-08-12 06:09+0000\n" "Last-Translator: Fabien (Open ERP) \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-08-12 04:05+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: product_margin diff --git a/addons/product_visible_discount/i18n/mn.po b/addons/product_visible_discount/i18n/mn.po index 4e18f35ca23..d7271ebe6b4 100644 --- a/addons/product_visible_discount/i18n/mn.po +++ b/addons/product_visible_discount/i18n/mn.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2009-03-25 12:11+0000\n" -"PO-Revision-Date: 2010-08-11 10:24+0000\n" +"PO-Revision-Date: 2010-08-12 06:37+0000\n" "Last-Translator: ub121 \n" "Language-Team: Mongolian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-08-12 04:08+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: product_visible_discount diff --git a/addons/profile_tools/installer.py b/addons/profile_tools/installer.py index 4037b073319..59e0cbab3db 100644 --- a/addons/profile_tools/installer.py +++ b/addons/profile_tools/installer.py @@ -26,10 +26,10 @@ class misc_tools_installer(osv.osv_memory): _columns = { # Tools - 'lunch':fields.boolean('Lunch Orders'), - 'subscription':fields.boolean('Recurring Documents'), - 'survey':fields.boolean('Survey'), - 'audittrail':fields.boolean('Audit Trail'), + 'lunch':fields.boolean('Lunch Orders',help='Installs tools for lunch module'), + 'subscription':fields.boolean('Recurring Documents',help='Installs tools for subscription module'), + 'survey':fields.boolean('Survey',help='Installs tools for survey module'), + 'audittrail':fields.boolean('Audit Trail',help='Installs tools for audittrail module'), } _defaults = { 'lunch': True, diff --git a/addons/profile_tools/misc_tools_installer.xml b/addons/profile_tools/misc_tools_installer.xml index 69250f0dcf1..64bb428e278 100644 --- a/addons/profile_tools/misc_tools_installer.xml +++ b/addons/profile_tools/misc_tools_installer.xml @@ -19,8 +19,7 @@ - Here are a few useful applications which, while they do not directly contribute to your business, can help you to improve your organization. + Here are a few useful applications which, while they do not directly contribute to your business, can help you to improve your organization. Configure diff --git a/addons/project/i18n/ru.po b/addons/project/i18n/ru.po index 6667d241c97..e6077850ce4 100644 --- a/addons/project/i18n/ru.po +++ b/addons/project/i18n/ru.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 05:42+0000\n" +"PO-Revision-Date: 2010-08-12 06:08+0000\n" "Last-Translator: OpenERP Administrators \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-08-12 03:41+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:55+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: project diff --git a/addons/project/i18n/tr.po b/addons/project/i18n/tr.po index 0e5af8da6fc..0a485ef4da9 100644 --- a/addons/project/i18n/tr.po +++ b/addons/project/i18n/tr.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 05:39+0000\n" +"PO-Revision-Date: 2010-08-12 05:46+0000\n" "Last-Translator: OpenERP Administrators \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-08-12 03:41+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: project diff --git a/addons/project/project.py b/addons/project/project.py index 6fe0ad82c11..a70e72cdfbb 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -163,7 +163,7 @@ class project(osv.osv): 'complete_name': fields.function(_complete_name, method=True, string="Project Name", type='char', size=250), 'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the project without removing it."), 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of Projects."), - 'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account', help="Link this project to an analytic account if you need financial management on projects. It enables you to connect projects with budgets, planning, cost and revenue analysis, timesheets on projects, etc."), + 'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account', help="Link this project to an analytic account if you need financial management on projects. It enables you to connect projects with budgets, planning, cost and revenue analysis, timesheets on projects, etc.", ondelete="cascade", required=True), 'priority': fields.integer('Sequence', help="Gives the sequence order when displaying a list of task"), 'warn_manager': fields.boolean('Warn Manager', help="If you check this field, the project manager will receive a request each time a task is completed by his team.", states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}), 'members': fields.many2many('res.users', 'project_user_rel', 'project_id', 'uid', 'Project Members', help="Project's member. Not used in any computation, just for information purpose.", states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}), @@ -283,7 +283,7 @@ class project(osv.osv): res_id = result[0] form_view_id = data_obj._get_id(cr, uid, 'project', 'edit_project') form_view = data_obj.read(cr, uid, form_view_id, ['res_id']) - tree_view_id = data_obj._get_id(cr, uid, 'project', 'view_project_list') + tree_view_id = data_obj._get_id(cr, uid, 'project', 'view_project') tree_view = data_obj.read(cr, uid, tree_view_id, ['res_id']) search_view_id = data_obj._get_id(cr, uid, 'project', 'view_project_project_filter') search_view = data_obj.read(cr, uid, search_view_id, ['res_id']) diff --git a/addons/project/project_demo.xml b/addons/project/project_demo.xml index 0ce0e37a327..a8593bca9b8 100644 --- a/addons/project/project_demo.xml +++ b/addons/project/project_demo.xml @@ -30,7 +30,7 @@ 1 - Open ERP Integration + OpenERP Integration diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 82b88716421..8505bc261a9 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -62,7 +62,7 @@ - + @@ -91,24 +91,6 @@ - - project.project.list - project.project - tree - - - - - - - - - - - - - - project.project.select project.project @@ -119,7 +101,7 @@ - + @@ -127,9 +109,10 @@ - - + + + @@ -418,6 +401,7 @@ + - + - + + + + + - - diff --git a/addons/project_caldav/project_caldav.py b/addons/project_caldav/project_caldav.py index 65e61c6e4cd..ea6c02bc2cb 100644 --- a/addons/project_caldav/project_caldav.py +++ b/addons/project_caldav/project_caldav.py @@ -21,13 +21,19 @@ from osv import fields, osv from caldav import calendar +from datetime import datetime + +from project.project import task as base_project_task class project_task(osv.osv): _name = "project.task" _inherit = ["calendar.todo", "project.task"] _columns = { + # force inherit from project.project_task so that + # calendar.todo.active is masked oute + 'active': base_project_task._columns['active'], 'write_date': fields.datetime('Write Date'), - 'create_date': fields.datetime('Create Date'), + 'create_date': fields.datetime('Create Date', readonly=True), 'attendee_ids': fields.many2many('calendar.attendee', \ 'task_attendee_rel', 'task_id', 'attendee_id', 'Attendees'), 'state': fields.selection([('draft', 'Draft'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', readonly=True, required=True, diff --git a/addons/project_gtd/project_gtd_demo.xml b/addons/project_gtd/project_gtd_demo.xml index 0f2a4d0b06c..a2d3cf65923 100644 --- a/addons/project_gtd/project_gtd_demo.xml +++ b/addons/project_gtd/project_gtd_demo.xml @@ -21,15 +21,15 @@ Today - terp-hr + terp-go-today This Week - terp-partner + terp-go-week This Month - terp-product + terp-go-month Long Term diff --git a/addons/project_planning/i18n/tr.po b/addons/project_planning/i18n/tr.po index 60eceb55788..f11284a9da1 100644 --- a/addons/project_planning/i18n/tr.po +++ b/addons/project_planning/i18n/tr.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 05:27+0000\n" +"PO-Revision-Date: 2010-08-12 05:20+0000\n" "Last-Translator: Fabien (Open ERP) \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-08-12 03:45+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: project_planning diff --git a/addons/project_scrum/project_scrum_demo.xml b/addons/project_scrum/project_scrum_demo.xml index d162a396abe..bc79209b2e0 100644 --- a/addons/project_scrum/project_scrum_demo.xml +++ b/addons/project_scrum/project_scrum_demo.xml @@ -9,7 +9,7 @@ [24, 25, 28, 26, 27, 29, 30, 31, 32, 33, 34, 35, 37, 36, 38] 156.0 - Open ERP - dev branch + OpenERP - dev branch @@ -30,7 +30,7 @@ 3 Automatic migration system 6.0 - This new system will enable you to migrate automatically from an old version of Open ERP to a new one. This system will migrate not only the Open ERP system but also the customers particularities. This happens without any kind of script or programming. It has been possible to carry out such a system thanks to the descriptive approach of Open ERP components. + This new system will enable you to migrate automatically from an old version of OpenERP to a new one. This system will migrate not only the OpenERP system but also the customers particularities. This happens without any kind of script or programming. It has been possible to carry out such a system thanks to the descriptive approach of OpenERP components. done @@ -39,7 +39,7 @@ 3 New accounting module 111.0 - The accounting module of Open ERP (financial accounting and management accounting) is being reshaped. New functionnalities will be added: intangible assets, a new way of presenting ledgers and bookings, new stock valuation calculation, and lots of predefined reports. + The accounting module of OpenERP (financial accounting and management accounting) is being reshaped. New functionalities will be added: intangible assets, a new way of presenting ledgers and bookings, new stock valuation calculation, and lots of predefined reports. open @@ -48,7 +48,7 @@ 3 Automated Plugin System to install/uninstall modules 4.0 - We have to develop a plug-in system which will enable to install/remove modules. The basic version of Open ERP will include only the required minimum, and you will select the modules thanks to the plug-in manager. This allows you to limit your system to your real needs: quality management, localisations, project and service management, marketing campaigns, and so on... + We have to develop a plug-in system which will enable to install/remove modules. The basic version of OpenERP will include only the required minimum, and you will select the modules thanks to the plug-in manager. This allows you to limit your system to your real needs: quality management, localisations, project and service management, marketing campaigns, and so on... open @@ -70,14 +70,14 @@ Test for 3.2.0 Publishing 5.0 - Test Open ERP to release stable 3.2.0 version. (may be 3.2.0-pre1 ?) + Test OpenERP to release stable 3.2.0 version. (may be 3.2.0-pre1 ?) Reshape the complete menu 4.0 - Restructure the Open ERP menu to be more like others ERP. + Restructure the OpenERP menu to be more like other ERPs. open @@ -223,7 +223,7 @@ Admin: Worked on the Automatic migration system Demo: Worked on the Test 3.2.0 before releasing -Admin:Work on Restructure the Open ERP menu to be more like others ERP. +Admin:Work on Restructure the OpenERP menu to be more like other ERPs. Demo: Work on Editable trees Demo :Bugfix - memory leak diff --git a/addons/purchase/i18n/et.po b/addons/purchase/i18n/et.po index a7421253ddb..2e261387044 100644 --- a/addons/purchase/i18n/et.po +++ b/addons/purchase/i18n/et.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 05:41+0000\n" +"PO-Revision-Date: 2010-08-12 05:47+0000\n" "Last-Translator: lyyser \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-08-12 03:44+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: purchase diff --git a/addons/purchase/i18n/pt_BR.po b/addons/purchase/i18n/pt_BR.po index 3a08d911b1a..d57a19666df 100644 --- a/addons/purchase/i18n/pt_BR.po +++ b/addons/purchase/i18n/pt_BR.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: pt_BR\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-07 03:51+0000\n" +"PO-Revision-Date: 2010-08-12 06:37+0000\n" "Last-Translator: Renato Lima - http://www.akretion.com " "\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-08-12 03:45+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: purchase diff --git a/addons/purchase/wizard/purchase_installer.xml b/addons/purchase/wizard/purchase_installer.xml index dc10beacd98..369849e1b18 100644 --- a/addons/purchase/wizard/purchase_installer.xml +++ b/addons/purchase/wizard/purchase_installer.xml @@ -9,7 +9,7 @@ - Purchase Modules Installation + Purchase Modules Configuration diff --git a/addons/sale/i18n/pt_BR.po b/addons/sale/i18n/pt_BR.po index 08df56ccfb9..13c3d5170ed 100644 --- a/addons/sale/i18n/pt_BR.po +++ b/addons/sale/i18n/pt_BR.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: pt_BR\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 05:13+0000\n" +"PO-Revision-Date: 2010-08-12 05:45+0000\n" "Last-Translator: Renato Lima - http://www.akretion.com " "\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-08-12 03:55+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: sale diff --git a/addons/sale/sale.py b/addons/sale/sale.py index c1ea2ea6a8e..62b91346706 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -703,6 +703,7 @@ class sale_order(osv.osv): for proc_id in proc_ids: wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr) + wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_check', cr) if order.state == 'shipping_except': val['state'] = 'progress' diff --git a/addons/sale/sale_installer.xml b/addons/sale/sale_installer.xml index c77faf905e6..0806ae941ac 100644 --- a/addons/sale/sale_installer.xml +++ b/addons/sale/sale_installer.xml @@ -8,7 +8,7 @@ - Sale Management Modules Installation + Sale Management Modules Configuration diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index bb32cfc8f83..e7fe2a6fe7d 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -1,7 +1,7 @@ - + diff --git a/addons/sale_journal/i18n/pl.po b/addons/sale_journal/i18n/pl.po index eb0f1a70cbf..0947ce0aac5 100644 --- a/addons/sale_journal/i18n/pl.po +++ b/addons/sale_journal/i18n/pl.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 05:39+0000\n" +"PO-Revision-Date: 2010-08-12 06:09+0000\n" "Last-Translator: OpenERP Administrators \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-08-12 03:58+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: sale_journal diff --git a/addons/stock/i18n/bs.po b/addons/stock/i18n/bs.po index d06b2744476..d5576c02e5b 100644 --- a/addons/stock/i18n/bs.po +++ b/addons/stock/i18n/bs.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-08-11 05:39+0000\n" +"PO-Revision-Date: 2010-08-12 05:46+0000\n" "Last-Translator: adnan \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-08-12 03:41+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: stock diff --git a/addons/stock/report/__init__.py b/addons/stock/report/__init__.py index ab4b2e16599..7b0f561897f 100644 --- a/addons/stock/report/__init__.py +++ b/addons/stock/report/__init__.py @@ -28,4 +28,5 @@ import lot_overview_all import report_stock import report_stock_picking import report_stock_move +import stock_inventory_move_report diff --git a/addons/stock/report/stock_inventory_move.rml b/addons/stock/report/stock_inventory_move.rml new file mode 100755 index 00000000000..cd82cc4312a --- /dev/null +++ b/addons/stock/report/stock_inventory_move.rml @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [[ repeatIn(objects,'o') ]] + + + + Stock Inventory + + + + + + + + + + + + + + Inventory + + + Date + + + + + [[ o.name ]] + [[ formatLang(o.date,date=True) ]] + + + + + + + + + + + + + Location + + + Production Lot + + + Product + + + Quantity + + + UOM + + + + + + + + [[ repeatIn(o.inventory_line_id, 'p') ]] + + + + [[ p.location_id.name ]] + + + [[ p.prod_lot_id and p.prod_lot_id.name or '' ]] + + + [[ p.product_id.name ]] + + + [[ p.product_qty ]] + + + [[ p.product_uom.name ]] + + + + + + + + + + + + + + Total: + + + [[ format(qty_total(o.inventory_line_id)['quantity']) ]] + + + [[ format(qty_total(o.inventory_line_id)['uom']) ]] + + + + + + + + diff --git a/addons/stock/report/stock_inventory_move_report.py b/addons/stock/report/stock_inventory_move_report.py new file mode 100755 index 00000000000..b89b6b9fa9b --- /dev/null +++ b/addons/stock/report/stock_inventory_move_report.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# 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 . +# +############################################################################## + +import time +from report import report_sxw + +class stock_inventory_move(report_sxw.rml_parse): + def __init__(self, cr, uid, name, context): + super(stock_inventory_move, self).__init__(cr, uid, name, context=context) + self.localcontext.update({ + 'time': time, + 'qty_total':self._qty_total + }) + + def _qty_total(self,objects): + total = 0.0 + uom = objects[0].product_uom.name + for obj in objects: + total += obj.product_qty + return {'quantity':str(total),'uom':uom} + +report_sxw.report_sxw( + 'report.stock.inventory.move', + 'stock.inventory', + 'addons/stock/report/stock_inventory_move.rml', + parser=stock_inventory_move +) +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/stock_report.xml b/addons/stock/stock_report.xml index f1adfc33816..a214dc8045e 100644 --- a/addons/stock/stock_report.xml +++ b/addons/stock/stock_report.xml @@ -8,5 +8,6 @@ + diff --git a/addons/stock_invoice_directly/i18n/it.po b/addons/stock_invoice_directly/i18n/it.po index c61ef891bf6..6392ae4436b 100644 --- a/addons/stock_invoice_directly/i18n/it.po +++ b/addons/stock_invoice_directly/i18n/it.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: 2009-04-10 14:08+0000\n" -"Last-Translator: <>\n" +"PO-Revision-Date: 2010-08-12 05:53+0000\n" +"Last-Translator: OpenERP Administrators \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-08-12 04:07+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: stock_invoice_directly diff --git a/addons/stock_location/i18n/ca.po b/addons/stock_location/i18n/ca.po index a00fb98d4de..0d7d3e60582 100644 --- a/addons/stock_location/i18n/ca.po +++ b/addons/stock_location/i18n/ca.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2009-09-16 17:43+0000\n" +"PO-Revision-Date: 2010-08-12 05:55+0000\n" "Last-Translator: Fabien (Open ERP) \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-08-12 04:05+0000\n" +"X-Launchpad-Export-Date: 2010-08-13 05:56+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: stock_location diff --git a/addons/stock_planning/stock_planning_view.xml b/addons/stock_planning/stock_planning_view.xml index 9b8b6afd506..0a89573e2f7 100644 --- a/addons/stock_planning/stock_planning_view.xml +++ b/addons/stock_planning/stock_planning_view.xml @@ -182,7 +182,7 @@ + parent="base.menu_base_partner" sequence="6" groups="base.group_extended,base.group_system"/> stock.sale.forecast.list.select diff --git a/addons/subscription/security/ir.model.access.csv b/addons/subscription/security/ir.model.access.csv index 33ab0881c52..e19fdde993b 100644 --- a/addons/subscription/security/ir.model.access.csv +++ b/addons/subscription/security/ir.model.access.csv @@ -3,8 +3,8 @@ access_subscription_document,subscription.document,model_subscription_document,b access_subscription_document_fields,subscription.document.fields,model_subscription_document_fields,base.group_system,1,1,1,1 access_subscription_subscription,subscription.subscription,model_subscription_subscription,base.group_user,1,1,1,1 access_subscription_subscription_history,subscription.subscription.history,model_subscription_subscription_history,base.group_user,1,1,1,1 -access_subscription_subscription_user,subscription.subscription user,model_subscription_subscription,base.group_survey_user,1,1,1,1 -access_subscription_subscription_manager,subscription.subscription manager,model_subscription_subscription,base.group_survey_manager,1,0,0,0 -access_subscription_subscription_history_user,subscription.subscription.history user,model_subscription_subscription_history,base.group_survey_user,1,1,1,1 +access_subscription_subscription_user,subscription.subscription user,model_subscription_subscription,base.group_tool_user,1,1,1,1 +access_subscription_subscription_manager,subscription.subscription manager,model_subscription_subscription,base.group_tool_manager,1,0,0,0 +access_subscription_subscription_history_user,subscription.subscription.history user,model_subscription_subscription_history,base.group_tool_user,1,1,1,1 access_subscription_subscription_system,subscription.subscription system,model_subscription_subscription,base.group_system,1,0,0,0 -access_subscription_document_user,subscription.document user,model_subscription_document,base.group_survey_user,1,1,1,1 +access_subscription_document_user,subscription.document user,model_subscription_document,base.group_tool_user,1,1,1,1 diff --git a/addons/subscription/security/subcription_security.xml b/addons/subscription/security/subcription_security.xml index 86f0e2c6069..0014f38182b 100644 --- a/addons/subscription/security/subcription_security.xml +++ b/addons/subscription/security/subcription_security.xml @@ -2,10 +2,10 @@ - + Tools / Manager - + Tools / User diff --git a/addons/survey/security/ir.model.access.csv b/addons/survey/security/ir.model.access.csv index 9944a84996d..8d50471fd03 100644 --- a/addons/survey/security/ir.model.access.csv +++ b/addons/survey/security/ir.model.access.csv @@ -1,30 +1,30 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_survey_type_manager","survey.type manager","model_survey_type","base.group_survey_manager",1,1,1,1 -"access_survey_type_user","survey.type user","model_survey_type","base.group_survey_user",1,1,1,1 -"access_survey_manager","survey","model_survey","base.group_survey_manager",1,0,0,0 +"access_survey_type_manager","survey.type manager","model_survey_type","base.group_tool_manager",1,1,1,1 +"access_survey_type_user","survey.type user","model_survey_type","base.group_tool_user",1,1,1,1 +"access_survey_manager","survey","model_survey","base.group_tool_manager",1,0,0,0 "access_survey_system","survey","model_survey","base.group_system",1,0,0,0 -"access_survey_user","survey","model_survey","base.group_survey_user",1,1,1,1 -"access_survey_page_manager","survey.page manager","model_survey_page","base.group_survey_manager",1,0,0,0 +"access_survey_user","survey","model_survey","base.group_tool_user",1,1,1,1 +"access_survey_page_manager","survey.page manager","model_survey_page","base.group_tool_manager",1,0,0,0 "access_survey_page_system","survey.page system","model_survey_page","base.group_system",1,0,0,0 -"access_survey_page_user","survey.page user","model_survey_page","base.group_survey_user",1,1,1,1 -"access_survey_question_manager","survey.question manager","model_survey_question","base.group_survey_manager",1,1,1,1 -"access_survey_question_user","survey.question user","model_survey_question","base.group_survey_user",1,1,1,1 -"access_survey_answer_manager","survey.answer manager","model_survey_answer","base.group_survey_manager",1,1,1,1 -"access_survey_answer_user","survey.answer user","model_survey_answer","base.group_survey_user",1,1,1,1 -"access_survey_response_manager","survey.response manager","model_survey_response","base.group_survey_manager",1,1,1,1 -"access_survey_response_user","survey.response user","model_survey_response","base.group_survey_user",1,1,1,1 -"access_survey_response_answer_manager","survey.response.answer manager","model_survey_response_answer","base.group_survey_manager",1,1,1,1 -"access_survey_response_answer_user","survey.response.answer user","model_survey_response_answer","base.group_survey_user",1,1,1,1 -"access_survey_history_user","survey.history.user","model_survey_history","base.group_survey_user",1,1,1,1 -"access_survey_question_column_heading_manager","survey.question.column.heading manager","model_survey_question_column_heading","base.group_survey_manager",1,1,1,1 -"access_survey_question_column_heading_user","survey.question.column.heading user","model_survey_question_column_heading","base.group_survey_user",1,0,0,0 -"access_survey_request_manager","survey.request manager","model_survey_request","base.group_survey_manager",1,0,0,0 -"access_survey_request_user","survey.request user","model_survey_request","base.group_survey_user",1,1,1,1 +"access_survey_page_user","survey.page user","model_survey_page","base.group_tool_user",1,1,1,1 +"access_survey_question_manager","survey.question manager","model_survey_question","base.group_tool_manager",1,1,1,1 +"access_survey_question_user","survey.question user","model_survey_question","base.group_tool_user",1,1,1,1 +"access_survey_answer_manager","survey.answer manager","model_survey_answer","base.group_tool_manager",1,1,1,1 +"access_survey_answer_user","survey.answer user","model_survey_answer","base.group_tool_user",1,1,1,1 +"access_survey_response_manager","survey.response manager","model_survey_response","base.group_tool_manager",1,1,1,1 +"access_survey_response_user","survey.response user","model_survey_response","base.group_tool_user",1,1,1,1 +"access_survey_response_answer_manager","survey.response.answer manager","model_survey_response_answer","base.group_tool_manager",1,1,1,1 +"access_survey_response_answer_user","survey.response.answer user","model_survey_response_answer","base.group_tool_user",1,1,1,1 +"access_survey_history_user","survey.history.user","model_survey_history","base.group_tool_user",1,1,1,1 +"access_survey_question_column_heading_manager","survey.question.column.heading manager","model_survey_question_column_heading","base.group_tool_manager",1,1,1,1 +"access_survey_question_column_heading_user","survey.question.column.heading user","model_survey_question_column_heading","base.group_tool_user",1,0,0,0 +"access_survey_request_manager","survey.request manager","model_survey_request","base.group_tool_manager",1,0,0,0 +"access_survey_request_user","survey.request user","model_survey_request","base.group_tool_user",1,1,1,1 "access_survey_request_system","survey.request system","model_survey_request","base.group_system",1,0,0,0 -"access_survey_tbl_column_heading_manager","survey.tbl.column.heading manager","model_survey_tbl_column_heading","base.group_survey_manager",1,1,1,1 -"access_survey_tbl_column_heading_user","survey.tbl.column.heading user","model_survey_tbl_column_heading","base.group_survey_user",1,1,1,1 -"access_survey_response_line_manager","survey.response.line manager","model_survey_response_line","base.group_survey_manager",1,1,1,1 -"access_survey_response_line_manager","survey.response.line manager","model_survey_response_line","base.group_survey_user",1,1,1,1 +"access_survey_tbl_column_heading_manager","survey.tbl.column.heading manager","model_survey_tbl_column_heading","base.group_tool_manager",1,1,1,1 +"access_survey_tbl_column_heading_user","survey.tbl.column.heading user","model_survey_tbl_column_heading","base.group_tool_user",1,1,1,1 +"access_survey_response_line_manager","survey.response.line manager","model_survey_response_line","base.group_tool_manager",1,1,1,1 +"access_survey_response_line_manager","survey.response.line manager","model_survey_response_line","base.group_tool_user",1,1,1,1 "access_survey_type","survey.type","model_survey_type","base.group_hr_manager",1,1,1,1 "access_survey","survey","model_survey","base.group_hr_manager",1,1,1,1 "access_survey_history_manager","survey.history","model_survey_history","base.group_hr_manager",1,1,1,1 @@ -38,7 +38,7 @@ "access_survey_response_answer","survey.response.answer","model_survey_response_answer","base.group_hr_manager",1,1,1,1 "access_survey_res_users","res.users","base.model_res_users","base.group_hr_manager",1,1,1,1 "access_survey_request","survey.request","model_survey_request","base.group_hr_manager",1,1,1,1 -"access_survey_history_survey_manager","survey.history manager","model_survey_history","base.group_survey_manager",1,0,0,0 +"access_survey_history_survey_manager","survey.history manager","model_survey_history","base.group_tool_manager",1,0,0,0 "access_survey_type_system","survey.type system","model_survey_type","base.group_system",1,0,0,0 "access_survey_question_system","survey.question system","model_survey_question","base.group_system",1,0,0,0 "access_survey_history_system","survey.history.system","model_survey_history","base.group_system",1,0,0,0 diff --git a/addons/survey/security/survey_security.xml b/addons/survey/security/survey_security.xml index 8c50d72496c..7172fdf615e 100644 --- a/addons/survey/security/survey_security.xml +++ b/addons/survey/security/survey_security.xml @@ -11,10 +11,10 @@ Human Resources / User - + Tools / Manager - + Tools / User diff --git a/addons/survey/survey_demo.xml b/addons/survey/survey_demo.xml index 43db63e982b..045a7c6cf38 100644 --- a/addons/survey/survey_demo.xml +++ b/addons/survey/survey_demo.xml @@ -17,7 +17,7 @@ - Open ERP Partner Feedback + OpenERP Partner Feedback 20 diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml index f45eab0bf9d..890d674a408 100644 --- a/addons/survey/survey_view.xml +++ b/addons/survey/survey_view.xml @@ -2,15 +2,15 @@ - + + groups="base.group_tool_manager,base.group_tool_user,base.group_system" sequence="2"/> - + + id="base.menu_lunch_reporting" sequence="6"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/locale/en-US/config_change.dtd b/addons/thunderbird/plugin/chrome/openerp_plugin/locale/en-US/config_change.dtd new file mode 100644 index 00000000000..a926d3a980d --- /dev/null +++ b/addons/thunderbird/plugin/chrome/openerp_plugin/locale/en-US/config_change.dtd @@ -0,0 +1,5 @@ + + + + + diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/locale/en-US/create.dtd b/addons/thunderbird/plugin/chrome/openerp_plugin/locale/en-US/create.dtd new file mode 100644 index 00000000000..181d408a3e9 --- /dev/null +++ b/addons/thunderbird/plugin/chrome/openerp_plugin/locale/en-US/create.dtd @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/locale/en-US/createpartner.dtd b/addons/thunderbird/plugin/chrome/openerp_plugin/locale/en-US/createpartner.dtd new file mode 100644 index 00000000000..67b32b32907 --- /dev/null +++ b/addons/thunderbird/plugin/chrome/openerp_plugin/locale/en-US/createpartner.dtd @@ -0,0 +1,7 @@ + + + + + + + diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/locale/en-US/mboximport.properties b/addons/thunderbird/plugin/chrome/openerp_plugin/locale/en-US/mboximport.properties new file mode 100644 index 00000000000..33845423f7d --- /dev/null +++ b/addons/thunderbird/plugin/chrome/openerp_plugin/locale/en-US/mboximport.properties @@ -0,0 +1,31 @@ +nomboxfile=není mbox souborem +folderexists=Není možné importovat: složka se stejným názvem již existuje +fileexists=Není možné importovat: soubor se stejným názvem již existuje +nowritable=Není možné importovat: nemáte právo zápisu do složky +exportOK=Export byl úspěšně dokončen +isNewsgroup=Tato funkce není dostupná: export složky z IMAP účtů nebo diskuzních \nskupin je možný, pouze pokud je nastavené čtení v režimu Offline +nofolder=Nebyla vybrána žádná cílová složka +badfolder=Není možné importovat do této složky (typ IMAP nebo diskuzní skupina) +exportAccount=Export všech složek +exportFolder=Export složky +filePickerImport=Výběr souboru k importu +filePickerExport=Výběr cílové složky +extensions.{3ed8cc52-86fc-4613-9026-c1ef969da4c3}.description=Umožňuje import a export souborů ve formátu mbox a eml +virtualfolder=Toto je virtuální složka. Pro export jejich\nzpráv musíte tyto zprávy nejdříve\nzkopírovat do normální složky. +searchdir=Vyberte složku, ve které budou vyhledány mbox soubory +confirmimport=Chcete importovat soubor? +endscan=Konec prohledávání složek +internalerror=Není možné provést import, protože nastala neznámá chyba +exportstart=Probíhá export, čekejte prosím... +exported=Exportovalo se +msgs=zpráv z +nosubjectmsg=bez_predmetu +messsubdir=zprávy +badfolder2=Není možné importovat do této složky (IMAP nebo diskuzní skupina nebo virtuální složka) +temp_error=Není možné importovat: nastala chyba při vytváření dočasného souboru +importEMLstart=Pobíhá import, čekejte prosím... +numEML=Naimportovány eml soubory: +CSVseparator=, +noEML=No eml file found in this directory +backupWarning=During this operation, the program could be\nunresponsive for some minutes.\nDo you want to go on?\n +noWaring=Don't show again this warning diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/locale/en-US/overlay.dtd b/addons/thunderbird/plugin/chrome/openerp_plugin/locale/en-US/overlay.dtd new file mode 100755 index 00000000000..9a91cf11b6c --- /dev/null +++ b/addons/thunderbird/plugin/chrome/openerp_plugin/locale/en-US/overlay.dtd @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/locale/en-US/plugin.dtd b/addons/thunderbird/plugin/chrome/openerp_plugin/locale/en-US/plugin.dtd new file mode 100644 index 00000000000..ed26728b0d0 --- /dev/null +++ b/addons/thunderbird/plugin/chrome/openerp_plugin/locale/en-US/plugin.dtd @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/locale/en-US/selectpartner.dtd b/addons/thunderbird/plugin/chrome/openerp_plugin/locale/en-US/selectpartner.dtd new file mode 100644 index 00000000000..e6a62c16003 --- /dev/null +++ b/addons/thunderbird/plugin/chrome/openerp_plugin/locale/en-US/selectpartner.dtd @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Account.png b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Account.png new file mode 100644 index 00000000000..b13f2b0f523 Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Account.png differ diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Archive.png b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Archive.png new file mode 100644 index 00000000000..5aa6a958d37 Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Archive.png differ diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Case.png b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Case.png new file mode 100644 index 00000000000..9b950b8ea9d Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Case.png differ diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Contact.png b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Contact.png new file mode 100644 index 00000000000..9bd6f9f6059 Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Contact.png differ diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Create.png b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Create.png new file mode 100644 index 00000000000..1ab240c32cb Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Create.png differ diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Error.gif b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Error.gif new file mode 100644 index 00000000000..38c3523781b Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Error.gif differ diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Invoice.png b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Invoice.png new file mode 100644 index 00000000000..4551107ec3b Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Invoice.png differ diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Move.gif b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Move.gif new file mode 100644 index 00000000000..401bf861213 Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Move.gif differ diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/MoveDown.png b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/MoveDown.png new file mode 100644 index 00000000000..3761ff1e747 Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/MoveDown.png differ diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/MoveLeft.png b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/MoveLeft.png new file mode 100644 index 00000000000..031d7532673 Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/MoveLeft.png differ diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/NEWT.png b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/NEWT.png new file mode 100644 index 00000000000..373464bd53e Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/NEWT.png differ diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/NEWT1.png b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/NEWT1.png new file mode 100644 index 00000000000..2daac224a51 Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/NEWT1.png differ diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Partner.png b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Partner.png new file mode 100644 index 00000000000..c661339598e Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Partner.png differ diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Product.png b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Product.png new file mode 100644 index 00000000000..51451e422ae Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Product.png differ diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Project.png b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Project.png new file mode 100644 index 00000000000..0f8ea2af8f5 Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Project.png differ diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Sale.png b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Sale.png new file mode 100644 index 00000000000..1b0b44f890e Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Sale.png differ diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Search.gif b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Search.gif new file mode 100644 index 00000000000..b29c3cf1054 Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Search.gif differ diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Success.gif b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Success.gif new file mode 100644 index 00000000000..fb3bff729c5 Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Success.gif differ diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Task.png b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Task.png new file mode 100644 index 00000000000..52056b1e713 Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/Task.png differ diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/developped_by.png b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/developped_by.png new file mode 100644 index 00000000000..54dc465b421 Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/developped_by.png differ diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/overlay.css b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/overlay.css new file mode 100755 index 00000000000..1f71b8fdcbe --- /dev/null +++ b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/overlay.css @@ -0,0 +1,3 @@ +menuitem#tiny-plugin { + color: red !important; +} diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/perform.gif b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/perform.gif new file mode 100644 index 00000000000..16cc3873858 Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/perform.gif differ diff --git a/addons/thunderbird/plugin/chrome/openerp_plugin/skin/tinyerp-icon.ico b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/tinyerp-icon.ico new file mode 100644 index 00000000000..b1e78c0047e Binary files /dev/null and b/addons/thunderbird/plugin/chrome/openerp_plugin/skin/tinyerp-icon.ico differ diff --git a/addons/thunderbird/plugin/components/nsXmlRpcClient.js b/addons/thunderbird/plugin/components/nsXmlRpcClient.js new file mode 100755 index 00000000000..40347a9993d --- /dev/null +++ b/addons/thunderbird/plugin/components/nsXmlRpcClient.js @@ -0,0 +1,1039 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Mozilla XML-RPC Client component. + * + * The Initial Developer of the Original Code is + * Digital Creations 2, Inc. + * Portions created by the Initial Developer are Copyright (C) 2000 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Martijn Pieters (original author) + * Samuel Sieb + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +/* + * nsXmlRpcClient XPCOM component + * Version: $Revision: 1.39 $ + * + * $Id: nsXmlRpcClient.js,v 1.39 2006/10/24 16:02:01 silver%warwickcompsoc.co.uk Exp $ + */ + +/* + * Constants + */ +const XMLRPCCLIENT_CONTRACTID = '@mozilla.org/xml-rpc/client;1'; +const XMLRPCCLIENT_CID = + Components.ID('{4d7d15c0-3747-4f7f-b6b3-792a5ea1a9aa}'); +const XMLRPCCLIENT_IID = Components.interfaces.nsIXmlRpcClient; + +const XMLRPCFAULT_CONTRACTID = '@mozilla.org/xml-rpc/fault;1'; +const XMLRPCFAULT_CID = + Components.ID('{691cb864-0a7e-448c-98ee-4a7f359cf145}'); +const XMLRPCFAULT_IID = Components.interfaces.nsIXmlRpcFault; + +const XMLHTTPREQUEST_CONTRACTID = '@mozilla.org/xmlextras/xmlhttprequest;1'; + +const NSICHANNEL = Components.interfaces.nsIChannel; + +const DEBUG = false; +const DEBUGPARSE = false; + +const DOMNode = Components.interfaces.nsIDOMNode; +/* + * Class definitions + */ + +/* The nsXmlRpcFault class constructor. */ +function nsXmlRpcFault() {} + +/* the nsXmlRpcFault class def */ +nsXmlRpcFault.prototype = { + faultCode: 0, + faultString: '', + + init: function(faultCode, faultString) { + this.faultCode = faultCode; + this.faultString = faultString; + }, + + toString: function() { + return ''; + }, + + // nsISupports interface + QueryInterface: function(iid) { + if (!iid.equals(Components.interfaces.nsISupports) && + !iid.equals(XMLRPCFAULT_IID)) + throw Components.results.NS_ERROR_NO_INTERFACE; + return this; + } +}; + +/* The nsXmlRpcClient class constructor. */ +function nsXmlRpcClient() {} + +/* the nsXmlRpcClient class def */ +nsXmlRpcClient.prototype = { + _serverUrl: null, + _useAuth: false, + + init: function(serverURL) { + this._serverUrl = serverURL; + this._encoding = "UTF-8"; + }, + + setAuthentication: function(username, password){ + if ((typeof username == "string") && + (typeof password == "string")){ + this._useAuth = true; + this._username = username; + this._password = password; + } + }, + + clearAuthentication: function(){ + this._useAuth = false; + }, + + setEncoding: function(encoding){ + this._encoding = encoding; + }, + + get serverUrl() { return this._serverUrl; }, + + // Internal copy of the status + _status: null, + _listener: null, + + asyncCall: function(listener, context, methodName, methodArgs, count) { + debug('asyncCall'); + // Check for call in progress. + if (this._inProgress) + return; + //throw Components.Exception('Call in progress!'); + + // Check for the server URL; + if (!this._serverUrl) + throw Components.Exception('Not initialized'); + + this._inProgress = true; + + // Clear state. + this._foundFault = false; + this._passwordTried = false; + this._result = null; + this._fault = null; + this._status = null; + this._responseStatus = null; + this._responseString = null; + this._listener = listener; + this._seenStart = false; + this._context = context; + + debug('Arguments: ' + methodArgs); + + // Generate request body + var xmlWriter = new XMLWriter(this._encoding); + this._generateRequestBody(xmlWriter, methodName, methodArgs); + + var requestBody = xmlWriter.data; + + debug('Request: ' + requestBody); + + this.xmlhttp = Components.classes[XMLHTTPREQUEST_CONTRACTID] + .createInstance(Components.interfaces.nsIXMLHttpRequest); + if (this._useAuth) { + this.xmlhttp.open('POST', this._serverUrl, true, + this._username, this._password); + } else { + this.xmlhttp.open('POST', this._serverUrl); + } + this.xmlhttp.onload = this._onload; + this.xmlhttp.onerror = this._onerror; + this.xmlhttp.parent = this; + this.xmlhttp.setRequestHeader('Content-Type','text/xml'); + this.xmlhttp.send(requestBody); + var chan = this.xmlhttp.channel.QueryInterface(NSICHANNEL); + chan.notificationCallbacks = this; + }, + + _onload: function(e) { + var result; + var parent = e.target.parent; + parent._inProgress = false; + parent._responseStatus = e.target.status; + parent._responseString = e.target.statusText; + if (!e.target.responseXML) { + if (e.target.status) { + try { + parent._listener.onError(parent, parent._context, + Components.results.NS_ERROR_FAILURE, + 'Server returned status ' + e.target.status); + } catch (ex) { + debug('Exception in listener.onError: ' + ex); + } + } else { + try { + parent._listener.onError(parent, parent._context, + Components.results.NS_ERROR_FAILURE, + 'Unknown network error'); + } catch (ex) { + debug('Exception in listener.onError: ' + ex); + } + } + return; + } + try { + e.target.responseXML.normalize(); + result = parent.parse(e.target.responseXML); + } catch (ex) { + try { + parent._listener.onError(parent, parent._context, + ex.result, ex.message); + } catch (ex) { + debug('Exception in listener.onError: ' + ex); + } + return; + } + if (parent._foundFault) { + parent._fault = result; + try { + parent._listener.onFault(parent, parent._context, result); + } catch(ex) { + debug('Exception in listener.onFault: ' + ex); + } + } else { + parent._result = result.value; + try { + parent._listener.onResult(parent, parent._context, + result.value); + } catch (ex) { + debug('Exception in listener.onResult: ' + ex); + } + } + }, + + _onerror: function(e) { + var parent = e.target.parent; + parent._inProgress = false; + try { + parent._listener.onError(parent, parent._context, + Components.results.NS_ERROR_FAILURE, + 'Unknown network error'); + } catch (ex) { + debug('Exception in listener.onError: ' + ex); + } + }, + + _foundFault: false, + + _fault: null, + _result: null, + _responseStatus: null, + _responseString: null, + + get fault() { return this._fault; }, + get result() { return this._result; }, + get responseStatus() { return this._responseStatus; }, + get responseString() { return this._responseString; }, + + /* Convenience. Create an appropriate XPCOM object for a given type */ + INT: 1, + BOOLEAN: 2, + STRING: 3, + DOUBLE: 4, + DATETIME: 5, + ARRAY: 6, + STRUCT: 7, + BASE64: 8, // Not part of nsIXmlRpcClient interface, internal use. + createType: function(type, uuid) { + const SUPPORTSID = '@mozilla.org/supports-'; + switch(type) { + case this.INT: + uuid.value = Components.interfaces.nsISupportsPRInt32 + return createInstance(SUPPORTSID + 'PRInt32;1', + 'nsISupportsPRInt32'); + + case this.BOOLEAN: + uuid.value = Components.interfaces.nsISupportsPRBool + return createInstance(SUPPORTSID + 'PRBool;1', + 'nsISupportsPRBool'); + + case this.STRING: + uuid.value = Components.interfaces.nsISupportsCString + return createInstance(SUPPORTSID + 'cstring;1', + 'nsISupportsCString'); + + case this.DOUBLE: + uuid.value = Components.interfaces.nsISupportsDouble + return createInstance(SUPPORTSID + 'double;1', + 'nsISupportsDouble'); + + case this.DATETIME: + uuid.value = Components.interfaces.nsISupportsPRTime + return createInstance(SUPPORTSID + 'PRTime;1', + 'nsISupportsPRTime'); + + case this.ARRAY: + uuid.value = Components.interfaces.nsISupportsArray + return createInstance(SUPPORTSID + 'array;1', + 'nsISupportsArray'); + + case this.STRUCT: + uuid.value = Components.interfaces.nsIDictionary + return createInstance('@mozilla.org/dictionary;1', + 'nsIDictionary'); + + default: throw Components.Exception('Unsupported type'); + } + }, + + // nsISupports interface + QueryInterface: function(iid) { + if (!iid.equals(Components.interfaces.nsISupports) && + !iid.equals(XMLRPCCLIENT_IID) && + !iid.equals(Components.interfaces.nsIInterfaceRequestor)) + throw Components.results.NS_ERROR_NO_INTERFACE; + return this; + }, + + // nsIInterfaceRequester interface + getInterface: function(iid, result){ + if (iid.equals(Components.interfaces.nsIAuthPrompt)){ + return this; + } + Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; + return null; + }, + + // nsIAuthPrompt interface + _passwordTried: false, + promptUsernameAndPassword: function(dialogTitle, text, passwordRealm, + savePassword, user, pwd){ + + if (this._useAuth){ + if (this._passwordTried){ + return false; + } + user.value = this._username; + pwd.value = this._password; + this._passwordTried = true; + return true; + } + return false; + }, + + /* Generate the XML-RPC request body */ + _generateRequestBody: function(writer, methodName, methodArgs) { + writer.startElement('methodCall'); + + writer.startElement('methodName'); + writer.write(methodName); + writer.endElement('methodName'); + + writer.startElement('params'); + for (var i = 0; i < methodArgs.length; i++) { + writer.startElement('param'); + this._generateArgumentBody(writer, methodArgs[i]); + writer.endElement('param'); + } + writer.endElement('params'); + + writer.endElement('methodCall'); + }, + + /* Write out a XML-RPC parameter value */ + _generateArgumentBody: function(writer, obj) { + writer.startElement('value'); + var sType = this._typeOf(obj); + switch (sType) { + case 'PRUint8': + case 'PRUint16': + case 'PRInt16': + case 'PRInt32': + obj=obj.QueryInterface(Components.interfaces['nsISupports' + + sType]); + writer.startElement('i4'); + writer.write(obj.toString()); + writer.endElement('i4'); + break; + + case 'PRBool': + obj=obj.QueryInterface(Components.interfaces.nsISupportsPRBool); + writer.startElement('boolean'); + writer.write(obj.data ? '1' : '0'); + writer.endElement('boolean'); + break; + + case 'Char': + case 'CString': + obj=obj.QueryInterface(Components.interfaces['nsISupports' + + sType]); + writer.startElement('string'); + writer.write(obj.toString()); + writer.endElement('string'); + break; + + case 'Float': + case 'Double': + obj=obj.QueryInterface(Components.interfaces['nsISupports' + + sType]); + writer.startElement('double'); + writer.write(obj.toString()); + writer.endElement('double'); + break; + + case 'PRTime': + obj = obj.QueryInterface( + Components.interfaces.nsISupportsPRTime); + var date = new Date(obj.data) + writer.startElement('dateTime.iso8601'); + writer.write(iso8601Format(date)); + writer.endElement('dateTime.iso8601'); + break; + + case 'InputStream': + obj = obj.QueryInterface(Components.interfaces.nsIInputStream); + obj = toScriptableStream(obj); + writer.startElement('base64'); + streamToBase64(obj, writer); + writer.endElement('base64'); + break; + + case 'Array': + obj = obj.QueryInterface( + Components.interfaces.nsISupportsArray); + writer.startElement('array'); + writer.startElement('data'); + for (var i = 0; i < obj.Count(); i++) + this._generateArgumentBody(writer, obj.GetElementAt(i)); + writer.endElement('data'); + writer.endElement('array'); + break; + + case 'Dictionary': + obj = obj.QueryInterface(Components.interfaces.nsIDictionary); + writer.startElement('struct'); + var keys = obj.getKeys({}); + for (var k = 0; k < keys.length; k++) { + writer.startElement('member'); + writer.startElement('name'); + writer.write(keys[k]); + writer.endElement('name'); + this._generateArgumentBody(writer, obj.getValue(keys[k])); + writer.endElement('member'); + } + writer.endElement('struct'); + break; + + default: + throw Components.Exception('Unsupported argument', null, null, + obj); + } + + writer.endElement('value'); + }, + + /* Determine type of a nsISupports primitive, array or dictionary. */ + _typeOf: function(obj) { + // XPConnect alows JS to pass in anything, because we are a regular + // JS object to it. So we have to test rigorously. + if (typeof obj != 'object') return 'Unknown'; + + // Anything else not nsISupports is not allowed. + if (typeof obj.QueryInterface != 'function') return 'Unknown'; + + // Now we will have to eliminate by trying all possebilities. + try { + obj.QueryInterface(Components.interfaces.nsISupportsPRUint8); + return 'PRUint8'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsISupportsPRUint16); + return 'PRUint16'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsISupportsPRInt16); + return 'PRInt16'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsISupportsPRInt32); + return 'PRInt32'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsISupportsPRBool); + return 'PRBool'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsISupportsChar); + return 'Char'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsISupportsCString); + return 'CString'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsISupportsFloat); + return 'Float'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsISupportsDouble); + return 'Double'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsISupportsPRTime); + return 'PRTime'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsIInputStream); + return 'InputStream'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsISupportsArray); + return 'Array'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsIDictionary); + return 'Dictionary'; + } catch(e) {} + + // Not a supported type + return 'Unknown'; + }, + + // Response parsing state + _valueStack: [], + _currValue: null, + _cdata: null, + + parse: function(doc) { + var node = doc.firstChild; + var result; + if (node.nodeType == DOMNode.TEXT_NODE) + node = node.nextSibling; + if ((node.nodeType != DOMNode.ELEMENT_NODE) || + (node.nodeName != 'methodResponse')) { + throw Components.Exception('Expecting a methodResponse', null, null, + doc); + } + node = node.firstChild; + if (node.nodeType == DOMNode.TEXT_NODE) + node = node.nextSibling; + if (node.nodeType != DOMNode.ELEMENT_NODE) + throw Components.Exception('Expecting a params or fault', null, + null, doc); + if (node.nodeName == 'params') { + node = node.firstChild; + if (node.nodeType == DOMNode.TEXT_NODE) + node = node.nextSibling; + if ((node.nodeType != DOMNode.ELEMENT_NODE) || + (node.nodeName != 'param')) { + throw Components.Exception('Expecting a param', null, null, + doc); + } + result = this.parseValue(node.firstChild); + } else if (node.nodeName == 'fault') { + this._foundFault = true; + result = this.parseFault(node.firstChild); + } else { + throw Components.Exception('Expecting a params or fault', null, + null, doc); + } + debug('Parse finished'); + return result; + }, + + parseValue: function(node) { + var cValue = new Value(); + if (node && (node.nodeType == DOMNode.TEXT_NODE)) + node = node.nextSibling; + if (!node || (node.nodeType != DOMNode.ELEMENT_NODE) || + (node.nodeName != 'value')) { + throw Components.Exception('Expecting a value', null, null, node); + } + node = node.firstChild; + if (!node) + return cValue; + if (node.nodeType == DOMNode.TEXT_NODE){ + if (!node.nextSibling) { + cValue.value = node.nodeValue; + return cValue; + } else { + node = node.nextSibling; + } + } + if (node.nodeType != DOMNode.ELEMENT_NODE) + throw Components.Exception('Expecting a value type', null, null, + node); + switch (node.nodeName) { + case 'string': + cValue.value = this.parseString(node.firstChild); + break; + case 'i4': + case 'int': + cValue.type = this.INT; + cValue.value = this.parseString(node.firstChild); + break; + case 'boolean': + cValue.type = this.BOOLEAN; + cValue.value = this.parseString(node.firstChild); + break; + case 'double': + cValue.type = this.DOUBLE; + cValue.value = this.parseString(node.firstChild); + break; + case 'dateTime.iso8601': + cValue.type = this.DATETIME; + cValue.value = this.parseString(node.firstChild); + break; + case 'base64': + cValue.type = this.BASE64; + cValue.value = this.parseString(node.firstChild); + break; + case 'struct': + cValue.type = this.STRUCT; + this.parseStruct(cValue, node.firstChild); + break; + case 'array': + cValue.type = this.ARRAY; + this.parseArray(cValue, node.firstChild); + break; + default: + throw Components.Exception('Expecting a value type', null, null, + node); + } + return cValue; + }, + + parseString: function(node) { + value = ''; + while (node) { + if (node.nodeType != DOMNode.TEXT_NODE) + throw Components.Exception('Expecting a text node', null, null, + node); + value += node.nodeValue; + node = node.nextSibling; + } + return value; + }, + + parseStruct: function(struct, node) { + while (node) { + if (node.nodeType == DOMNode.TEXT_NODE) + node = node.nextSibling; + if (!node) + return; + if ((node.nodeType != DOMNode.ELEMENT_NODE) || + (node.nodeName != 'member')) { + throw Components.Exception('Expecting a member', null, null, + node); + } + this.parseMember(struct, node.firstChild); + node = node.nextSibling; + } + }, + + parseMember: function(struct, node) { + var cValue; + if (node.nodeType == DOMNode.TEXT_NODE) + node = node.nextSibling; + if (!node || (node.nodeType != DOMNode.ELEMENT_NODE) || + (node.nodeName != 'name')) { + throw Components.Exception('Expecting a name', null, null, node); + } + struct.name = this.parseString(node.firstChild); + cValue = this.parseValue(node.nextSibling); + struct.appendValue(cValue.value); + }, + + parseArray: function(array, node) { + if (node.nodeType == DOMNode.TEXT_NODE) + node = node.nextSibling; + if (!node || (node.nodeType != DOMNode.ELEMENT_NODE) || + (node.nodeName != 'data')) { + throw Components.Exception('Expecting array data', null, null, node); + } + for (node = node.firstChild; node; node = node.nextSibling) { + if (node.nodeType == DOMNode.TEXT_NODE) + continue; + array.appendValue(this.parseValue(node).value); + } + }, + + parseFault: function(node) { + var fault = createInstance(XMLRPCFAULT_CONTRACTID, 'nsIXmlRpcFault'); + var cValue = this.parseValue(node); + if ((cValue.type != this.STRUCT) || + (!cValue.value.hasKey('faultCode')) || + (!cValue.value.hasKey('faultString'))) { + throw Components.Exception('Invalid fault', null, null, node); + } + fault.init(cValue.value.getValue('faultCode').data, + cValue.value.getValue('faultString').data); + return fault; + } +}; + +/* The XMLWriter class constructor */ +function XMLWriter(encoding) { + if (!encoding) + encoding = "UTF-8"; + this.data = ''; +} + +/* The XMLWriter class def */ +XMLWriter.prototype = { + data: '', + + startElement: function(element) { + this.data += '<' + element + '>'; + }, + + endElement: function(element) { + this.data += '' + element + '>'; + }, + + write: function(text) { + for (var i = 0; i < text.length; i++) { + var c = text[i]; + switch (c) { + case '<': + this.data += '<'; + break; + case '&': + this.data += '&'; + break; + default: + this.data += c; + } + } + }, + + markup: function(text) { this.data += text } +}; + +/* The Value class contructor */ +function Value() { this.type = this.STRING; }; + +/* The Value class def */ +Value.prototype = { + INT: nsXmlRpcClient.prototype.INT, + BOOLEAN: nsXmlRpcClient.prototype.BOOLEAN, + STRING: nsXmlRpcClient.prototype.STRING, + DOUBLE: nsXmlRpcClient.prototype.DOUBLE, + DATETIME: nsXmlRpcClient.prototype.DATETIME, + ARRAY: nsXmlRpcClient.prototype.ARRAY, + STRUCT: nsXmlRpcClient.prototype.STRUCT, + BASE64: nsXmlRpcClient.prototype.BASE64, + + _createType: nsXmlRpcClient.prototype.createType, + + name: null, + + _value: null, + get value() { return this._value; }, + set value(val) { + // accepts [0-9]+ or x[0-9a-fA-F]+ and returns the character. + function entityTrans(substr, code) { + return String.fromCharCode("0" + code); + } + + switch (this.type) { + case this.STRING: + val = val.replace(/([0-9]+);/g, entityTrans); + val = val.replace(/(x[0-9a-fA-F]+);/g, entityTrans); + val = val.replace(/</g, '<'); + val = val.replace(/>/g, '>'); + val = val.replace(/&/g, '&'); + this._value.data = val; + break; + + case this.BOOLEAN: + this._value.data = (val == 1); + break; + + case this.DATETIME: + this._value.data = Date.UTC(val.slice(0, 4), + val.slice(4, 6) - 1, val.slice(6, 8), val.slice(9, 11), + val.slice(12, 14), val.slice(15)); + break; + + case this.BASE64: + this._value.data = base64ToString(val); + break; + + default: + this._value.data = val; + } + }, + + _type: null, + get type() { return this._type; }, + set type(type) { + this._type = type; + if (type == this.BASE64) + this._value = this._createType(this.STRING, {}); + else this._value = this._createType(type, {}); + }, + + appendValue: function(val) { + switch (this.type) { + case this.ARRAY: + this.value.AppendElement(val); + break; + + case this.STRUCT: + this.value.setValue(this.name, val); + break; + } + } +}; + +/* + * Objects + */ + +/* nsXmlRpcClient Module (for XPCOM registration) */ +var nsXmlRpcClientModule = { + registerSelf: function(compMgr, fileSpec, location, type) { + compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar); + + compMgr.registerFactoryLocation(XMLRPCCLIENT_CID, + 'XML-RPC Client JS component', + XMLRPCCLIENT_CONTRACTID, + fileSpec, + location, + type); + compMgr.registerFactoryLocation(XMLRPCFAULT_CID, + 'XML-RPC Fault JS component', + XMLRPCFAULT_CONTRACTID, + fileSpec, + location, + type); + }, + + getClassObject: function(compMgr, cid, iid) { + if (!cid.equals(XMLRPCCLIENT_CID) && !cid.equals(XMLRPCFAULT_CID)) + throw Components.results.NS_ERROR_NO_INTERFACE; + + if (!iid.equals(Components.interfaces.nsIFactory)) + throw Components.results.NS_ERROR_NOT_IMPLEMENTED; + + if (cid.equals(XMLRPCCLIENT_CID)) + return nsXmlRpcClientFactory + else return nsXmlRpcFaultFactory; + }, + + canUnload: function(compMgr) { return true; } +}; + +/* nsXmlRpcClient Class Factory */ +var nsXmlRpcClientFactory = { + createInstance: function(outer, iid) { + if (outer != null) + throw Components.results.NS_ERROR_NO_AGGREGATION; + + if (!iid.equals(XMLRPCCLIENT_IID) && + !iid.equals(Components.interfaces.nsISupports)) + throw Components.results.NS_ERROR_INVALID_ARG; + + return new nsXmlRpcClient(); + } +} + +/* nsXmlRpcFault Class Factory */ +var nsXmlRpcFaultFactory = { + createInstance: function(outer, iid) { + if (outer != null) + throw Components.results.NS_ERROR_NO_AGGREGATION; + + if (!iid.equals(XMLRPCFAULT_IID) && + !iid.equals(Components.interfaces.nsISupports)) + throw Components.results.NS_ERROR_INVALID_ARG; + + return new nsXmlRpcFault(); + } +} + +/* + * Functions + */ + +/* module initialisation */ +function NSGetModule(comMgr, fileSpec) { return nsXmlRpcClientModule; } + +/* Create an instance of the given ContractID, with given interface */ +function createInstance(contractId, intf) { + return Components.classes[contractId] + .createInstance(Components.interfaces[intf]); +} + +/* Get a pointer to a service indicated by the ContractID, with given interface */ +function getService(contractId, intf) { + return Components.classes[contractId] + .getService(Components.interfaces[intf]); +} + +/* Convert an inputstream to a scriptable inputstream */ +function toScriptableStream(input) { + var SIStream = Components.Constructor( + '@mozilla.org/scriptableinputstream;1', + 'nsIScriptableInputStream', 'init'); + return new SIStream(input); +} + +/* format a Date object into a iso8601 datetime string, UTC time */ +function iso8601Format(date) { + var datetime = date.getUTCFullYear(); + var month = String(date.getUTCMonth() + 1); + datetime += (month.length == 1 ? '0' + month : month); + var day = date.getUTCDate(); + datetime += (day < 10 ? '0' + day : day); + + datetime += 'T'; + + var hour = date.getUTCHours(); + datetime += (hour < 10 ? '0' + hour : hour) + ':'; + var minutes = date.getUTCMinutes(); + datetime += (minutes < 10 ? '0' + minutes : minutes) + ':'; + var seconds = date.getUTCSeconds(); + datetime += (seconds < 10 ? '0' + seconds : seconds); + + return datetime; +} + +/* Convert a stream to Base64, writing it away to a string writer */ +const BASE64CHUNK = 255; // Has to be dividable by 3!! +function streamToBase64(stream, writer) { + while (stream.available()) { + var data = []; + while (data.length < BASE64CHUNK && stream.available()) { + var d = stream.read(1).charCodeAt(0); + // reading a 0 results in NaN, compensate. + data = data.concat(isNaN(d) ? 0 : d); + } + writer.write(toBase64(data)); + } +} + +/* Convert data (an array of integers) to a Base64 string. */ +const toBase64Table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' + + '0123456789+/'; +const base64Pad = '='; +function toBase64(data) { + var result = ''; + var length = data.length; + var i; + // Convert every three bytes to 4 ascii characters. + for (i = 0; i < (length - 2); i += 3) { + result += toBase64Table[data[i] >> 2]; + result += toBase64Table[((data[i] & 0x03) << 4) + (data[i+1] >> 4)]; + result += toBase64Table[((data[i+1] & 0x0f) << 2) + (data[i+2] >> 6)]; + result += toBase64Table[data[i+2] & 0x3f]; + } + + // Convert the remaining 1 or 2 bytes, pad out to 4 characters. + if (length%3) { + i = length - (length%3); + result += toBase64Table[data[i] >> 2]; + if ((length%3) == 2) { + result += toBase64Table[((data[i] & 0x03) << 4) + (data[i+1] >> 4)]; + result += toBase64Table[(data[i+1] & 0x0f) << 2]; + result += base64Pad; + } else { + result += toBase64Table[(data[i] & 0x03) << 4]; + result += base64Pad + base64Pad; + } + } + + return result; +} + +/* Convert Base64 data to a string */ +const toBinaryTable = [ + -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, + -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, + -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63, + 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1, + -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14, + 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1, + -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40, + 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1 +]; +function base64ToString(data) { + var result = ''; + var leftbits = 0; // number of bits decoded, but yet to be appended + var leftdata = 0; // bits decoded, but yet to be appended + + // Convert one by one. + for (var i = 0; i < data.length; i++) { + var c = toBinaryTable[data.charCodeAt(i) & 0x7f]; + var padding = (data[i] == base64Pad); + // Skip illegal characters and whitespace + if (c == -1) continue; + + // Collect data into leftdata, update bitcount + leftdata = (leftdata << 6) | c; + leftbits += 6; + + // If we have 8 or more bits, append 8 bits to the result + if (leftbits >= 8) { + leftbits -= 8; + // Append if not padding. + if (!padding) + result += String.fromCharCode((leftdata >> leftbits) & 0xff); + leftdata &= (1 << leftbits) - 1; + } + } + + // If there are any bits left, the base64 string was corrupted + if (leftbits) + throw Components.Exception('Corrupted base64 string'); + + return result; +} + +if (DEBUG) debug = function(msg) { + dump(' -- XML-RPC client -- : ' + msg + '\n'); +}; +else debug = function() {} + +// vim:sw=4:sr:sta:et:sts: diff --git a/addons/thunderbird/plugin/components/xml-rpc.xpt b/addons/thunderbird/plugin/components/xml-rpc.xpt new file mode 100755 index 00000000000..8e59aa20c85 Binary files /dev/null and b/addons/thunderbird/plugin/components/xml-rpc.xpt differ diff --git a/addons/thunderbird/plugin/defaults/preferences/tiny.js b/addons/thunderbird/plugin/defaults/preferences/tiny.js new file mode 100755 index 00000000000..ca8332c868e --- /dev/null +++ b/addons/thunderbird/plugin/defaults/preferences/tiny.js @@ -0,0 +1,56 @@ + +pref("extensions.tiny.serverurl", "http://localhost"); +pref("extensions.tiny.serverport", "8069"); +pref("extensions.tiny.serverdbname", "terp"); +pref("extensions.tiny.username","admin"); +pref("extensions.tiny.password","admin"); +pref("extensions.tiny.senderemail",""); +pref("extensions.tiny.sendername",""); +pref("extensions.tiny.receiveremail",""); +pref("extensions.tiny.subject",""); +pref("extensions.tiny.receiveddate",""); +pref("extensions.tiny.partnerid",""); +pref("extensions.tiny.contactid",""); +pref("extensions.tiny.attachvalue",""); +pref("extensions.tiny.cclist",""); +pref("extensions.tiny.messagebody",""); +pref("extensions.tiny.displayName",""); +pref("extensions.tiny.attachmentdata",""); +pref("extensions.tiny.userid",3); +pref("extensions.tiny.partnername",""); +pref("extensions.tiny.officeno",""); +pref("extensions.tiny.phoneno",""); +pref("extensions.tiny.address",""); +pref("extensions.tiny.listobject","Partner,Partner Address,Accout Invoice,Project,Product,Account,Sale Order,Project Task"); +pref("extensions.tiny.object","res.partner,res.partner.address,account.invoice,project.project,product.product,account.account,sale.order,project.task"); +pref("extensions.tiny.imagename","chrome://openerp_plugin/skin/Partner.png,chrome://openerp_plugin/skin/Contact.png,chrome://openerp_plugin/skin/Invoice.png,chrome://openerp_plugin/skin/Project.png,chrome://openerp_plugin/skin/Product.png,chrome://openerp_plugin/skin/Account.png,chrome://openerp_plugin/skin/Sale.png,chrome://openerp_plugin/skin/Case.png,chrome://openerp_plugin/skin/Task.png"); +pref("extensions.tiny.attachmentlength",""); +pref("extensions.tiny.attachment",""); +pref("extensions.tiny.db_list","false"); +pref("extensions.tiny.connect_server","false"); +pref("extensions.tiny.module_install","yes"); +pref("extensions.tiny.serverprotocol", "false"); + + + +pref("mboximport.export.filenames_toascii", false); +pref("mboximport.export.overwrite", false); +pref("mboximport.confirm.before_mbox_import", true); +pref("mboximport.clipboard.always_just_text", false); +pref("mboximport.export.HTML_as_displayed", false); +pref("mboximport.exportEML.filename_format", 0); +pref("mboximport.delay.clean_statusbar", 5000); +pref("mboximport.subject.max_length", 50); +pref("mboximport.author.max_length", 50); +pref("mboximport.recipients.max_length", 50); +pref("extensions.{3ed8cc52-86fc-4613-9026-c1ef969da4c3}.description", "chrome://mboximport/locale/mboximport.properties"); +pref("mboximport.export.set_filetime", false); +pref("mboximport.exportEML.use_dir", false); +pref("mboximport.exportMBOX.use_dir", false); +pref("mboximport.exportMSG.use_dir", false); +pref("mboximport.export.filenames_addtime", false); +pref("mboximport.export_all.warning1", true); +pref("mboximport.export_all.warning2", true); + +pref("mboximport.exportMSG.dir", "/tmp"); + diff --git a/addons/thunderbird/plugin/install.js b/addons/thunderbird/plugin/install.js new file mode 100755 index 00000000000..50e4b301e32 --- /dev/null +++ b/addons/thunderbird/plugin/install.js @@ -0,0 +1,105 @@ +// constants +const APP_DISPLAY_NAME = "OpenERP Thunderbird Plugins"; +const APP_NAME = "OpenERP"; +const APP_VERSION = "1.0"; +const WARNING = "WARNING: You need administrator privileges to install OpenERP Thunderbird Plugin. It will be installed in the application directory for all users."; +const VERSION_ERROR = "This extension can only be installed in a version higher than 2.0"; +const NOT_WRITABLE_ERROR = "This extension requires write access to the application directory to install properly." +const locales = [ + "en-US", + null +]; + +// Gecko 1.7 doesn't support custom button labels +var incompatible = (typeof Install.BUTTON_POS_0 == "undefined"); +if (incompatible) + alert(VERSION_ERROR); + +if (!incompatible) { + // Check whether all directories can be accessed + var dirList = [ + getFolder("Components"), + getFolder(getFolder("Program", "defaults"), "pref") + ]; + for (var i = 0; i < dirList.length; i++) + if (!File.isWritable(dirList[i])) + incompatible = true; + + if (incompatible) + alert(NOT_WRITABLE_ERROR); +} + +if (!incompatible && confirm(WARNING, APP_DISPLAY_NAME)) { + /* Pre-Install Cleanup (for prior versions) */ + + // List of files to be checked + var checkFiles = [ + [getFolder("Components"), "nsXmlRpcClient.js"], // Root component + [getFolder("Components"), "xml-rpc.xpt"], // Component interface + ]; + + // Remove any existing files + initInstall("pre-install", "/rename", "0.0"); // open dummy-install + for (var i = 0 ; i < checkFiles.length ; i++) { + var currentDir = checkFiles[i][0]; + var name = checkFiles[i][1]; + var oldFile = getFolder(currentDir, name); + + // Find a name to rename the file into + var newName = name + "-uninstalled"; + for (var n = 1; File.exists(oldFile) && File.exists(getFolder(currentDir, newName)); n++) + newName = name + n + "-uninstalled"; + + if (File.exists(oldFile)) + File.rename(oldFile, newName); + } + performInstall(); // commit renamed files + + /* Main part of the installation */ + + var chromeType = DELAYED_CHROME; + + var files = [ + ["components/nsXmlRpcClient.js", getFolder("Components")], + ["components/xml-rpc.xpt", getFolder("Components")], + ["defaults/preferences/tiny.js", getFolder(getFolder("Program", "defaults"), "pref")], + ]; + + // initialize our install + initInstall(APP_NAME, APP_PACKAGE, APP_VERSION); + + // Add files + for (var i = 0; i < files.length; i++) + addFile(APP_NAME, APP_VERSION, files[i][0], files[i][1], null); + + try { + var err = registerChrome(CONTENT | chromeType, jar, "content/"); + if (err != SUCCESS) + throw "Chrome registration for content failed (error code " + err + ")."; + + err = registerChrome(SKIN | chromeType, jar, "skin/classic/"); + if (err != SUCCESS) + throw "Chrome registration for skin failed (error code " + err + ")."; + + for (i = 0; i < locales.length; i++) { + if (!locales[i]) + continue; + + err = registerChrome(LOCALE | chromeType, jar, "locale/" + locales[i] + "/"); + if (err != SUCCESS) + throw "Chrome registration for " + locales[i] + " locale failed (error code " + err + ")."; + } + + var err = performInstall(); + if (err != SUCCESS && err != 999) + throw "Committing installation failed (error code " + err + ")."; + + alert("OpenERP Thunderbird Plugin " + APP_VERSION + " is now installed.\n" + + "It will become active after you restart your browser."); + } + catch (ex) { + alert("Installation failed: " + ex + "\n" + + "You probably don't have the necessary permissions (log in as system administrator)."); + cancelInstall(err); + } +} diff --git a/addons/thunderbird/plugin/install.rdf b/addons/thunderbird/plugin/install.rdf new file mode 100755 index 00000000000..07fdd116744 --- /dev/null +++ b/addons/thunderbird/plugin/install.rdf @@ -0,0 +1,22 @@ + + + + {d57f315a-9f5d-4366-a530-a769a4a8c949} + chrome://openerp_plugin/skin/tinyerp-icon.ico + OpenERP Plugin for Thunderbird 2.0 + 1.0 + OpenERP Thunderbird Integration + OpenERP SA + + http://openerp.com + + + + {3550f703-e582-4d05-9a08-453d09bdfdc6} + 2.0 + 3.0.* + + + + diff --git a/addons/thunderbird/plugin/openerp_plugin.xpi b/addons/thunderbird/plugin/openerp_plugin.xpi new file mode 100644 index 00000000000..c9715e48e50 Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin.xpi differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome.manifest b/addons/thunderbird/plugin/openerp_plugin/chrome.manifest new file mode 100755 index 00000000000..5fa9c2f5754 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome.manifest @@ -0,0 +1,5 @@ +content openerp_plugin jar:chrome/openerp_plugin.jar!/content/ +overlay chrome://messenger/content/messenger.xul chrome://openerp_plugin/content/overlay.xul +locale openerp_plugin en-US jar:chrome/openerp_plugin.jar!/locale/en-US/ +skin openerp_plugin classic/1.0 jar:chrome/openerp_plugin.jar!/skin/ +#style chrome://global/content/customizeToolbar.xul chrome://openerp_plugin/skin/overlay.css diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar new file mode 100644 index 00000000000..26bdfe94a26 Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/address.xul b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/address.xul new file mode 100644 index 00000000000..2d6f0e2dec1 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/address.xul @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config.js b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config.js new file mode 100755 index 00000000000..5757897de96 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config.js @@ -0,0 +1,163 @@ + +function config_close() +{ + //window.close("chrome://openerp_plugin/content/config_change.xul", "", "chrome"); + //ksa + window.close("chrome://openerp_plugin/content/config_change.xul", "", "chrome"); + window.open("chrome://openerp_plugin/content/config.xul", "", "chrome"); +} + +//set the value of the configuration fields +function config_change_load() +{ + var s = getServer(); + var a =s.split(':'); + if (String(a)=="" || String(a)=="undefined"){ + document.getElementById('txtcurl').value = "localhost" + document.getElementById('txtcport').value = "8069" + } + else + { + len = a[1]; + var url = ""; + for (i=0;i0){ + var objectcharpref = ''; + var imagecharpref = ''; + var objcharpref = ''; + var nodelist = document.getElementById("listObjectListBox").selectedItem.childNodes + var childnode = document.getElementById("listObjectListBox").childNodes + for(i=2;i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + &develop.value; + + + &information.value; + &openerp.value; + &axelor.value; + &tinyerp.value; + + + Copyright © 2006-TODAY OpenERP SA All Rights Reserved. + OpenERP is a trademark of the OpenERP SA Company. OpenERP Web is jointly developed by OpenERP SA and Axelor. + Licenced under the terms of OpenERP Public License (OEPL) v1.1 (https://tiny.odoo.com/LICENSE.txt) + + + + + + + + + diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config_change.xul b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config_change.xul new file mode 100644 index 00000000000..1e23652d98b --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config_change.xul @@ -0,0 +1,33 @@ + + + + + + + + + + + + Openerp Connection + + + + + + + + + + + + + + + + + + + diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/create.xul b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/create.xul new file mode 100644 index 00000000000..d3d551d63e8 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/create.xul @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/createpartner.xul b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/createpartner.xul new file mode 100644 index 00000000000..abc23a5b430 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/createpartner.xul @@ -0,0 +1,26 @@ + + + + + + + + + + + + &name.value; + + + + + + + + + + + + diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/exportTools.js b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/exportTools.js new file mode 100644 index 00000000000..7da3701b1f3 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/exportTools.js @@ -0,0 +1,248 @@ + +var MBstrBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"]. + getService(Components.interfaces.nsIStringBundleService); +var mboximportbundle = MBstrBundleService.createBundle("chrome://openerp_plugin/locale/mboximport.properties"); + + +function saveMsgAsEML(msguri,file,append,uriArray,hdrArray,fileArray) { + + var myEMLlistner = { + + scriptStream : null, + emailtext : "", + + QueryInterface : function(iid) { + if (iid.equals(Components.interfaces.nsIStreamListener) || + iid.equals(Components.interfaces.nsIMsgHeaderSink) || + iid.equals(Components.interfaces.nsISupports)) + return this; + + throw Components.results.NS_NOINTERFACE; + return 0; + }, + + onStartRequest : function (aRequest, aContext) { + this.scriptStream = Components.classes['@mozilla.org/binaryinputstream;1'].createInstance(Components.interfaces.nsIBinaryInputStream); + }, + + onStopRequest : function (aRequest, aContext, aStatusCode) { + this.scriptStream = null; + + if (append) { + if (this.emailtext != "") { + var data = this.emailtext + "\n"; + // Some Imap servers don't add to the message the "From" prologue + if (data && ! data.match(/^From/)) { + var now = new Date; + var prologue = "From - " + now.toString() + "\n"; + data = prologue+data; + } + data = IETescapeBeginningFrom(data); + } + var fileClone = file.clone(); + IETwriteDataOnDisk(fileClone,data,true,this.sub,null); + } + else { + if (! hdrArray) + var sub = getSubjectForHdr(hdr); + else { + var parts = hdrArray[IETexported].split("§][§^^§"); + var sub = parts[4]; + } + + var data = this.emailtext.replace(/^From.+\r?\n]/, ""); + data = IETescapeBeginningFrom(data); + var clone = file.clone(); + // The name is taken from the subject "corrected" + clone.append(sub+".eml"); + clone.createUnique(0,0644); + var time = (hdr.dateInSeconds)*1000; + IETwriteDataOnDisk(clone,data,false,null,time); + } + IETexported = IETexported + 1; + IETwritestatus(mboximportbundle.GetStringFromName("exported")+" "+IETexported+" "+mboximportbundle.GetStringFromName("msgs")+" "+IETtotal); + + if (IETexported < IETtotal) { + if (fileArray) { + var nextUri = uriArray[IETexported]; + var nextFile = fileArray[IETexported]; + } + else if (! hdrArray) { + var nextUri = uriArray[IETexported]; + var nextFile = file; + } + else { + parts = hdrArray[IETexported].split("§][§^^§"); + var nextUri = parts[5]; + var nextFile = file; + } + saveMsgAsEML(nextUri,nextFile,append,uriArray,hdrArray,fileArray); + } + else { + IETexported = 0; + IETtotal = 0; + } + }, + + onDataAvailable : function (aRequest, aContext, aInputStream, aOffset, aCount) { + this.scriptStream.setInputStream(aInputStream); + var chunk = this.scriptStream.readBytes(aCount); + this.emailtext += chunk; + } + }; + var mms = messenger.messageServiceFromURI(msguri).QueryInterface(Components.interfaces.nsIMsgMessageService); + var hdr = mms.messageURIToMsgHdr(msguri); + mms.streamMessage(msguri, myEMLlistner, msgWindow, null, false, null); +} + + +function nametoascii(str) { + if (! gPrefBranch.getBoolPref("mboximport.export.filenames_toascii")) { + str = str.replace(/[\x00-\x19]/g,"_"); + return str.replace(/[\/\\:,<>*\?\"\|]/g,"_"); + } + if (str) + str = str.replace(/[^a-zA-Z0-9]/g,"_"); + else + str = "Undefinied_or_empty"; + return str; +} + + +function IETwriteDataOnDisk(file,data,append,name,time) { + var foStream = Components.classes["@mozilla.org/network/file-output-stream;1"] + .createInstance(Components.interfaces.nsIFileOutputStream); + if (append) { + file.append(name); + foStream.init(file, 0x02 | 0x08 | 0x10, 0664, 0); // write, create, append + } + else + foStream.init(file, 0x02 | 0x08 | 0x20, 0664, 0); // write, create, truncate + if (data) + foStream.write(data,data.length); + foStream.close(); + var prefs = Components.classes["@mozilla.org/preferences-service;1"] + .getService(Components.interfaces.nsIPrefBranch); + if (time && prefs.getBoolPref("mboximport.export.set_filetime")) + file.lastModifiedTime = time; +} + + + +function IETescapeBeginningFrom(data) { + // Workaround to fix the "From " in beginning line problem in body messages + // See https://bugzilla.mozilla.org/show_bug.cgi?id=119441 and + // https://bugzilla.mozilla.org/show_bug.cgi?id=194382 + // TB2 has uncorrect beahviour with html messages + // This is not very fine, but I didnt' find anything better... + var datacorrected = data.replace(/\nFrom /g, "\n From "); + return datacorrected; +} + + +function getPredefinedFolder(type) { + var prefs = Components.classes["@mozilla.org/preferences-service;1"] + .getService(Components.interfaces.nsIPrefBranch); + // type 0 = folder + // type 1 = all messages + // type 2 = selected messages + + var use_dir = "mboximport.exportMSG.use_dir"; + + var dir_path=""; + if(navigator.userAgent.indexOf('Linux')!= -1){ + dir_path ="/tmp" + } + else if(navigator.userAgent.indexOf('Win')!= -1){ + dir_path ="C:\\" + } + else if(navigator.userAgent.indexOf('Mac OS X')!= -1){ + dir_path ="/tmp" + } + try { + var localFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); + localFile.initWithPath(dir_path); + return localFile; + + } + catch(e) { + return null; + } +} + +function getSubjectForHdr(hdr) { + var emlNameType = gPrefBranch.getIntPref("mboximport.exportEML.filename_format"); + var mustcorrectname = gPrefBranch.getBoolPref("mboximport.export.filenames_toascii"); + var subMaxLen = gPrefBranch.getIntPref("mboximport.subject.max_length")-1; + if (hdr.mime2DecodedSubject) + + var subj = hdr.mime2DecodedSubject.substring(0, subMaxLen); + else + var subj =IETnosub; + subj = nametoascii(subj); + var dateInSec = hdr.dateInSeconds; + var msgDate8601string = dateInSecondsTo8601(dateInSec); + var key = hdr.messageKey; + if (emlNameType == 2) { + var pattern = gPrefBranch.getCharPref("mboximport.export.filename_pattern"); + pattern = pattern.replace("%s",subj); + pattern = pattern.replace("%k",key); + pattern = pattern.replace("%d", msgDate8601string); + pattern = pattern.replace(/-%e/g, ""); + pattern = pattern.replace(/[\x00-\x19]/g,"_"); + var fname = pattern; + } + else { + + var fname = msgDate8601string+"-"+subj+"-"+hdr.messageKey; + } + setFileName(fname) + fname = fname.replace(/[\x00-\x19]/g,"_"); + if (mustcorrectname) + fname = nametoascii(fname); + else + fname = fname.replace(/[\/\\:,<>*\?\"\|]/g,"_"); + return fname; +} + +function dateInSecondsTo8601(secs) { + var addTime = gPrefBranch.getBoolPref("mboximport.export.filenames_addtime"); + var msgDate = new Date(secs*1000); + var msgDate8601 = msgDate.getFullYear(); + if (msgDate.getMonth() < 9) + var month = "0"+(msgDate.getMonth()+1); + else + var month = msgDate.getMonth()+1; + if (msgDate.getDate() < 10) + var day = "0"+ msgDate.getDate(); + else + var day = msgDate.getDate(); + var msgDate8601string = msgDate8601.toString()+month.toString()+day.toString(); + if (addTime && gPrefBranch.getIntPref("mboximport.exportEML.filename_format") == 2) { + if (msgDate.getHours() < 10) + var hours = "0"+msgDate.getHours(); + else + var hours = msgDate.getHours(); + if (msgDate.getMinutes() < 10) + var min = "0"+msgDate.getMinutes(); + else + var min = msgDate.getMinutes(); + msgDate8601string += "-"+ hours.toString() + min.toString(); + } + return msgDate8601string; +} + +function IETwritestatus(text) { + document.getElementById("statusText").setAttribute("label", text); + var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); + var delay = prefs.getIntPref("mboximport.delay.clean_statusbar"); + if (delay > 0) + window.setTimeout(function(){IETdeletestatus(text);}, delay); +} + +function IETdeletestatus(text) { + if (document.getElementById("statusText").getAttribute("label") == text) + document.getElementById("statusText").setAttribute("label", ""); +} + + diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/loaddata.js b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/loaddata.js new file mode 100755 index 00000000000..8a3b226f68e --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/loaddata.js @@ -0,0 +1,134 @@ +//gives the preference branch instance +var preferenceBranch = getPref(); + +//returns the selected checkbox for searching +function getnamesearch() +{ + var checkboxlist = []; + var j=0; + var objectlist = preferenceBranch.getCharPref("object").split(','); + if (objectlist[0]!=''){ + for (var i=1;i<=objectlist.length;i++) + { + if(document.getElementById('cbx'+i) && document.getElementById('cbx'+i).checked == true) + { + checkboxlist[j] = objectlist[i-1] //document.getElementById('cbx'+i).label; + j++; + } + } + } + return checkboxlist; +} +//function to set the text value for the selected partner for contact creation +function selectPartner(){ + if(document.getElementById('listPartnerBox').selectedItem){ + var listselectedItem = document.getElementById('listPartnerBox').selectedItem; + var value = listselectedItem.firstChild.getAttribute('label'); + setPartnerId(listselectedItem.value); + document.getElementById('txtselectpartner').setAttribute('value',value); + window.opener.document.getElementById('txtselectpartner').setAttribute('value',value); + } + else{ + window.opener.document.getElementById('txtselectpartner').setAttribute('value',''); + } +} + +//function for the intialization procedure //used while loading and unloading of the window +var myPrefObserver = +{ + //set the intial value of the email for the text field in plugin window and also loads the listbox of objects with image + loaddata: function() + { + setTimeout("listSearchDocumentAttachment()", 0) + }, + + //set the initial value of name and email field of create contact window + createContact: function() + { + document.getElementById("txtname").value = getSenderName(); + document.getElementById("txtemail").value = getSenderEmail(); + document.getElementById("country").value = getAllCountry(); + document.getElementById("state").value = getAllState(); + setPartnerId(0); + }, + + //sets the value of email information in preferences and adds observer for the window + register: function() + { + appendDbList() + preferenceBranch.addObserver("", myPrefObserver, false); + document.getElementById("txturl").value = getServer(); + var s = document.getElementById('txturl').value; + var a =s.split(':'); + setPort(a[a.length-1]); + document.getElementById("txtusername").value = getUsername(); + document.getElementById("txtpassword").value = getPassword(); + document.getElementById("DBlist_text").value = getDbName(); + if(getPref().getCharPref("object") != ''){ + var objectlist = getPref().getCharPref("object").split(','); + var imagelist = getPref().getCharPref("imagename").split(','); + var obj = getPref().getCharPref("listobject").split(','); + if(objectlist.length>0){ + for(i=0;i 2) + { + var emlsArray = gFolderDisplay.selectedMessages; + } + else + { + var emlsArray = GetSelectedMessages(); + } + + IETtotal = emlsArray.length; + IETexported = 0; + var msguri = emlsArray[0]; + + if(GetNumSelectedMessages() < 1 || GetNumSelectedMessages() > 1){ + alert("You must select only one mail to archive"); + return false + } + + //gives the selected email uri + var messageUri= gDBView.URIForFirstSelectedMessage; + + var messenger = Components.classes['@mozilla.org/messenger;1'].createInstance(Components.interfaces.nsIMessenger); + + //gives the selected email object + var message = messenger.messageServiceFromURI(messageUri).messageURIToMsgHdr(messageUri); + + + if (version > 2) + { + m_uri = message.folder.getUriForMsg(message); + saveMsgAsEML(m_uri,file,false,emlsArray,null); + } + else + { + saveMsgAsEML(msguri,file,false,emlsArray,null); + } + + //gives the received email date + var stdate = new Date(message.date / 1000); + + //functionality to split the author name and email + if(message.author.charAt(0) == '"'){ + sendername = message.author.split('"')[1].split('"')[0]; + } + else if(message.author.indexOf('<')!=-1){ + sendername = message.author.split('<')[0]; + } + else{ + sendername = message.author; + } + if(message.author.indexOf('<')!=-1){ + senderemail = message.author.split('<')[1].split('>')[0]; + } + else{ + senderemail = message.author + } + + //gives the receiver email address + receiveremail = message.mime2DecodedRecipients; + + //parsing the received date in the particular format + receivedDate = stdate.getFullYear()+'/'+(stdate.getMonth()+1)+'/'+stdate.getDate(); + + //gives the selected email subject + subject = message.subject; + + //gives the selected email cclist + cclist = message.ccList; + + //gives the selected email message body in text format + if (version > 2) + { + var listener = Components.classes["@mozilla.org/network/sync-stream-listener;1"].createInstance(Components.interfaces.nsISyncStreamListener); + var uri = message.folder.getUriForMsg(message); + messenger.messageServiceFromURI(uri) + .streamMessage(uri, listener, null, null, false, ""); + var folder = message.folder; + messagebody = folder.getMsgTextFromStream(listener.inputStream,message.Charset,65536,32768,false,true,{}) + } + else + { + messagebody = getMessageBrowser().docShell.contentViewer.DOMDocument.body.textContent; + } + //gives the selected email message body in html format + msghtmlbody = ""// getMessageBrowser().docShell.contentViewer.DOMDocument.body.innerHTML; + + //set the initial information for the selected email + setSenderEmail(senderemail); + setSenderName(sendername); + setReceiverEmail(receiveremail); + setSubject(subject); + setReceivedDate(receivedDate); + setCCList(cclist); + setMessageBody(messagebody); + getPref().setCharPref('displayName',''); + getPref().setCharPref('attachmentdata',''); + name = []; + test = []; + getPref().setCharPref('attachmentlength',currentAttachments.length); + //retrieving the information for the selected email's attachment + if(currentAttachments.length > 0){ + for(i=0;i 1){ + alert("You must select only one mail For Open Contact Detail"); + return false + } + + //gives the selected email uri + var messageUri= gDBView.URIForFirstSelectedMessage; + + var messenger = Components.classes['@mozilla.org/messenger;1'].createInstance(Components.interfaces.nsIMessenger); + + //gives the selected email object + var message = messenger.messageServiceFromURI(messageUri).messageURIToMsgHdr(messageUri); + + //functionality to split the author name and email + if(message.author.charAt(0) == '"'){ + sendername = message.author.split('"')[1].split('"')[0]; + } + else if(message.author.indexOf('<')!=-1){ + sendername = message.author.split('<')[0]; + } + else{ + sendername = message.author; + } + if(message.author.indexOf('<')!=-1){ + senderemail = message.author.split('<')[1].split('>')[0]; + } + else{ + senderemail = message.author + } + + //set the initial information for the selected email + setSenderEmail(senderemail); + setSenderName(sendername); + setPartnerName(""); + setStreet(""); + setStreet2(""); + setZipCode(""); + setCity(""); + setOfficenumber(""); + setFax(""); + setMobilenumber(""); + + if (getmodule_install() == "no") + { + alert("Please install the thunderbird module on your '" + getDbName() +"' database Or try again !"); + return false + } + window.open("chrome://openerp_plugin/content/address.xul", "", "chrome, resizable=yes"); + +} + +//function to open the configuration window +var Config = { + onLoad: function() { + // initialization code + this.initialized = true; + }, + + onMenuItemCommand: function() { + window.open("chrome://openerp_plugin/content/config.xul", "", "chrome"); + } +}; +window.addEventListener("load", function(e) { Config.onLoad(e); }, false); + +//function to open the plugin window for searching the records for a particular object +var Plugin = { + onLoad: function() { + this.initialized = true; + }, + + onMenuItemCommand: function() { + window.open("chrome://openerp_plugin/content/plugin.xul", "", "chrome, resizable=yes"); + } +}; +window.addEventListener("load", function(e) { Plugin.onLoad(e); }, false); + +//function to open the window for creating a new partner contact +var Create = { + onLoad: function(){ + this.initialized=true; + }, + + onMenuItemCommand: function(){ + window.open("chrome://openerp_plugin/content/create.xul", "", "chrome"); + } +}; +window.addEventListener("load", function(e) { Create.onLoad(e); }, false); + +var Address = { + onLoad: function(){ + this.initialized=true; + }, + + onMenuItemCommand: function(){ + open_contact(); + searchContact(); + } +}; + + +//function to open the window for selecting the partner for a new contact creation +var Select = { + onLoad: function(){ + this.initialized=true; + }, + + onMenuItemCommand: function(){ + window.open("chrome://openerp_plugin/content/selectpartner.xul", "", "chrome"); + } +}; + +var CreatePartner = { + onLoad: function(){ + this.initialized=true; + }, + + onMenuItemCommand: function(){ + window.open("chrome://openerp_plugin/content/createpartner.xul", "", "chrome"); + } +}; +window.addEventListener("load", function(e) { CreatePartner.onLoad(e); }, false); + diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.xul b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.xul new file mode 100755 index 00000000000..1956ebe89c2 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.xul @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/plugin.xul b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/plugin.xul new file mode 100644 index 00000000000..137bdca7904 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/plugin.xul @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Documents + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/selectpartner.xul b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/selectpartner.xul new file mode 100644 index 00000000000..f0512339a40 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/selectpartner.xul @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/static.js b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/static.js new file mode 100644 index 00000000000..c44c5bf7bb4 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/static.js @@ -0,0 +1,19 @@ + +//function to check all the checkbox +function selectAllCheckbox() +{ + var objectlist = preferenceBranch.getCharPref("object").split(','); + if(objectlist.length == 1 && objectlist[0]==''){ + return false; + } + for (var i=1;i<=objectlist.length;i++) + { + var checkboxobj = document.getElementById('cbx'+i); + if (!checkboxobj) + continue + if(document.getElementById('cbxselectall').checked == true) + checkboxobj.checked = true; + else + checkboxobj.checked = false; + } +} diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/tiny_xmlrpc.js b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/tiny_xmlrpc.js new file mode 100755 index 00000000000..61afb1571a1 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/tiny_xmlrpc.js @@ -0,0 +1,2045 @@ +/** +* Global instance stored here +*/ + +var xmlRpcClient; + +//Service name on server like /common,/db etc... +var strServerService; + +//temporary variables +var strobject; + +//Array +var arrDbList = new Array(); +var arrPartnerList = new Array(); +var arrFinalList = new Array(); + + +var contentType = new Array(); +var uri = new Array(); +var url = new Array(); +var name = new Array(); +var attach_eml ="no"; +var popup_display = "yes" +var rpc= { + servers: {}, + addserver: function(name,ip,port,path) { + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess'); + this.servers[name]= { + ip: ip, + port: port, + path: path, + avaible: true, + sock: Components.classes['@mozilla.org/xml-rpc/client;1'].createInstance(Components.interfaces.nsIXmlRpcClient)}; + }, + getany: function(rpcval,n) { + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess'); + var t = ['PRUint8','PRUint16','PRInt16','PRInt32','PRBool','Char','CString','Float','Double','PRTime','InputStream','Array','Dictionary']; + for (var i=0; i0) + for (var i=0; i"+params[0]; + msg+= "\n3. Your server may not be launched or connected to the network."; + } + func_out([false,'error '+status,msg]); + } }; + var p = []; + for (var i=0; i>>>"+result) + } +} + +//Sets the preference service +function getPref(){ + var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService); + var branchobj = prefService.getBranch("extensions.tiny."); + branchobj.QueryInterface(Components.interfaces.nsIPrefBranch2); + return branchobj +} + +function setFileName(fname){ + getPref().setCharPref('fname',fname); +} + +//set attachment file save or not +function setAttachment(argAttac){ + getPref().setCharPref('attachment',argAttac); +} + +//set preference value for server url +function setServer(argServer){ + getPref().setCharPref('serverurl',argServer); +} + +//set preference value for server port +function setPort(argPort){ + getPref().setCharPref('serverport',argPort) +} + +//set preference value of database name for data searching and selection +function setDbName(argDbName){ + getPref().setCharPref('serverdbname',argDbName); +} + +//set preference value of username for login +function setUsername(argUsername){ + getPref().setCharPref('username',argUsername); +} + +//set preference value of password for login +function setPassword(argPassword){ + getPref().setCharPref('password',argPassword); +} + +//set preference value for storing partner id +function setPartnerId(argPartnerId){ + getPref().setCharPref('partnerid',argPartnerId) +} + +//set preference value for Resource Id +function setResourceId(argResourceId){ + getPref().setCharPref('res_id',argResourceId) +} +//set server service +function setServerService(argServerService){ + strServerService = argServerService; +} + +//set preference value for sender email +function setSenderEmail(argSenderEmail){ + getPref().setCharPref('senderemail',argSenderEmail) +} + +//set preference value for receiver email +function setReceiverEmail(argReceiverEmail){ + getPref().setCharPref('receiveremail',argReceiverEmail) +} + +//set preference value for sender name +function setSenderName(argSenderName){ + getPref().setCharPref('sendername',argSenderName) +} + +//set preference value for email subject +function setSubject(argSubject){ + getPref().setCharPref('subject',argSubject) +} + +//set preference value for email received date +function setReceivedDate(argReceivedDate){ + getPref().setCharPref('receiveddate',argReceivedDate) +} + +//set preference value for storing contact id which is used while storing mail contents after creating a new partner contact +function setContactId(argContactId){ + getPref().setCharPref('contactid',argContactId) +} + +//set preference value for storing attachment option in config +function setAttachValue(argAttachValue){ + getPref().setCharPref('attachvalue',argAttachValue) +} + +//set preference value for email cclist +function setCCList(argCCList){ + getPref().setCharPref('cclist',argCCList) +} + +//set preference value for email message body +function setMessageBody(argMessageBody){ + getPref().setCharPref('messagebody',argMessageBody) +} + +//set preference value for Partner Name +function setPartnerName(argPartnerName){ + getPref().setCharPref('partnername',argPartnerName) +} + +//set preference value for Contact Name +function setContactName(argContactName){ + getPref().setCharPref('contactname',argContactName) +} + +//set preference value for street +function setStreet(argStreet){ + getPref().setCharPref('street',argStreet) +} + +//set preference value for street2 +function setStreet2(argStreet2){ + getPref().setCharPref('street2',argStreet2) +} + +//set preference value for zipcode +function setZipCode(argZipcode){ + getPref().setCharPref('zipcode',argZipcode) +} + +//set preference value for Office Number +function setOfficenumber(argOfficenumber){ + getPref().setCharPref('officeno',argOfficenumber) +} + +//set preference value for Phone Number +function setMobilenumber(argMobilenumber){ + getPref().setCharPref('phoneno',argMobilenumber) +} + +//set preference value for Fax +function setFax(argFax){ + getPref().setCharPref('fax',argFax) +} + +//set preference value for city +function setCity(argCity){ + getPref().setCharPref('city',argCity) +} + +//set preference value for country +function setCountry(argCountry){ + getPref().setCharPref('country',argCountry) +} + +//set preference value for state +function setState(argState){ + getPref().setCharPref('state',argState) +} + + +//set the value for the whole server url +function setServerUrl(argServerUrl) +{ + var seperateUrl = argServerUrl.split(':'); + setServer(seperateUrl.slice(0,seperateUrl.length-1).join(":")); + setPort(seperateUrl[seperateUrl.length-1]); +} + +//set preference value for storing user id +function setUserId(argUserId){ + getPref().setIntPref('userid',argUserId); +} + +//set database list is displaye or not +function setDBList(argDBList){ + getPref().setCharPref('db_list',argDBList) +} + +//set server connect or not +function setconnect_server(argconnect_server){ + getPref().setCharPref('connect_server',argconnect_server) +} + +//set module install or not +function setmodule_install(argconnect_module){ + getPref().setCharPref('module_install',argconnect_module) +} + +//get module install or not +function getmodule_install(){ + return getPref().getCharPref('module_install'); +} + + +//get server connect or not +function getconnect_server(){ + return getPref().getCharPref('connect_server'); +} + + +//get partner id +function getPartnerId(){ + return getPref().getCharPref('partnerid'); +} +//get database list is displaye or not +function getDBList(){ + return getPref().getCharPref('db_list'); +} + +function getFileName(){ + return getPref().getCharPref('fname'); +} + +//get attachment save or not +function getAttachment(){ + return getPref().getCharPref('attachment'); +} + +//get serverurl +function getServer(){ + return getPref().getCharPref('serverurl'); +} + +//get server port +function getPort(){ + return getPref().getCharPref('serverport'); +} + +//get database name +function getDbName(){ + return getPref().getCharPref('serverdbname'); +} + +//get username from config settings +function getUsername(){ + return getPref().getCharPref('username'); +} + +//get password from config settings +function getPassword(){ + return getPref().getCharPref('password'); +} + +//get serverservice +function getServerService(){ + return strServerService; + +} + +//get sender email +function getSenderEmail(){ + return getPref().getCharPref('senderemail'); +} + +//get receiver email +function getReceiverEmail(){ + return getPref().getCharPref('receiveremail'); +} + +//get resource id +function getResourceId(){ + return getPref().getCharPref('res_id'); +} + + +//get sender name +function getSenderName(){ + str = getPref().getCharPref('sendername'); + if(!str.toString().match(/=?utf-8?q?/)) + { + return str; + } + else + { + + string = str.replace(/[\'Š',\'Ž',\'š',\'ž',\'Ÿ',\'À',\'Á',\'Â',\'Ã',\'Ä',\'Å',\'Ç',\'È',\'É',\'Ê',\'Ë',\'Ì',\'Í',\'Î',\'Ï',\'Ñ',\'Ò',\'Ó',\'Ô',\'Õ',\'Ö',\'Ø',\'Ù',\'Ú',\'Û',\'Ü',\'Ý',\'à',\'á',\'â',\'ã',\'ä',\'å',\'ç',\'è',\'é',\'ê',\'ë',\'ì',\'í',\'î',\'ï',\'ñ',\'ò',\'ó',\'ô',\'õ',\'ö',\'ø',\'ù',\'ú',\'û',\'ü',\'ý',\'ÿ',\'Þ',\'þ',\'Ð',\'ð',\'ß',\'Œ',\'œ',\'Æ',\'æ',\'µ']/g,'"',"'",'“','”',"\n","\r",'_/',"'S','Z','s','z','Y','A','A','A','A','A','A','C','E','E','E','E','I','I','I','I','N','O','O','O','O','O','O','U','U','U','U','Y','a','a','a','a','a','a','c','e','e','e','e','i','i','i','i','n','o','o','o','o','o','o','u','u','u','u','y','y','TH','th','DH','dh','ss','OE','oe','AE','ae','u','','','','','','','-'"); + + var utftext = ""; + var encoded_string = ""; + var convertedString = ""; + for (var n = 0; n < string.length; n++) + { + var c = string.charCodeAt(n); + if (c < 128) { + utftext += String.fromCharCode(c); + } + } + + encoded_string = encode64(utftext); + return encoded_string; + } +} + +//ger partner name +function getPartnerName(){ + return getPref().getCharPref('partnername'); +} + +//get contact name +function getContactName(){ + return getPref().getCharPref('contactname'); +} + + +//get street name +function getStreet(){ + return getPref().getCharPref('street'); +} + +//get street2 name +function getStreet2(){ + return getPref().getCharPref('street2'); +} + +//get zip code +function getZipCode(){ + return getPref().getCharPref('zipcode'); +} + +//get city name +function getCity(){ + return getPref().getCharPref('city'); +} + +//get country name +function getCountry(){ + return getPref().getCharPref('country'); +} + +//get state name +function getState(){ + return getPref().getCharPref('state'); +} + +//get office no +function getOfficenumber(){ + return getPref().getCharPref('officeno'); +} + +//get mobile no +function getMobilenumber(){ + return getPref().getCharPref('phoneno'); +} + +//get fax no +function getFax(){ + return getPref().getCharPref('fax'); +} + + +//get email subject +function getSubject(){ + return getPref().getCharPref('subject'); +} + +//get email received date +function getReceivedDate(){ + return getPref().getCharPref('receiveddate'); +} + +//get contact id which is used while storing mail contents after creating a new partner contact +function getContactId(){ + return getPref().getCharPref('contactid'); +} + +//get attachment option information from the configuration settings +function getAttachValue(){ + return getPref().getCharPref('attachvalue'); +} + +//get email cclist information +function getCCList(){ + return getPref().getCharPref('cclist'); +} + +//get email message body +function getMessageBody(){ + return getPref().getCharPref('messagebody'); +} + +//get the whole server path +function getServerUrl(){ + return getServer()+":"+getPort()+"/"+getServerService(); +} + +//get user id for the xmlrpc request +function getUserId(){ + return getPref().getIntPref('userid'); +} + +//Creates and returns and instance of the XML-RPC client +function getClient() { + // Enable correct security + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess'); + return Components.classes['@mozilla.org/xml-rpc/client;1'].createInstance(Components.interfaces.nsIXmlRpcClient); +} + +//returns the xmlrpc client instance +function getXmlRpc() { + if (!xmlRpcClient) { + xmlRpcClient = getClient(); + } + + // Initialize the client with the URL + xmlRpcClient.init(getServerUrl()); + return xmlRpcClient; +} + +// function to get all basic parameters +function getBasicList(){ + var branchobj = getPref(); + arrBasicList = []; + arrBasicList[0] = branchobj.getCharPref("serverdbname"); + arrBasicList[1] = branchobj.getIntPref('userid'); + arrBasicList[2] = branchobj.getCharPref("password"); + arrBasicList[3] = getServer() + arrBasicList[4] = getPort() + return arrBasicList +} + +function createMenuItem_db(aLabel) { + const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; + var item = document.createElementNS(XUL_NS, "menuitem"); // create a new XUL menuitem + item.setAttribute("label", aLabel); + item.setAttribute("value", aLabel); + return item; +} + +//xmlrpc request handler for getting the list of database +var listDbHandler = { + onResult: function(client, context, result) { + setconnect_server("true") + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess'); + var arrMethodList = result.QueryInterface(Components.interfaces.nsISupportsArray); + // Set the number of results + var count = arrMethodList.Count(); + // Loop through the results, adding items to the list + for (i = 0; i < count; i++) { + var strlDbName = arrMethodList.QueryElementAt(i, Components.interfaces.nsISupportsCString); + arrDbList[i] = strlDbName.data; + } + var database = "" + if (count > 0) + { + setDBList("true") + var label = document.getElementById("database_option"); + var vbox = document.createElement("vbox"); + var hbox = document.createElement("hbox"); + var label1 = document.createElement("label"); + label1.setAttribute("width","80"); + label1.setAttribute("value","Database:"); + label1.setAttribute("id","label111"); + var menu1 = document.createElement("menulist"); + var menupopup1 = document.createElement("menupopup"); + menu1.setAttribute("id","DBlist"); + menu1.setAttribute("width","300"); + var menuitem1 = document.createElement("menuitem"); + database = arrDbList[0] + menuitem1.setAttribute("label", arrDbList[0]); + menuitem1.setAttribute("value", arrDbList[0]); + menupopup1.appendChild(menuitem1); + menu1.appendChild(menupopup1) + hbox.appendChild(label1); + hbox.appendChild(menu1); + vbox.appendChild(hbox); + label.appendChild(vbox); + + var d = document.getElementById("first"); + var d_nested = document.getElementById("lbldb_list1"); + var throwawayNode = d.removeChild(d_nested); + var d_nested = document.getElementById("DBlist_text"); + var throwawayNode = d.removeChild(d_nested); + + + } + else + { + setDBList("false") + } + // Loop through the results, adding items to the list + if (count) + { + const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; + var popup = document.getElementById("DBlist"); // a element + var arrsec=new Array() + for (var i=0;i element + for (i=0;i element + for (i=0;i element + for (i=0;i0){ + temp.AppendElement(test1); + } + return temp; +} + +//function to search and fillup section selection box +function createMenuItem(aLabel) { + const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; + var item = document.createElementNS(XUL_NS, "menuitem"); // create a new XUL menuitem + item.setAttribute("label", aLabel[1]); + item.setAttribute("value", aLabel[0]); + return item; +} + + +function listinstallmodule( result ) { + if ( rpc.onfault( result ) ) + { + setmodule_install('no') + } +} + +function module_install() +{ + setmodule_install("yes") + var branchobj = getPref(); + setServerService('xmlrpc/object'); + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess'); + var xmlRpcClient = getXmlRpc(); + strDbName = branchobj.getCharPref("serverdbname"); + struid = branchobj.getIntPref('userid'); + strpass = branchobj.getCharPref("password"); + strmethod = 'search'; + strobj = 'thunderbird.partner'; // TOFIX: Find module 'thunderbird' into 'module.module' model. + var temp = new Array() + server=getServer() + port=getPort() + basicList=getBasicList() + rpc.addserver('object',basicList[3] , basicList[4],'/xmlrpc/object'); + srcids=rpc.ask( 'object', 'execute', [basicList[0],basicList[1],basicList[2],strobj,strmethod,[]],listinstallmodule) +} + + +var listSearchContactHandler = { + onResult: function(client, context, result) { + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess'); + var sendername = getSenderEmail(); + var arrIdList = result.QueryInterface(Components.interfaces.nsISupportsArray); + var count = arrIdList.Count(); + for (i = 0; i < count; i++) { + var strlResult = arrIdList.QueryElementAt(i, Components.interfaces.nsISupportsArray); + var strlSearchResult = strlResult.QueryElementAt(0, Components.interfaces.nsISupportsCString); + var strlSearchResultValue = strlResult.QueryElementAt(1, Components.interfaces.nsISupportsCString); + if(strlSearchResult=="partner_name"){ + setPartnerName(strlSearchResultValue); + var t = getPartnerName();} + + if(strlSearchResult=="contactname"){ + setSenderName(strlSearchResultValue); + var t = getSenderName();} + + if(strlSearchResult=="street"){ + setStreet(strlSearchResultValue); + var t = getStreet();} + + if(strlSearchResult=="street2"){ + setStreet2(strlSearchResultValue); + var t = getStreet2();} + + if(strlSearchResult=="zip"){ + setZipCode(strlSearchResultValue); + var t = getZipCode();} + + if(strlSearchResult=="city"){ + setCity(strlSearchResultValue); + var t = getCity();} + + if(strlSearchResult=="phone"){ + setOfficenumber(strlSearchResultValue); + var t = getOfficenumber();} + + if(strlSearchResult=="fax"){ + setFax(strlSearchResultValue); + var t = getFax();} + + if(strlSearchResult=="mobile"){ + setMobilenumber(strlSearchResultValue); + var t = getMobilenumber();} + + if(strlSearchResult=="email" && strlSearchResultValue!=''){ + setSenderEmail(sendername); + var t = getSenderEmail();} + + if(strlSearchResult=="res_id"){ + setResourceId(strlSearchResultValue); + var t = getResourceId();} + } + }, + onFault: function (client, ctxt, fault) { + + }, + + onError: function (client, ctxt, status, errorMsg) { + + } + +} +var listSearchContactdetailHandler = { + onResult: function(client, context, result) { + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess'); + var sendername = getSenderEmail(); + var arrIdList = result.QueryInterface(Components.interfaces.nsISupportsArray); + var count = arrIdList.Count(); + for (i = 0; i < count; i++) { + var strlResult = arrIdList.QueryElementAt(i, Components.interfaces.nsISupportsArray); + var strlSearchResult = strlResult.QueryElementAt(0, Components.interfaces.nsISupportsCString); + var strlSearchResultValue = strlResult.QueryElementAt(1, Components.interfaces.nsISupportsCString); + if(strlSearchResult=="email" && strlSearchResultValue=='') + { + alert("Contact is not Available") + document.getElementById("txtemail").value = sendername; + } + if(strlSearchResult=="partner_name"){ + document.getElementById("txtname").value =strlSearchResultValue;} + + if(strlSearchResult=="contactname"){ + document.getElementById("txtcontactname").value =strlSearchResultValue;} + + if(strlSearchResult=="street"){ + document.getElementById("txtstreet").value =strlSearchResultValue;} + + if(strlSearchResult=="street2"){ + document.getElementById("txtstreet2").value =strlSearchResultValue;} + if(strlSearchResult=="zip"){ + document.getElementById("txtzip").value =strlSearchResultValue;} + + if(strlSearchResult=="city"){ + document.getElementById("txtcity").value =strlSearchResultValue;} + if(strlSearchResult=="phone"){ + document.getElementById("txtoffice").value =strlSearchResultValue;} + + if(strlSearchResult=="fax"){ + document.getElementById("txtfax").value =strlSearchResultValue;} + + if(strlSearchResult=="mobile"){ + document.getElementById("txtmobile").value =strlSearchResultValue;} + + if(strlSearchResult=="email"&& strlSearchResultValue!=''){ + document.getElementById("txtemail").value =strlSearchResultValue;} + + if(strlSearchResult=="res_id"){ + setResourceId(strlSearchResultValue); + var t = getResourceId();} + + } + }, + onFault: function (client, ctxt, fault) { + + }, + + onError: function (client, ctxt, status, errorMsg) { + + } + +} + +function searchContactdetail() +{ + var branchobj = getPref(); + setServerService('xmlrpc/object'); + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess'); + arrFinalList = []; + var xmlRpcClient = getXmlRpc(); + var cmbSearchList = document.getElementById('listSearchBox'); + var strDbName = xmlRpcClient.createType(xmlRpcClient.STRING,{}); + strDbName.data = branchobj.getCharPref("serverdbname"); + var struid = xmlRpcClient.createType(xmlRpcClient.INT,{}); + struid.data = branchobj.getIntPref('userid'); + var strpass = xmlRpcClient.createType(xmlRpcClient.STRING,{}); + strpass.data = branchobj.getCharPref("password"); + var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{}); + strobj.data = 'thunderbird.partner'; + var strmethod = xmlRpcClient.createType(xmlRpcClient.STRING,{}); + strmethod.data = 'search_contact'; + var strname = xmlRpcClient.createType(xmlRpcClient.STRING,{}); + strname.data =document.getElementById("txtemail").value; + xmlRpcClient.asyncCall(listSearchContactdetailHandler,cmbSearchList,'execute',[ strDbName,struid,strpass,strobj,strmethod,strname ],6); +} + +//xmlrpc request handler for getting the search results for the particular selected check box object +var listSearchCheckboxHandler = { + onResult: function(client, context, result) { + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess'); + var arrMethodList = result.QueryInterface(Components.interfaces.nsISupportsArray); + // Set the number of results + var count = arrMethodList.Count(); + var close=0; + if(count == 0 && popup_display != "no"){ + alert("No records Found"); + return false; + } + else if(count ==2 ) + { + if (arrMethodList.QueryElementAt(0, Components.interfaces.nsISupportsCString)=="error") + { + close =1; + } + } + popup_display = "yes" + // Loop through the results, adding items to the list + var arr1 = new Array(); + var arr2 = new Array(); + var flag1 = 0; + var flag2 = 0; + var er =""; + var er_val =new Array(); + for (i = 0; i < count; i++) + { + if(i%2==0){ + if (arrMethodList.QueryElementAt(i, Components.interfaces.nsISupportsCString)=="error") + { + er = arrMethodList.QueryElementAt(i, Components.interfaces.nsISupportsCString); + er_val[0] =arrMethodList.QueryElementAt(i+1, Components.interfaces.nsISupportsArray); + i +=1; + continue; + } + arr1[flag1] = arrMethodList.QueryElementAt(i, Components.interfaces.nsISupportsCString); + flag1++; + } + else{ + arr2[flag2] = arrMethodList.QueryElementAt(i, Components.interfaces.nsISupportsArray); + flag2++; + } + } + if (er) + { + var arrSearchList1 = new Array(); + for(j=0;j element + + if (String(popup) != "null"){ + object=popup.value; + if (object == undefined) { alert("select At Least one Document !")} + else{ + var branchobj = getPref(); + setServerService('xmlrpc/object'); + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess'); + var xmlRpcClient = getXmlRpc(); + var strDbName = xmlRpcClient.createType(xmlRpcClient.STRING,{}); + strDbName.data = branchobj.getCharPref("serverdbname"); + var struids = xmlRpcClient.createType(xmlRpcClient.INT,{}); + struids.data = branchobj.getIntPref('userid'); + var strpass = xmlRpcClient.createType(xmlRpcClient.STRING,{}); + strpass.data = branchobj.getCharPref("password"); + var strmethod = xmlRpcClient.createType(xmlRpcClient.STRING,{}); + strmethod.data = 'process_email'; + var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{}); + strobj.data = 'thunderbird.partner'; + var eml_string = parse_eml() + var a = ['model', 'message']; + var b = [object, eml_string]; + var arrofarr = dictcontact(a,b); + xmlRpcClient.asyncCall(listArchiveHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod,arrofarr],6); + alert("Mail Archive Successfully"); + window.close(); + } + } + else + { + alert(" select At Least one Document !") + } +} + + +//xmlrpc request handler for creating a new contact +var listCreateContactHandler = { + onResult: function(client, context, result) { + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess'); + var createId = result.QueryInterface(Components.interfaces.nsISupportsPRInt32); + setContactId(createId); + alert("Contact Created Successfully."); + window.close(); + }, + onFault: function (client, ctxt, fault) { + + }, + + onError: function (client, ctxt, status, errorMsg) { + + } +} + +var listUpdateContactHandler = { + onResult: function(client, context, result) { + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess'); + alert("Contact Update Successfully."); + window.close(); + var partnerId = result.QueryInterface(Components.interfaces.nsISupportsPRInt32); + setResourceId(partnerId); + window.close(); + }, + onFault: function (client, ctxt, fault) { + + }, + + onError: function (client, ctxt, status, errorMsg) { + + } +} + +//function to create a new contact +function createContact(){ + var branchobj = getPref(); + setServerService('xmlrpc/object'); + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess'); + var xmlRpcClient = getXmlRpc(); + var strDbName = xmlRpcClient.createType(xmlRpcClient.STRING,{}); + strDbName.data = branchobj.getCharPref("serverdbname"); + var struids = xmlRpcClient.createType(xmlRpcClient.INT,{}); + struids.data = branchobj.getIntPref('userid'); + var strpass = xmlRpcClient.createType(xmlRpcClient.STRING,{}); + strpass.data = branchobj.getCharPref("password"); + var strmethod = xmlRpcClient.createType(xmlRpcClient.STRING,{}); + strmethod.data = 'create_contact'; + var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{}); + strobj.data = 'thunderbird.partner'; + var a = ['partner_id','name','street','street2','zip','city','country_id','state_id','phone','fax','mobile','email']; + var b = [getPartnerId(),getSenderName(),document.getElementById("txtstreet").value,document.getElementById("txtstreet2").value,document.getElementById("txtzip").value, document.getElementById("txtcity").value,document.getElementById("country").value,document.getElementById("state").value,document.getElementById("txtoffice").value,document.getElementById("txtfax").value,document.getElementById("txtmobile").value,getSenderEmail()]; + var arrofarr = dictcontact(a,b); + xmlRpcClient.asyncCall(listCreateContactHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod,arrofarr],6); +} + +function UpdateContact(){ + var branchobj = getPref(); + setServerService('xmlrpc/object'); + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess'); + var xmlRpcClient = getXmlRpc(); + var strDbName = xmlRpcClient.createType(xmlRpcClient.STRING,{}); + strDbName.data = branchobj.getCharPref("serverdbname"); + var struids = xmlRpcClient.createType(xmlRpcClient.INT,{}); + struids.data = branchobj.getIntPref('userid'); + var strpass = xmlRpcClient.createType(xmlRpcClient.STRING,{}); + strpass.data = branchobj.getCharPref("password"); + var strmethod = xmlRpcClient.createType(xmlRpcClient.STRING,{}); + strmethod.data = 'update_contact'; + var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{}); + strobj.data = 'thunderbird.partner'; + var a = ['res_id','partner_id','name','street','street2','zip','city','country_id','state_id','phone','fax','mobile','email']; + var b = [getResourceId(),getPartnerName(),document.getElementById("txtcontactname").value,document.getElementById("txtstreet").value,document.getElementById("txtstreet2").value,document.getElementById("txtzip").value, document.getElementById("txtcity").value,document.getElementById("country").value,document.getElementById("state").value,document.getElementById("txtoffice").value,document.getElementById("txtfax").value,document.getElementById("txtmobile").value,document.getElementById("txtemail").value]; + var arrofarr = dictcontact(a,b); + xmlRpcClient.asyncCall(listUpdateContactHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod,arrofarr],6); +} + +//xmlrpc request handler for creating a attachment record +var listAttachHandler = { + onResult: function(client, context, result) { + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess'); + var createId = result.QueryInterface(Components.interfaces.nsISupportsPRInt32); + + }, + onFault: function (client, ctxt, fault) { + + }, + + onError: function (client, ctxt, status, errorMsg) { + + } +} + + +//function to encode the string into base64 +var base64chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(""); +function base64_encode (s) + { + // the result/encrypted string, the padding string, and the pad count + var r = ""; var p = ""; var c = s.length % 3; + + // add a right zero pad to make this string a multiple of 3 characters + if (c > 0) { for (; c < 3; c++) { p += '='; s += "\0"; } } + + // increment over the length of the string, three characters at a time + for (c = 0; c < s.length; c += 3) { + + // we add newlines after every 76 output characters, according to the MIME specs + if (c > 0 && (c / 3 * 4) % 76 == 0) { r += "\r\n"; } + + // these three 8-bit (ASCII) characters become one 24-bit number + var n = (s.charCodeAt(c) << 16) + (s.charCodeAt(c+1) << 8) + s.charCodeAt(c+2); + + // this 24-bit number gets separated into four 6-bit numbers + n = [(n >>> 18) & 63, (n >>> 12) & 63, (n >>> 6) & 63, n & 63]; + + // those four 6-bit numbers are used as indices into the base64 character list + r += base64chars[n[0]] + base64chars[n[1]] + base64chars[n[2]] + base64chars[n[3]]; + + // add the actual padding string, after removing the zero pad + } return r.substring(0, r.length - p.length) + p; + } + +//function to encode the string into base64 +var keyStr = "ABCDEFGHIJKLMNOP" + + "QRSTUVWXYZabcdef" + + "ghijklmnopqrstuv" + + "wxyz0123456789+/" + + "="+"-_.!~*'()"; + +function encode64(input) { +var output = ""; +var chr1, chr2, chr3 = ""; +var enc1, enc2, enc3, enc4 = ""; +var i = 0; + +do { + chr1 = input.charCodeAt(i++); + chr2 = input.charCodeAt(i++); + chr3 = input.charCodeAt(i++); + + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3)) { + enc4 = 64; + } + + output = output + + keyStr.charAt(enc1) + + keyStr.charAt(enc2) + + keyStr.charAt(enc3) + + keyStr.charAt(enc4); + chr1 = chr2 = chr3 = ""; + enc1 = enc2 = enc3 = enc4 = ""; +} while (i < input.length); + +return output; +} + + +//function to read the contents of the attachment files from the temp folder +function createInstance(name,test){ + var encoded_string = ''; + var file_name = '' + + for(i=0;i element + object=popup.value; + resobj.data = object; + var a = ['object']; + var b = [getPref().getCharPref("object")]; + var arrofarr = dictcontact(a,b); + xmlRpcClient.asyncCall(listsearchAttachmentHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod,arrofarr],6); +} + + +//function to create a new attachment record + +function win_close() +{ + var fpath ="" + if(navigator.userAgent.indexOf('Linux')!= -1){ + fpath ="/tmp/" + } + else if(navigator.userAgent.indexOf('Win')!= -1){ + fpath ="C:\\" + } + else if(navigator.userAgent.indexOf('Mac OS X')!= -1){ + fpath ="/tmp/" + } + try + { + name = fpath + getFileName() +".eml" + + var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); + file.initWithPath( name ); + file.remove(true); + window.close(); + } + catch(err) + { + window.close(); + } +} + +function attachmentWidnowOpen(msg) +{ + + if (msg=="create") + { + var popup = document.getElementById("section").selectedItem; // a element + if (String(popup) != "null"){ + object=popup.value; + if (object=="" || object == undefined) { alert("select at least one document !")} + else{ + create_archivemail() + } + } + else + { + alert("select at least one Document !") + } + } + else if (msg=="upload") + { + if(document.getElementById('listSearchBox').selectedItem) + { + upload_archivemail() + } + else{ + alert("Please select at least one record"); + } + } +} diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/address.dtd b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/address.dtd new file mode 100644 index 00000000000..3b5b95e2a32 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/address.dtd @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config.dtd b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config.dtd new file mode 100755 index 00000000000..23cd94efa05 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config.dtd @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config_change.dtd b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config_change.dtd new file mode 100644 index 00000000000..a926d3a980d --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config_change.dtd @@ -0,0 +1,5 @@ + + + + + diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/create.dtd b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/create.dtd new file mode 100644 index 00000000000..181d408a3e9 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/create.dtd @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/createpartner.dtd b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/createpartner.dtd new file mode 100644 index 00000000000..67b32b32907 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/createpartner.dtd @@ -0,0 +1,7 @@ + + + + + + + diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/mboximport.properties b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/mboximport.properties new file mode 100644 index 00000000000..33845423f7d --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/mboximport.properties @@ -0,0 +1,31 @@ +nomboxfile=není mbox souborem +folderexists=Není možné importovat: složka se stejným názvem již existuje +fileexists=Není možné importovat: soubor se stejným názvem již existuje +nowritable=Není možné importovat: nemáte právo zápisu do složky +exportOK=Export byl úspěšně dokončen +isNewsgroup=Tato funkce není dostupná: export složky z IMAP účtů nebo diskuzních \nskupin je možný, pouze pokud je nastavené čtení v režimu Offline +nofolder=Nebyla vybrána žádná cílová složka +badfolder=Není možné importovat do této složky (typ IMAP nebo diskuzní skupina) +exportAccount=Export všech složek +exportFolder=Export složky +filePickerImport=Výběr souboru k importu +filePickerExport=Výběr cílové složky +extensions.{3ed8cc52-86fc-4613-9026-c1ef969da4c3}.description=Umožňuje import a export souborů ve formátu mbox a eml +virtualfolder=Toto je virtuální složka. Pro export jejich\nzpráv musíte tyto zprávy nejdříve\nzkopírovat do normální složky. +searchdir=Vyberte složku, ve které budou vyhledány mbox soubory +confirmimport=Chcete importovat soubor? +endscan=Konec prohledávání složek +internalerror=Není možné provést import, protože nastala neznámá chyba +exportstart=Probíhá export, čekejte prosím... +exported=Exportovalo se +msgs=zpráv z +nosubjectmsg=bez_predmetu +messsubdir=zprávy +badfolder2=Není možné importovat do této složky (IMAP nebo diskuzní skupina nebo virtuální složka) +temp_error=Není možné importovat: nastala chyba při vytváření dočasného souboru +importEMLstart=Pobíhá import, čekejte prosím... +numEML=Naimportovány eml soubory: +CSVseparator=, +noEML=No eml file found in this directory +backupWarning=During this operation, the program could be\nunresponsive for some minutes.\nDo you want to go on?\n +noWaring=Don't show again this warning diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/overlay.dtd b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/overlay.dtd new file mode 100755 index 00000000000..9a91cf11b6c --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/overlay.dtd @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/plugin.dtd b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/plugin.dtd new file mode 100644 index 00000000000..ed26728b0d0 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/plugin.dtd @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/selectpartner.dtd b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/selectpartner.dtd new file mode 100644 index 00000000000..e6a62c16003 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/selectpartner.dtd @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Account.png b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Account.png new file mode 100644 index 00000000000..b13f2b0f523 Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Account.png differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Archive.png b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Archive.png new file mode 100644 index 00000000000..5aa6a958d37 Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Archive.png differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Case.png b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Case.png new file mode 100644 index 00000000000..9b950b8ea9d Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Case.png differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Contact.png b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Contact.png new file mode 100644 index 00000000000..9bd6f9f6059 Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Contact.png differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Create.png b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Create.png new file mode 100644 index 00000000000..1ab240c32cb Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Create.png differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Error.gif b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Error.gif new file mode 100644 index 00000000000..38c3523781b Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Error.gif differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Invoice.png b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Invoice.png new file mode 100644 index 00000000000..4551107ec3b Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Invoice.png differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Move.gif b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Move.gif new file mode 100644 index 00000000000..401bf861213 Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Move.gif differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/MoveDown.png b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/MoveDown.png new file mode 100644 index 00000000000..3761ff1e747 Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/MoveDown.png differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/MoveLeft.png b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/MoveLeft.png new file mode 100644 index 00000000000..031d7532673 Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/MoveLeft.png differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/NEWT.png b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/NEWT.png new file mode 100644 index 00000000000..373464bd53e Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/NEWT.png differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/NEWT1.png b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/NEWT1.png new file mode 100644 index 00000000000..2daac224a51 Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/NEWT1.png differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Partner.png b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Partner.png new file mode 100644 index 00000000000..c661339598e Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Partner.png differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Product.png b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Product.png new file mode 100644 index 00000000000..51451e422ae Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Product.png differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Project.png b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Project.png new file mode 100644 index 00000000000..0f8ea2af8f5 Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Project.png differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Sale.png b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Sale.png new file mode 100644 index 00000000000..1b0b44f890e Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Sale.png differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Search.gif b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Search.gif new file mode 100644 index 00000000000..b29c3cf1054 Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Search.gif differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Success.gif b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Success.gif new file mode 100644 index 00000000000..fb3bff729c5 Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Success.gif differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Task.png b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Task.png new file mode 100644 index 00000000000..52056b1e713 Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Task.png differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/developped_by.png b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/developped_by.png new file mode 100644 index 00000000000..54dc465b421 Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/developped_by.png differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/overlay.css b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/overlay.css new file mode 100755 index 00000000000..1f71b8fdcbe --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/overlay.css @@ -0,0 +1,3 @@ +menuitem#tiny-plugin { + color: red !important; +} diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/perform.gif b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/perform.gif new file mode 100644 index 00000000000..16cc3873858 Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/perform.gif differ diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/tinyerp-icon.ico b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/tinyerp-icon.ico new file mode 100644 index 00000000000..b1e78c0047e Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/tinyerp-icon.ico differ diff --git a/addons/thunderbird/plugin/openerp_plugin/components/nsXmlRpcClient.js b/addons/thunderbird/plugin/openerp_plugin/components/nsXmlRpcClient.js new file mode 100755 index 00000000000..40347a9993d --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/components/nsXmlRpcClient.js @@ -0,0 +1,1039 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Mozilla XML-RPC Client component. + * + * The Initial Developer of the Original Code is + * Digital Creations 2, Inc. + * Portions created by the Initial Developer are Copyright (C) 2000 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Martijn Pieters (original author) + * Samuel Sieb + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +/* + * nsXmlRpcClient XPCOM component + * Version: $Revision: 1.39 $ + * + * $Id: nsXmlRpcClient.js,v 1.39 2006/10/24 16:02:01 silver%warwickcompsoc.co.uk Exp $ + */ + +/* + * Constants + */ +const XMLRPCCLIENT_CONTRACTID = '@mozilla.org/xml-rpc/client;1'; +const XMLRPCCLIENT_CID = + Components.ID('{4d7d15c0-3747-4f7f-b6b3-792a5ea1a9aa}'); +const XMLRPCCLIENT_IID = Components.interfaces.nsIXmlRpcClient; + +const XMLRPCFAULT_CONTRACTID = '@mozilla.org/xml-rpc/fault;1'; +const XMLRPCFAULT_CID = + Components.ID('{691cb864-0a7e-448c-98ee-4a7f359cf145}'); +const XMLRPCFAULT_IID = Components.interfaces.nsIXmlRpcFault; + +const XMLHTTPREQUEST_CONTRACTID = '@mozilla.org/xmlextras/xmlhttprequest;1'; + +const NSICHANNEL = Components.interfaces.nsIChannel; + +const DEBUG = false; +const DEBUGPARSE = false; + +const DOMNode = Components.interfaces.nsIDOMNode; +/* + * Class definitions + */ + +/* The nsXmlRpcFault class constructor. */ +function nsXmlRpcFault() {} + +/* the nsXmlRpcFault class def */ +nsXmlRpcFault.prototype = { + faultCode: 0, + faultString: '', + + init: function(faultCode, faultString) { + this.faultCode = faultCode; + this.faultString = faultString; + }, + + toString: function() { + return ''; + }, + + // nsISupports interface + QueryInterface: function(iid) { + if (!iid.equals(Components.interfaces.nsISupports) && + !iid.equals(XMLRPCFAULT_IID)) + throw Components.results.NS_ERROR_NO_INTERFACE; + return this; + } +}; + +/* The nsXmlRpcClient class constructor. */ +function nsXmlRpcClient() {} + +/* the nsXmlRpcClient class def */ +nsXmlRpcClient.prototype = { + _serverUrl: null, + _useAuth: false, + + init: function(serverURL) { + this._serverUrl = serverURL; + this._encoding = "UTF-8"; + }, + + setAuthentication: function(username, password){ + if ((typeof username == "string") && + (typeof password == "string")){ + this._useAuth = true; + this._username = username; + this._password = password; + } + }, + + clearAuthentication: function(){ + this._useAuth = false; + }, + + setEncoding: function(encoding){ + this._encoding = encoding; + }, + + get serverUrl() { return this._serverUrl; }, + + // Internal copy of the status + _status: null, + _listener: null, + + asyncCall: function(listener, context, methodName, methodArgs, count) { + debug('asyncCall'); + // Check for call in progress. + if (this._inProgress) + return; + //throw Components.Exception('Call in progress!'); + + // Check for the server URL; + if (!this._serverUrl) + throw Components.Exception('Not initialized'); + + this._inProgress = true; + + // Clear state. + this._foundFault = false; + this._passwordTried = false; + this._result = null; + this._fault = null; + this._status = null; + this._responseStatus = null; + this._responseString = null; + this._listener = listener; + this._seenStart = false; + this._context = context; + + debug('Arguments: ' + methodArgs); + + // Generate request body + var xmlWriter = new XMLWriter(this._encoding); + this._generateRequestBody(xmlWriter, methodName, methodArgs); + + var requestBody = xmlWriter.data; + + debug('Request: ' + requestBody); + + this.xmlhttp = Components.classes[XMLHTTPREQUEST_CONTRACTID] + .createInstance(Components.interfaces.nsIXMLHttpRequest); + if (this._useAuth) { + this.xmlhttp.open('POST', this._serverUrl, true, + this._username, this._password); + } else { + this.xmlhttp.open('POST', this._serverUrl); + } + this.xmlhttp.onload = this._onload; + this.xmlhttp.onerror = this._onerror; + this.xmlhttp.parent = this; + this.xmlhttp.setRequestHeader('Content-Type','text/xml'); + this.xmlhttp.send(requestBody); + var chan = this.xmlhttp.channel.QueryInterface(NSICHANNEL); + chan.notificationCallbacks = this; + }, + + _onload: function(e) { + var result; + var parent = e.target.parent; + parent._inProgress = false; + parent._responseStatus = e.target.status; + parent._responseString = e.target.statusText; + if (!e.target.responseXML) { + if (e.target.status) { + try { + parent._listener.onError(parent, parent._context, + Components.results.NS_ERROR_FAILURE, + 'Server returned status ' + e.target.status); + } catch (ex) { + debug('Exception in listener.onError: ' + ex); + } + } else { + try { + parent._listener.onError(parent, parent._context, + Components.results.NS_ERROR_FAILURE, + 'Unknown network error'); + } catch (ex) { + debug('Exception in listener.onError: ' + ex); + } + } + return; + } + try { + e.target.responseXML.normalize(); + result = parent.parse(e.target.responseXML); + } catch (ex) { + try { + parent._listener.onError(parent, parent._context, + ex.result, ex.message); + } catch (ex) { + debug('Exception in listener.onError: ' + ex); + } + return; + } + if (parent._foundFault) { + parent._fault = result; + try { + parent._listener.onFault(parent, parent._context, result); + } catch(ex) { + debug('Exception in listener.onFault: ' + ex); + } + } else { + parent._result = result.value; + try { + parent._listener.onResult(parent, parent._context, + result.value); + } catch (ex) { + debug('Exception in listener.onResult: ' + ex); + } + } + }, + + _onerror: function(e) { + var parent = e.target.parent; + parent._inProgress = false; + try { + parent._listener.onError(parent, parent._context, + Components.results.NS_ERROR_FAILURE, + 'Unknown network error'); + } catch (ex) { + debug('Exception in listener.onError: ' + ex); + } + }, + + _foundFault: false, + + _fault: null, + _result: null, + _responseStatus: null, + _responseString: null, + + get fault() { return this._fault; }, + get result() { return this._result; }, + get responseStatus() { return this._responseStatus; }, + get responseString() { return this._responseString; }, + + /* Convenience. Create an appropriate XPCOM object for a given type */ + INT: 1, + BOOLEAN: 2, + STRING: 3, + DOUBLE: 4, + DATETIME: 5, + ARRAY: 6, + STRUCT: 7, + BASE64: 8, // Not part of nsIXmlRpcClient interface, internal use. + createType: function(type, uuid) { + const SUPPORTSID = '@mozilla.org/supports-'; + switch(type) { + case this.INT: + uuid.value = Components.interfaces.nsISupportsPRInt32 + return createInstance(SUPPORTSID + 'PRInt32;1', + 'nsISupportsPRInt32'); + + case this.BOOLEAN: + uuid.value = Components.interfaces.nsISupportsPRBool + return createInstance(SUPPORTSID + 'PRBool;1', + 'nsISupportsPRBool'); + + case this.STRING: + uuid.value = Components.interfaces.nsISupportsCString + return createInstance(SUPPORTSID + 'cstring;1', + 'nsISupportsCString'); + + case this.DOUBLE: + uuid.value = Components.interfaces.nsISupportsDouble + return createInstance(SUPPORTSID + 'double;1', + 'nsISupportsDouble'); + + case this.DATETIME: + uuid.value = Components.interfaces.nsISupportsPRTime + return createInstance(SUPPORTSID + 'PRTime;1', + 'nsISupportsPRTime'); + + case this.ARRAY: + uuid.value = Components.interfaces.nsISupportsArray + return createInstance(SUPPORTSID + 'array;1', + 'nsISupportsArray'); + + case this.STRUCT: + uuid.value = Components.interfaces.nsIDictionary + return createInstance('@mozilla.org/dictionary;1', + 'nsIDictionary'); + + default: throw Components.Exception('Unsupported type'); + } + }, + + // nsISupports interface + QueryInterface: function(iid) { + if (!iid.equals(Components.interfaces.nsISupports) && + !iid.equals(XMLRPCCLIENT_IID) && + !iid.equals(Components.interfaces.nsIInterfaceRequestor)) + throw Components.results.NS_ERROR_NO_INTERFACE; + return this; + }, + + // nsIInterfaceRequester interface + getInterface: function(iid, result){ + if (iid.equals(Components.interfaces.nsIAuthPrompt)){ + return this; + } + Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; + return null; + }, + + // nsIAuthPrompt interface + _passwordTried: false, + promptUsernameAndPassword: function(dialogTitle, text, passwordRealm, + savePassword, user, pwd){ + + if (this._useAuth){ + if (this._passwordTried){ + return false; + } + user.value = this._username; + pwd.value = this._password; + this._passwordTried = true; + return true; + } + return false; + }, + + /* Generate the XML-RPC request body */ + _generateRequestBody: function(writer, methodName, methodArgs) { + writer.startElement('methodCall'); + + writer.startElement('methodName'); + writer.write(methodName); + writer.endElement('methodName'); + + writer.startElement('params'); + for (var i = 0; i < methodArgs.length; i++) { + writer.startElement('param'); + this._generateArgumentBody(writer, methodArgs[i]); + writer.endElement('param'); + } + writer.endElement('params'); + + writer.endElement('methodCall'); + }, + + /* Write out a XML-RPC parameter value */ + _generateArgumentBody: function(writer, obj) { + writer.startElement('value'); + var sType = this._typeOf(obj); + switch (sType) { + case 'PRUint8': + case 'PRUint16': + case 'PRInt16': + case 'PRInt32': + obj=obj.QueryInterface(Components.interfaces['nsISupports' + + sType]); + writer.startElement('i4'); + writer.write(obj.toString()); + writer.endElement('i4'); + break; + + case 'PRBool': + obj=obj.QueryInterface(Components.interfaces.nsISupportsPRBool); + writer.startElement('boolean'); + writer.write(obj.data ? '1' : '0'); + writer.endElement('boolean'); + break; + + case 'Char': + case 'CString': + obj=obj.QueryInterface(Components.interfaces['nsISupports' + + sType]); + writer.startElement('string'); + writer.write(obj.toString()); + writer.endElement('string'); + break; + + case 'Float': + case 'Double': + obj=obj.QueryInterface(Components.interfaces['nsISupports' + + sType]); + writer.startElement('double'); + writer.write(obj.toString()); + writer.endElement('double'); + break; + + case 'PRTime': + obj = obj.QueryInterface( + Components.interfaces.nsISupportsPRTime); + var date = new Date(obj.data) + writer.startElement('dateTime.iso8601'); + writer.write(iso8601Format(date)); + writer.endElement('dateTime.iso8601'); + break; + + case 'InputStream': + obj = obj.QueryInterface(Components.interfaces.nsIInputStream); + obj = toScriptableStream(obj); + writer.startElement('base64'); + streamToBase64(obj, writer); + writer.endElement('base64'); + break; + + case 'Array': + obj = obj.QueryInterface( + Components.interfaces.nsISupportsArray); + writer.startElement('array'); + writer.startElement('data'); + for (var i = 0; i < obj.Count(); i++) + this._generateArgumentBody(writer, obj.GetElementAt(i)); + writer.endElement('data'); + writer.endElement('array'); + break; + + case 'Dictionary': + obj = obj.QueryInterface(Components.interfaces.nsIDictionary); + writer.startElement('struct'); + var keys = obj.getKeys({}); + for (var k = 0; k < keys.length; k++) { + writer.startElement('member'); + writer.startElement('name'); + writer.write(keys[k]); + writer.endElement('name'); + this._generateArgumentBody(writer, obj.getValue(keys[k])); + writer.endElement('member'); + } + writer.endElement('struct'); + break; + + default: + throw Components.Exception('Unsupported argument', null, null, + obj); + } + + writer.endElement('value'); + }, + + /* Determine type of a nsISupports primitive, array or dictionary. */ + _typeOf: function(obj) { + // XPConnect alows JS to pass in anything, because we are a regular + // JS object to it. So we have to test rigorously. + if (typeof obj != 'object') return 'Unknown'; + + // Anything else not nsISupports is not allowed. + if (typeof obj.QueryInterface != 'function') return 'Unknown'; + + // Now we will have to eliminate by trying all possebilities. + try { + obj.QueryInterface(Components.interfaces.nsISupportsPRUint8); + return 'PRUint8'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsISupportsPRUint16); + return 'PRUint16'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsISupportsPRInt16); + return 'PRInt16'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsISupportsPRInt32); + return 'PRInt32'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsISupportsPRBool); + return 'PRBool'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsISupportsChar); + return 'Char'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsISupportsCString); + return 'CString'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsISupportsFloat); + return 'Float'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsISupportsDouble); + return 'Double'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsISupportsPRTime); + return 'PRTime'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsIInputStream); + return 'InputStream'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsISupportsArray); + return 'Array'; + } catch(e) {} + + try { + obj.QueryInterface(Components.interfaces.nsIDictionary); + return 'Dictionary'; + } catch(e) {} + + // Not a supported type + return 'Unknown'; + }, + + // Response parsing state + _valueStack: [], + _currValue: null, + _cdata: null, + + parse: function(doc) { + var node = doc.firstChild; + var result; + if (node.nodeType == DOMNode.TEXT_NODE) + node = node.nextSibling; + if ((node.nodeType != DOMNode.ELEMENT_NODE) || + (node.nodeName != 'methodResponse')) { + throw Components.Exception('Expecting a methodResponse', null, null, + doc); + } + node = node.firstChild; + if (node.nodeType == DOMNode.TEXT_NODE) + node = node.nextSibling; + if (node.nodeType != DOMNode.ELEMENT_NODE) + throw Components.Exception('Expecting a params or fault', null, + null, doc); + if (node.nodeName == 'params') { + node = node.firstChild; + if (node.nodeType == DOMNode.TEXT_NODE) + node = node.nextSibling; + if ((node.nodeType != DOMNode.ELEMENT_NODE) || + (node.nodeName != 'param')) { + throw Components.Exception('Expecting a param', null, null, + doc); + } + result = this.parseValue(node.firstChild); + } else if (node.nodeName == 'fault') { + this._foundFault = true; + result = this.parseFault(node.firstChild); + } else { + throw Components.Exception('Expecting a params or fault', null, + null, doc); + } + debug('Parse finished'); + return result; + }, + + parseValue: function(node) { + var cValue = new Value(); + if (node && (node.nodeType == DOMNode.TEXT_NODE)) + node = node.nextSibling; + if (!node || (node.nodeType != DOMNode.ELEMENT_NODE) || + (node.nodeName != 'value')) { + throw Components.Exception('Expecting a value', null, null, node); + } + node = node.firstChild; + if (!node) + return cValue; + if (node.nodeType == DOMNode.TEXT_NODE){ + if (!node.nextSibling) { + cValue.value = node.nodeValue; + return cValue; + } else { + node = node.nextSibling; + } + } + if (node.nodeType != DOMNode.ELEMENT_NODE) + throw Components.Exception('Expecting a value type', null, null, + node); + switch (node.nodeName) { + case 'string': + cValue.value = this.parseString(node.firstChild); + break; + case 'i4': + case 'int': + cValue.type = this.INT; + cValue.value = this.parseString(node.firstChild); + break; + case 'boolean': + cValue.type = this.BOOLEAN; + cValue.value = this.parseString(node.firstChild); + break; + case 'double': + cValue.type = this.DOUBLE; + cValue.value = this.parseString(node.firstChild); + break; + case 'dateTime.iso8601': + cValue.type = this.DATETIME; + cValue.value = this.parseString(node.firstChild); + break; + case 'base64': + cValue.type = this.BASE64; + cValue.value = this.parseString(node.firstChild); + break; + case 'struct': + cValue.type = this.STRUCT; + this.parseStruct(cValue, node.firstChild); + break; + case 'array': + cValue.type = this.ARRAY; + this.parseArray(cValue, node.firstChild); + break; + default: + throw Components.Exception('Expecting a value type', null, null, + node); + } + return cValue; + }, + + parseString: function(node) { + value = ''; + while (node) { + if (node.nodeType != DOMNode.TEXT_NODE) + throw Components.Exception('Expecting a text node', null, null, + node); + value += node.nodeValue; + node = node.nextSibling; + } + return value; + }, + + parseStruct: function(struct, node) { + while (node) { + if (node.nodeType == DOMNode.TEXT_NODE) + node = node.nextSibling; + if (!node) + return; + if ((node.nodeType != DOMNode.ELEMENT_NODE) || + (node.nodeName != 'member')) { + throw Components.Exception('Expecting a member', null, null, + node); + } + this.parseMember(struct, node.firstChild); + node = node.nextSibling; + } + }, + + parseMember: function(struct, node) { + var cValue; + if (node.nodeType == DOMNode.TEXT_NODE) + node = node.nextSibling; + if (!node || (node.nodeType != DOMNode.ELEMENT_NODE) || + (node.nodeName != 'name')) { + throw Components.Exception('Expecting a name', null, null, node); + } + struct.name = this.parseString(node.firstChild); + cValue = this.parseValue(node.nextSibling); + struct.appendValue(cValue.value); + }, + + parseArray: function(array, node) { + if (node.nodeType == DOMNode.TEXT_NODE) + node = node.nextSibling; + if (!node || (node.nodeType != DOMNode.ELEMENT_NODE) || + (node.nodeName != 'data')) { + throw Components.Exception('Expecting array data', null, null, node); + } + for (node = node.firstChild; node; node = node.nextSibling) { + if (node.nodeType == DOMNode.TEXT_NODE) + continue; + array.appendValue(this.parseValue(node).value); + } + }, + + parseFault: function(node) { + var fault = createInstance(XMLRPCFAULT_CONTRACTID, 'nsIXmlRpcFault'); + var cValue = this.parseValue(node); + if ((cValue.type != this.STRUCT) || + (!cValue.value.hasKey('faultCode')) || + (!cValue.value.hasKey('faultString'))) { + throw Components.Exception('Invalid fault', null, null, node); + } + fault.init(cValue.value.getValue('faultCode').data, + cValue.value.getValue('faultString').data); + return fault; + } +}; + +/* The XMLWriter class constructor */ +function XMLWriter(encoding) { + if (!encoding) + encoding = "UTF-8"; + this.data = ''; +} + +/* The XMLWriter class def */ +XMLWriter.prototype = { + data: '', + + startElement: function(element) { + this.data += '<' + element + '>'; + }, + + endElement: function(element) { + this.data += '' + element + '>'; + }, + + write: function(text) { + for (var i = 0; i < text.length; i++) { + var c = text[i]; + switch (c) { + case '<': + this.data += '<'; + break; + case '&': + this.data += '&'; + break; + default: + this.data += c; + } + } + }, + + markup: function(text) { this.data += text } +}; + +/* The Value class contructor */ +function Value() { this.type = this.STRING; }; + +/* The Value class def */ +Value.prototype = { + INT: nsXmlRpcClient.prototype.INT, + BOOLEAN: nsXmlRpcClient.prototype.BOOLEAN, + STRING: nsXmlRpcClient.prototype.STRING, + DOUBLE: nsXmlRpcClient.prototype.DOUBLE, + DATETIME: nsXmlRpcClient.prototype.DATETIME, + ARRAY: nsXmlRpcClient.prototype.ARRAY, + STRUCT: nsXmlRpcClient.prototype.STRUCT, + BASE64: nsXmlRpcClient.prototype.BASE64, + + _createType: nsXmlRpcClient.prototype.createType, + + name: null, + + _value: null, + get value() { return this._value; }, + set value(val) { + // accepts [0-9]+ or x[0-9a-fA-F]+ and returns the character. + function entityTrans(substr, code) { + return String.fromCharCode("0" + code); + } + + switch (this.type) { + case this.STRING: + val = val.replace(/([0-9]+);/g, entityTrans); + val = val.replace(/(x[0-9a-fA-F]+);/g, entityTrans); + val = val.replace(/</g, '<'); + val = val.replace(/>/g, '>'); + val = val.replace(/&/g, '&'); + this._value.data = val; + break; + + case this.BOOLEAN: + this._value.data = (val == 1); + break; + + case this.DATETIME: + this._value.data = Date.UTC(val.slice(0, 4), + val.slice(4, 6) - 1, val.slice(6, 8), val.slice(9, 11), + val.slice(12, 14), val.slice(15)); + break; + + case this.BASE64: + this._value.data = base64ToString(val); + break; + + default: + this._value.data = val; + } + }, + + _type: null, + get type() { return this._type; }, + set type(type) { + this._type = type; + if (type == this.BASE64) + this._value = this._createType(this.STRING, {}); + else this._value = this._createType(type, {}); + }, + + appendValue: function(val) { + switch (this.type) { + case this.ARRAY: + this.value.AppendElement(val); + break; + + case this.STRUCT: + this.value.setValue(this.name, val); + break; + } + } +}; + +/* + * Objects + */ + +/* nsXmlRpcClient Module (for XPCOM registration) */ +var nsXmlRpcClientModule = { + registerSelf: function(compMgr, fileSpec, location, type) { + compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar); + + compMgr.registerFactoryLocation(XMLRPCCLIENT_CID, + 'XML-RPC Client JS component', + XMLRPCCLIENT_CONTRACTID, + fileSpec, + location, + type); + compMgr.registerFactoryLocation(XMLRPCFAULT_CID, + 'XML-RPC Fault JS component', + XMLRPCFAULT_CONTRACTID, + fileSpec, + location, + type); + }, + + getClassObject: function(compMgr, cid, iid) { + if (!cid.equals(XMLRPCCLIENT_CID) && !cid.equals(XMLRPCFAULT_CID)) + throw Components.results.NS_ERROR_NO_INTERFACE; + + if (!iid.equals(Components.interfaces.nsIFactory)) + throw Components.results.NS_ERROR_NOT_IMPLEMENTED; + + if (cid.equals(XMLRPCCLIENT_CID)) + return nsXmlRpcClientFactory + else return nsXmlRpcFaultFactory; + }, + + canUnload: function(compMgr) { return true; } +}; + +/* nsXmlRpcClient Class Factory */ +var nsXmlRpcClientFactory = { + createInstance: function(outer, iid) { + if (outer != null) + throw Components.results.NS_ERROR_NO_AGGREGATION; + + if (!iid.equals(XMLRPCCLIENT_IID) && + !iid.equals(Components.interfaces.nsISupports)) + throw Components.results.NS_ERROR_INVALID_ARG; + + return new nsXmlRpcClient(); + } +} + +/* nsXmlRpcFault Class Factory */ +var nsXmlRpcFaultFactory = { + createInstance: function(outer, iid) { + if (outer != null) + throw Components.results.NS_ERROR_NO_AGGREGATION; + + if (!iid.equals(XMLRPCFAULT_IID) && + !iid.equals(Components.interfaces.nsISupports)) + throw Components.results.NS_ERROR_INVALID_ARG; + + return new nsXmlRpcFault(); + } +} + +/* + * Functions + */ + +/* module initialisation */ +function NSGetModule(comMgr, fileSpec) { return nsXmlRpcClientModule; } + +/* Create an instance of the given ContractID, with given interface */ +function createInstance(contractId, intf) { + return Components.classes[contractId] + .createInstance(Components.interfaces[intf]); +} + +/* Get a pointer to a service indicated by the ContractID, with given interface */ +function getService(contractId, intf) { + return Components.classes[contractId] + .getService(Components.interfaces[intf]); +} + +/* Convert an inputstream to a scriptable inputstream */ +function toScriptableStream(input) { + var SIStream = Components.Constructor( + '@mozilla.org/scriptableinputstream;1', + 'nsIScriptableInputStream', 'init'); + return new SIStream(input); +} + +/* format a Date object into a iso8601 datetime string, UTC time */ +function iso8601Format(date) { + var datetime = date.getUTCFullYear(); + var month = String(date.getUTCMonth() + 1); + datetime += (month.length == 1 ? '0' + month : month); + var day = date.getUTCDate(); + datetime += (day < 10 ? '0' + day : day); + + datetime += 'T'; + + var hour = date.getUTCHours(); + datetime += (hour < 10 ? '0' + hour : hour) + ':'; + var minutes = date.getUTCMinutes(); + datetime += (minutes < 10 ? '0' + minutes : minutes) + ':'; + var seconds = date.getUTCSeconds(); + datetime += (seconds < 10 ? '0' + seconds : seconds); + + return datetime; +} + +/* Convert a stream to Base64, writing it away to a string writer */ +const BASE64CHUNK = 255; // Has to be dividable by 3!! +function streamToBase64(stream, writer) { + while (stream.available()) { + var data = []; + while (data.length < BASE64CHUNK && stream.available()) { + var d = stream.read(1).charCodeAt(0); + // reading a 0 results in NaN, compensate. + data = data.concat(isNaN(d) ? 0 : d); + } + writer.write(toBase64(data)); + } +} + +/* Convert data (an array of integers) to a Base64 string. */ +const toBase64Table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' + + '0123456789+/'; +const base64Pad = '='; +function toBase64(data) { + var result = ''; + var length = data.length; + var i; + // Convert every three bytes to 4 ascii characters. + for (i = 0; i < (length - 2); i += 3) { + result += toBase64Table[data[i] >> 2]; + result += toBase64Table[((data[i] & 0x03) << 4) + (data[i+1] >> 4)]; + result += toBase64Table[((data[i+1] & 0x0f) << 2) + (data[i+2] >> 6)]; + result += toBase64Table[data[i+2] & 0x3f]; + } + + // Convert the remaining 1 or 2 bytes, pad out to 4 characters. + if (length%3) { + i = length - (length%3); + result += toBase64Table[data[i] >> 2]; + if ((length%3) == 2) { + result += toBase64Table[((data[i] & 0x03) << 4) + (data[i+1] >> 4)]; + result += toBase64Table[(data[i+1] & 0x0f) << 2]; + result += base64Pad; + } else { + result += toBase64Table[(data[i] & 0x03) << 4]; + result += base64Pad + base64Pad; + } + } + + return result; +} + +/* Convert Base64 data to a string */ +const toBinaryTable = [ + -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, + -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, + -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63, + 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1, + -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14, + 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1, + -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40, + 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1 +]; +function base64ToString(data) { + var result = ''; + var leftbits = 0; // number of bits decoded, but yet to be appended + var leftdata = 0; // bits decoded, but yet to be appended + + // Convert one by one. + for (var i = 0; i < data.length; i++) { + var c = toBinaryTable[data.charCodeAt(i) & 0x7f]; + var padding = (data[i] == base64Pad); + // Skip illegal characters and whitespace + if (c == -1) continue; + + // Collect data into leftdata, update bitcount + leftdata = (leftdata << 6) | c; + leftbits += 6; + + // If we have 8 or more bits, append 8 bits to the result + if (leftbits >= 8) { + leftbits -= 8; + // Append if not padding. + if (!padding) + result += String.fromCharCode((leftdata >> leftbits) & 0xff); + leftdata &= (1 << leftbits) - 1; + } + } + + // If there are any bits left, the base64 string was corrupted + if (leftbits) + throw Components.Exception('Corrupted base64 string'); + + return result; +} + +if (DEBUG) debug = function(msg) { + dump(' -- XML-RPC client -- : ' + msg + '\n'); +}; +else debug = function() {} + +// vim:sw=4:sr:sta:et:sts: diff --git a/addons/thunderbird/plugin/openerp_plugin/components/xml-rpc.xpt b/addons/thunderbird/plugin/openerp_plugin/components/xml-rpc.xpt new file mode 100755 index 00000000000..8e59aa20c85 Binary files /dev/null and b/addons/thunderbird/plugin/openerp_plugin/components/xml-rpc.xpt differ diff --git a/addons/thunderbird/plugin/openerp_plugin/defaults/preferences/tiny.js b/addons/thunderbird/plugin/openerp_plugin/defaults/preferences/tiny.js new file mode 100755 index 00000000000..ca8332c868e --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/defaults/preferences/tiny.js @@ -0,0 +1,56 @@ + +pref("extensions.tiny.serverurl", "http://localhost"); +pref("extensions.tiny.serverport", "8069"); +pref("extensions.tiny.serverdbname", "terp"); +pref("extensions.tiny.username","admin"); +pref("extensions.tiny.password","admin"); +pref("extensions.tiny.senderemail",""); +pref("extensions.tiny.sendername",""); +pref("extensions.tiny.receiveremail",""); +pref("extensions.tiny.subject",""); +pref("extensions.tiny.receiveddate",""); +pref("extensions.tiny.partnerid",""); +pref("extensions.tiny.contactid",""); +pref("extensions.tiny.attachvalue",""); +pref("extensions.tiny.cclist",""); +pref("extensions.tiny.messagebody",""); +pref("extensions.tiny.displayName",""); +pref("extensions.tiny.attachmentdata",""); +pref("extensions.tiny.userid",3); +pref("extensions.tiny.partnername",""); +pref("extensions.tiny.officeno",""); +pref("extensions.tiny.phoneno",""); +pref("extensions.tiny.address",""); +pref("extensions.tiny.listobject","Partner,Partner Address,Accout Invoice,Project,Product,Account,Sale Order,Project Task"); +pref("extensions.tiny.object","res.partner,res.partner.address,account.invoice,project.project,product.product,account.account,sale.order,project.task"); +pref("extensions.tiny.imagename","chrome://openerp_plugin/skin/Partner.png,chrome://openerp_plugin/skin/Contact.png,chrome://openerp_plugin/skin/Invoice.png,chrome://openerp_plugin/skin/Project.png,chrome://openerp_plugin/skin/Product.png,chrome://openerp_plugin/skin/Account.png,chrome://openerp_plugin/skin/Sale.png,chrome://openerp_plugin/skin/Case.png,chrome://openerp_plugin/skin/Task.png"); +pref("extensions.tiny.attachmentlength",""); +pref("extensions.tiny.attachment",""); +pref("extensions.tiny.db_list","false"); +pref("extensions.tiny.connect_server","false"); +pref("extensions.tiny.module_install","yes"); +pref("extensions.tiny.serverprotocol", "false"); + + + +pref("mboximport.export.filenames_toascii", false); +pref("mboximport.export.overwrite", false); +pref("mboximport.confirm.before_mbox_import", true); +pref("mboximport.clipboard.always_just_text", false); +pref("mboximport.export.HTML_as_displayed", false); +pref("mboximport.exportEML.filename_format", 0); +pref("mboximport.delay.clean_statusbar", 5000); +pref("mboximport.subject.max_length", 50); +pref("mboximport.author.max_length", 50); +pref("mboximport.recipients.max_length", 50); +pref("extensions.{3ed8cc52-86fc-4613-9026-c1ef969da4c3}.description", "chrome://mboximport/locale/mboximport.properties"); +pref("mboximport.export.set_filetime", false); +pref("mboximport.exportEML.use_dir", false); +pref("mboximport.exportMBOX.use_dir", false); +pref("mboximport.exportMSG.use_dir", false); +pref("mboximport.export.filenames_addtime", false); +pref("mboximport.export_all.warning1", true); +pref("mboximport.export_all.warning2", true); + +pref("mboximport.exportMSG.dir", "/tmp"); + diff --git a/addons/thunderbird/plugin/openerp_plugin/install.js b/addons/thunderbird/plugin/openerp_plugin/install.js new file mode 100755 index 00000000000..50e4b301e32 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/install.js @@ -0,0 +1,105 @@ +// constants +const APP_DISPLAY_NAME = "OpenERP Thunderbird Plugins"; +const APP_NAME = "OpenERP"; +const APP_VERSION = "1.0"; +const WARNING = "WARNING: You need administrator privileges to install OpenERP Thunderbird Plugin. It will be installed in the application directory for all users."; +const VERSION_ERROR = "This extension can only be installed in a version higher than 2.0"; +const NOT_WRITABLE_ERROR = "This extension requires write access to the application directory to install properly." +const locales = [ + "en-US", + null +]; + +// Gecko 1.7 doesn't support custom button labels +var incompatible = (typeof Install.BUTTON_POS_0 == "undefined"); +if (incompatible) + alert(VERSION_ERROR); + +if (!incompatible) { + // Check whether all directories can be accessed + var dirList = [ + getFolder("Components"), + getFolder(getFolder("Program", "defaults"), "pref") + ]; + for (var i = 0; i < dirList.length; i++) + if (!File.isWritable(dirList[i])) + incompatible = true; + + if (incompatible) + alert(NOT_WRITABLE_ERROR); +} + +if (!incompatible && confirm(WARNING, APP_DISPLAY_NAME)) { + /* Pre-Install Cleanup (for prior versions) */ + + // List of files to be checked + var checkFiles = [ + [getFolder("Components"), "nsXmlRpcClient.js"], // Root component + [getFolder("Components"), "xml-rpc.xpt"], // Component interface + ]; + + // Remove any existing files + initInstall("pre-install", "/rename", "0.0"); // open dummy-install + for (var i = 0 ; i < checkFiles.length ; i++) { + var currentDir = checkFiles[i][0]; + var name = checkFiles[i][1]; + var oldFile = getFolder(currentDir, name); + + // Find a name to rename the file into + var newName = name + "-uninstalled"; + for (var n = 1; File.exists(oldFile) && File.exists(getFolder(currentDir, newName)); n++) + newName = name + n + "-uninstalled"; + + if (File.exists(oldFile)) + File.rename(oldFile, newName); + } + performInstall(); // commit renamed files + + /* Main part of the installation */ + + var chromeType = DELAYED_CHROME; + + var files = [ + ["components/nsXmlRpcClient.js", getFolder("Components")], + ["components/xml-rpc.xpt", getFolder("Components")], + ["defaults/preferences/tiny.js", getFolder(getFolder("Program", "defaults"), "pref")], + ]; + + // initialize our install + initInstall(APP_NAME, APP_PACKAGE, APP_VERSION); + + // Add files + for (var i = 0; i < files.length; i++) + addFile(APP_NAME, APP_VERSION, files[i][0], files[i][1], null); + + try { + var err = registerChrome(CONTENT | chromeType, jar, "content/"); + if (err != SUCCESS) + throw "Chrome registration for content failed (error code " + err + ")."; + + err = registerChrome(SKIN | chromeType, jar, "skin/classic/"); + if (err != SUCCESS) + throw "Chrome registration for skin failed (error code " + err + ")."; + + for (i = 0; i < locales.length; i++) { + if (!locales[i]) + continue; + + err = registerChrome(LOCALE | chromeType, jar, "locale/" + locales[i] + "/"); + if (err != SUCCESS) + throw "Chrome registration for " + locales[i] + " locale failed (error code " + err + ")."; + } + + var err = performInstall(); + if (err != SUCCESS && err != 999) + throw "Committing installation failed (error code " + err + ")."; + + alert("OpenERP Thunderbird Plugin " + APP_VERSION + " is now installed.\n" + + "It will become active after you restart your browser."); + } + catch (ex) { + alert("Installation failed: " + ex + "\n" + + "You probably don't have the necessary permissions (log in as system administrator)."); + cancelInstall(err); + } +} diff --git a/addons/thunderbird/plugin/openerp_plugin/install.rdf b/addons/thunderbird/plugin/openerp_plugin/install.rdf new file mode 100755 index 00000000000..07fdd116744 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/install.rdf @@ -0,0 +1,22 @@ + + + + {d57f315a-9f5d-4366-a530-a769a4a8c949} + chrome://openerp_plugin/skin/tinyerp-icon.ico + OpenERP Plugin for Thunderbird 2.0 + 1.0 + OpenERP Thunderbird Integration + OpenERP SA + + http://openerp.com + + + + {3550f703-e582-4d05-9a08-453d09bdfdc6} + 2.0 + 3.0.* + + + + diff --git a/addons/thunderbird/plugin/tiny_plugin-2.0.xpi b/addons/thunderbird/plugin/tiny_plugin-2.0.xpi deleted file mode 100644 index e39b655a0fb..00000000000 Binary files a/addons/thunderbird/plugin/tiny_plugin-2.0.xpi and /dev/null differ diff --git a/addons/thunderbird/security/ir.model.access.csv b/addons/thunderbird/security/ir.model.access.csv index f5b3247103c..0a6c192eb56 100644 --- a/addons/thunderbird/security/ir.model.access.csv +++ b/addons/thunderbird/security/ir.model.access.csv @@ -1,2 +1,2 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_tinythunderbird_partner","tinythunderbird.partner","model_tinythunderbird_partner",,1,1,1,1 + diff --git a/addons/thunderbird/thunderbird_installer.xml b/addons/thunderbird/thunderbird_installer.xml index 8b9f8fabf6a..834ac7c6a38 100644 --- a/addons/thunderbird/thunderbird_installer.xml +++ b/addons/thunderbird/thunderbird_installer.xml @@ -9,13 +9,13 @@ - Thunderbird Plug-In Installation + Thunderbird Module Installation Thunderbird - This module allows you to archive an e-mail on one or more objects of OpenERP. You can attach an email to a partner, a task, an analytic account or any other object. You can also create a new document like a lead, a phone call, claim and many more. + This module allows you to archive an e-mail on one or more objects of OpenERP. You can attach an email to a partner, a task, an analytic account or any other object. You can also create a new object like a lead, a phone call, claim and many more. Configure diff --git a/addons/wiki/data/wiki_main.xml b/addons/wiki/data/wiki_main.xml index 772528f0949..223274ea826 100644 --- a/addons/wiki/data/wiki_main.xml +++ b/addons/wiki/data/wiki_main.xml @@ -2,14 +2,14 @@ - The Open ERP wiki + The OpenERP wiki help, quick start, wiki, formatting 0 1 0 Initial Page - =The Open ERP wiki= -The Open ERP wiki allows you to manage your enterprise's contents using wiki + =The OpenERP wiki= +The OpenERP wiki allows you to manage your enterprise's contents using wiki restructured texts. This module provides a collaborative way to manage internal FAQs, quality manuals, technical references, etc. @@ -19,9 +19,9 @@ FAQs, quality manuals, technical references, etc. * Detailed history on all pages, * Integrated with the document management system. -==Why you should use the Open ERP integrated wiki than a separate wiki system ?== +==Why you should use the OpenERP integrated wiki than a separate wiki system ?== * Allows links to any document of the system, -* Uses the access controls of Open ERP for uniq access rights management, +* Uses the access controls of OpenERP for uniq access rights management, * Use it to describe projects, tasks, products, * Integrated with customer portal to provide restricted external accesses, * Linked to users processes for quality manuals. @@ -29,7 +29,7 @@ FAQs, quality manuals, technical references, etc. ==To get more information== * [[Basic Wiki Editing]] * [[Wiki Documentation]] -* [http://openerp.com The Open ERP website] +* [http://openerp.com The OpenERP website] diff --git a/addons/wiki/data/wiki_quickstart.xml b/addons/wiki/data/wiki_quickstart.xml index 665179114ce..7324fa6f18f 100644 --- a/addons/wiki/data/wiki_quickstart.xml +++ b/addons/wiki/data/wiki_quickstart.xml @@ -36,7 +36,7 @@ apostrophes on each side. ===Internal=== You give the link as same as the wiki Page Title -Go back to Main Page : [[The Open ERP wiki]] +Go back to Main Page : [[The OpenERP wiki]] ===External=== You can give link to the other Web page over the Internet easily [http://google.com Visit Google] ==Attachments== @@ -45,7 +45,7 @@ You can get the External links easily img:http://images.google.co.in/intl/en_ALL/images/images_hp.gif -==Play with Open ERP Records== +==Play with OpenERP Records== * edit:res.partner|False|Create New Partner * edit:res.partner|China Export|Edit China Export * edit:res.country|India|Edit Country - India @@ -85,7 +85,7 @@ A newline starts a new paragraph. ! Link ! Contact Email |- -| '''Open ERP''' - ''Belgium'' +| '''OpenERP''' - ''Belgium'' | [http://openerp.com] | [mailto:sales AT tiny.be] |} @@ -96,7 +96,7 @@ A newline starts a new paragraph. ! Link ! Contact Email |- -| '''Open ERP''' - ''Belgium'' +| '''OpenERP''' - ''Belgium'' | [http://openerp.com] | [mailto:sales AT tiny.be] |} diff --git a/addons/wiki_faq/wiki_faq.xml b/addons/wiki_faq/wiki_faq.xml index 1926efd33f7..046451eec93 100644 --- a/addons/wiki_faq/wiki_faq.xml +++ b/addons/wiki_faq/wiki_faq.xml @@ -30,7 +30,7 @@ What's the Bug Tracker ? == Answer == -The Open ERP bugtracker allows to manage bugs. Stop using a separated bugtracker. Using Open ERP +The OpenERP bugtracker allows to manage bugs. Stop using a separated bugtracker. Using OpenERP will allow you to track time on bugs, to integrate it with the mail gateway, to link bugs with timesheets, to invoice bugs, etc. @@ -48,7 +48,7 @@ Integration Benefits: == External Links == -* The Open ERP Website: [http://openerp.com] +* The OpenERP Website: [http://openerp.com] * The DMS Documentation: [http://openerp.com] @@ -87,7 +87,7 @@ Integration Benefits: == External Links == -* The Open ERP Website : [http://openerp.com] +* The OpenERP Website : [http://openerp.com] * The DMS Documentation : [http://openerp.com]