[MERGE] merged with trunk-development branch

bzr revid: hmo@tinyerp.com-20111212055032-2zhd483up2eu0t6a
This commit is contained in:
Harry (OpenERP) 2011-12-12 11:20:32 +05:30
commit 156da1e4df
211 changed files with 12475 additions and 12709 deletions

View File

@ -104,6 +104,7 @@ module named account_voucher.
'account_invoice_view.xml',
'partner_view.xml',
'data/account_data.xml',
'data/data_account_type.xml',
'account_invoice_workflow.xml',
'project/project_view.xml',
'project/project_report.xml',

File diff suppressed because it is too large Load Diff

View File

@ -34,8 +34,6 @@ class account_bank_statement(osv.osv):
for line in vals['line_ids']:
seq += 1
line[2]['sequence'] = seq
new_line_ids += tuple(line)
vals['line_ids'] = new_line_ids
return super(account_bank_statement, self).create(cr, uid, vals, context=context)
def write(self, cr, uid, ids, vals, context=None):

View File

@ -34,10 +34,6 @@
<field name="date_stop"/>
<field name="period" colspan="4"/>
</group>
<group colspan="4" attrs="{'invisible':[('charts','!=','configurable')]}">
<field name="sale_tax" on_change="on_change_tax(sale_tax)" attrs="{'required':[('charts','=','configurable')]}"/>
<field name="purchase_tax" groups="base.group_extended"/>
</group>
</group>
</group>
</data>

View File

@ -1753,18 +1753,18 @@
<field name="arch" type="xml">
<form string="Payment Term">
<group>
<group colspan="2" col="4">
<field name="name" select="1"/>
<separator string="Amount Computation" colspan="4"/>
<field name="value" colspan="4"/>
<field name="value_amount" colspan="4" attrs="{'readonly':[('value','=','balance')]}"/>
</group>
<group colspan="2" col="4">
<field name="sequence"/>
<separator string="Due Date Computation" colspan="4"/>
<field name="days" colspan="4"/>
<field name="days2" colspan="4"/>
</group>
<group colspan="2" col="4">
<field name="name" select="1"/>
<separator string="Amount Computation" colspan="4"/>
<field name="value" colspan="4"/>
<field name="value_amount" colspan="4" attrs="{'readonly':[('value','=','balance')]}"/>
</group>
<group colspan="2" col="4">
<field name="sequence"/>
<separator string="Due Date Computation" colspan="4"/>
<field name="days" colspan="4"/>
<field name="days2" colspan="4"/>
</group>
</group>
<newline/>
<separator string="Example" colspan="4"/>
@ -2114,6 +2114,7 @@
<field name="currency_id"/>
<field name="reconcile"/>
<field name="chart_template_id"/>
<separator string="Default taxes" colspan="4"/>
<field name="tax_ids" colspan="4" nolabel="1"/>
</page>
@ -2184,9 +2185,13 @@
<form string="Chart of Accounts Template">
<group>
<field name="name"/>
<field name="account_root_id"/>
<field name="bank_account_view_id"/>
<field name="tax_code_root_id"/>
<field name="account_root_id" attrs="{'required': [('parent_id', '=', False)]}"/>
<field name="bank_account_view_id" attrs="{'required': [('parent_id', '=', False)]}"/>
<field name="tax_code_root_id" attrs="{'required': [('parent_id', '=', False)]}"/>
<field name="parent_id" />
<!--<field name="code_digits" />-->
<field name="visible" />
<field name="complete_tax_set" />
</group>
<field name="tax_template_ids" colspan="4" readonly="1" nolabel="1"/>
<separator string="Properties" colspan="4"/>
@ -2270,7 +2275,9 @@
<field name="chart_template_id"/>
<field name="type"/>
<field name="type_tax_use"/>
<field name="price_include"/>
<group colspan="2" col="4">
<field name="price_include"/>
</group>
</group>
<notebook colspan="4">
<page string="Tax Definition">
@ -2437,10 +2444,13 @@
<group string="res_config_contents" position="replace">
<field name="company_id" widget="selection"/> <!-- we assume that this wizard will be run only by administrators and as this field may cause problem if hidden (because of the default company of the user removed from the selection because already configured), we simply choosed to remove the group "multi company" of it -->
<field name ="code_digits" groups="account.group_account_user"/>
<field name="chart_template_id" widget="selection" on_change="onchange_chart_template_id(chart_template_id)"/>
<field name ="seq_journal" groups="account.group_account_user"/>
<field name="sale_tax" domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('sale','all'))]"/>
<field name="purchase_tax" domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('purchase', 'all'))]"/>
<field name="chart_template_id" widget="selection" on_change="onchange_chart_template_id(chart_template_id)" domain="[('visible','=', True)]"/>
<field name ="seq_journal" groups="base.group_extended"/>
<field name="sale_tax" attrs="{'invisible': [('complete_tax_set', '!=', True)]}" domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('sale','all'))]"/>
<field name="purchase_tax" attrs="{'invisible': [('complete_tax_set', '!=', True)]}" domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('purchase', 'all'))]"/>
<field name ="sale_tax_rate" attrs="{'invisible': [('complete_tax_set', '=', True)]}"/>
<field name ="purchase_tax_rate" attrs="{'invisible': [('complete_tax_set', '=', True)]}"/>
<field name ="complete_tax_set" invisible="1"/>
<newline/> <!-- extended view because the web UI is not good for one2many -->
<field colspan="4" mode="tree" name="bank_accounts_id" nolabel="1" widget="one2many_list" groups="account.group_account_user">
<form string="Bank Information">

View File

@ -46,7 +46,6 @@
</column>
<column>
<action name="%(action_treasory_graph)d" string="Treasury"/> <!--groups="account.group_account_manager,account.group_account_user"-->
<action name="%(action_aged_receivable)d" string="Aged Receivables"/> <!--groups="account.group_account_manager,account.group_account_user"-->
</column>
</board>
</form>

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record model="account.account.type" id="data_account_type_view">
<field name="name">View</field>
<field name="code">view</field>
<field name="close_method">none</field>
</record>
<record model="account.account.type" id="data_account_type_receivable">
<field name="name">Receivable</field>
<field name="code">receivable</field>
<field name="close_method">unreconciled</field>
</record>
<record model="account.account.type" id="data_account_type_payable">
<field name="name">Payable</field>
<field name="code">payable</field>
<field name="close_method">unreconciled</field>
</record>
<record model="account.account.type" id="data_account_type_bank">
<field name="name">Bank</field>
<field name="code">bank</field>
<field name="close_method">balance</field>
</record>
<record model="account.account.type" id="data_account_type_cash">
<field name="name">Cash</field>
<field name="code">cash</field>
<field name="close_method">balance</field>
</record>
<record model="account.account.type" id="data_account_type_asset">
<field name="name">Asset</field>
<field name="code">asset</field>
<field name="close_method">balance</field>
</record>
<record model="account.account.type" id="data_account_type_liability">
<field name="name">Liability</field>
<field name="code">liability</field>
<field name="close_method">balance</field>
</record>
<record model="account.account.type" id="data_account_type_income">
<field name="name">Income</field>
<field name="code">income</field>
<field name="close_method">none</field>
</record>
<record model="account.account.type" id="data_account_type_expense">
<field name="name">Expense</field>
<field name="code">expense</field>
<field name="close_method">none</field>
</record>
</data>
</openerp>

View File

@ -23,7 +23,6 @@ import logging
import time
import datetime
from dateutil.relativedelta import relativedelta
from os.path import join as opj
from operator import itemgetter
from tools.translate import _
@ -58,8 +57,6 @@ class account_installer(osv.osv_memory):
'date_start': fields.date('Start Date', required=True),
'date_stop': fields.date('End Date', required=True),
'period': fields.selection([('month', 'Monthly'), ('3months','3 Monthly')], 'Periods', required=True),
'sale_tax': fields.float('Sale Tax(%)'),
'purchase_tax': fields.float('Purchase Tax(%)'),
'company_id': fields.many2one('res.company', 'Company', required=True),
'has_default_company' : fields.boolean('Has Default Company', readonly=True),
}
@ -76,8 +73,6 @@ class account_installer(osv.osv_memory):
'date_start': lambda *a: time.strftime('%Y-01-01'),
'date_stop': lambda *a: time.strftime('%Y-12-31'),
'period': 'month',
'sale_tax': 0.0,
'purchase_tax': 0.0,
'company_id': _default_company,
'has_default_company': _default_has_default_company,
'charts': 'configurable'
@ -100,9 +95,6 @@ class account_installer(osv.osv_memory):
res['fields'][field]['selection'] = cmp_select
return res
def on_change_tax(self, cr, uid, id, tax):
return {'value': {'purchase_tax': tax}}
def on_change_start_date(self, cr, uid, id, start_date=False):
if start_date:
start_date = datetime.datetime.strptime(start_date, "%Y-%m-%d")
@ -118,92 +110,7 @@ class account_installer(osv.osv_memory):
if context is None:
context = {}
fy_obj = self.pool.get('account.fiscalyear')
mod_obj = self.pool.get('ir.model.data')
obj_acc_temp = self.pool.get('account.account.template')
obj_tax_code_temp = self.pool.get('account.tax.code.template')
obj_tax_temp = self.pool.get('account.tax.template')
obj_acc_chart_temp = self.pool.get('account.chart.template')
record = self.browse(cr, uid, ids, context=context)[0]
for res in self.read(cr, uid, ids, context=context):
if record.charts == 'configurable':
fp = tools.file_open(opj('account', 'configurable_account_chart.xml'))
tools.convert_xml_import(cr, 'account', fp, {}, 'init', True, None)
fp.close()
s_tax = (res.get('sale_tax', 0.0))/100
p_tax = (res.get('purchase_tax', 0.0))/100
pur_temp_tax = mod_obj.get_object_reference(cr, uid, 'account', 'tax_code_base_purchases')
pur_temp_tax_id = pur_temp_tax and pur_temp_tax[1] or False
pur_temp_tax_paid = mod_obj.get_object_reference(cr, uid, 'account', 'tax_code_output')
pur_temp_tax_paid_id = pur_temp_tax_paid and pur_temp_tax_paid[1] or False
sale_temp_tax = mod_obj.get_object_reference(cr, uid, 'account', 'tax_code_base_sales')
sale_temp_tax_id = sale_temp_tax and sale_temp_tax[1] or False
sale_temp_tax_paid = mod_obj.get_object_reference(cr, uid, 'account', 'tax_code_input')
sale_temp_tax_paid_id = sale_temp_tax_paid and sale_temp_tax_paid[1] or False
chart_temp_ids = obj_acc_chart_temp.search(cr, uid, [('name','=','Configurable Account Chart Template')], context=context)
chart_temp_id = chart_temp_ids and chart_temp_ids[0] or False
if s_tax * 100 > 0.0:
tax_account_ids = obj_acc_temp.search(cr, uid, [('name', '=', 'Tax Received')], context=context)
sales_tax_account_id = tax_account_ids and tax_account_ids[0] or False
vals_tax_code_temp = {
'name': _('TAX %s%%') % (s_tax*100),
'code': _('TAX %s%%') % (s_tax*100),
'parent_id': sale_temp_tax_id
}
new_tax_code_temp = obj_tax_code_temp.create(cr, uid, vals_tax_code_temp, context=context)
vals_paid_tax_code_temp = {
'name': _('TAX Received %s%%') % (s_tax*100),
'code': _('TAX Received %s%%') % (s_tax*100),
'parent_id': sale_temp_tax_paid_id
}
new_paid_tax_code_temp = obj_tax_code_temp.create(cr, uid, vals_paid_tax_code_temp, context=context)
sales_tax_temp = obj_tax_temp.create(cr, uid, {
'name': _('Sale TAX %s%%') % (s_tax*100),
'amount': s_tax,
'base_code_id': new_tax_code_temp,
'tax_code_id': new_paid_tax_code_temp,
'ref_base_code_id': new_tax_code_temp,
'ref_tax_code_id': new_paid_tax_code_temp,
'type_tax_use': 'sale',
'type': 'percent',
'sequence': 0,
'account_collected_id': sales_tax_account_id,
'account_paid_id': sales_tax_account_id,
'chart_template_id': chart_temp_id,
}, context=context)
if p_tax * 100 > 0.0:
tax_account_ids = obj_acc_temp.search(cr, uid, [('name', '=', 'Tax Paid')], context=context)
purchase_tax_account_id = tax_account_ids and tax_account_ids[0] or False
vals_tax_code_temp = {
'name': _('TAX %s%%') % (p_tax*100),
'code': _('TAX %s%%') % (p_tax*100),
'parent_id': pur_temp_tax_id
}
new_tax_code_temp = obj_tax_code_temp.create(cr, uid, vals_tax_code_temp, context=context)
vals_paid_tax_code_temp = {
'name': _('TAX Paid %s%%') % (p_tax*100),
'code': _('TAX Paid %s%%') % (p_tax*100),
'parent_id': pur_temp_tax_paid_id
}
new_paid_tax_code_temp = obj_tax_code_temp.create(cr, uid, vals_paid_tax_code_temp, context=context)
purchase_tax_temp = obj_tax_temp.create(cr, uid, {
'name': _('Purchase TAX %s%%') % (p_tax*100),
'amount': p_tax,
'base_code_id': new_tax_code_temp,
'tax_code_id': new_paid_tax_code_temp,
'ref_base_code_id': new_tax_code_temp,
'ref_tax_code_id': new_paid_tax_code_temp,
'type_tax_use': 'purchase',
'type': 'percent',
'sequence': 0,
'account_collected_id': purchase_tax_account_id,
'account_paid_id': purchase_tax_account_id,
'chart_template_id': chart_temp_id,
}, context=context)
if 'date_start' in res and 'date_stop' in res:
f_ids = fy_obj.search(cr, uid, [('date_start', '<=', res['date_start']), ('date_stop', '>=', res['date_stop']), ('company_id', '=', res['company_id'][0])], context=context)
if not f_ids:

View File

@ -66,7 +66,6 @@ import account_change_currency
import account_report_balance_sheet
import account_report_profit_loss
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -46,7 +46,6 @@ user-wise as well as month wise.
],
'demo_xml' : [],
'installable': True,
'application': True,
'active' : False,
'certificate': '0042927202589',
}

View File

@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-11-24 12:54+0000\n"
"PO-Revision-Date: 2011-07-12 12:04+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"PO-Revision-Date: 2011-12-10 11:58+0000\n"
"Last-Translator: Paulino Ascenção <Unknown>\n"
"Language-Team: Portuguese <pt@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-05 05:57+0000\n"
"X-Generator: Launchpad (build 14231)\n"
"X-Launchpad-Export-Date: 2011-12-11 05:36+0000\n"
"X-Generator: Launchpad (build 14450)\n"
#. module: account_asset
#: model:ir.actions.act_window,name:account_asset.action_account_asset_asset_list_normal
@ -27,12 +27,12 @@ msgstr "Activos em Aberto"
#: field:account.asset.property,method_end:0
#: field:account.asset.property.history,method_end:0
msgid "Ending date"
msgstr ""
msgstr "Data final"
#. module: account_asset
#: view:account.asset.asset:0
msgid "Depreciation board"
msgstr ""
msgstr "Painel de amortização"
#. module: account_asset
#: view:account.asset.asset:0
@ -60,7 +60,7 @@ msgstr "Linear"
#. module: account_asset
#: view:account.asset.asset:0
msgid "Change duration"
msgstr ""
msgstr "Alterar a duração"
#. module: account_asset
#: field:account.asset.asset,child_ids:0
@ -70,12 +70,12 @@ msgstr "Activos filho"
#. module: account_asset
#: field:account.asset.board,value_asset:0
msgid "Asset Value"
msgstr "Valor do Imobilizado"
msgstr "Valor do Ativo"
#. module: account_asset
#: wizard_field:account.asset.modify,init,name:0
msgid "Reason"
msgstr ""
msgstr "Motivo"
#. module: account_asset
#: view:account.asset.asset:0
@ -94,7 +94,7 @@ msgstr "Movimentos gerados"
#: field:account.asset.property,method_delay:0
#: field:account.asset.property.history,method_delay:0
msgid "Number of interval"
msgstr ""
msgstr "Número de intervalo"
#. module: account_asset
#: wizard_button:account.asset.compute,asset_compute,asset_open:0
@ -136,7 +136,7 @@ msgstr "Histórico de alterações"
#. module: account_asset
#: view:account.asset.asset:0
msgid "Depreciation entries"
msgstr ""
msgstr "Lançamentos de amortização"
#. module: account_asset
#: view:account.asset.asset:0
@ -158,12 +158,12 @@ msgstr "Terceiro"
#: field:account.asset.property,method_period:0
#: field:account.asset.property.history,method_period:0
msgid "Period per interval"
msgstr ""
msgstr "Período por intervalo"
#. module: account_asset
#: view:account.asset.asset:0
msgid "Depreciation duration"
msgstr ""
msgstr "Duração da amortização"
#. module: account_asset
#: field:account.asset.property,account_analytic_id:0
@ -178,7 +178,7 @@ msgstr "Estado"
#. module: account_asset
#: view:account.asset.asset:0
msgid "Depreciation methods"
msgstr ""
msgstr "Métodos de amortização"
#. module: account_asset
#: view:account.asset.asset:0
@ -188,12 +188,12 @@ msgstr "Outra informação"
#. module: account_asset
#: field:account.asset.board,value_asset_cumul:0
msgid "Cumul. value"
msgstr ""
msgstr "Valor acumulado"
#. module: account_asset
#: view:account.asset.property:0
msgid "Assets methods"
msgstr ""
msgstr "Métodos de imobilizado"
#. module: account_asset
#: constraint:ir.ui.view:0
@ -203,7 +203,7 @@ msgstr "XML Inválido para a Arquitectura de Vista!"
#. module: account_asset
#: model:ir.model,name:account_asset.model_account_asset_property
msgid "Asset property"
msgstr ""
msgstr "Propriedade do ativo"
#. module: account_asset
#: wizard_view:account.asset.compute,asset_compute:0
@ -273,7 +273,7 @@ msgstr "Nome do activo"
#. module: account_asset
#: view:account.asset.asset:0
msgid "Accounts information"
msgstr ""
msgstr "Informação das contas"
#. module: account_asset
#: field:account.asset.asset,note:0
@ -291,7 +291,7 @@ msgstr "Rascunho"
#. module: account_asset
#: field:account.asset.property,type:0
msgid "Depr. method type"
msgstr ""
msgstr "Tipo de método de amotiz."
#. module: account_asset
#: field:account.asset.property,account_asset_id:0
@ -311,7 +311,7 @@ msgstr "Normal"
#. module: account_asset
#: field:account.asset.property,method_progress_factor:0
msgid "Progressif factor"
msgstr ""
msgstr "Fator de progressividade"
#. module: account_asset
#: field:account.asset.asset,localisation:0
@ -326,7 +326,7 @@ msgstr "Método de cálculo"
#. module: account_asset
#: field:account.asset.property,method_time:0
msgid "Time method"
msgstr ""
msgstr "Método temporal"
#. module: account_asset
#: field:account.asset.asset,active:0
@ -341,7 +341,7 @@ msgstr "Utilizador"
#. module: account_asset
#: field:account.asset.asset,property_ids:0
msgid "Asset method name"
msgstr ""
msgstr "Nome do método de ativo"
#. module: account_asset
#: field:account.asset.asset,date:0
@ -368,7 +368,7 @@ msgstr "Histórico"
#. module: account_asset
#: field:account.asset.property,account_actif_id:0
msgid "Depreciation account"
msgstr ""
msgstr "Conta de amortização"
#. module: account_asset
#: field:account.asset.asset,period_id:0
@ -412,24 +412,24 @@ msgstr ""
#. module: account_asset
#: model:ir.module.module,shortdesc:account_asset.module_meta_information
msgid "Asset management"
msgstr "Gestão de Activo"
msgstr "Gestão do Imobilizado"
#. module: account_asset
#: view:account.asset.board:0
#: field:account.asset.property,board_ids:0
#: model:ir.model,name:account_asset.model_account_asset_board
msgid "Asset board"
msgstr ""
msgstr "Painel do imobilizado"
#. module: account_asset
#: field:account.asset.asset,state:0
msgid "Global state"
msgstr ""
msgstr "Estado global"
#. module: account_asset
#: selection:account.asset.property,method_time:0
msgid "Delay"
msgstr ""
msgstr "Demora"
#. module: account_asset
#: wizard_view:account.asset.close,init:0
@ -439,7 +439,7 @@ msgstr "Informação geral"
#. module: account_asset
#: field:account.asset.property,journal_analytic_id:0
msgid "Analytic journal"
msgstr ""
msgstr "Diário analítico"
#. module: account_asset
#: field:account.asset.property,name:0
@ -454,7 +454,7 @@ msgstr "Diário"
#. module: account_asset
#: field:account.asset.property.history,name:0
msgid "History name"
msgstr "Nome de História"
msgstr "Nome de histórico"
#. module: account_asset
#: view:account.asset.asset:0
@ -477,13 +477,13 @@ msgstr "Categoria de activos"
#. module: account_asset
#: view:account.asset.asset:0
msgid "Depreciation"
msgstr ""
msgstr "Amortização"
#. module: account_asset
#: field:account.asset.asset,code:0
#: field:account.asset.category,code:0
msgid "Asset code"
msgstr "Código de imobilizado"
msgstr "Código do ativo"
#. module: account_asset
#: field:account.asset.asset,value_total:0

View File

@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2011-04-24 03:28+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"PO-Revision-Date: 2011-12-09 10:09+0000\n"
"Last-Translator: Paulino Ascenção <Unknown>\n"
"Language-Team: Portuguese <pt@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-05 05:56+0000\n"
"X-Generator: Launchpad (build 14231)\n"
"X-Launchpad-Export-Date: 2011-12-10 04:56+0000\n"
"X-Generator: Launchpad (build 14450)\n"
#. module: account_sequence
#: view:account.sequence.installer:0
@ -28,12 +28,13 @@ msgstr ""
msgid ""
"You cannot create entries on different periods/journals in the same move"
msgstr ""
"Não pode criar registos em períodos ou diários diferentes no mesmo movimento"
#. module: account_sequence
#: help:account.move,internal_sequence_number:0
#: help:account.move.line,internal_sequence_number:0
msgid "Internal Sequence Number"
msgstr ""
msgstr "Número interno de sequência"
#. module: account_sequence
#: help:account.sequence.installer,number_next:0
@ -43,12 +44,12 @@ msgstr ""
#. module: account_sequence
#: field:account.sequence.installer,number_next:0
msgid "Next Number"
msgstr ""
msgstr "Próximo número"
#. module: account_sequence
#: field:account.sequence.installer,number_increment:0
msgid "Increment Number"
msgstr ""
msgstr "Incremento"
#. module: account_sequence
#: model:ir.module.module,description:account_sequence.module_meta_information
@ -57,6 +58,10 @@ msgid ""
" This module maintains internal sequence number for accounting entries.\n"
" "
msgstr ""
"\n"
" Esse módulo gere os números de sequência internos dos lançamentos "
"contabilísticos.\n"
" "
#. module: account_sequence
#: model:ir.module.module,shortdesc:account_sequence.module_meta_information

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

@ -37,7 +37,6 @@ It installs the profile for associations to manage events, registrations, member
'demo_xml': [],
'installable': True,
'active': False,
'application': True,
'certificate': '0078696047261',
'images': ['images/association1.jpeg'],
}

View File

@ -1009,10 +1009,19 @@ class calendar_event(osv.osv):
else:
result[event] = ""
return result
def _rrule_write(self, obj, cr, uid, ids, field_name, field_value, args, context=None):
data = self._get_empty_rrule_data()
if field_value:
data['recurrency'] = True
for event in self.browse(cr, uid, ids, context=context):
rdate = rule_date or event.date
update_data = self._parse_rrule(field_value, dict(data), rdate)
data.update(update_data)
super(calendar_event, obj).write(cr, uid, ids, data, context=context)
return True
_columns = {
'id': fields.integer('ID', readonly=True),
'sequence': fields.integer('Sequence'),
@ -1023,7 +1032,7 @@ class calendar_event(osv.osv):
'duration': fields.float('Duration', states={'done': [('readonly', True)]}),
'description': fields.text('Description', states={'done': [('readonly', True)]}),
'class': fields.selection([('public', 'Public'), ('private', 'Private'), \
('confidential', 'Confidential')], 'Mark as', states={'done': [('readonly', True)]}),
('confidential', 'Public for Employees')], 'Mark as', states={'done': [('readonly', True)]}),
'location': fields.char('Location', size=264, help="Location of Event", states={'done': [('readonly', True)]}),
'show_as': fields.selection([('free', 'Free'), ('busy', 'Busy')], \
'Show as', states={'done': [('readonly', True)]}),
@ -1036,7 +1045,7 @@ defines the list of date/time exceptions for a recurring calendar component."),
'exrule': fields.char('Exception Rule', size=352, help="Defines a \
rule or repeating pattern of time to exclude from the recurring rule."),
'rrule': fields.function(_get_rulestring, type='char', size=124, \
store=True, string='Recurrent Rule'),
fnct_inv=_rrule_write, store=True, string='Recurrent Rule'),
'rrule_type': fields.selection([('none', ''), ('daily', 'Daily'), \
('weekly', 'Weekly'), ('monthly', 'Monthly'), \
('yearly', 'Yearly'),],
@ -1079,7 +1088,6 @@ rule or repeating pattern of time to exclude from the recurring rule."),
'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."),
'recurrency': fields.boolean('Recurrent', help="Recurrent Meeting"),
'edit_all': fields.boolean('Edit All', help="Edit all Occurrences of recurrent Meeting."),
}
def default_organizer(self, cr, uid, context=None):
@ -1102,83 +1110,68 @@ rule or repeating pattern of time to exclude from the recurring rule."),
'active': 1,
'user_id': lambda self, cr, uid, ctx: uid,
'organizer': default_organizer,
'edit_all' : False,
}
def get_recurrent_ids(self, cr, uid, select, base_start_date, base_until_date, limit=100, context=None):
def get_recurrent_ids(self, cr, uid, select, domain, limit=100, context=None):
"""Gives virtual event ids for recurring events based on value of Recurrence Rule
This method gives ids of dates that comes between start date and end date of calendar views
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param base_start_date: Get Start Date
@param base_until_date: Get End Date
@param limit: The Number of Results to Return """
if not context:
context = {}
virtual_id = context and context.get('virtual_id', False) or False
if isinstance(select, (str, int, long)):
ids = [select]
else:
ids = select
result = []
if ids and virtual_id:
for data in super(calendar_event, self).read(cr, uid, ids, context=context):
start_date = base_start_date and datetime.strptime(base_start_date[:10]+ ' 00:00:00' , "%Y-%m-%d %H:%M:%S") or False
until_date = base_until_date and datetime.strptime(base_until_date[:10]+ ' 23:59:59', "%Y-%m-%d %H:%M:%S") or False
event_date = datetime.strptime(data['date'], "%Y-%m-%d %H:%M:%S")
for data in super(calendar_event, self).read(cr, uid, select, context=context):
if not data['rrule']:
result.append(data['id'])
continue
event_date = datetime.strptime(data['date'], "%Y-%m-%d %H:%M:%S")
# To check: If the start date is replace by event date .. the event date will be changed by that of calendar code
if not data['rrule']:
if start_date and (event_date < start_date):
continue
if until_date and (event_date > until_date):
continue
idval = data['id']
result.append(idval)
else:
start_date = event_date
exdate = data['exdate'] and data['exdate'].split(',') or []
rrule_str = data['rrule']
new_rrule_str = []
rrule_until_date = False
is_until = False
for rule in rrule_str.split(';'):
name, value = rule.split('=')
if name == "UNTIL":
is_until = True
value = parser.parse(value)
rrule_until_date = parser.parse(value.strftime("%Y-%m-%d %H:%M:%S"))
if until_date and until_date >= rrule_until_date:
until_date = rrule_until_date
if until_date:
value = until_date.strftime("%Y%m%d%H%M%S")
else:
value = value.strftime("%Y%m%d%H%M%S")
new_rule = '%s=%s' % (name, value)
new_rrule_str.append(new_rule)
if not is_until and until_date:
value = until_date.strftime("%Y%m%d%H%M%S")
name = "UNTIL"
new_rule = '%s=%s' % (name, value)
new_rrule_str.append(new_rule)
new_rrule_str = ';'.join(new_rrule_str)
rdates = get_recurrent_dates(str(new_rrule_str), exdate, start_date, data['exrule'])
for r_date in rdates:
if start_date and r_date < start_date:
continue
if until_date and r_date > until_date:
continue
idval = real_id2base_calendar_id(data['id'], r_date.strftime("%Y-%m-%d %H:%M:%S"))
result.append(idval)
if result:
ids = list(set(result))
if not data['rrule']:
continue
exdate = data['exdate'] and data['exdate'].split(',') or []
rrule_str = data['rrule']
new_rrule_str = []
rrule_until_date = False
is_until = False
for rule in rrule_str.split(';'):
name, value = rule.split('=')
if name == "UNTIL":
is_until = True
value = parser.parse(value)
rrule_until_date = parser.parse(value.strftime("%Y-%m-%d %H:%M:%S"))
value = value.strftime("%Y%m%d%H%M%S")
new_rule = '%s=%s' % (name, value)
new_rrule_str.append(new_rule)
new_rrule_str = ';'.join(new_rrule_str)
rdates = get_recurrent_dates(str(new_rrule_str), exdate, event_date, data['exrule'])
for r_date in rdates:
ok = True
for arg in domain:
if arg[0] in ('date', 'date_deadline'):
if (arg[1]=='='):
ok = ok and r_date.strftime('%Y-%m-%d')==arg[2]
if (arg[1]=='>'):
ok = ok and r_date.strftime('%Y-%m-%d')>arg[2]
if (arg[1]=='<'):
ok = ok and r_date.strftime('%Y-%m-%d')<arg[2]
if (arg[1]=='>='):
ok = ok and r_date.strftime('%Y-%m-%d')>=arg[2]
if (arg[1]=='<='):
ok = ok and r_date.strftime('%Y-%m-%d')<=arg[2]
if not ok:
continue
idval = real_id2base_calendar_id(data['id'], r_date.strftime("%Y-%m-%d %H:%M:%S"))
result.append(idval)
if isinstance(select, (str, int, long)):
return ids and ids[0] or False
else:
ids = list(set(result))
return ids
def compute_rule_string(self, datas):
@ -1243,17 +1236,17 @@ rule or repeating pattern of time to exclude from the recurring rule."),
'week_list' : False
}
def _write_rrule(self, cr, uid, ids, field_value, rule_date=False, context=None):
data = self._get_empty_rrule_data()
if field_value:
data['recurrency'] = True
for event in self.browse(cr, uid, ids, context=context):
rdate = rule_date or event.date
update_data = self._parse_rrule(field_value, dict(data), rdate)
data.update(update_data)
#parse_rrule
self.write(cr, uid, event.id, data, context=context)
#def _write_rrule(self, cr, uid, ids, field_value, rule_date=False, context=None):
# data = self._get_empty_rrule_data()
#
# if field_value:
# data['recurrency'] = True
# for event in self.browse(cr, uid, ids, context=context):
# rdate = rule_date or event.date
# update_data = self._parse_rrule(field_value, dict(data), rdate)
# data.update(update_data)
# #parse_rrule
# self.write(cr, uid, event.id, data, context=context)
def _parse_rrule(self, rule, data, date_start):
@ -1311,9 +1304,9 @@ rule or repeating pattern of time to exclude from the recurring rule."),
return res
def search(self, cr, uid, args, offset=0, limit=0, order=None, context=None, count=False):
context = context or {}
args_without_date = []
start_date = False
until_date = False
filter_date = []
for arg in args:
if arg[0] == "id":
@ -1323,17 +1316,18 @@ rule or repeating pattern of time to exclude from the recurring rule."),
elif arg[0] not in ('date', unicode('date'), 'date_deadline', unicode('date_deadline')):
args_without_date.append(arg)
else:
if arg[1] in ('>', '>='):
if start_date:
continue
start_date = arg[2]
elif arg[1] in ('<', '<='):
if until_date:
continue
until_date = arg[2]
if context.get('virtual_id', True):
args_without_date.append('|')
args_without_date.append(arg)
if context.get('virtual_id', True):
args_without_date.append(('recurrency','=',1))
filter_date.append(arg)
res = super(calendar_event, self).search(cr, uid, args_without_date, \
0, 0, order, context, count=False)
res = self.get_recurrent_ids(cr, uid, res, start_date, until_date, limit, context=context)
if context.get('virtual_id', True):
res = self.get_recurrent_ids(cr, uid, res, args, limit, context=context)
if count:
return len(res)
elif limit:
@ -1341,17 +1335,6 @@ rule or repeating pattern of time to exclude from the recurring rule."),
else:
return res
def get_edit_all(self, cr, uid, id, vals=None):
"""
return true if we have to edit all meeting from the same recurrent
or only on occurency
"""
meeting = self.read(cr,uid, id, ['edit_all', 'recurrency'] )
if(vals and 'edit_all' in vals): #we jsut check edit_all
return vals['edit_all']
else: #it's a recurrent event and edit_all is already check
return meeting['recurrency'] and meeting['edit_all']
def _get_data(self, cr, uid, id, context=None):
res = self.read(cr, uid, [id],['date', 'date_deadline'])
return res[0]
@ -1370,101 +1353,63 @@ rule or repeating pattern of time to exclude from the recurring rule."),
def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True):
if context is None:
context = {}
context = context or {}
if isinstance(ids, (str, int, long)):
select = [ids]
else:
select = ids
new_ids = []
ids = [ids]
res = False
for event_id in select:
# Special write of complex IDS
for event_id in ids[:]:
if len(str(event_id).split('-')) == 1:
continue
ids.remove(event_id)
real_event_id = base_calendar_id2real_id(event_id)
edit_all = self.get_edit_all(cr, uid, event_id, vals=vals)
if edit_all:
if self.need_to_update(event_id, vals):
res = self._get_data(cr, uid, real_event_id, context=context)
vals.update(res)
event_id = real_event_id
if not vals.get('recurrency', True):
ids.append(real_event_id)
continue
#if edit one instance of a reccurrent id
if len(str(event_id).split('-')) > 1 and not edit_all:
data = self.read(cr, uid, event_id, ['date', 'date_deadline', \
'rrule', 'duration', 'exdate'])
if data.get('rrule'):
data.update(vals)
data.update({
'recurrent_uid': real_event_id,
'recurrent_id': data.get('date'),
'rrule_type': 'none',
'rrule': '',
'edit_all': False,
'recurrency' : False,
})
data = self.read(cr, uid, event_id, ['date', 'date_deadline', \
'rrule', 'duration', 'exdate'])
if data.get('rrule'):
data.update(vals)
data.update({
'recurrent_uid': real_event_id,
'recurrent_id': data.get('date'),
'rrule_type': 'none',
'rrule': '',
'recurrency' : False,
})
new_id = self.copy(cr, uid, real_event_id, default=data, context=context)
new_id = self.copy(cr, uid, real_event_id, default=data, context=context)
date_new = event_id.split('-')[1]
date_new = time.strftime("%Y%m%dT%H%M%S", \
time.strptime(date_new, "%Y%m%d%H%M%S"))
exdate = (data['exdate'] and (data['exdate'] + ',') or '') + date_new
res = self.write(cr, uid, [real_event_id], {'exdate': exdate})
date_new = event_id.split('-')[1]
date_new = time.strftime("%Y%m%dT%H%M%S", \
time.strptime(date_new, "%Y%m%d%H%M%S"))
exdate = (data['exdate'] and (data['exdate'] + ',') or '') + date_new
res = self.write(cr, uid, [real_event_id], {'exdate': exdate})
context.update({'active_id': new_id, 'active_ids': [new_id]})
continue
if not real_event_id in new_ids:
new_ids.append(real_event_id)
context.update({'active_id': new_id, 'active_ids': [new_id]})
continue
if vals.get('vtimezone', '') and vals.get('vtimezone', '').startswith('/freeassociation.sourceforge.net/tzfile/'):
vals['vtimezone'] = vals['vtimezone'][40:]
updated_vals = self.onchange_dates(cr, uid, new_ids,
vals.get('date', False),
vals.get('duration', False),
vals.get('date_deadline', False),
vals.get('allday', False),
context=context)
vals.update(updated_vals.get('value', {}))
if new_ids:
if 'rrule' in vals.keys():
if 'date' in vals.keys():
date_to_write = vals['date']
else:
date_to_write = False
self._write_rrule(cr, uid, new_ids, vals['rrule'], date_to_write, context)
res = super(calendar_event, self).write(cr, uid, new_ids, vals, context=context)
res = super(calendar_event, self).write(cr, uid, ids, vals, context=context)
if ('alarm_id' in vals or 'base_calendar_alarm_id' in vals)\
or ('date' in vals or 'duration' in vals or 'date_deadline' in vals):
# change alarm details
alarm_obj = self.pool.get('res.alarm')
alarm_obj.do_alarm_create(cr, uid, new_ids, self._name, 'date', context=context)
alarm_obj.do_alarm_create(cr, uid, ids, self._name, 'date', context=context)
return res or True and False
def browse(self, cr, uid, ids, context=None, list_class=None, fields_process=None):
if isinstance(ids, (str, int, long)):
select = [ids]
else:
select = ids
select = map(lambda x: base_calendar_id2real_id(x), select)
res = super(calendar_event, self).browse(cr, uid, select, context, \
list_class, fields_process)
if isinstance(ids, (str, int, long)):
return res and res[0] or False
return res
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False):
if not context:
context = {}
if 'date' in groupby:
raise osv.except_osv(_('Warning !'), _('Group by date not supported, use the calendar view instead'))
virtual_id = context.get('virtual_id', False)
virtual_id = context.get('virtual_id', True)
context.update({'virtual_id': False})
res = super(calendar_event, self).read_group(cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby)
for re in res:
@ -1479,8 +1424,12 @@ rule or repeating pattern of time to exclude from the recurring rule."),
# FIXME This whole id mangling has to go!
if context is None:
context = {}
fields2 = fields and fields[:] or None
EXTRAFIELDS = ('class','user_id','date','duration')
for f in EXTRAFIELDS:
if fields and (f not in fields):
fields2.append(f)
if isinstance(ids, (str, int, long)):
select = [ids]
@ -1488,17 +1437,13 @@ rule or repeating pattern of time to exclude from the recurring rule."),
select = ids
select = map(lambda x: (x, base_calendar_id2real_id(x)), select)
result = []
if fields and 'date' not in fields:
fields.append('date')
if fields and 'duration' not in fields:
fields.append('duration')
real_data = super(calendar_event, self).read(cr, uid,
[real_id for base_calendar_id, real_id in select],
fields=fields, context=context, load=load)
fields=fields2, context=context, load=load)
real_data = dict(zip([x['id'] for x in real_data], real_data))
for base_calendar_id, real_id in select:
for base_calendar_id, real_id in select:
res = real_data[real_id].copy()
ls = base_calendar_id2real_id(base_calendar_id, with_date=res and res.get('duration', 0) or 0)
if not isinstance(ls, (str, int, long)) and len(ls) >= 2:
@ -1507,9 +1452,25 @@ rule or repeating pattern of time to exclude from the recurring rule."),
res['id'] = base_calendar_id
result.append(res)
for r in result:
if r['user_id']:
user_id = type(r['user_id']) in (tuple,list) and r['user_id'][0] or r['user_id']
if user_id==uid:
continue
if r['class']=='private':
for f in r.keys():
if f not in ('id','date','date_deadline','duration','user_id','state'):
r[f] = False
if f=='name':
r[f] = _('Busy')
for r in result:
for k in EXTRAFIELDS:
if (k in r) and ((not fields) or (k not in fields)):
del r[k]
if isinstance(ids, (str, int, long)):
return result and result[0] or False
return result
def copy(self, cr, uid, id, default=None, context=None):
@ -1520,68 +1481,49 @@ rule or repeating pattern of time to exclude from the recurring rule."),
alarm_obj = self.pool.get('res.alarm')
alarm_obj.do_alarm_create(cr, uid, [res], self._name, 'date', context=context)
return res
def unlink(self, cr, uid, ids, context=None):
if not isinstance(ids, list):
ids = [ids]
res = False
for id in ids:
data_list = self.read(cr, uid, [id], ['date', 'rrule', 'exdate'], context=context)
if len(data_list) < 1:
for event_id in ids[:]:
if len(str(event_id).split('-')) == 1:
continue
event_data = data_list[0]
event_id = event_data['id']
if self.get_edit_all(cr, uid, event_id, vals=None):
event_id = base_calendar_id2real_id(event_id)
real_event_id = base_calendar_id2real_id(event_id)
data = self.read(cr, uid, real_event_id, ['exdate'], context=context)
date_new = event_id.split('-')[1]
date_new = time.strftime("%Y%m%dT%H%M%S", \
time.strptime(date_new, "%Y%m%d%H%M%S"))
exdate = (data['exdate'] and (data['exdate'] + ',') or '') + date_new
self.write(cr, uid, [real_event_id], {'exdate': exdate})
ids.remove(event_id)
if isinstance(event_id, (int, long)):
res = super(calendar_event, self).unlink(cr, uid, event_id, context=context)
self.pool.get('res.alarm').do_alarm_unlink(cr, uid, [event_id], self._name)
self.unlink_events(cr, uid, [event_id], context=context)
else:
str_event, date_new = event_id.split('-')
event_id = int(str_event)
if event_data['rrule']:
# Remove one of the recurrent event
date_new = time.strftime("%Y%m%dT%H%M%S", \
time.strptime(date_new, "%Y%m%d%H%M%S"))
exdate = (event_data['exdate'] and (event_data['exdate'] + ',') or '') + date_new
res = self.write(cr, uid, [event_id], {'exdate': exdate})
else:
res = super(calendar_event, self).unlink(cr, uid, [event_id], context=context)
self.pool.get('res.alarm').do_alarm_unlink(cr, uid, [event_id], self._name)
self.unlink_events(cr, uid, [event_id], context=context)
res = super(calendar_event, self).unlink(cr, uid, ids, context=context)
self.pool.get('res.alarm').do_alarm_unlink(cr, uid, ids, self._name)
self.unlink_events(cr, uid, ids, context=context)
return res
def create(self, cr, uid, vals, context=None):
if context is None:
context = {}
if vals.get('vtimezone', '') and vals.get('vtimezone', '').startswith('/freeassociation.sourceforge.net/tzfile/'):
vals['vtimezone'] = vals['vtimezone'][40:]
if 'date' in vals and 'rrule' in vals and vals['rrule']:
update_datas = self._parse_rrule(vals['rrule'], self._get_empty_rrule_data(), vals['date'])
update_datas['recurrency'] = True
vals.update(update_datas)
updated_vals = self.onchange_dates(cr, uid, [],
vals.get('date', False),
vals.get('duration', False),
vals.get('date_deadline', False),
vals.get('allday', False),
context=context)
vals.update(updated_vals.get('value', {}))
#updated_vals = self.onchange_dates(cr, uid, [],
# vals.get('date', False),
# vals.get('duration', False),
# vals.get('date_deadline', False),
# vals.get('allday', False),
# context=context)
#vals.update(updated_vals.get('value', {}))
res = super(calendar_event, self).create(cr, uid, vals, context)
alarm_obj = self.pool.get('res.alarm')
alarm_obj.do_alarm_create(cr, uid, [res], self._name, 'date', context=context)
return res
def do_tentative(self, cr, uid, ids, context=None, *args):
""" Makes event invitation as Tentative

View File

@ -242,8 +242,7 @@
<field name="alarm_id" string="Reminder"
widget="selection" />
<group colspan="2" col="4" attrs="{'readonly': [('state','=','done')]}">
<field name="recurrency"/>
<field name="edit_all" attrs="{'invisible':[('recurrency','=', False)]}" />
<field name="recurrency"/>
</group>
</group>
<notebook colspan="4">

View File

@ -72,7 +72,7 @@
!python {model: crm.meeting}: |
from base_calendar import base_calendar
base_cal_id = base_calendar.real_id2base_calendar_id(ref('crm_meeting_sprintreview0'), '2011-09-01 13:01:00')
self.write(cr, uid, [base_cal_id], {'name': 'Sprint Review for google modules', 'edit_all': True})
self.write(cr, uid, [base_cal_id], {'name': 'Sprint Review for google modules'})
-
I check whether all the records are edited or not.
-

View File

@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2010-12-15 10:44+0000\n"
"Last-Translator: OpenERP Administrators <Unknown>\n"
"PO-Revision-Date: 2011-12-10 12:08+0000\n"
"Last-Translator: Paulino Ascenção <Unknown>\n"
"Language-Team: Portuguese <pt@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-05 05:39+0000\n"
"X-Generator: Launchpad (build 14231)\n"
"X-Launchpad-Export-Date: 2011-12-11 05:36+0000\n"
"X-Generator: Launchpad (build 14450)\n"
#. module: base_module_quality
#: code:addons/base_module_quality/object_test/object_test.py:187
@ -152,7 +152,7 @@ msgstr "Objecto de Teste"
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Save Report"
msgstr "Gravar Relatório"
msgstr "Guardar relatório"
#. module: base_module_quality
#: code:addons/base_module_quality/wizard/module_quality_check.py:46

View File

@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2011-05-17 12:07+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"PO-Revision-Date: 2011-12-10 12:08+0000\n"
"Last-Translator: Paulino Ascenção <Unknown>\n"
"Language-Team: Portuguese <pt@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2011-11-05 05:56+0000\n"
"X-Generator: Launchpad (build 14231)\n"
"X-Launchpad-Export-Date: 2011-12-11 05:36+0000\n"
"X-Generator: Launchpad (build 14450)\n"
#. module: base_tools
#: model:ir.module.module,shortdesc:base_tools.module_meta_information

View File

@ -83,54 +83,30 @@
<field name="act_window_id" ref="act_my_oppor"/>
</record>
<record model="ir.actions.act_window" id="act_my_meetings">
<field name="name">My Meetings</field>
<field name="res_model">crm.meeting</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="crm.crm_case_tree_view_meet"/>
<field name="domain">[('user_id','=',uid),('state','not in',('cancel','done'))]</field>
<field name="context">{'default_user_id': uid}</field>
</record>
<record model="ir.actions.act_window" id="act_my_oppor_stage">
<field name="name">Planned Revenue By Stage</field>
<field name="res_model">crm.lead.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_report_crm_oppor_graph"/>
<field name="domain">['&amp;', '&amp;', ('user_id','=',uid), ('type', '=', 'opportunity'), '!' , '&amp;', ('state', '=', 'done'), ('date_closed','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%Y-%m-%d'))]</field>
<field name="domain">[('user_id','=',uid), ('type', '=', 'opportunity'), ('state','in',('draft','open','done','pending')), '!', '&amp;', ('state', '=', 'done'), ('date_closed','&gt;=',datetime.date.today().strftime('%Y-%m-01'))]</field>
<field name="context">{'search_default_Stage':1}</field>
</record>
<record model="ir.actions.act_window" id="act_sales_pipeline">
<field name="name">My Win/Lost Ratio for The Last Year</field>
<field name="res_model">crm.lead.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_opportunity_user_graph1"/>
<field name="domain">['&amp;', ('user_id', '=', uid),'&amp;', ('state', '=', 'done') , '&amp;', ('create_date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%Y-%m-%d')), ('type', '=', 'opportunity')]</field>
</record>
<record model="ir.ui.view" id="board_crm_form">
<field name="name">Sales Dashboard Form</field>
<field name="model">board.board</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sales Dashboard">
<board style="1-1">
<board style="2-1">
<column>
<action string="My Open Opportunities"
<action string="My Opportunities"
name="%(act_my_oppor)d" creatable="true"/>
<action
string="My Meetings"
name="%(act_my_meetings)d" creatable="true"/>
</column>
<column>
<action string="My Planned Revenues by Stage"
name="%(act_my_oppor_stage)d"/>
<action string="My Win/Lost Ratio"
name="%(act_sales_pipeline)d"/>
</column>
</board>
</form>

View File

@ -748,10 +748,11 @@ class crm_lead(crm_case, osv.osv):
self.write(cr, uid, [res_id], vals, context)
return res_id
def message_update(self, cr, uid, ids, msg, vals={}, default_act='pending', context=None):
def message_update(self, cr, uid, ids, msg, vals=None, default_act='pending', context=None):
if isinstance(ids, (str, int, long)):
ids = [ids]
if vals == None:
vals = {}
super(crm_lead, self).message_update(cr, uid, ids, msg, context=context)
if msg.get('priority') in dict(crm.AVAILABLE_PRIORITIES):

View File

@ -31,7 +31,6 @@
parent="base.menu_base_partner" sequence="1" />
<menuitem parent="base.menu_sales" name="Leads"
groups="base.group_extended"
id="menu_crm_case_categ0_act_leads"
action="crm_case_category_act_leads_all" sequence="1" />

View File

@ -51,7 +51,7 @@
<field name="res_model">crm.meeting</field>
<field name="view_mode">calendar,tree,form,gantt</field>
<field name="view_id" ref="crm_case_calendar_view_meet"/>
<field name="context">{"search_default_user_id":uid, 'search_default_section_id': section_id, 'virtual_id' : True}</field>
<field name="context">{"search_default_user_id":uid, 'search_default_section_id': section_id}</field>
<field name="search_view_id" ref="view_crm_case_meetings_filter"/>
<field name="help">The meeting calendar is shared between the sales teams and fully integrated with other applications such as the employee holidays or the business opportunities. You can also synchronize meetings with your mobile phone using the caldav interface.
</field>

View File

@ -45,7 +45,6 @@
widget="selection" />
<group colspan="2" col="4" attrs="{'readonly': ['|', ('recurrent_uid','!=',False), ('state','=','done')]}">
<field name="recurrency"/>
<field name="edit_all" attrs="{'invisible':[('recurrency','=', False)]}" />
</group>
</group>
<notebook colspan="4">
@ -67,7 +66,7 @@
<field name="email_from"/>
</group><group col="2" colspan="2">
<separator colspan="2" string="Visibility"/>
<field name="class" string="Privacy"/>
<field name="class" string="Privacy" groups="base.group_extended"/>
<field name="show_as" string="Show time as" groups="base.group_extended"/>
<field name="rrule" invisible="1" readonly="1"/>
<field name="recurrent_id" invisible="1"/>
@ -231,24 +230,11 @@
<tree string="Meetings"
colors="red:state=='open';black:state in ('draft', 'cancel','done','pending')">
<field name="name" string="Subject" />
<field name="date" string="Start Date" />
<field name="user_id"/>
<field name="date"/>
<field name="duration" />
<field name="partner_id" string="Partner" />
<field name="location" />
<field name="categ_id" string="Meeting Type"/>
<field name="class" string="Privacy"/>
<field name="state" groups="base.group_extended"/>
<field name="user_id" invisible="1"/>
<field name="show_as" invisible="1" string="Show time as"/>
<button name="case_reset" string="Reset to Unconfirmed"
states="open,done" type="object"
icon="gtk-convert" />
<button name="case_open" string="Confirm"
states="draft" type="object"
icon="gtk-go-forward" />
<button name="case_close" string="Done"
states="open" type="object"
icon="gtk-jump-to" />
</tree>
</field>
</record>
@ -295,7 +281,7 @@
<search string="Search Meetings">
<group>
<field name="name" string="Meeting / Partner"
domain="[('name','ilike',self), ('partner_id','ilike', self)]"/>
filter_domain="['|', ('name','ilike',self), ('partner_id','ilike', self)]"/>
<field name="user_id" groups="base.group_extended">
<filter icon="terp-personal" groups="base.group_extended"
domain="[('user_id','=',uid)]"

View File

@ -40,6 +40,13 @@
<record model="ir.ui.menu" id="base.menu_base_config">
<field eval="[(4, ref('base.group_sale_manager'))]" name="groups_id"/>
</record>
<record id="crm_meeting_global" model="ir.rule">
<field name="name">Hide Private Meetings</field>
<field ref="model_crm_meeting" name="model_id"/>
<field eval="1" name="global"/>
<field name="domain_force">['|',('user_id','=',user.id),('show_as','=','busy')]</field>
</record>
</data>
</openerp>

View File

@ -21,8 +21,6 @@
from osv import osv, fields
from tools.translate import _
import pprint
pp = pprint.PrettyPrinter(indent=4)
import time

View File

@ -52,7 +52,6 @@ automatically new claims based on incoming emails.
'test/ui/claim_demo.yml'
],
'installable': True,
'application': True,
'active': False,
'certificate' : '00612027414703404749',
'images': ['images/claim_categories.jpeg','images/claim_stages.jpeg','images/claims.jpeg'],

View File

@ -53,7 +53,6 @@ fund status.
],
'test': ['test/process/fund-rising.yml'],
'installable': True,
'application': True,
'active': False,
'certificate' : '00871545204231528989',
'images': ['images/fundraising_analysis.jpeg','images/fundraising_categories.jpeg','images/funds.jpeg'],

View File

@ -51,7 +51,6 @@ and categorize your interventions with a channel and a priority level.
],
'test': ['test/process/help-desk.yml'],
'installable': True,
'application': True,
'active': False,
'certificate' : '00830691522781519309',
'images': ['images/helpdesk_analysis.jpeg','images/helpdesk_categories.jpeg','images/helpdesk_requests.jpeg'],

View File

@ -7,22 +7,15 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Document board">
<board style="1-1" >
<board style="2-1" >
<column>
<action string="New Files"
name="%(document.action_view_all_document_tree1)d"
view_mode="tree,form"/>
<action string="File Size by Month"
name="%(document.action_view_size_month)d"
view_mode="graph,tree"/>
</column>
<column>
<action string="Files by Resource Type"
name="%(document.action_view_document_by_resourcetype_graph)d"
view_mode="graph,tree"/>
<action string="Files by Partner"
name="%(document.action_view_files_by_partner)d"
<action string="File Size by Month"
name="%(document.action_view_size_month)d"
view_mode="graph,tree"/>
</column>
</board>
@ -65,7 +58,7 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Document board">
<board style="1-1">
<board style="2-1">
<column>
<action string="Wall of Shame"
name="%(document.action_view_wall)d"

View File

@ -132,7 +132,7 @@ class document_file(osv.osv):
# fields used for file storage
'store_fname': fields.char('Stored Filename', size=200),
}
_order = "create_date desc"
_order = "id desc"
def __get_def_directory(self, cr, uid, context=None):
dirobj = self.pool.get('document.directory')

View File

@ -120,14 +120,6 @@
</record>
<record model="ir.actions.act_window" id="action_view_document_by_resourcetype_graph">
<field name="name">Files by Resource Type</field>
<field name="res_model">report.document.user</field>
<field name="view_id" ref="view_document_by_resourcetype_graph"/>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
</record>
<!--***************************************************************************************-->
<record model="ir.ui.view" id="view_size_month">

View File

@ -49,7 +49,6 @@ FTP client.
],
'installable': True,
'active': False,
'application': True,
'certificate': '00934787762705016005',
'images': ['images/1_configure_ftp.jpeg','images/2_document_browse.jpeg','images/3_document_ftp.jpeg'],
'post_load': 'post_load',

View File

@ -37,6 +37,7 @@ technical OpenERP documentation at http://doc.openerp.com
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'depends': ['base', 'email_template'],
'icon': '/edi/static/src/img/knowledge.png',
'data': [
'security/ir.model.access.csv',
],

Binary file not shown.

After

Width:  |  Height:  |  Size: 948 B

View File

@ -56,7 +56,6 @@ Note that:
'demo_xml': ['event_demo.xml'],
'test': ['test/test_event.yml'],
'installable': True,
'application': True,
'active': False,
'certificate': '0083059161581',
'images': ['images/1_event_type_list.jpeg','images/2_events.jpeg','images/3_registrations.jpeg'],

View File

@ -40,7 +40,7 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Association Dashboard">
<board style="1-1">
<board style="2-1">
<column>
<action string="Next Events"
name="%(act_event_view)d"

View File

@ -54,7 +54,10 @@ You can manage:
'hr_demo.xml',
'hr_department_demo.xml',
],
'test': ['test/test_hr.yml'],
'test': [
'test/open2recruit2close_job.yml',
'test/hr_demo.yml',
],
'installable': True,
'active': False,
'certificate': '0086710558965',

View File

@ -0,0 +1,10 @@
-
!record {model: hr.job, id: job_jr_appli, view: False}:
no_of_employee: 0.0
no_of_recruitment: 5.0
-
!record {model: hr.employee, id: employee1, view: False}:
address_id: base.main_address
company_id: base.main_company
department_id: dep_technical
user_id: base.user_demo

View File

@ -0,0 +1,38 @@
-
In order to test the process of Human Resource Management, I open Job Postion for "Jr. Application Engineer".
-
!python {model: hr.job}: |
self.job_open(cr, uid, [ref('job_jr_appli')])
-
I check state of Job Position after opening it.
-
!assert {model: hr.job, id: job_jr_appli, string: Job position is in 'open' state and no_of_recruitment = 0}:
- state == 'open'
- no_of_recruitment == 0
-
Now, Recruitement is started so I start recruitement of Job Postion of "Jr. Application Engineer" Profile.
-
!python {model: hr.job}: |
self.job_recruitement(cr, uid, [ref('job_jr_appli')])
-
I check 'state' and number of 'Expected in Recruitment' after initiating the recruitment
-
!assert {model: hr.job, id: job_jr_appli, string: Job position is in 'recruit' state and no_of_recruitment = 1.0}:
- state == 'recruit'
- no_of_recruitment == 1.0
-
I assign the job position to a newly hired employee
-
!python {model: hr.employee}: |
self.write(cr, uid, [ref('employee1')], {'job_id':ref('job_jr_appli')})
-
Now I don't want to recruit new employee for this position. so I mark it as Old.
-
!python {model: hr.job}: |
self.job_old(cr, uid, [ref('job_jr_appli')])
-
I check 'state' and number of 'Expected in Recruitment' after closing the Job position.
-
!assert {model: hr.job, id: job_jr_appli, string: Job position is in 'old' state and no_of_recruitment = 0}:
- state == 'old'
- no_of_recruitment == 0

View File

@ -1,140 +0,0 @@
-
In order to test hr module in OpenERP, I will create new Employee, Department and Job Position.
-
I create "RD Department" in Department form.
-
!record {model: hr.department, id: hr_department_rd0}:
manager_id: base.user_root
name: 'R & D'
-
Now, I create a new employee Mark Johnson, and select department as RD Department.
-
!record {model: hr.employee, id: hr_employee_mark}:
address_home_id: base.res_partner_address_1
company_id: base.main_company
gender: male
marital: 'single'
name: Mark Johnson
-
I change the company of the employee.
-
!python {model: hr.employee}: |
res = self.onchange_company(cr, uid, [ref('hr_employee_mark')], ref('base.main_company'), None)
values = dict([('company_id', ref('base.main_company'))] + res['value'].items())
self.write(cr, uid, [ref('hr_employee_mark')], values, None)
-
I assign department for employee Mark Johnson.
-
!python {model: hr.employee}: |
res = self.onchange_department_id(cr, uid, [ref('hr_employee_mark')], ref('hr_department_rd0'), None)
assert res['value']['parent_id']
values = dict([('department_id', ref('hr_department_rd0'))] + res['value'].items())
self.write(cr, uid, [ref('hr_employee_mark')], values, None)
-
Now I create a user for employee Mark Johnson.
-
!record {model: res.users, id: hr_users_markjohnson0}:
context_lang: en_US
groups_id:
- base.group_user
login: markjohnson
name: Mark Johnson
password: markjohnson
-
I assign user to employee Mark Johnson.
-
!python {model: hr.employee}: |
res = self.onchange_user(cr, uid, [ref('hr_employee_mark')], ref('hr_users_markjohnson0'), None)
values = dict([('user_id', ref('hr_users_markjohnson0'))] + res['value'].items())
self.write(cr, uid, [ref('hr_employee_mark')], values, None)
-
In order to check the wizard Employee Hierarchy , I will create new employee Phil Graves and select Mark Johnson as
Manager.
-
!record {model: hr.employee, id: hr_employee_phil}:
address_home_id: base.res_partner_address_3000
company_id: base.main_company
gender: male
name: Phil Graves
user_id: base.user_demo
parent_id: 'hr_employee_mark'
-
I fill the Working address for Employee.
-
!python {model: hr.employee}: |
res = self.onchange_address_id(cr, uid, ref('hr_employee_phil'), ref('base.res_partner_address_3000'), None)
assert res['value']
values = dict([('address_id', ref('base.res_partner_address_3000'))] + res['value'].items())
self.write(cr, uid, [ref('hr_employee_phil')], values, None)
-
I will open up form view of Mark Johnson and test the wizard Employee Hierarchy so it display the employee
hierarchy starting from Mark Johnson.
-
I will create new Job Position. I will check successful creation of new Job Position by adding the information.
-
!record {model: hr.job, id: hr_job_jea0}:
department_id: 'hr_department_rd0'
description: 'Position of Junior Application Engineer'
expected_employees: 5
name: 'JAE'
-
I check that Employee form is in "Open" state.
-
!assert {model: hr.job, id: hr_job_jea0}:
- state == 'open'
-
I create Employee for job position.
-
!record {model: hr.job, id: hr_job_jea0}:
employee_ids:
- address_home_id: base.res_partner_address_1
name: Manuel Lehba
department_id: 'hr_department_rd0'
gender: male
parent_id: 'hr_employee_mark'
-
I check that "Number of Employees" field have some value.
-
!assert {model: hr.job, id: hr_job_jea0}:
- no_of_employee != False
-
As more requirements on the said job position are come, I increase the number of expected employees.
-
!python {model: hr.job}: |
res = self.on_change_expected_employee(cr, uid, [ref('hr_job_jea0')], 6, 3, None)
assert res['value']['expected_employees']
values = dict([('expected_employees', ref('hr_job_jea0'))] + res['value'].items())
self.write(cr, uid, [ref('hr_job_jea0')], values, None)
-
I open the job position for recruitment.
-
!python {model: hr.job}: |
self.job_recruitement(cr, uid, [ref('hr_job_jea0')])
-
I assign the job position to employee and mark the position.
-
!python {model: hr.job}: |
self.job_open(cr, uid, [ref('hr_job_jea0')])
-
Now the process is over so I don't want to use this position. I mark it as Old.
-
!python {model: hr.job}: |
self.job_old(cr, uid, [ref('hr_job_jea0')])
-
I create a parent category for the new recruited employees who are Freshers.
-
!record {model: hr.employee.category, id: hr_employee_category_fresher0}:
name: Fresher
-
I create another category for Junior Level freshers.
-
!record {model: hr.employee.category, id: hr_employee_category_juniorlevel0}:
name: Junior Level
parent_id: hr_employee_category_fresher0
-
I open the tree view of Categories and see the categories in a hierarchical manner.
-
!python {model: hr.employee.category}: |
res = self.name_get(cr, uid, [ref('hr_employee_category_juniorlevel0')], None)
assert res

View File

@ -1,14 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="act_hr_evaluation_tree" model="ir.actions.act_window">
<field name="name">My Appraisal Remaining</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr_evaluation.evaluation</field>
<record model="ir.actions.act_window" id="action_hr_evaluation_interview_board">
<field name="name">Interview Requests</field>
<field name="res_model">hr.evaluation.interview</field>
<field name="view_type">form</field>
<field name="view_id" eval="False"/>
<field name="domain">[('state','in',('wait', 'progress')),('create_uid','=',uid)]</field>
<field name="search_view_id" ref="hr_evaluation.view_hr_evaluation_tree"/>
<field name="domain">[('is_evaluation' ,'=', True), ('user_id', '=', uid),('state','=','waiting_answer')]</field>
<field name="search_view_id" ref="view_hr_evaluation_interview_search"/>
</record>
<record id="board_hr_evaluation_form" model="ir.ui.view">
@ -18,7 +17,7 @@
<field name="type">form</field>
<field name="arch" type="xml">
<xpath expr="/form/board/column[1]" position="inside">
<action name="%(act_hr_evaluation_tree)d" string="My Appraisal Remaining"/>
<action name="%(action_hr_evaluation_interview_board)d" string="Interview Requests"/>
</xpath>
</field>
</record>

View File

@ -365,7 +365,7 @@
</record>
<record id="view_evaluation_calendar" model="ir.ui.view">
<field name="name">Interview Request</field>
<field name="name">Interview Requests</field>
<field name="model">hr.evaluation.interview</field>
<field name="type">calendar</field>
<field name="arch" type="xml">
@ -379,7 +379,7 @@
<field name="name">Interview Requests</field>
<field name="res_model">hr.evaluation.interview</field>
<field name="view_type">form</field>
<field name="view_id" ref="view_hr_evaluation_interview_form"/>
<field name="view_id" eval="False"/>
<field name="domain">[('is_evaluation' ,'=', True)]</field>
<field name="context">{'default_is_evaluation': True, "search_default_todo":1,"search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_hr_evaluation_interview_search"/>

View File

@ -30,8 +30,6 @@
<field name="employee_id"/>
<field name="date"/>
<field name="user_id" invisible="1"/>
<field name="department_id" groups="base.group_extended"/>
<field name="ref"/>
<field name="name"/>
<field name="amount"/>
<field name="state"/>

View File

@ -397,7 +397,6 @@
<field name="max_leaves"/>
<field name="leaves_taken"/>
<field name="remaining_leaves"/>
<field name="limit"/>
</tree>
</field>
</record>

View File

@ -365,10 +365,11 @@ class hr_applicant(crm.crm_case, osv.osv):
self.write(cr, uid, [res_id], vals, context)
return res_id
def message_update(self, cr, uid, ids, msg, vals={}, default_act='pending', context=None):
def message_update(self, cr, uid, ids, msg, vals=None, default_act='pending', context=None):
if isinstance(ids, (str, int, long)):
ids = [ids]
if vals is None:
vals = {}
msg_from = msg['from']
vals.update({
'description': msg['body_text']

View File

@ -53,7 +53,6 @@ Once installed, check the menu 'Ideas' in the 'Tools' main menu.""",
'test/test_idea.yml'
],
'installable': True,
'application': True,
'certificate': '0071515601309',
'images': ['images/1_ideas.jpeg','images/2_idea_categories.jpeg','images/3_vote_idea.jpeg'],
}

View File

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
import account
import l10n_multilang
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
{
"name" : "Multi language Chart of Accounts",
"version" : "1.1",
"author" : "OpenERP SA",
"category": 'Localization/Account Charts',
"description": """
* Multi language support for Chart of Accounts, Taxes, Tax Codes , Journals, Accounting Templates,
Analytic Chart of Accounts and Analytic Journals.
* Setup wizard changes
- Copy translations for COA, Tax, Tax Code and Fiscal Position from templates to target objects.
""",
'website': 'http://www.openerp.com',
'init_xml': [],
"depends" : ['account_accountant'],
'update_xml': [
],
'demo_xml': [
],
'installable': True,
'active': False,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,107 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
from tools.translate import _
#in this file, we mostly add the tag translate=True on existing fields that we now want to be translated
class account_account_template(osv.osv):
_inherit = 'account.account.template'
_columns = {
'name': fields.char('Name', size=128, required=True, select=True, translate=True),
}
account_account_template()
class account_tax(osv.osv):
_inherit = 'account.tax'
_columns = {
'name': fields.char('Tax Name', size=128, required=True, select=True, translate=True),
}
account_tax()
class account_tax_template(osv.osv):
_inherit = 'account.tax.template'
_columns = {
'name': fields.char('Tax Name', size=128, required=True, select=True, translate=True),
}
account_tax_template()
class account_tax_code_template(osv.osv):
_inherit = 'account.tax.code.template'
_columns = {
'name': fields.char('Tax Case Name', size=64, required=True, translate=True),
}
account_tax_code_template()
class account_chart_template(osv.osv):
_inherit = 'account.chart.template'
_columns={
'name': fields.char('Name', size=64, required=True, translate=True),
'spoken_languages': fields.char('Spoken Languages', size=64, help="State here the languages for which the translations of templates could be loaded at the time of installation of this localization module and copied in the final object when generating them from templates. You must provide the language codes separated by ';'"),
}
_order = 'name'
account_chart_template()
class account_fiscal_position(osv.osv):
_inherit = 'account.fiscal.position'
_columns = {
'name': fields.char('Fiscal Position', size=64, required=True, translate=True),
}
account_fiscal_position()
class account_fiscal_position_template(osv.osv):
_inherit = 'account.fiscal.position.template'
_columns = {
'name': fields.char('Fiscal Position Template', size=64, required=True, translate=True),
}
account_fiscal_position_template()
class account_journal(osv.osv):
_inherit = 'account.journal'
_columns = {
'name': fields.char('Journal Name', size=64, required=True, translate=True),
}
account_journal()
class account_analytic_account(osv.osv):
_inherit = 'account.analytic.account'
_columns = {
'name': fields.char('Account Name', size=128, required=True, translate=True),
}
account_analytic_account()
class account_analytic_journal(osv.osv):
_inherit = 'account.analytic.journal'
_columns = {
'name': fields.char('Journal Name', size=64, required=True, translate=True),
}
account_analytic_journal()

View File

@ -0,0 +1,156 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
import os
from tools.translate import _
import netsvc
logger=netsvc.Logger()
class wizard_multi_charts_accounts(osv.osv_memory):
"""
Change wizard that a new account chart for a company.
* Add option to install languages during the setup
* Copy translations for COA, Tax, Tax Code and Fiscal Position from templates to target objects.
"""
_inherit = 'wizard.multi.charts.accounts'
def process_translations(self, cr, uid, langs, in_obj, in_field, in_ids, out_obj, out_ids, force_write=False, context=None):
"""
This method copies translations values of templates into new Accounts/Taxes/Journals for languages selected
:param cr: A database cursor
:param uid: ID of the user currently logged in
:param langs: List of languages to load for new records
:param in_field: Name of the translatable field of source templates
:param in_obj: Name of source object of templates.
:param in_ids: List of ids of source object
:param out_obj: Destination object for which translation is to be copied
:param out_ids: List of ids of destination object
:param force_write: boolean that depicts if we need to create a translation OR simply replace the actual value
with the translation in the uid's language by doing a write (in case it's TRUE)
:param context: usual context information. May contain the key 'lang', which is the language of the user running
the wizard, that will be used if force_write is True
:return: True
"""
if context is None:
context = {}
src = {}
xlat_obj = self.pool.get('ir.translation')
#find the source from Account Template
for x in in_obj.browse(cr, uid, in_ids):
src.update({x.id: x.name})
for lang in langs:
#find the value from Translation
value = xlat_obj._get_ids(cr, uid, in_obj._name + ',' + in_field, 'model', lang, in_ids)
for j in range(len(in_ids)):
in_id = in_ids[j]
if value[in_id]:
if not force_write:
#copy Translation from Source to Destination object
xlat_obj.create(cr, uid, {
'name': out_obj._name + ',' + in_field,
'type': 'model',
'res_id': out_ids[j],
'lang': lang,
'src': src[in_id],
'value': value[in_id],
})
else:
#replace the value in the destination object only if it's the user lang
if context.get('lang') == lang:
self.pool.get(out_obj._name).write(cr, uid, out_ids[j], {in_field: value[in_id]})
else:
logger.notifyChannel('addons.'+self._name, netsvc.LOG_WARNING,
'Language: %s. Translation from template: there is no translation available for %s!' %(lang, src[in_id]))#out_obj._name))
return True
def execute(self, cr, uid, ids, context=None):
res = super(wizard_multi_charts_accounts, self).execute(cr, uid, ids, context=context)
obj_multi = self.browse(cr, uid, ids[0], context=context)
company_id = obj_multi.company_id.id
# load languages
langs = []
res_lang_obj = self.pool.get('res.lang')
installed_lang_ids = res_lang_obj.search(cr, uid, [])
installed_langs = [x.code for x in res_lang_obj.browse(cr, uid, installed_lang_ids, context=context)]
if obj_multi.chart_template_id.spoken_languages:
for lang in obj_multi.chart_template_id.spoken_languages.split(';'):
if lang not in installed_langs:
# the language is not installed, so we don't need to load its translations
continue
else:
# the language was already installed, so the po files have been loaded at the installation time
# and now we need to copy the translations of templates to the right objects
langs.append(lang)
if langs:
# write account.account translations in the real COA
self._process_accounts_translations(cr, uid, obj_multi, company_id, langs, 'name', context=context)
# copy account.tax.code translations
self._process_tax_codes_translations(cr, uid, obj_multi, company_id, langs, 'name', context=context)
# copy account.tax translations
self._process_taxes_translations(cr, uid, obj_multi, company_id, langs, 'name', context=context)
# copy account.fiscal.position translations
self._process_fiscal_pos_translations(cr, uid, obj_multi, company_id, langs, 'name', context=context)
return res
def _process_accounts_translations(self, cr, uid, obj_multi, company_id, langs, field, context=None):
obj_acc_template = self.pool.get('account.account.template')
obj_acc = self.pool.get('account.account')
acc_template_root_id = obj_multi.chart_template_id.account_root_id.id
acc_root_id = obj_acc.search(cr, uid, [('company_id', '=', company_id), ('parent_id', '=', None)])[0]
in_ids = obj_acc_template.search(cr, uid, [('id', 'child_of', [acc_template_root_id])], order='id')[1:]
out_ids = obj_acc.search(cr, uid, [('id', 'child_of', [acc_root_id])], order='id')[1:]
return self.process_translations(cr, uid, langs, obj_acc_template, field, in_ids, obj_acc, out_ids, force_write=True, context=context)
def _process_tax_codes_translations(self, cr, uid, obj_multi, company_id, langs, field, context=None):
obj_tax_code_template = self.pool.get('account.tax.code.template')
obj_tax_code = self.pool.get('account.tax.code')
tax_code_template_root_id = obj_multi.chart_template_id.tax_code_root_id.id
tax_code_root_id = obj_tax_code.search(cr, uid, [('company_id', '=', company_id), ('parent_id', '=', None)])[0]
in_ids = obj_tax_code_template.search(cr, uid, [('id', 'child_of', [tax_code_template_root_id])], order='id')[1:]
out_ids = obj_tax_code.search(cr, uid, [('id', 'child_of', [tax_code_root_id])], order='id')[1:]
return self.process_translations(cr, uid, langs, obj_tax_code_template, field, in_ids, obj_tax_code, out_ids, force_write=False, context=context)
def _process_taxes_translations(self, cr, uid, obj_multi, company_id, langs, field, context=None):
obj_tax_template = self.pool.get('account.tax.template')
obj_tax = self.pool.get('account.tax')
in_ids = sorted([x.id for x in obj_multi.chart_template_id.tax_template_ids])
out_ids = obj_tax.search(cr, uid, [('company_id', '=', company_id)], order='id')
return self.process_translations(cr, uid, langs, obj_tax_template, field, in_ids, obj_tax, out_ids, force_write=False, context=context)
def _process_fiscal_pos_translations(self, cr, uid, obj_multi, company_id, langs, field, context=None):
obj_fiscal_position_template = self.pool.get('account.fiscal.position.template')
obj_fiscal_position = self.pool.get('account.fiscal.position')
in_ids = obj_fiscal_position_template.search(cr, uid, [('chart_template_id', '=', obj_multi.chart_template_id.id)], order='id')
out_ids = obj_fiscal_position.search(cr, uid, [('company_id', '=', company_id)], order='id')
return self.process_translations(cr, uid, langs, obj_fiscal_position_template, field, in_ids, obj_fiscal_position, out_ids, force_write=False, context=context)
wizard_multi_charts_accounts()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -55,7 +55,6 @@
"demo_xml": ['lunch_demo.xml'],
"test": ['test/test_lunch.yml', 'test/lunch_report.yml'],
"installable": True,
'application': True,
"certificate" : "001292377792581874189",
'images': ['images/cash_moves.jpeg','images/lunch_orders.jpeg','images/products.jpeg'],
}

View File

@ -380,12 +380,16 @@ class mail_message(osv.osv):
if 'To' in fields:
msg['to'] = decode(msg_txt.get('To'))
if 'Delivered-To' in fields:
msg['to'] = decode(msg_txt.get('Delivered-To'))
if 'CC' in fields:
msg['cc'] = decode(msg_txt.get('CC'))
if 'Cc' in fields:
msg['cc'] = decode(msg_txt.get('Cc'))
if 'Reply-To' in fields:
msg['reply'] = decode(msg_txt.get('Reply-To'))
@ -455,6 +459,7 @@ class mail_message(osv.osv):
msg['sub_type'] = msg['subtype'] or 'plain'
return msg
def send(self, cr, uid, ids, auto_commit=False, context=None):
"""Sends the selected emails immediately, ignoring their current
state (mails that have already been sent should not be passed

View File

@ -58,6 +58,14 @@ class mail_thread(osv.osv):
'message_ids': fields.one2many('mail.message', 'res_id', 'Messages', readonly=True),
}
def message_capable_models(self, cr, uid, context=None):
ret_dict = {}
for model_name in self.pool.obj_list():
model = self.pool.get(model_name)
if 'mail.thread' in getattr(model, '_inherit', []):
ret_dict[model_name] = model._description
return ret_dict
def message_thread_followers(self, cr, uid, ids, context=None):
"""Returns a list of email addresses of the people following
this thread, including the sender of each mail, and the

View File

@ -60,7 +60,6 @@ Note: If you need demo data, you can install the marketing_campaign_crm_demo mod
'demo_xml': [
],
'installable': True,
'application': True,
'active': False,
'certificate' : '00421723279617928365',
'images': ['images/campaign.png', 'images/campaigns.jpeg','images/email_account.jpeg','images/email_templates.jpeg','images/segments.jpeg'],

View File

@ -21,7 +21,7 @@
{
"name" : "Manufacturing Resource Planning",
"name" : "MRP",
"version" : "1.1",
"author" : "OpenERP SA",
"website" : "http://www.openerp.com",

View File

@ -9,11 +9,10 @@
<form string="Manufacturing board">
<board style="2-1">
<column>
<action name="%(mrp.mrp_production_action2)d" string="Next Production Orders" creatable="true"/>
<action name="%(procurement.procurement_exceptions)d" string="Procurements in Exception" domain="[('state','=','exception')]"/>
<action name="%(mrp.mrp_production_action2)d" string="Next Production Orders" creatable="true"/>
</column>
<column>
<action name="%(mrp.action_report_workcenter_load_tree)d" string="Work Center Future Load"/> <!--groups="base.group_extended"-->
<action name="%(mrp.action_report_in_out_picking_tree)d" string="Stock Value Variation"/>
</column>
</board>

View File

@ -41,14 +41,6 @@
</search>
</field>
</record>
<record id="action_report_workcenter_load_tree" model="ir.actions.act_window">
<field name="name">Work Center Loads</field>
<field name="res_model">report.workcenter.load</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="search_view_id" ref="view_workcenter_load_search"/>
<field name="help">Work Center Loads gives you a projection of work center loads over a specified period. It is expressed in number of hours and machine related cycles.</field>
</record>
<menuitem id="next_id_77" name="Reporting"
parent="base.menu_mrp_root" sequence="49"/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -51,7 +51,6 @@ The aim is to have a complete module to manage all products repairs. The followi
'demo_xml': [],
'test': ['test/test_mrp_repair.yml', 'test/mrp_repair_report.yml','test/mrp_repair_cancel.yml'],
'installable': True,
'application': True,
'active': False,
'certificate': '0060814381277',
}

View File

@ -1,29 +0,0 @@
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/ or
http://starship.python.net/crew/mhammond/win32/
3.If you are using MS Outlook 2007 than you are required to install "Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1 (CDO 1.21)". It can be downloaded from
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2714320D-C997-4DE1-986F-24F081725D36&displaylang=en
and With MS Outlook2003 Install inbuilt Collaboration Data Objects(CDO) while installing Outlook.
To read more regarding Collaboration Data Objects(CDO) click following link:
+ http://support.microsoft.com/kb/171440
How to install openerp-outlook plug-in?
======================================================================================
1. Save the executable plug-in file.
2. Close Outlook Application if Running.
3. Run executable plug-in file and the folllow the instruction.
How to uninstall openerp-outlook plug-in?
=====================================================================================
1. Go to Control Panel Click "Add/Remove Programmes"
2. You will entry, you will find entry named 'OpenERP Outlook Addin 1.0' select it and click Uninstall.
Note : Plug In has been successfully tested with MS Office 2003 and MS Offcie 2007.
Enjoy Archiving your Outlook E-mails to OpenERP.

View File

@ -25,7 +25,7 @@
'version' : '1.0',
'author' : 'OpenERP SA',
'website' : 'http://www.openerp.com/',
'depends' : ['base', 'mail'],
'depends' : ['base', 'mail','plugin'],
'category' : 'Customer Relationship Management',
'description': '''
This module provides the Outlook Plug-in.
@ -33,7 +33,7 @@ This module provides the Outlook Plug-in.
Outlook plug-in allows you to select an object that youd like to add
to your email and its attachments from MS Outlook. You can select a partner, a task,
a project, an analytical account, or any other object and archive selected
mail into email.messages with attachments.
mail into mail.message with attachments.
''',
'init_xml' : [],
'demo_xml' : [],

View File

@ -32,7 +32,7 @@ class outlook_installer(osv.osv_memory):
def default_get(self, cr, uid, fields, context=None):
data = super(outlook_installer, self).default_get(cr, uid, fields, context=context)
data['doc_file'] = 'http://doc.openerp.com/book/2/2_6_Comms/2_6_Comms_outlook.html'
file = open(addons.get_module_resource('outlook','plugin','openerp-outlook-addin.exe'), 'r')
file = open(addons.get_module_resource('outlook','plugin','openerp-outlook-plugin_v2.0','OpenERPOutlookPluginSetup','Release','OpenERPOutlookPluginSetup.msi'), 'r')
data['plugin_file'] = base64.encodestring(file.read())
return data
@ -47,21 +47,18 @@ class outlook_installer(osv.osv_memory):
_defaults = {
'outlook' : True,
'name' : 'Openerp-Outlook-Addin.exe',
'name' : 'OpenERPOutlookPlugin.msi',
'doc_name' : 'Installation Guide to OpenERP Outlook Plug-in.doc',
'description' : """
System requirements:
1. Python 2.6+.
2. Python for Windows extensions (PyWin32); this module must be installed for the appropriate version of Python.
3.1 With MS Outlook 2007, install the package Collaboration Data Objects, version 1.2.1, http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2714320D-C997-4DE1-986F-24F081725D36
3.2 With MS Outlook 2003, install the builtin Collaboration Data Objects(CDO) while installing Outlook.
1. MS Outlook 2005 or above.
2. MS .Net Framework 3.5 .
Plugin installation:
1. Save the executable plug-in file.
1. Save the msi plug-in file.
2. Close the Outlook application if it is open.
3. Run the executable plug-in file, and follow the given instructions.
Please refer to the README file for dependencies (external link: openobject-addons/outlook/README).
3. Run the executable plug-in file (OpenERPOutlookPlugin.msi).
"""
}
outlook_installer()

View File

@ -14,7 +14,9 @@
<attribute name="string">Install Outlook Plug-In</attribute>
</separator>
<xpath expr="//label[@string='description']" position="attributes">
<attribute name="string">This plug-in allows you to link your e-mail to OpenERP's documents. You can attach it to any existing one in OpenERP or create a new one.</attribute>
<attribute name="string">This plug-in allows you to create new contact or link contact to an existing partner.
Also allows to link your e-mail to OpenERP's documents.
You can attach it to any existing one in OpenERP or create a new one.</attribute>
</xpath>
<xpath expr="//button[@string='Install Modules']" position="replace">
<button colspan="1" icon="gtk-close" special="cancel" string="_Close"/>

View File

@ -1,2 +0,0 @@
python addin.py
pause

View File

@ -1,2 +0,0 @@
python addin.py --unregister
pause

View File

@ -1,301 +0,0 @@
# This module is part of the spambayes project, which is Copyright 2003
# The Python Software Foundation and is covered by the Python Software
# Foundation license.
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
from win32com import universal
from win32com.client import gencache, DispatchWithEvents
import pythoncom
from win32com.client import constants
import sys
import os
from win32com.client import Dispatch
import win32con
sys.path.append(os.path.abspath(os.path.dirname(__file__))) #outlook
sys.path.append(os.path.abspath(__file__)) #outlook/addin
import manager
from win32com.client import CastTo
import win32ui
from tiny_xmlrpc import XMLRpcConn
import locale
locale.setlocale(locale.LC_NUMERIC, "C")
# Support for COM objects we use.
gencache.EnsureModule('{00062FFF-0000-0000-C000-000000000046}', 0, 9, 0, bForDemand=True) # Outlook 9
gencache.EnsureModule('{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}', 0, 2, 1, bForDemand=True) # Office 9
# The TLB defiining the interfaces we implement
universal.RegisterInterfaces('{AC0714F2-3D04-11D1-AE7D-00A0C90F26F4}', 0, 1, 0, ["_IDTExtensibility2"])
global NewConn
# Retrieves registered XMLRPC connection
def GetConn():
d=Dispatch("Python.OpenERP.XMLRpcConn")
return d
class Configuration:
def OnClick(self, button, cancel):
import win32ui
try:
mngr = manager.GetManager()
mngr.ShowManager()
except Exception,e:
win32ui.MessageBox("Fail to Initialize dialog.\n"+str(e),"OpenERP Configuration", win32con.MB_ICONERROR)
return cancel
#
class ViewPartners:
def OnClick(self, button, cancel):
from win32com.client import Dispatch
import win32con
mngr = manager.GetManager()
data = mngr.LoadConfig()
outlook = Dispatch("Outlook.Application")
ex = outlook.ActiveExplorer()
if ex:
is_login = str(data['login'])
if is_login == 'False':
win32ui.MessageBox("Please login to the database first", "OpenERP Connection", win32con.MB_ICONEXCLAMATION)
elif ex.Selection.Count == 1 or ex.Selection.Count == 0:
mngr = manager.GetManager()
mngr.ShowManager("IDD_VIEW_PARTNER_DIALOG")
elif ex.Selection.Count > 1:
win32ui.MessageBox("Multiple selection not allowed. Please select only one mail at a time.","Open Contact",win32con.MB_ICONINFORMATION)
return cancel
#
class OpenPartner:
def OnClick(self, button, cancel):
import win32ui
mngr = manager.GetManager()
data = mngr.LoadConfig()
outlook = Dispatch("Outlook.Application")
ex = outlook.ActiveExplorer()
if ex:
is_login = str(data['login'])
if is_login == 'False':
win32ui.MessageBox("Please login to the database first", "OpenERP Connection", win32con.MB_ICONEXCLAMATION)
elif ex.Selection.Count == 1:
mngr = manager.GetManager()
mngr.ShowManager("IDD_OPEN_PARTNER_DIALOG")
elif ex.Selection.Count == 0:
win32ui.MessageBox("No mail selected to push to OpenERP","Push to OpenERP",win32con.MB_ICONINFORMATION)
elif ex.Selection.Count > 1:
win32ui.MessageBox("Multiple selection not allowed. Please select only one mail at a time.","Push to OpenERP",win32con.MB_ICONINFORMATION)
return cancel
#
class OpenDocument:
def OnClick(self, button, cancel):
from win32com.client import Dispatch
import win32con
mngr = manager.GetManager()
data = mngr.LoadConfig()
outlook = Dispatch("Outlook.Application")
ex = outlook.ActiveExplorer()
if ex:
is_login = str(data['login'])
if is_login == 'False':
win32ui.MessageBox("Please login to the database first", "OpenERP Connection", win32con.MB_ICONEXCLAMATION)
elif ex.Selection.Count == 1 or ex.Selection.Count == 0:
mngr = manager.GetManager()
mngr.ShowManager("IDD_OPEN_DOCUEMNT_DIALOG")
elif ex.Selection.Count > 1:
win32ui.MessageBox("Multiple selection not allowed. Please select only one mail at a time.","Open Document",win32con.MB_ICONINFORMATION)
return cancel
#
class ArchiveEvent:
def OnClick(self, button, cancel):
from win32com.client import Dispatch
import win32con
mngr = manager.GetManager()
data=mngr.LoadConfig()
outlook = Dispatch("Outlook.Application")
ex = outlook.ActiveExplorer()
if ex:
is_login = str(data['login'])
if is_login == 'False':
win32ui.MessageBox("Please login to the database first", "OpenERP Connection", win32con.MB_ICONEXCLAMATION)
elif ex.Selection.Count == 1:
mngr = manager.GetManager()
mngr.ShowManager("IDD_SYNC")
elif ex.Selection.Count == 0:
win32ui.MessageBox("No mail selected to push to OpenERP","Push to OpenERP",win32con.MB_ICONINFORMATION)
elif ex.Selection.Count > 1:
win32ui.MessageBox("Multiple selection not allowed. Please select only one mail at a time.","Push to OpenERP",win32con.MB_ICONINFORMATION)
return cancel
#
class OutlookAddin:
_com_interfaces_ = ['_IDTExtensibility2']
_public_methods_ = ['OnConnection','GetAppDataPath']
_reg_clsctx_ = pythoncom.CLSCTX_INPROC_SERVER
_reg_clsid_ = "{0F47D9F3-598B-4d24-B7E3-92AC15ED27E8}"
_reg_progid_ = "Python.OpenERP.OutlookAddin"
_reg_policy_spec_ = "win32com.server.policy.EventHandlerPolicy"
def OnConnection(self, application, connectMode, addin, custom):
# ActiveExplorer may be none when started without a UI (eg, WinCE synchronisation)
activeExplorer = application.ActiveExplorer()
if activeExplorer is not None:
bars = activeExplorer.CommandBars
new_bar = bars.Add('Open ERP',0,0,0)
menu_bar = bars.Item("Menu Bar")
tools_menu = menu_bar.Controls(5)
tools_menu = CastTo(tools_menu, "CommandBarPopup")
item = tools_menu.Controls.Add(Type=constants.msoControlButton, Temporary=True)
# Hook events for the item
item = self.menu_bar_Button = DispatchWithEvents(item, Configuration)
item.Caption="Configuration"
item.TooltipText = "Click to configure OpenERP"
item.Enabled = True
item = tools_menu.Controls.Add(Type=constants.msoControlButton, Temporary=True)
# Hook events for the item
item = self.menu_bar_arch_Button = DispatchWithEvents(item, ArchiveEvent)
item.Caption="Push"
item.TooltipText = "Click to push to OpenERP"
item.Enabled = True
toolbar = bars.Item("Standard")
openerp_bar = bars.Item('Open ERP')
item = openerp_bar.Controls.Add(Type = constants.msoControlButton, Temporary = True)
item = self.toolbarButtonConfig = DispatchWithEvents(item, Configuration)
item.Caption = "Configuration"
item.TooltipText = "Click to configure OpenERP."
item.Enabled = True
item = openerp_bar.Controls.Add(Type=constants.msoControlButton, Temporary=True)
# Hook events for the item
item = self.toolbarButton = DispatchWithEvents(item, ArchiveEvent)
item.Caption="Push"
item.TooltipText = "Click to push to OpenERP"
item.Enabled = True
# Adding Menu in Menu Bar to the Web Menu of the Outlook
toolbarweb = bars.Item("Web")
item = openerp_bar.Controls.Add(Type = constants.msoControlButton, Temporary = True)
item = self.toolbarButtonOpenPartner = DispatchWithEvents(item, OpenPartner)
item.Caption = "Partner"
item.TooltipText = "Click to Open OpenERP Partner Contact Information."
item.Enabled = True
item = openerp_bar.Controls.Add(Type = constants.msoControlButton, Temporary = True)
item = self.toolbarButtonOpenDocument = DispatchWithEvents(item, OpenDocument)
item.Caption = "Document"
item.TooltipText = "Click to Open Document that has been pushed to server."
item.Enabled = True
# Hook events for the item
# item = toolbarweb.Controls.Add(Type = constants.msoControlButton, Temporary = True)
# item = self.toolbarButtonPartner = DispatchWithEvents(item, ViewPartners)
# item.Caption = "Open Contact"
# item.TooltipText = "Click to Open OpenERP Partner Contact Information."
# item.Enabled = True
# item = tools_menu.Controls.Add(Type=constants.msoControlButton, Temporary=True)
# # Hook events for the item
# item = self.menu_bar_viewpartner_Button = DispatchWithEvents(item, ViewPartners)
# item.Caption = "Open Contact"
# item.TooltipText = "Click to Open Partner detail"
# item.Enabled = True
item = tools_menu.Controls.Add(Type=constants.msoControlButton, Temporary=True)
# Hook events for the item
item = self.menu_bar_openpartner_Button = DispatchWithEvents(item, OpenPartner)
item.Caption = "Partner"
item.TooltipText = "Click to Open Partner detail"
item.Enabled = True
item = tools_menu.Controls.Add(Type=constants.msoControlButton, Temporary=True)
# Hook events for the item
item = self.menu_bar_opendocument_Button = DispatchWithEvents(item, OpenDocument)
item.Caption = "Document"
item.TooltipText = "Click to Open Document that has been pushed to server."
item.Enabled = True
def OnDisconnection(self, mode, custom):
mngr = manager.GetManager()
mngr.config['login'] = False
mngr.SaveConfig()
self.item.close()
pass
def OnAddInsUpdate(self, custom):
pass
def OnStartupComplete(self, custom):
pass
def OnBeginShutdown(self, custom):
pass
def GetAppDataPath(self):
mngr = manager.GetManager()
return mngr.data_directory
def RegisterAddin(klass):
import _winreg
key = _winreg.CreateKey(_winreg.HKEY_CURRENT_USER, "Software\\Microsoft\\Office\\Outlook\\Addins")
subkey = _winreg.CreateKey(key, klass._reg_progid_)
_winreg.SetValueEx(subkey, "CommandLineSafe", 0, _winreg.REG_DWORD, 0)
_winreg.SetValueEx(subkey, "LoadBehavior", 0, _winreg.REG_DWORD, 3)
_winreg.SetValueEx(subkey, "Description", 0, _winreg.REG_SZ, klass._reg_progid_)
_winreg.SetValueEx(subkey, "FriendlyName", 0, _winreg.REG_SZ, klass._reg_progid_)
def UnregisterAddin(klass):
import _winreg
try:
_winreg.DeleteKey(_winreg.HKEY_CURRENT_USER, "Software\\Microsoft\\Office\\Outlook\\Addins\\" + klass._reg_progid_)
except:
pass
def UnregisterXMLConn(klass):
import _winreg
try:
_winreg.DeleteKey(_winreg.HKEY_CURRENT_USER, "Software\\Microsoft\\Office\\Outlook\\Addins\\XMLConnection" + klass._reg_progid_)
except:
pass
def RegisterXMLConn(klass):
import _winreg
key = _winreg.CreateKey(_winreg.HKEY_CURRENT_USER, "Software\\Microsoft\\Office\\Outlook\\Addins\\XMLConnection")
subkey = _winreg.CreateKey(key, klass._reg_progid_)
_winreg.SetValueEx(subkey, "CommandLineSafe", 0, _winreg.REG_DWORD, 0)
_winreg.SetValueEx(subkey, "LoadBehavior", 0, _winreg.REG_DWORD, 3)
_winreg.SetValueEx(subkey, "Description", 0, _winreg.REG_SZ, klass._reg_progid_)
_winreg.SetValueEx(subkey, "FriendlyName", 0, _winreg.REG_SZ, klass._reg_progid_)
if __name__ == '__main__':
import win32com.server.register
NewConn=XMLRpcConn()
win32com.server.register.UseCommandLine(OutlookAddin)
win32com.server.register.UseCommandLine(NewConn)
if "--unregister" in sys.argv:
UnregisterAddin(OutlookAddin)
UnregisterXMLConn(NewConn)
print "\n \tPlug In Un-registered Successfully.\n\tThank You for Using PlugIn."
else:
RegisterAddin(OutlookAddin)
RegisterXMLConn(NewConn)
print "\n \tPlug In Registered Successfully.\n\tEnjoy Archiving with OpenERP.\n\tSee UserGuide for More. "
#mngr = manager.GetManager()
#mngr.ShowManager("IDD_MANAGER")
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

File diff suppressed because it is too large Load Diff

View File

@ -1,83 +0,0 @@
# This package defines dialog boxes used by the main
# This module is part of the spambayes project, which is Copyright 2003
# The Python Software Foundation and is covered by the Python Software
# Foundation license.
import os, sys, stat
#import dialog_map
def LoadDialogs(rc_name = "dialogs.rc"):
base_name = os.path.splitext(rc_name)[0]
mod_name = "dialogs.resources." + base_name
mod = None
# If we are running from source code, check the .py file is up to date
# wrt the .rc file passed in.
# If we are running from binaries, the rc name is not used at all - we
# assume someone running from source previously generated the .py!
if not hasattr(sys, "frozen"):
from resources import rc2py
rc_path = os.path.dirname( rc2py.__file__ )
if not os.path.isabs(rc_name):
rc_name = os.path.join( rc_path, rc_name)
py_name = os.path.join(rc_path, base_name + ".py")
mtime = size = None
if os.path.exists(py_name):
try:
mod = __import__(mod_name)
mod = sys.modules[mod_name]
mtime = mod._rc_mtime_
size = mod._rc_size_
except (ImportError, AttributeError):
mtime = None
try:
stat_data = os.stat(rc_name)
rc_mtime = stat_data[stat.ST_MTIME]
rc_size = stat_data[stat.ST_SIZE]
except OSError:
rc_mtime = rc_size = None
if rc_mtime!=mtime or rc_size!=size:
# Need to generate the dialog.
print "Generating %s from %s" % (py_name, rc_name)
rc2py.convert(rc_name, py_name)
if mod is not None:
reload(mod)
if mod is None:
mod = __import__(mod_name)
mod = sys.modules[mod_name]
return mod.FakeParser()
def ShowDialog(parent, manager, config, idd):
"""Displays another dialog"""
if manager.dialog_parser is None:
manager.dialog_parser = LoadDialogs()
import dialog_map
print dir(dialog_map)
commands = dialog_map.dialog_map[idd]
if not parent:
import win32gui
try:
parent = win32gui.GetActiveWindow()
except win32gui.error:
pass
import dlgcore
dlg = dlgcore.ProcessorDialog(parent, manager, config, idd, commands)
return dlg.DoModal()
def MakePropertyPage(parent, manager, config, idd, yoffset=24):
"""Creates a child dialog box to use as property page in a tab control"""
if manager.dialog_parser is None:
manager.dialog_parser = LoadDialogs()
import dialog_map
commands = dialog_map.dialog_map[idd]
if not parent:
raise "Parent must be the tab control"
import dlgcore
dlg = dlgcore.ProcessorPage(parent, manager, config, idd, commands, yoffset)
return dlg
import dlgutils
SetWaitCursor = dlgutils.SetWaitCursor
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,325 +0,0 @@
# A core, data-driven dialog.
# Driven completely by "Control Processor" objects.
# This module is part of the spambayes project, which is Copyright 2003
# The Python Software Foundation and is covered by the Python Software
# Foundation license.
import win32gui, win32api, win32con
import commctrl
import struct, array
from dlgutils import *
# Isolate the nasty stuff for tooltips somewhere.
class TooltipManager:
def __init__(self, dialog):
self.dialog = dialog
self.hwnd_tooltip = None
self.tooltip_tools = {}
def HideTooltip(self):
if self.hwnd_tooltip is not None:
win32gui.SendMessage(self.hwnd_tooltip, commctrl.TTM_TRACKACTIVATE, 0, 0)
def ShowTooltipForControl(self, control_id, text):
# Note sure this tooltip stuff is quite right!
# Hide an existing one, so the new one gets created.
# (new one empty is no big deal, but hiding the old one is, so
# we get re-queried for the text.
hwnd_dialog = self.dialog.hwnd
self.HideTooltip()
if self.hwnd_tooltip is None:
TTS_BALLOON = 0x40
self.hwnd_tooltip = win32gui.CreateWindowEx(0, "tooltips_class32", None,
win32con.WS_POPUP | TTS_BALLOON,
win32con.CW_USEDEFAULT, win32con.CW_USEDEFAULT,
win32con.CW_USEDEFAULT, win32con.CW_USEDEFAULT,
hwnd_dialog, 0, 0, None)
# 80 chars max for our tooltip
# hrm - how to measure this in pixels!
win32gui.SendMessage(self.hwnd_tooltip,
commctrl.TTM_SETMAXTIPWIDTH,
0, 300)
format = "iiiiiiiiiii"
tt_size = struct.calcsize(format)
buffer = array.array("c", text + "\0")
text_address, size = buffer.buffer_info()
uID = control_id
flags = commctrl.TTF_TRACK | commctrl.TTF_ABSOLUTE
data = struct.pack(format, tt_size, flags, hwnd_dialog, uID, 0,0,0,0, 0, text_address, 0)
# Add a tool for this control only if we haven't already
if control_id not in self.tooltip_tools:
win32gui.SendMessage(self.hwnd_tooltip,
commctrl.TTM_ADDTOOL,
0, data)
self.tooltip_tools[control_id] = 1
control = win32gui.GetDlgItem(hwnd_dialog, control_id)
child_rect = win32gui.GetWindowRect(control)
xOff = yOff = 15 # just below and right of the control
win32gui.SendMessage(self.hwnd_tooltip,
commctrl.TTM_TRACKPOSITION,
0,
MAKELONG(child_rect[0]+xOff, child_rect[1]+yOff))
win32gui.SendMessage(self.hwnd_tooltip,
commctrl.TTM_TRACKACTIVATE,
1,data)
# A base dialog class, that loads from resources. Has no real smarts.
class Dialog:
def __init__(self, parent, parser, idd):
win32gui.InitCommonControls()
self.hinst = win32api.GetModuleHandle(None)
self.parent = parent
self.dialog_parser = parser
self.template = parser.dialogs[idd]
def _GetIDName(self, cid):
return self.dialog_parser.names.get(cid, str(cid))
def CreateWindow(self):
return self._DoCreate(win32gui.CreateDialogIndirect)
def DoModal(self):
return self._DoCreate(win32gui.DialogBoxIndirect)
def GetMessageMap(self):
ret = {
win32con.WM_COMMAND: self.OnCommand,
win32con.WM_NOTIFY: self.OnNotify,
win32con.WM_INITDIALOG: self.OnInitDialog,
win32con.WM_CLOSE: self.OnClose,
win32con.WM_DESTROY: self.OnDestroy,
win32con.WM_RBUTTONUP: self.OnRButtonUp,
}
return ret
def DoInitialPosition(self):
# centre the dialog
desktop = win32gui.GetDesktopWindow()
l,t,r,b = win32gui.GetWindowRect(self.hwnd)
w = r-l
h = b-t
dt_l, dt_t, dt_r, dt_b = win32gui.GetWindowRect(desktop)
centre_x, centre_y = win32gui.ClientToScreen( desktop, ( (dt_r-dt_l)/2, (dt_b-dt_t)/2) )
win32gui.MoveWindow(self.hwnd, centre_x-(w/2), centre_y-(h/2), w, h, 0)
def OnInitDialog(self, hwnd, msg, wparam, lparam):
self.hwnd = hwnd
self.DoInitialPosition()
def OnCommand(self, hwnd, msg, wparam, lparam):
pass
def OnNotify(self, hwnd, msg, wparam, lparam):
pass
def OnClose(self, hwnd, msg, wparam, lparam):
pass
def OnDestroy(self, hwnd, msg, wparam, lparam):
pass
def OnRButtonUp(self, hwnd, msg, wparam, lparam):
pass
def _DoCreate(self, fn):
message_map = self.GetMessageMap()
return win32gui.DialogBoxIndirect(self.hinst, self.template, self.parent, message_map)
# A couple of helpers
def GetDlgItem(self, id):
if type(id)==type(''):
id = self.dialog_parser.ids[id]
return win32gui.GetDlgItem(self.hwnd, id)
def SetDlgItemText(self, id, text):
hchild = self.GetDlgItem(id)
win32gui.SendMessage(hchild, win32con.WM_SETTEXT, 0, text)
# A dialog with a tooltip manager
class TooltipDialog(Dialog):
def __init__(self, parent, parser, idd):
Dialog.__init__(self, parent, parser, idd)
self.tt = TooltipManager(self)
def GetMessageMap(self):
ret = Dialog.GetMessageMap(self)
ret.update( {
win32con.WM_HELP: self.OnHelp,
win32con.WM_LBUTTONDOWN: self.OnLButtonDown,
win32con.WM_ACTIVATE: self.OnActivate,
})
return ret
def OnLButtonDown(self, hwnd, msg, wparam, lparam):
self.tt.HideTooltip()
def OnActivate(self, hwnd, msg, wparam, lparam):
self.tt.HideTooltip()
def OnDestroy(self, hwnd, msg, wparam, lparam):
self.tt.HideTooltip()
def OnHelp(self, hwnd, msg, wparam, lparam):
format = "iiiiiii"
buf = win32gui.PyMakeBuffer(struct.calcsize(format), lparam)
cbSize, iContextType, iCtrlId, hItemHandle, dwContextID, x, y = \
struct.unpack(format, buf)
tt_text = self.GetPopupHelpText(iCtrlId)
if tt_text:
self.tt.ShowTooltipForControl(iCtrlId, tt_text)
else:
self.tt.HideTooltip()
return 1
def GetPopupHelpText(self, control_id):
return None
# A "Processor Dialog" works with Command Processors, to link Outlook-Plugin
# options with control IDS, giving a "data driven" dialog.
class ProcessorDialog(TooltipDialog):
def __init__(self, parent, manager, config, idd, option_handlers):
TooltipDialog.__init__(self, parent, manager.dialog_parser, idd)
parser = manager.dialog_parser
self.manager = manager
self.config = config
self.command_processors = {}
self.processor_message_map = {}
self.all_processors = []
for data in option_handlers:
klass = data[0]
id_names = data[1]
rest = data[2:]
ids = id_names.split()
int_ids = [ parser.ids[id] for id in ids]
instance = klass(self,int_ids, *rest)
self.all_processors.append(instance)
for int_id in int_ids:
self.command_processors[int_id] = instance
for message in instance.GetMessages():
existing = self.processor_message_map.setdefault(message, [])
existing.append(instance)
def GetMessageMap(self):
ret = TooltipDialog.GetMessageMap(self)
for key in self.processor_message_map.keys():
if key in ret:
print "*** WARNING: Overwriting message!!!"
ret[key] = self.OnCommandProcessorMessage
return ret
def OnInitDialog(self, hwnd, msg, wparam, lparam):
TooltipDialog.OnInitDialog(self, hwnd, msg, wparam, lparam)
if __debug__: # this is just a debugging aid
for int_id in self.command_processors:
try:
self.GetDlgItem(int_id)
except win32gui.error:
print "ERROR: Dialog item %s refers to an invalid control" % \
self._GetIDName(int_id)
self.LoadAllControls()
def GetPopupHelpText(self, iCtrlId):
cp = self.command_processors.get(iCtrlId)
tt_text = None
if cp is not None:
return cp.GetPopupHelpText(iCtrlId)
print "Can not get command processor for", self._GetIDName(iCtrlId)
return None
def OnRButtonUp(self, hwnd, msg, wparam, lparam):
for cp in self.command_processors.values():
cp.OnRButtonUp(wparam,lparam)
def OnCommandProcessorMessage(self, hwnd, msg, wparam, lparam):
for p in self.processor_message_map[msg]:
p.OnMessage(msg, wparam, lparam)
# Called back by a processor when it changes an option. We tell all other
# options on our page that the value changed.
def OnOptionChanged(self, changed_by, option):
for p in self.all_processors:
if p is not changed_by:
p.OnOptionChanged(option)
def OnDestroy(self, hwnd, msg, wparam, lparam):
for p in self.all_processors:
p.Term()
TooltipDialog.OnDestroy(self, hwnd, msg, wparam, lparam)
self.command_processors = None
self.all_processors = None
self.processor_message_map = None
def LoadAllControls(self):
for p in self.all_processors:
p.Init()
def ApplyHandlingOptionValueError(self, func, *args):
try:
return func(*args)
except ValueError, why:
mb_flags = win32con.MB_ICONEXCLAMATION | win32con.MB_OK
win32gui.MessageBox(self.hwnd, str(why), "OpenERP Configuration", mb_flags)
return False
def SaveAllControls(self):
for p in self.all_processors:
if not self.ApplyHandlingOptionValueError(p.Done):
win32gui.SetFocus(p.GetControl())
return False
return True
def OnClose(self, hwnd, msg, wparam, lparam):
if TooltipDialog.OnClose(self, hwnd, msg, wparam, lparam):
return 1
if not self.SaveAllControls():
return 1
win32gui.EndDialog(hwnd, 0)
def OnNotify(self, hwnd, msg, wparam, lparam):
# Parse the NMHDR
TooltipDialog.OnNotify(self, hwnd, msg, wparam, lparam)
format = "iii"
buf = win32gui.PyMakeBuffer(struct.calcsize(format), lparam)
hwndFrom, idFrom, code = struct.unpack(format, buf)
code += 0x4f0000 # hrm - wtf - commctrl uses this, and it works with mfc. *sigh*
# delegate rest to our commands.
self._GetIDName(idFrom)
if self.command_processors is not None:
handler = self.command_processors.get(idFrom)
if handler is None:
print "Ignoring OnNotify for", self._GetIDName(idFrom)
return
return handler.OnNotify( (hwndFrom, idFrom, code), wparam, lparam)
return
def OnCommand(self, hwnd, msg, wparam, lparam):
TooltipDialog.OnCommand(self, hwnd, msg, wparam, lparam)
id = win32api.LOWORD(wparam)
# Sometimes called after OnDestroy???
if self.command_processors is None:
print "Ignoring OnCommand for", self._GetIDName(id)
return
else:
handler = self.command_processors.get(id)
if handler is None:
print "Ignoring OnCommand for", self._GetIDName(id)
return
self.ApplyHandlingOptionValueError(handler.OnCommand, wparam, lparam)
class ProcessorPage(ProcessorDialog):
def __init__(self, parent, manager, config, idd, option_handlers, yoffset):
ProcessorDialog.__init__(self, parent, manager, config, idd,option_handlers)
self.yoffset = yoffset
def DoInitialPosition(self):
# The hardcoded values are a bit of a hack.
win32gui.SetWindowPos(self.hwnd, win32con.HWND_TOP, 1, self.yoffset, 0, 0, win32con.SWP_NOSIZE)
def CreateWindow(self):
# modeless. Pages should have the WS_CHILD window style
message_map = self.GetMessageMap()
# remove frame from dialog and make sure it is a child
self.template[0][2] = self.template[0][2] & ~(win32con.DS_MODALFRAME|win32con.WS_POPUP|win32con.WS_OVERLAPPED|win32con.WS_CAPTION)
self.template[0][2] = self.template[0][2] | win32con.WS_CHILD
return win32gui.CreateDialogIndirect(self.hinst, self.template, self.parent, message_map)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,20 +0,0 @@
# Generic utilities for dialog functions.
# This module is part of the spambayes project, which is Copyright 2003
# The Python Software Foundation and is covered by the Python Software
# Foundation license.
def MAKELONG(l,h):
return ((h & 0xFFFF) << 16) | (l & 0xFFFF)
MAKELPARAM=MAKELONG
def SetWaitCursor(wait):
import win32gui, win32con
if wait:
hCursor = win32gui.LoadCursor(0, win32con.IDC_WAIT)
else:
hCursor = win32gui.LoadCursor(0, 0)
win32gui.SetCursor(hCursor)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,320 +0,0 @@
# Option Control Processors for our dialog.
# These are extensions to basic Control Processors that are linked with
# Outlook-Plugin options.
# This module is part of the spambayes project, which is Copyright 2003
# The Python Software Foundation and is covered by the Python Software
# Foundation license.
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
import win32gui, win32api, win32con, win32ui
import commctrl
import struct, array
from dlgutils import *
import xmlrpclib
import processors
verbose = 0 # set to 1 to see option values fetched and set.
# A ControlProcessor that is linked up with options. These get a bit smarter.
class OptionControlProcessor(processors.ControlProcessor):
def __init__(self, window, control_ids):
processors.ControlProcessor.__init__(self, window, control_ids)
def GetPopupHelpText(self, idFrom):
doc = " ".join(self.option.doc().split())
if self.option.default_value:
doc += " (the default value is %s)" % self.option.default_value
return doc
# We override Init, and break it into 2 steps.
def Init(self):
self.UpdateControl_FromValue()
def Done(self):
self.UpdateValue_FromControl()
return True
# # Only sub-classes know how to update their controls from the value.
def UpdateControl_FromValue(self):
raise NotImplementedError
def UpdateValue_FromControl(self):
raise NotImplementedError
class ComboProcessor(OptionControlProcessor):
def __init__(self, window, control_ids, func, args):
self.func = func
self.args = args
OptionControlProcessor.__init__(self, window, control_ids)
def OnCommand(self, wparam, lparam):
code = win32api.HIWORD(wparam)
if code == win32con.CBN_SELCHANGE:
self.UpdateValue_FromControl()
def Init(self):
self.UpdateControl_FromValue()
def UpdateControl_FromValue(self):
pass
def UpdateValue_FromControl(self):
pass
class DBComboProcessor(ComboProcessor):
def Init(self):
self.UpdateControl_FromValue()
def UpdateControl_FromValue(self):
combo = self.GetControl()
conn = self.func()
list = conn.GetDBList()
db = conn.getitem('_dbname')
if list == -1:
hinst = win32gui.dllhandle
parent = self.window.hwnd
dwStyle = win32con.WS_CHILD | win32con.WS_VISIBLE | win32con.WS_TABSTOP | win32con.WS_BORDER | \
win32con.ES_AUTOHSCROLL | win32con.FF_ROMAN | win32con.FW_EXTRALIGHT
hwndImg = win32gui.CreateWindow (
"EDIT",
db,
dwStyle,
127,80,235,20,
parent,
7000,
0,
None);
self.active_control_id = 7000
win32gui.ShowWindow(combo, False)
else:
try:
txtbx = win32gui.GetDlgItem(self.window.hwnd, 7000)
win32gui.DestroyWindow(txtbx)
except Exception,e:
print "Exception : %s"%str(e)
pass
win32gui.ShowWindow(combo, True)
win32gui.SendMessage(combo, win32con.CB_RESETCONTENT,0, 0);
for item in list:
win32gui.SendMessage(combo, win32con.CB_ADDSTRING, 0, str(item))
sel = win32gui.SendMessage(combo, win32con.CB_SELECTSTRING, 0, db)
dbb=win32gui.GetDlgItemText(self.window.hwnd, 2004)
if sel == -1:
win32gui.SendMessage(combo, win32con.CB_SETCURSEL, 0, 0)
self.active_control_id = self.control_id
def UpdateValue_FromControl(self):
db = win32gui.GetDlgItemText(self.window.hwnd, self.active_control_id)
conn = self.func()
if conn.getitem('_dbname') != db:
conn.setitem('_dbname', db)
conn.setitem('_login', 'False')
class PartnersComboProcessor(ComboProcessor):
def UpdateControl_FromValue(self):
from manager import ustr
import win32ui
combo = self.GetControl()
conn = self.func()
win32gui.SendMessage(combo, win32con.CB_RESETCONTENT,0, 0);
id_list = {}
p_list=[]
try:
p_list = list(conn.GetPartners())
cnt=0
for item in p_list:
win32gui.SendMessage(combo, win32con.CB_ADDSTRING, 0, ustr(item[1]).encode('iso-8859-1'))
id_list[cnt] = item[0]
cnt+=1
conn.setitem('partner_id_list', str(id_list))
cnt = win32gui.SendMessage(combo, win32con.CB_GETCOUNT, 0, 0)
win32gui.SendMessage(combo, win32con.CB_SETCURSEL, -1, 0)
return
except xmlrpclib.Fault,e:
msg = str(e.faultCode) or e.faultString or e.message or str(e)
except Exception,e:
msg = str(e)
win32ui.MessageBox(str(e),"Partners",win32con.MB_ICONEXCLAMATION)
win32gui.DestroyWindow(self.window.hwnd)
def UpdateValue_FromControl(self):
combo = self.GetControl()
conn = self.func()
sel = win32gui.SendMessage(combo, win32con.CB_GETCURSEL)
conn.setitem('sel_id', sel)
class StateComboProcessor(ComboProcessor):
def Init(self):
self.UpdateControl_FromValue()
def UpdateControl_FromValue(self):
from manager import ustr
import win32ui
combo = self.GetControl()
conn = self.func()
win32gui.SendMessage(combo, win32con.CB_RESETCONTENT, 0, 0);
id_list = {}
state_list=[]
try:
state_list = list(conn.GetAllState())
for item in state_list:
win32gui.SendMessage(combo, win32con.CB_ADDSTRING, 0, ustr(item[1]).encode('iso-8859-1'))
win32gui.SendMessage(combo, win32con.CB_SETCURSEL, -1, 0)
cnt = win32gui.SendMessage(combo, win32con.CB_GETCOUNT, 0, 0)
return
except xmlrpclib.Fault,e:
msg = str(e.faultCode) or e.faultString or e.message or str(e)
win32ui.MessageBox(msg, "Open Partner")
except Exception,e:
win32ui.MessageBox(str(e), "Open Partner")
def UpdateValue_FromControl(self):
pass
class CountryComboProcessor(ComboProcessor):
def Init(self):
self.UpdateControl_FromValue()
def UpdateControl_FromValue(self):
from manager import ustr
import win32ui
combo = self.GetControl()
conn = self.func()
win32gui.SendMessage(combo, win32con.CB_RESETCONTENT, 0, 0);
id_list = {}
state_list=[]
try:
country_list = list(conn.GetAllCountry())
for item in country_list:
win32gui.SendMessage(combo, win32con.CB_ADDSTRING, 0, ustr(item[1]).encode('iso-8859-1'))
win32gui.SendMessage(combo, win32con.CB_SETCURSEL, -1, 0)
cnt = win32gui.SendMessage(combo, win32con.CB_GETCOUNT, 0, 0)
return
except xmlrpclib.Fault,e:
msg = str(e.faultCode) or e.faultString or e.message or str(e)
win32ui.MessageBox(msg, "Open Partner")
except Exception,e:
win32ui.MessageBox(str(e), "Open Partner")
def UpdateValue_FromControl(self):
pass
class CSComboProcessor(ComboProcessor):
def UpdateControl_FromValue(self):
combo = self.GetControl()
conn = self.func()
if str(conn.getitem('_iscrm')) == 'False':
win32gui.EnableWindow(combo, False)
return
try:
list=['CRM Lead']#, 'CRM Helpdesk', 'CRM Lead', 'CRM Meeting', 'CRM Opportunity', 'CRM Phonecall']
objlist = conn.GetAllObjects()
if'hr.applicant' in objlist:
list.append('HR Applicant')
if'project.issue' in objlist:
list.append('Project Issue')
win32gui.SendMessage(combo, win32con.CB_RESETCONTENT,0, 0);
for item in list:
win32gui.SendMessage(combo, win32con.CB_ADDSTRING, 0, str(item))
win32gui.SendMessage(combo, win32con.CB_SETCURSEL, 0, 0)
return
except xmlrpclib.Fault,e:
win32ui.MessageBox(str(e.faultCode),"CRM Case",win32con.MB_ICONEXCLAMATION)
except Exception,e:
win32ui.MessageBox(str(e),"CRM Case",win32con.MB_ICONEXCLAMATION)
def UpdateValue_FromControl(self):
pass
class TextProcessor(OptionControlProcessor):
def __init__(self, window, control_ids, func, args):
self.func = func
self.args = args
OptionControlProcessor.__init__(self, window, control_ids)
def UpdateControl_FromValue(self):
args = (self,)+(self.window,) + self.args
self.func(*args)
def UpdateValue_FromControl(self):
pass
class ListBoxProcessor(OptionControlProcessor):
def __init__(self, window, control_ids, func, args):
self.func = func
self.args = args
OptionControlProcessor.__init__(self, window, control_ids)
def Init(self):
args = (self,)+(self.window,) + self.args
if not self.init_done:
self.func(*args)
def UpdateControl_FromValue(self):
pass
def UpdateValue_FromControl(self):
pass
class ListBoxProcessor(OptionControlProcessor):
def __init__(self, window, control_ids, func, args):
self.func = func
self.args = args
OptionControlProcessor.__init__(self, window, control_ids)
def Init(self):
args = (self,)+(self.window,) + self.args
if not self.init_done:
self.func(*args)
def UpdateControl_FromValue(self):
pass
def UpdateValue_FromControl(self):
pass
class GroupProcessor(OptionControlProcessor):
def __init__(self, window, control_ids, func, args):
self.func = func
self.args = args
OptionControlProcessor.__init__(self, window, control_ids)
def Init(self):
args = (self,)+(self.window,) + self.args
self.func(*args)
def UpdateControl_FromValue(self):
pass
def UpdateValue_FromControl(self):
pass
class ProtocolComboProcessor(ComboProcessor):
def Init(self):
self.UpdateControl_FromValue()
def UpdateControl_FromValue(self):
combo = self.GetControl()
list = ['XML-RPC', 'XML-RPCS']
win32gui.ShowWindow(combo, True)
win32gui.SendMessage(combo, win32con.CB_RESETCONTENT, 0, 0);
for item in list:
win32gui.SendMessage(combo, win32con.CB_ADDSTRING, 0, str(item))
if sel == -1:
win32gui.SendMessage(combo, win32con.CB_SETCURSEL, 1, 0)
self.active_control_id = self.control_id
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,147 +0,0 @@
# Control Processors for our dialog.
# This module is part of the spambayes project, which is Copyright 2003
# The Python Software Foundation and is covered by the Python Software
# Foundation license.
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
import win32gui, win32api, win32con
import commctrl
import struct, array
from dlgutils import *
import win32ui
# Cache our leaky bitmap handles
bitmap_handles = {}
# A generic set of "ControlProcessors". A control processor by itself only
# does a few basic things.
class ControlProcessor:
def __init__(self, window, control_ids):
self.control_id = control_ids[0]
self.other_ids = control_ids[1:]
self.window = window
self.init_done=False
def Init(self):
pass
def Done(self): # done with 'ok' - ie, save options. May return false.
return True
def Term(self): # closing - can't fail.
pass
def GetControl(self, control_id = None):
control_id = control_id or self.control_id
try:
h = win32gui.GetDlgItem(self.window.hwnd, control_id)
except:
hparent = win32gui.GetParent(self.window.hwnd)
hparent = win32gui.GetParent(hparent)
h = win32gui.GetDlgItem(hparent, control_id)
return h
def GetPopupHelpText(self, idFrom):
return None
def OnCommand(self, wparam, lparam):
pass
def OnNotify(self, nmhdr, wparam, lparam):
pass
def GetMessages(self):
return []
def OnMessage(self, msg, wparam, lparam):
raise RuntimeError, "I don't hook any messages, so I shouldn't be called"
def OnOptionChanged(self, option):
pass
def OnRButtonUp(self, wparam, lparam):
pass
class ImageProcessor(ControlProcessor):
def Init(self):
rcp = self.window.manager.dialog_parser;
bmp_id = int(win32gui.GetWindowText(self.GetControl()))
if bitmap_handles.has_key(bmp_id):
handle = bitmap_handles[bmp_id]
else:
import resources
mod_handle, mod_bmp, extra_flags = resources.GetImageParamsFromBitmapID(rcp, bmp_id)
load_flags = extra_flags|win32con.LR_COLOR|win32con.LR_SHARED
handle = win32gui.LoadImage(mod_handle, mod_bmp,win32con.IMAGE_BITMAP,0,0,load_flags)
bitmap_handles[bmp_id] = handle
win32gui.SendMessage(self.GetControl(), win32con.STM_SETIMAGE, win32con.IMAGE_BITMAP, handle)
def GetPopupHelpText(self, cid):
return None
class ButtonProcessor(ControlProcessor):
def OnCommand(self, wparam, lparam):
code = win32api.HIWORD(wparam)
id = win32api.LOWORD(wparam)
if code == win32con.BN_CLICKED:
self.OnClicked(id)
class RadioButtonProcessor(ControlProcessor):
def __init__(self, window, control_ids, func='', args=''):
self.func = func
self.args = args
ControlProcessor.__init__(self, window, control_ids)
def OnCommand(self, wparam, lparam):
code = win32api.HIWORD(wparam)
id = win32api.LOWORD(wparam)
if code == win32con.BN_CLICKED:
text=win32gui.GetDlgItemText(self.window.hwnd, self.control_id)
conn = self.func()
conn.setitem('protocol', text)
p=conn.getitem('protocol')
class CloseButtonProcessor(ButtonProcessor):
def OnClicked(self, id):
win32gui.EndDialog(self.window.hwnd, id)
class CancelButtonProcessor(ButtonProcessor):
def __init__(self, window, control_ids, func, args):
self.func = func
self.args = args
ControlProcessor.__init__(self, window, control_ids)
def OnClicked(self, id):
a=self.func(self.window)
win32gui.EndDialog(self.window.hwnd, id)
class CommandButtonProcessor(ButtonProcessor):
def __init__(self, window, control_ids, func, args):
self.func = func
self.args = args
ControlProcessor.__init__(self, window, control_ids)
def OnClicked(self, id):
# Bit of a hack - always pass the manager as the first arg.
self.id = id
args = (self, ) + self.args
self.func(*args)
def GetPopupHelpText(self, ctrlid):
assert ctrlid == self.control_id
doc = self.func.__doc__
if doc is None:
return ""
return " ".join(doc.split())
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

View File

@ -1,32 +0,0 @@
# This module is part of the spambayes project, which is Copyright 2003
# The Python Software Foundation and is covered by the Python Software
# Foundation license.
# Package that manages and defines dialog resources
def GetImageParamsFromBitmapID(rc_parser, bmpid):
import os, sys
import win32gui, win32con, win32api
if type(bmpid)==type(0):
bmpid = rc_parser.names[bmpid]
int_bmpid = rc_parser.ids[bmpid]
# For both binary and source versions, we currently load from files.
# In future py2exe built binary versions we will be able to load the
# bitmaps directly from our DLL.
filename = rc_parser.bitmaps[bmpid]
if hasattr(sys, "frozen"):
# in our .exe/.dll - load from that.
if sys.frozen=="dll":
hmod = sys.frozendllhandle
else:
hmod = win32api.GetModuleHandle(None)
return hmod, int_bmpid, 0
else:
# source code - load the .bmp directly.
if not os.path.isabs(filename):
# In this directory
filename = os.path.join( os.path.dirname( __file__ ), filename)
return 0, filename, win32con.LR_LOADFROMFILE
assert 0, "not reached"
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,224 +0,0 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by dialogs.rc
//
#define IDD_MANAGER 101
#define IDD_TRAINING 102
#define IDD_FILTER 103
#define IDD_FILTER_NOW 104
#define IDD_FOLDER_SELECTOR 105
#define IDD_ABOUT 106
#define IDD_GENERAL 108
//#define IDD_FILTER_SPAM 110
#define IDD_FILTER_UNSURE 111
#define IDD_DIAGNOSTIC 113
#define IDD_WIZARD 114
#define IDD_WIZARD_WELCOME 115
#define IDD_WIZARD_FINISHED_UNTRAINED 116
#define IDD_WIZARD_FOLDERS_REST 117
#define IDD_WIZARD_FOLDERS_WATCH 118
#define IDD_WIZARD_FINISHED_UNCONFIGURED 119
#define IDD_WIZARD_FOLDERS_TRAIN 120
#define IDD_WIZARD_TRAIN 121
#define IDD_WIZARD_FINISHED_TRAINED 122
#define IDD_WIZARD_TRAINING_IS_IMPORTANT 123
#define IDD_WIZARD_FINISHED_TRAIN_LATER 124
#define IDB_SBWIZLOGO 125
#define IDB_FOLDERS 127
#define IDC_PROGRESS 1000
#define IDC_PROGRESS_TEXT 1001
#define IDC_STATIC_HAM 1002
#define IDC_STATIC_SPAM 1003
#define IDC_BROWSE_HAM 1004
#define IDC_BROWSE_SPAM 1005
#define IDC_START 1006
#define IDC_BUT_REBUILD 1007
#define IDC_BUT_RESCORE 1008
#define IDC_VERSION 1009
#define IDC_BUT_TRAIN_FROM_SPAM_FOLDER 1010
#define IDC_BUT_TRAIN_TO_SPAM_FOLDER 1011
#define IDC_BUT_TRAIN_NOW 1012
#define IDC_BUT_FILTER_ENABLE 1013
#define IDC_FILTER_STATUS 1014
#define IDC_BUT_FILTER_DEFINE 1016
#define IDC_BUT_ABOUT 1017
#define IDC_BUT_ACT_SCORE 1018
#define IDC_BUT_ACT_ALL 1019
#define IDC_BUT_UNREAD 1020
#define IDC_BUT_UNSEEN 1021
#define IDC_SLIDER_CERTAIN 1023
#define IDC_EDIT_CERTAIN 1024
#define IDC_ACTION_CERTAIN 1025
#define IDC_FOLDER_CERTAIN 1027
#define IDC_BROWSE_CERTAIN 1028
#define IDC_SLIDER_UNSURE 1029
#define IDC_EDIT_UNSURE 1030
#define IDC_ACTION_UNSURE 1031
#define IDC_FOLDER_UNSURE 1033
#define IDC_BROWSE_UNSURE 1034
#define IDC_TRAINING_STATUS 1035
#define IDC_FOLDER_NAMES 1036
#define IDC_BROWSE 1037
#define IDC_FOLDER_WATCH 1038
#define IDC_BROWSE_WATCH 1039
#define IDC_LIST_FOLDERS 1040
#define IDC_BUT_SEARCHSUB 1041
#define IDC_BUT_CLEARALL 1042
#define IDC_STATUS1 1043
#define IDC_STATUS2 1044
#define IDC_BUT_NEW 1046
#define IDC_MARK_SPAM_AS_READ 1047
#define IDC_SAVE_SPAM_SCORE 1048
#define IDC_MARK_UNSURE_AS_READ 1051
#define IDC_DELAY1_SLIDER 1056
#define IDC_DELAY1_TEXT 1057
#define IDC_DELAY2_SLIDER 1058
#define IDC_DELAY2_TEXT 1059
#define IDC_INBOX_TIMER_ONLY 1060
#define IDC_VERBOSE_LOG 1061
#define IDB_OPENERPLOGO 1062
#define IDC_TAB 1068
#define IDC_BACK_BTN 1069
#define IDC_BUT_WIZARD 1070
#define IDC_SHOW_DATA_FOLDER 1071
#define IDC_ABOUT_BTN 1072
#define IDC_BUT_RESET 1073
#define IDC_DEL_SPAM_RS 1074
#define IDC_RECOVER_RS 1075
#define IDC_FORWARD_BTN 1077
#define IDC_PAGE_PLACEHOLDER 1078
#define IDC_BUT_SHOW_DIAGNOSTICS 1080
#define IDC_BUT_PREPARATION 1081
#define IDC_FOLDER_HAM 1083
#define IDC_BUT_UNTRAINED 1088
#define IDC_BUT_TRAIN 1089
#define IDC_BUT_TIMER_ENABLED 1091
#define IDC_WIZ_GRAPHIC 1092
#define IDC_BUT_VIEW_LOG 1093
#define IDC_EDIT1 1094
#define IDC_STATISTICS 1095
#define ID_SERVER 2001
#define ID_PORT 2002
#define ID_SERVER_PORT 2003
#define ID_DB_DROPDOWNLIST 2004
#define ID_USERNAME 2005
#define ID_PASSWORD 2006
#define ID_BUT_TESTCONNECTION 2007
#define ID_DONE 2008
#define IDD_OBJECT_SETTINGS 2009
#define IDC_BUT_LOAD_IMAGE 2010
#define IDC_BUT_SAVE_OBJECT 2011
#define IDC_BUT_DEL_OBJECT 2012
#define IDC_OBJECT_TITLE 2013
#define IDC_OBJECT_NAME 2014
#define IDC_IMAGE_PATH 2015
#define IDC_LIST 2016
#define IDC_HEADER 2017
#define ID_CREATE_CONTACT 2018
#define ID_MAKE_ATTACHMENT 2019
#define ID_CREATE_CASE 2020
#define IDC_BUT_SET_SERVER_PORT 2021
#define IDD_SERVER_PORT_DIALOG 2022
#define IDC_CHKBX 2023
#define IDC_STATIC_GROUP 2024
#define ID_ATT_METHOD_DROPDOWNLIST 2025
#define IDC_NAME_LIST 2026
#define IDD_ABOUT 2027
#define IDC_ABOUT 2028
#define IDC_CONTACT_LIST 2029
#define ID_NAME_TEXT 2030
#define IDD_NEW_CONTACT_DIALOG 2031
#define ID_PARTNER_DROPDOWNLIST 2032
#define ID_NEW_PARTNER_BUTTON 2033
#define IDD_NEW_PARTNER_DIALOG 2034
#define ID_SAVE_PARTNER_BUTTON 2035
#define ID_PARTNER_NAME_TEXT 2036
#define IDC_NAME_LIST1 2037
#define IDC_RELOAD 2038
#define ID_PROTOCOL_GRP 2040
#define IDR_XML_PROTOCOL 2041
#define IDR_XMLS_PROTOCOL 2042
#define IDR_NETRPC_PROTOCOL 2043
#define IDD_VIEW_PARTNER_DIALOG 2044
#define IDET_PARTNER_NAME 2045
#define IDET_PARTNER_CONTACT_NAME 2046
#define IDET_PARTNER_EMAIL 2047
#define IDET_PARTNER_OFFICENO 2048
#define IDET_PARTNER_MOBILENO 2050
#define IDET_SEARCH_PARTNER 2051
#define IDPB_SEARCH_PARTNER 2052
#define IDET_PARTNER_STREET 2053
#define IDET_PARTNER_STREET2 2054
#define IDET_PARTNER_COUNTRY 2057
#define IDET_PARTNER_FAX 2058
#define IDPB_WRITE_CHANGES 2059
#define ID_ALL_STATE_DROPDOWNLIST 2060
#define ID_ALL_COUNTRY_DROPDOWNLIST 2061
#define IDET_PARTNER_STATE 2062
#define IDET_PARTNER_COUNTRY 2063
#define IDET_PARTNER 2064
//
#define ID_STREET_TEXT 2062
#define ID_STREET2_TEXT 2063
#define ID_FED_STATE_DROPLIST 2064
#define ID_COUNTRY_DROPLIST 2065
#define ID_FAX_TEXT 2066
#define ID_PARTNER_CITY_TEXT 2067
#define ID_ZIP_TEXT 2068
#define ID_PARTNER_DROPLIST 2069
#define ID_NEW_PART_BUTTON 2070
#define IDPB_NEWPARTNER_BUTTON 2071
#define IDD_SELECT_PARTNER 2073
#define IDC_LIST_PARTNER 2072
#define IDPB_SELECT_PARTNER 2075
#define IDET_PARTNER_SEARCH_NAME 2076
#define IDPB_PARTNER_SEARCH 2077
#define IDPB_CREATE_NEW_PARTNER 2078
#define ID_PARTNER_TEXT 2079
#define IDET_WED_SERVER 2080
#define IDET_WEB_PORT 2081
#define ID_SET_WEB_CONNECTION 2082
#define IDPB_WEB_CONNECTION 2083
#define IDD_OPEN_PARTNER_DIALOG 2084
#define IDET_PARTNER_LINK_TEXT 2085
#define IDEB_OPENDOC_LINK_TEXT 2086
#define IDD_OPEN_DOCUEMNT_DIALOG 2087
#define IDD_WEB_SERVER_PORT_DIALOG 2088
#define IDET_WEB_SERVER 2089
#define IDET_WEB_PORT 2090
#define ID_WEB_OK 2091
#define IDPB_NEW_PARTNER_BUTTON 2092
#define IDPB_NEW_PART_BUTTON 2093
#define IDD_SELECT_COUNTRY 2094
#define IDET_COUNTRY_SEARCH_NAME 2095
#define IDC_LIST_COUNTRY 2096
#define IDPB_SELECT_COUNTRY 2097
#define IDPB_SEARCH_COUNTRY 2098
#define IDD_SELECT_STATE 2099
#define IDET_STATE_SEARCH_NAME 2100
#define IDC_LIST_STATE 2101
#define IDPB_SELECT_STATE 2102
#define IDPB_SEARCH_STATE 2103
#define IDPB_SEARCH_STATE1 2104
#define IDPB_SEARCH_COUNTRY1 2105
#define IDET_NC_PARTNER_STATE 2106
#define IDPB_NC_SEARCH_STATE1 2107
#define IDET_NC_PARTNER_COUNTRY 2108
#define IDPB_NC_SEARCH_COUNTRY1 2109
#define ID_DROPDOWNLIST_PROTOCOL 2110
#define IDCB_WEB_SECURE 2111
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 128
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1096
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

File diff suppressed because one or more lines are too long

View File

@ -1,339 +0,0 @@
// Microsoft Visual C++ generated resource script.
//
#include "dialogs.h"
IDB_OPENERPLOGO BITMAP "OpenERP_Logo.bmp"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_MANAGER DIALOGEX 0, 0, 460, 260
STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU | DS_MODALFRAME
CAPTION "OpenERP Configuration"
FONT 8, "Tahoma", 1000, 0, 0x0
BEGIN
DEFPUSHBUTTON "Close",ID_DONE,400,239,50,14//,WS_VISIBLE //| WS_TABSTOP
CONTROL "",IDC_TAB,"SysTabControl32",0x0,8,7,440,228
CONTROL "",IDC_LIST,"SysListView32",WS_CHILD | WS_VISIBLE | WS_BORDER | WS_HSCROLL | WS_VSCROLL |
LVS_SHOWSELALWAYS | LVS_REPORT | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES,0,0,0,0
END
IDD_GENERAL DIALOGEX 0, 0, 430, 210
STYLE DS_SETFONT | WS_CHILD | WS_CAPTION | WS_SYSMENU
CAPTION "Connection Parameters"
FONT 8, "Tahoma", 0, 0, 0x1
BEGIN
GROUPBOX "Connection Parameters",IDC_STATIC_GROUP, 10, 10,250,130
LTEXT "Server : ",IDC_STATIC,30,30,100,17
EDITTEXT ID_SERVER_PORT,85,30,120,12,ES_READONLY | WS_VISIBLE | WS_TABSTOP// left top width height
PUSHBUTTON "Change",IDC_BUT_SET_SERVER_PORT,210,30,30,13, WS_VISIBLE | WS_TABSTOP
LTEXT "Database : ",IDC_STATIC,30,50,100,17
COMBOBOX ID_DB_DROPDOWNLIST,85,50,154,40,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_VISIBLE | WS_TABSTOP
LTEXT "Username : ",IDC_STATIC,30,70,100,17
EDITTEXT ID_USERNAME,85,70,154,12,ES_AUTOHSCROLL | WS_VISIBLE | WS_TABSTOP
LTEXT "Password : ",IDC_STATIC,30,90,100,17
EDITTEXT ID_PASSWORD,85,90,154,12,ES_AUTOHSCROLL | WS_VISIBLE | WS_TABSTOP | ES_PASSWORD
PUSHBUTTON "Connect",ID_BUT_TESTCONNECTION,179,110,60,13, WS_VISIBLE | WS_TABSTOP
GROUPBOX "WebServer Parameters",IDC_STATIC_GROUP, 270, 10,150,130
LTEXT "Server : ",IDC_STATIC, 280, 30, 50, 15
EDITTEXT IDET_WED_SERVER,310, 29, 90, 12,ES_AUTOHSCROLL | ES_READONLY
PUSHBUTTON "Change",ID_SET_WEB_CONNECTION, 295, 50, 50, 12 , WS_VISIBLE | WS_TABSTOP
PUSHBUTTON "Connect",IDPB_WEB_CONNECTION, 350, 50, 50, 12 , WS_VISIBLE | WS_TABSTOP
END
IDD_OBJECT_SETTINGS DIALOGEX 0, 0, 430, 210
STYLE DS_SETFONT | DS_MODALFRAME | WS_CHILD | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP
CAPTION "Documents Setting"
FONT 8, "Tahoma", 0, 0, 0x1
BEGIN
GROUPBOX "Document Attributes",IDC_STATIC_GROUP, 2, 2, 343, 32
LTEXT "Title:",IDC_STATIC,5,16,30,17
EDITTEXT IDC_OBJECT_TITLE,22,14,57,12,ES_AUTOHSCROLL | WS_TABSTOP// left top width height
LTEXT "Document Name:",IDC_STATIC,83,16,60,17
EDITTEXT IDC_OBJECT_NAME,138,14,57,12,ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Image:",IDC_STATIC,200,16,22,17
EDITTEXT IDC_IMAGE_PATH,223,14,57,12,ES_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "Load Image",IDC_BUT_LOAD_IMAGE,289,13,50,15,WS_TABSTOP
PUSHBUTTON "Add",IDC_BUT_SAVE_OBJECT,350,13,38,15,WS_TABSTOP
PUSHBUTTON "Delete",IDC_BUT_DEL_OBJECT,392,13,38,15,WS_TABSTOP
CONTROL "List1",IDC_LIST,"SysListView32",WS_CHILD | WS_VISIBLE | WS_BORDER | WS_HSCROLL | WS_VSCROLL |
LVS_SHOWSELALWAYS | LVS_EX_GRIDLINES | LVS_REPORT | LVS_EX_FULLROWSELECT, 8,40,535,160
END
IDD_ABOUT DIALOGEX 0, 0, 430, 210
STYLE DS_SETFONT | DS_MODALFRAME | WS_CHILD | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP
CAPTION "About"
FONT 8, "Tahoma", 400, 0, 0x0
BEGIN
GROUPBOX "About Plugin",IDC_STATIC,7,3,422,200
CONTROL 1062,IDB_OPENERPLOGO,"Static",SS_BITMAP | SS_REALSIZEIMAGE,60,30,20,20
LTEXT "",IDC_ABOUT,80,90,300,100
END
IDD_SERVER_PORT_DIALOG DIALOGEX 0, 0, 160, 90
STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP
CAPTION "OpenERP Connection"
FONT 8, "Tahoma", 400, 0, 0x0
BEGIN
LTEXT "Server : ",IDC_STATIC,5,3,150,17
EDITTEXT ID_SERVER, 45, 3, 100, 12, ES_AUTOHSCROLL | WS_TABSTOP
LTEXT " Port : ",IDC_STATIC,5,18,100,17
EDITTEXT ID_PORT, 45, 18, 100, 12, ES_AUTOHSCROLL | WS_TABSTOP
GROUPBOX "", IDC_STATIC_GROUP, 5, 35, 150, 5
LTEXT "Protocol Connection :", IDC_STATIC, 5, 45, 80, 17
COMBOBOX ID_DROPDOWNLIST_PROTOCOL, 75, 43, 75, 50, CBS_DROPDOWNLIST |WS_VSCROLL | WS_VISIBLE | WS_TABSTOP
PUSHBUTTON "Close",IDCANCEL,60,70,45,14,WS_TABSTOP
DEFPUSHBUTTON "OK",IDOK,110,70,45,14,WS_TABSTOP
END
IDD_SYNC DIALOGEX 0, 0, 470, 320
STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP
CAPTION "Push to OpenERP"
FONT 8, "Tahoma", 1000, 0, 0x0
BEGIN
GROUPBOX "Link to an Existing Documents ", IDC_STATIC_GROUP, 8,5,250,290,WS_TABSTOP
LTEXT "Search : ",IDC_STATIC,15,17,40,12
EDITTEXT ID_SEARCH_TEXT,60,15,120,12,ES_AUTOHSCROLL | WS_TABSTOP// left top width height
PUSHBUTTON "Search",ID_SEARCH,187,15,40,14,WS_TABSTOP
LTEXT "Documents : ",IDC_STATIC,15,140,100,14
CONTROL "List1",IDC_NAME_LIST,"SysListView32",WS_CHILD | WS_VISIBLE | WS_BORDER | LVS_SHOWSELALWAYS | LVS_REPORT | WS_TABSTOP, 15,150,234,110
PUSHBUTTON "Push",ID_MAKE_ATTACHMENT,160,270,85,14,WS_TABSTOP
GROUPBOX " Create a New Document ", IDC_STATIC_GROUP, 263,5,202,100,WS_TABSTOP
LTEXT "Type of Document : ",IDC_STATIC,266,25,100,12
COMBOBOX ID_ATT_METHOD_DROPDOWNLIST,332,24,75,45,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Create",ID_CREATE_CASE,412,23,50,14,WS_TABSTOP
GROUPBOX " Create a New Contact ", IDC_STATIC_GROUP, 263, 110,202,185,WS_TABSTOP
LTEXT "Create a New Contact : ",IDC_STATIC,280,140,100,12
PUSHBUTTON "Create Contact",ID_CREATE_CONTACT,360,138,60,14,WS_TABSTOP
PUSHBUTTON "Close",IDCANCEL,385,300,60,14,WS_TABSTOP
END
IDD_NEW_CONTACT_DIALOG DIALOGEX 0, 0, 350, 180
STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP
CAPTION "Create a New Contact"
FONT 8, "Tahoma", 1000, 0, 0x0
BEGIN
LTEXT "Select Partner : ",IDC_STATIC,13,20,50,17
EDITTEXT ID_PARTNER_TEXT, 70, 18, 150, 12 , ES_AUTOHSCROLL |ES_READONLY
PUSHBUTTON "Search Partner",ID_NEW_PARTNER_BUTTON,225,17,60,14, WS_TABSTOP
PUSHBUTTON "New Partner",IDPB_NEW_PARTNER_BUTTON,290, 17, 50, 14, WS_TABSTOP
GROUPBOX "Postal Address ", IDC_STATIC_GROUP,10,35,175,123
LTEXT "Contact Name : ",IDC_STATIC, 18, 53, 100, 17
EDITTEXT ID_CONTACT_NAME_TEXT, 76, 52, 100, 12, ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Street : ",IDC_STATIC, 18, 67, 40, 17
EDITTEXT ID_STREET_TEXT, 76, 66, 100, 12, ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Street2 : ",IDC_STATIC, 18, 81, 40, 17
EDITTEXT ID_STREET2_TEXT, 76, 80, 100, 12, ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Zip : ",IDC_STATIC, 18, 94, 50, 17
EDITTEXT ID_ZIP_TEXT,76, 93, 100, 12,ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "City : ",IDC_STATIC, 18,106, 50, 17
EDITTEXT ID_PARTNER_CITY_TEXT,76,107,100,12,ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Fed. State : ",IDC_STATIC,18, 134, 50, 15
EDITTEXT IDET_NC_PARTNER_STATE, 76, 135, 54, 12,ES_AUTOHSCROLL |ES_READONLY
PUSHBUTTON "Search", IDPB_NC_SEARCH_STATE1 ,135, 136, 40, 12, WS_TABSTOP
LTEXT "Country :",IDC_STATIC, 18,121,35,15
EDITTEXT IDET_NC_PARTNER_COUNTRY, 76, 122, 54, 12,ES_AUTOHSCROLL |ES_READONLY
PUSHBUTTON "Search", IDPB_NC_SEARCH_COUNTRY1, 135, 121, 40, 12, WS_TABSTOP
GROUPBOX "Communication ", IDC_STATIC_GROUP, 188, 35, 150, 123
LTEXT "Office : ",IDC_STATIC,194, 53, 30, 17
EDITTEXT ID_CONTACT_OFFICE_TEXT, 224, 52, 100, 12,ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Mobile : ",IDC_STATIC,194, 67, 30, 17
EDITTEXT ID_CONTACT_MOBILE_TEXT, 224, 66, 100, 12,ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Fax : ",IDC_STATIC,194, 81, 30, 17
EDITTEXT ID_FAX_TEXT, 224, 80, 100, 12,ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Email : ",IDC_STATIC, 194, 95, 30, 17
EDITTEXT ID_CONTACT_EMAIL_TEXT, 224, 94, 100, 12,ES_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "Cancel",IDCANCEL,290,162,45,13, WS_TABSTOP
PUSHBUTTON "Save",ID_CONTACT_SAVE_BUTTON,240,162,45,13, WS_TABSTOP
END
IDD_NEW_PARTNER_DIALOG DIALOGEX 0, 0, 140,40
STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP
CAPTION "Create a New Partner"
FONT 8, "Tahoma", 400, 0, 0x0
BEGIN
LTEXT "Name : ",IDC_STATIC,5,3,100,17
EDITTEXT ID_PARTNER_NAME_TEXT,40,3,94,12,ES_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "Cancel",IDCANCEL,90,22,45,14,WS_TABSTOP
DEFPUSHBUTTON "Save",ID_SAVE_PARTNER_BUTTON,40,22,45,14,WS_TABSTOP
END
IDD_VIEW_PARTNER_DIALOG DIALOGEX 0, 0, 350, 215
STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP
CAPTION "Open Contact"
FONT 8, "Tahoma", 400, 0, 0x0
BEGIN
LTEXT "Email ID : ",IDC_STATIC,32,17,40,12
EDITTEXT IDET_SEARCH_PARTNER, 70, 15, 200, 12, ES_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "Search Contact ",IDPB_SEARCH_PARTNER,280,15,60,14,WS_TABSTOP
LTEXT "Partner Name : ",IDC_STATIC,13,42,50,17
EDITTEXT IDET_PARTNER,70, 42, 150, 12,ES_AUTOHSCROLL |ES_READONLY
PUSHBUTTON "Search Partner",ID_NEW_PART_BUTTON,225,41,60,14, WS_TABSTOP
PUSHBUTTON "New Partner",IDPB_NEW_PART_BUTTON,290,41,50,14, WS_TABSTOP
GROUPBOX "Postal Address ", IDC_STATIC_GROUP,10,65,175,125
LTEXT "Contact Name : ",IDC_STATIC,18,83,50,17
EDITTEXT IDET_PARTNER_CONTACT_NAME,76,82,100,12,ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Street : ",IDC_STATIC,18,97,50,17
EDITTEXT IDET_PARTNER_STREET,76,96,100,12,ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Street2 : ",IDC_STATIC,18,112,50,17
EDITTEXT IDET_PARTNER_STREET2, 76, 111, 100, 12, ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Zip : ",IDC_STATIC, 18, 126, 50,14
EDITTEXT IDET_ZIP, 76, 125, 100, 12 , ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "City : ",IDC_STATIC,18,140,50,17
EDITTEXT IDET_PARTNER_CITY,76,139,100,12,ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Fed. State : ",IDC_STATIC,18,154,50,17
EDITTEXT IDET_PARTNER_STATE, 76, 153, 54, 12,ES_AUTOHSCROLL |ES_READONLY
PUSHBUTTON "Search", IDPB_SEARCH_STATE1 ,135, 153, 40, 12, WS_TABSTOP
LTEXT "Country :",IDC_STATIC, 18, 169, 35, 17
EDITTEXT IDET_PARTNER_COUNTRY, 76, 168, 54, 12,ES_AUTOHSCROLL |ES_READONLY
PUSHBUTTON "Search", IDPB_SEARCH_COUNTRY1, 135, 168, 40, 12, WS_TABSTOP
GROUPBOX "Communication ", IDC_STATIC_GROUP, 188, 65, 152, 125
LTEXT "Phone : ",IDC_STATIC, 194, 83, 30, 17
EDITTEXT IDET_PARTNER_OFFICENO, 224, 82, 100, 12, ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Mobile : ",IDC_STATIC, 194, 97, 30, 17
EDITTEXT IDET_PARTNER_MOBILENO, 224, 96, 100, 12, ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Email : ",IDC_STATIC, 194, 111, 30, 17
EDITTEXT IDET_PARTNER_FAX, 224, 110, 100, 12, ES_AUTOHSCROLL |ES_READONLY
LTEXT "Fax : ",IDC_STATIC,194,125,30,17
EDITTEXT IDET_PARTNER_EMAIL, 224, 124, 100, 12, ES_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "Create a New Contact", IDPB_NEWPARTNER_BUTTON, 124, 195, 82, 14, WS_TABSTOP
PUSHBUTTON "Save", IDPB_WRITE_CHANGES, 213, 195, 60, 14, WS_TABSTOP
PUSHBUTTON "Cancel", IDCANCEL, 281, 195, 60, 14, WS_TABSTOP
END
IDD_SELECT_PARTNER DIALOGEX 0, 0, 220, 250
STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP
CAPTION "Search Partner"
FONT 8, "Tahoma", 400, 0, 0x0
BEGIN
LTEXT "Enter Name : ",IDC_STATIC,8,12,80,17
EDITTEXT IDET_PARTNER_SEARCH_NAME, 55, 10, 100, 12, ES_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "Search", IDPB_PARTNER_SEARCH, 160, 10, 50, 14, WS_TABSTOP
CONTROL "List1",IDC_LIST_PARTNER,"SysListView32",WS_CHILD | WS_VISIBLE | WS_BORDER | WS_HSCROLL | WS_VSCROLL |
LVS_SHOWSELALWAYS | LVS_EX_GRIDLINES | LVS_REPORT | LVS_EX_FULLROWSELECT, 8,40,200,185
PUSHBUTTON "Create New Partner", IDPB_CREATE_NEW_PARTNER, 10, 230, 100, 14, WS_TABSTOP
PUSHBUTTON "Select", IDPB_SELECT_PARTNER, 170, 230, 40, 14, WS_TABSTOP
END
IDD_OPEN_PARTNER_DIALOG DIALOGEX 0, 0, 200,65
STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP
CAPTION "Open Partner"
FONT 8, "Tahoma", 400, 0, 0x0
BEGIN
LTEXT "Link to Partner : (If this link does not opens directly in web browser then copy an the link and paste in web browser.) ",IDC_STATIC,5,3,190,25
EDITTEXT IDET_PARTNER_LINK_TEXT,5,31,190,12,ES_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "Ok",IDCANCEL,150,45,45,13,WS_TABSTOP
END
IDD_OPEN_DOCUEMNT_DIALOG DIALOGEX 0, 0, 200,65
STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP
CAPTION "Open Document"
FONT 8, "Tahoma", 400, 0, 0x0
BEGIN
LTEXT "Link to Document : (If this link does not opens directly in web browser then copy an the link and paste in web browser.) ",IDC_STATIC,5,3,190,25
EDITTEXT IDEB_OPENDOC_LINK_TEXT,5,31,190,12,ES_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "Ok",IDCANCEL,150,45,45,14,WS_TABSTOP
END
IDD_WEB_SERVER_PORT_DIALOG DIALOGEX 0, 0, 160, 80
STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP
CAPTION "OpenERP Connection"
FONT 8, "Tahoma", 400, 0, 0x0
BEGIN
LTEXT "Server : ",IDC_STATIC,5,3,150,17
EDITTEXT IDET_WEB_SERVER,40,3,100,12,ES_AUTOHSCROLL | WS_TABSTOP
LTEXT "Port : ",IDC_STATIC,5,18,100,17
EDITTEXT IDET_WEB_PORT,40,18,100,12,ES_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "Close",IDCANCEL,110,50,45,14,WS_TABSTOP
DEFPUSHBUTTON "OK",ID_WEB_OK,50,50,50,14,WS_TABSTOP
PUSHBUTTON "SSL (https)",IDCB_WEB_SECURE,20,35,100,14,BS_AUTOCHECKBOX | BST_CHECKED |WS_TABSTOP
END
IDD_SELECT_COUNTRY DIALOGEX 0, 0, 220, 250
STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP
CAPTION "Search Country"
FONT 8, "Tahoma", 400, 0, 0x0
BEGIN
LTEXT "Enter Name : ",IDC_STATIC,8,12,80,17
EDITTEXT IDET_COUNTRY_SEARCH_NAME, 55, 10, 100, 12, ES_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "Search", IDPB_SEARCH_COUNTRY, 160, 10, 50, 14, WS_TABSTOP
CONTROL "List1",IDC_LIST_COUNTRY,"SysListView32",WS_CHILD | WS_VISIBLE | WS_BORDER | WS_HSCROLL | WS_VSCROLL |
LVS_SHOWSELALWAYS | LVS_EX_GRIDLINES | LVS_REPORT | LVS_EX_FULLROWSELECT, 8,40,200,185
PUSHBUTTON "Select", IDPB_SELECT_COUNTRY, 170, 230, 40, 14, WS_TABSTOP
END
IDD_SELECT_STATE DIALOGEX 0, 0, 220, 250
STYLE DS_SETFONT | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_CONTEXTHELP
CAPTION "Search Fed. State"
FONT 8, "Tahoma", 400, 0, 0x0
BEGIN
LTEXT "Enter Name : ",IDC_STATIC,8,12,80,17
EDITTEXT IDET_STATE_SEARCH_NAME, 55, 10, 100, 12, ES_AUTOHSCROLL | WS_TABSTOP
PUSHBUTTON "Search", IDPB_STATE_SEARCH, 160, 10, 50, 14, WS_TABSTOP
CONTROL "List1",IDC_LIST_STATE,"SysListView32",WS_CHILD | WS_VISIBLE | WS_BORDER | WS_HSCROLL | WS_VSCROLL |
LVS_SHOWSELALWAYS | LVS_EX_GRIDLINES | LVS_REPORT | LVS_EX_FULLROWSELECT, 8,40,200,185
PUSHBUTTON "Select", IDPB_SELECT_STATE, 170, 230, 40, 14, WS_TABSTOP
END

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

View File

@ -1,41 +0,0 @@
# rc2py.py
# This module is part of the spambayes project, which is Copyright 2003
# The Python Software Foundation and is covered by the Python Software
# Foundation license.
__author__="Adam Walker"
__doc__=""""
Converts an .rc windows resource source file into a python source file
with the same basic public interface as the rcparser module.
"""
import sys, os, stat
import rcparser
def convert(inputFilename = None, outputFilename = None):
"""See the module doc string"""
if inputFilename is None:
inputFilename = "dialogs.rc"
if outputFilename is None:
outputFilename = "test.py"
rcp = rcparser.ParseDialogs(inputFilename)
in_stat = os.stat(inputFilename)
out = open(outputFilename, "wt")
out.write("#%s\n" % outputFilename)
out.write("#This is a generated file. Please edit %s instead.\n" % inputFilename)
out.write("_rc_size_=%d\n_rc_mtime_=%d\n" % (in_stat[stat.ST_SIZE], in_stat[stat.ST_MTIME]))
out.write("class FakeParser:\n")
out.write("\tdialogs = "+repr(rcp.dialogs)+"\n")
out.write("\tids = "+repr(rcp.ids)+"\n")
out.write("\tnames = "+repr(rcp.names)+"\n")
out.write("\tbitmaps = "+repr(rcp.bitmaps)+"\n")
out.write("def ParseDialogs(s):\n")
out.write("\treturn FakeParser()\n")
out.close()
if __name__=="__main__":
if len(sys.argv)>1:
convert(sys.argv[1], sys.argv[2])
else:
convert()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,379 +0,0 @@
# Windows dialog .RC file parser, by Adam Walker.
# This module is part of the spambayes project, which is Copyright 2003
# The Python Software Foundation and is covered by the Python Software
# Foundation license.
__author__="Adam Walker"
import sys, os, shlex
import win32con
#import win32gui
import commctrl
_controlMap = {"DEFPUSHBUTTON":0x80,
"PUSHBUTTON":0x80,
"Button":0x80,
"GROUPBOX":0x80,
"Static":0x82,
"CTEXT":0x82,
"RTEXT":0x82,
"LTEXT":0x82,
"LISTBOX":0x83,
"SCROLLBAR":0x84,
"COMBOBOX":0x85,
"EDITTEXT":0x81,
}
_addDefaults = {"EDITTEXT":win32con.WS_BORDER,
"GROUPBOX":win32con.BS_GROUPBOX,
"LTEXT":win32con.SS_LEFT,
"DEFPUSHBUTTON":win32con.BS_DEFPUSHBUTTON,
"CTEXT":win32con.SS_CENTER,
"RTEXT":win32con.SS_RIGHT}
defaultControlStyle = win32con.WS_CHILD | win32con.WS_VISIBLE
class DialogDef:
name = ""
id = 0
style = 0
styleEx = None
caption = ""
font = "MS Sans Serif"
fontSize = 8
x = 0
y = 0
w = 0
h = 0
template = None
def __init__(self, n, i):
self.name = n
self.id = i
self.styles = []
self.stylesEx = []
self.controls = []
#print "dialog def for ",self.name, self.id
def createDialogTemplate(self):
t = None
self.template = [[self.caption, (self.x,self.y,self.w,self.h), self.style, self.styleEx, (self.fontSize, self.font)]]
# Add the controls
for control in self.controls:
self.template.append(control.createDialogTemplate())
return self.template
class ControlDef:
id = ""
controlType = ""
subType = ""
idNum = 0
style = defaultControlStyle
label = ""
x = 0
y = 0
w = 0
h = 0
def __init__(self):
self.styles = []
def toString(self):
s = "<Control id:"+self.id+" controlType:"+self.controlType+" subType:"+self.subType\
+" idNum:"+str(self.idNum)+" style:"+str(self.style)+" styles:"+str(self.styles)+" label:"+self.label\
+" x:"+str(self.x)+" y:"+str(self.y)+" w:"+str(self.w)+" h:"+str(self.h)+">"
return s
def createDialogTemplate(self):
ct = self.controlType
if "CONTROL"==ct:
ct = self.subType
if ct in _addDefaults:
self.style |= _addDefaults[ct]
if ct in _controlMap:
ct = _controlMap[ct]
t = [ct, self.label, self.idNum, (self.x, self.y, self.w, self.h), self.style]
#print t
return t
class RCParser:
next_id = 1001
dialogs = {}
_dialogs = {}
debugEnabled = False;
token = ""
def __init__(self):
self.ids = {"IDOK":1, "IDCANCEL":2, "IDC_STATIC": -1}
self.names = {1:"IDOK", 2:"IDCANCEL", -1:"IDC_STATIC"}
self.bitmaps = {}
def debug(self, *args):
if self.debugEnabled:
print args
def getToken(self):
self.token = self.lex.get_token()
self.debug("getToken returns:", self.token)
if self.token=="":
self.token = None
return self.token
def getCommaToken(self):
tok = self.getToken()
assert tok == ",", "Token '%s' should be a comma!" % tok
def loadDialogs(self, rcFileName):
"""
RCParser.loadDialogs(rcFileName) -> None
Load the dialog information into the parser. Dialog Definations can then be accessed
using the "dialogs" dictionary member (name->DialogDef). The "ids" member contains the dictionary of id->name.
The "names" member contains the dictionary of name->id
"""
hFileName = rcFileName[:-2]+"h"
try:
h = open(hFileName, "rU")
self.parseH(h)
h.close()
except OSError:
print "No .h file. ignoring."
f = open(rcFileName)
self.open(f)
self.getToken()
while self.token!=None:
self.parse()
self.getToken()
f.close()
def open(self, file):
self.lex = shlex.shlex(file)
self.lex.commenters = "//#"
def parseH(self, file):
lex = shlex.shlex(file)
lex.commenters = "//"
token = " "
while token is not None:
token = lex.get_token()
if token == "" or token is None:
token = None
else:
if token=='define':
n = lex.get_token()
i = int(lex.get_token())
self.ids[n] = i
if self.names.has_key(i):
# ignore AppStudio special ones.
if not n.startswith("_APS_"):
print "Duplicate id",i,"for",n,"is", self.names[i]
else:
self.names[i] = n
if self.next_id<=i:
self.next_id = i+1
def parse(self):
deep = 0
if self.token == None:
more == None
elif "BEGIN" == self.token:
deep = 1
while deep!=0:
self.getToken()
if "BEGIN" == self.token:
deep += 1
elif "END" == self.token:
deep -= 1
elif "IDD_" == self.token[:4]:
possibleDlgName = self.token
#print "possible dialog:", possibleDlgName
self.getToken()
if "DIALOG" == self.token or "DIALOGEX" == self.token:
self.dialog(possibleDlgName)
elif "IDB_" == self.token[:4]:
possibleBitmap = self.token
self.getToken()
if "BITMAP" == self.token:
self.getToken()
if self.token=="MOVEABLE":
self.getToken() # PURE
self.getToken() # bmpname
bmf = self.token[1:-1] # quotes
self.bitmaps[possibleBitmap] = bmf
print "BITMAP", possibleBitmap, bmf
#print win32gui.LoadImage(0, bmf, win32con.IMAGE_BITMAP,0,0,win32con.LR_DEFAULTCOLOR|win32con.LR_LOADFROMFILE)
def addId(self, id_name):
if id_name in self.ids:
id = self.ids[id_name]
else:
id = self.next_id
self.next_id += 1
self.ids[id_name] = id
self.names[id] = id_name
return id
def lang(self):
while self.token[0:4]=="LANG" or self.token[0:7]=="SUBLANG" or self.token==',':
self.getToken();
def dialog(self, name):
dlg = DialogDef(name,self.addId(name))
assert len(dlg.controls)==0
self._dialogs[name] = dlg
extras = []
self.getToken()
while not self.token.isdigit():
self.debug("extra", self.token)
extras.append(self.token)
self.getToken()
dlg.x = int(self.token)
self.getCommaToken()
self.getToken() # number
dlg.y = int(self.token)
self.getCommaToken()
self.getToken() # number
dlg.w = int(self.token)
self.getCommaToken()
self.getToken() # number
dlg.h = int(self.token)
self.getToken()
while not (self.token==None or self.token=="" or self.token=="END"):
if self.token=="STYLE":
self.dialogStyle(dlg)
elif self.token=="EXSTYLE":
self.dialogExStyle(dlg)
elif self.token=="CAPTION":
self.dialogCaption(dlg)
elif self.token=="FONT":
self.dialogFont(dlg)
elif self.token=="BEGIN":
self.controls(dlg)
else:
break
self.dialogs[name] = dlg.createDialogTemplate()
def dialogStyle(self, dlg):
dlg.style, dlg.styles = self.styles( [], win32con.WS_VISIBLE | win32con.DS_SETFONT)
def dialogExStyle(self, dlg):
self.getToken()
dlg.styleEx, dlg.stylesEx = self.styles( [], 0)
def styles(self, defaults, defaultStyle):
list = defaults
style = defaultStyle
if "STYLE"==self.token:
self.getToken()
i = 0
Not = False
while ((i%2==1 and ("|"==self.token or "NOT"==self.token)) or (i%2==0)) and not self.token==None:
Not = False;
if "NOT"==self.token:
Not = True
self.getToken()
i += 1
if self.token!="|":
if self.token in win32con.__dict__:
value = getattr(win32con,self.token)
else:
if self.token in commctrl.__dict__:
value = getattr(commctrl,self.token)
else:
value = 0
if Not:
list.append("NOT "+self.token)
self.debug("styles add Not",self.token, value)
style &= ~value
else:
list.append(self.token)
self.debug("styles add", self.token, value)
style |= value
self.getToken()
self.debug("style is ",style)
return style, list
def dialogCaption(self, dlg):
if "CAPTION"==self.token:
self.getToken()
self.token = self.token[1:-1]
self.debug("Caption is:",self.token)
dlg.caption = self.token
self.getToken()
def dialogFont(self, dlg):
if "FONT"==self.token:
self.getToken()
dlg.fontSize = int(self.token)
self.getCommaToken()
self.getToken() # Font name
dlg.font = self.token[1:-1] # it's quoted
self.getToken()
while "BEGIN"!=self.token:
self.getToken()
def controls(self, dlg):
if self.token=="BEGIN": self.getToken()
while self.token!="END":
control = ControlDef()
control.controlType = self.token;
#print self.token
self.getToken()
if self.token[0:1]=='"':
control.label = self.token[1:-1]
self.getCommaToken()
self.getToken()
elif self.token.isdigit():
control.label = self.token
self.getCommaToken()
self.getToken()
# msvc seems to occasionally replace "IDC_STATIC" with -1
if self.token=='-':
if self.getToken() != '1':
raise RuntimeError, \
"Negative literal in rc script (other than -1) - don't know what to do"
self.token = "IDC_STATIC"
control.id = self.token
control.idNum = self.addId(control.id)
self.getCommaToken()
if control.controlType == "CONTROL":
self.getToken()
control.subType = self.token[1:-1]
# Styles
self.getCommaToken()
self.getToken()
control.style, control.styles = self.styles([], defaultControlStyle)
#self.getToken() #,
# Rect
control.x = int(self.getToken())
self.getCommaToken()
control.y = int(self.getToken())
self.getCommaToken()
control.w = int(self.getToken())
self.getCommaToken()
self.getToken()
control.h = int(self.token)
self.getToken()
if self.token==",":
self.getToken()
control.style, control.styles = self.styles([], defaultControlStyle)
#print control.toString()
dlg.controls.append(control)
def ParseDialogs(rc_file):
rcp = RCParser()
try:
rcp.loadDialogs(rc_file)
except:
lex = getattr(rcp, "lex", None)
if lex:
print "ERROR parsing dialogs at line", lex.lineno
print "Next 10 tokens are:"
for i in range(10):
print lex.get_token(),
print
raise
return rcp
if __name__=='__main__':
rc_file = os.path.join(os.path.dirname(__file__), "dialogs.rc")
d = ParseDialogs(rc_file)
import pprint
for id, ddef in d.dialogs.items():
print "Dialog %s (%d controls)" % (id, len(ddef))
pprint.pprint(ddef)
print
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,95 +0,0 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
#!/usr/bin/python
#-*- encoding: utf-8 -*-
import sys
import chilkat
import os
from manager import ustr
import email
cemail = chilkat.CkEmail()
dt = chilkat.SYSTEMTIME()
def generateEML(mail):
sub = (mail.Subject).replace(' ','')
body = mail.Body.encode("utf-8")
recipients = mail.Recipients
sender_email = mail.SenderEmailAddress
attachments=mail.Attachments
cemail = chilkat.CkEmail()
cemail.put_Subject (ustr(sub).encode('iso-8859-1'))
cemail.put_Body (ustr(body).encode('utf-8'))
cemail.put_FromAddress (ustr(sender_email).encode('iso-8859-1'))
cemail.put_From (ustr(sender_email).encode('iso-8859-1'))
for i in xrange(1, recipients.Count+1):
name = ustr(recipients.Item(i).Name).encode('iso-8859-1')
address = ustr(recipients.Item(i).Address).encode('iso-8859-1')
cemail.AddTo(name,address)
eml_name= ustr(sub).encode('iso-8859-1')+'-'+str(mail.EntryID)[-9:]
ls = ['*', '/', '\\', '<', '>', ':', '?', '"', '|', '\t', '\n']
mails_folder_path = os.path.abspath("%temp%\\dialogs\\resources\\mails\\")
attachments_folder_path = mails_folder_path + "\\attachments\\"
if not os.path.exists(attachments_folder_path):
os.makedirs(attachments_folder_path)
for i in xrange(1, attachments.Count+1):
fn = eml_name + '-' + ustr(attachments[i].FileName).encode('iso-8859-1')
for c in ls:
fn = fn.replace(c,'')
if len(fn) > 64:
l = 64 - len(fn)
f = fn.split('-')
fn = '-'.join(f[1:])
if len(fn) > 64:
l = 64 - len(fn)
f = fn.split('.')
fn = f[0][0:l] + '.' + f[-1]
att_file = os.path.join(attachments_folder_path, fn)
if os.path.exists(att_file):
os.remove(att_file)
attachments[i].SaveAsFile(att_file)
contentType = cemail.addFileAttachment(att_file)
if (contentType == None ):
print mail.lastErrorText()
sys.exit()
if not os.path.exists(mails_folder_path):
os.makedirs(mails_folder_path)
for c in ls:
eml_name = eml_name.replace(c,'')
if len(eml_name) > 64:
l = 64 - len(eml_name)
f = eml_name.split('-')
eml_name = f[0][0:l] + '.' + f[-1]
eml_path = ustr(os.path.join(mails_folder_path,eml_name+".eml")).encode('iso-8859-1')
success = cemail.SaveEml(eml_path)
fp = open(eml_path, 'rb')
new_mail = email.message_from_file(fp)
fp.close()
if (success == False):
print cemail.lastErrorText()
sys.exit()
return new_mail, eml_path
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,195 +0,0 @@
# This module is part of the spambayes project, which is Copyright 2003
# The Python Software Foundation and is covered by the Python Software
# Foundation license.
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
import os
import sys
import win32api, win32con
import win32com.client
import pythoncom
try:
True, False
except NameError:
# Maintain compatibility with Python 2.2
True, False = 1, 0
try:
filesystem_encoding = sys.getfilesystemencoding()
except AttributeError:
filesystem_encoding = "mbcs"
# Work out our "application directory", which is
# the directory of our main .py/.dll/.exe file we
# are running from.
if hasattr(sys, "frozen"):
assert sys.frozen == "dll", "outlook only supports inproc servers"
this_filename = win32api.GetModuleFileName(sys.frozendllhandle)
else:
try:
this_filename = os.path.abspath(__file__)
except NameError: # no __file__ - means Py2.2 and __name__=='__main__'
this_filename = os.path.abspath(sys.argv[0])
# See if we can use the new bsddb module. (The old one is unreliable
# on Windows, so we don't use that)
try:
import bsddb3 as bsddb
# bsddb3 is definitely not broken
use_db = True
except ImportError:
# Not using the 3rd party bsddb3, so try the one in the std library
try:
import bsddb
use_db = hasattr(bsddb, "db") # This name is not in the old one.
except ImportError:
# No DB library at all!
assert not hasattr(sys, "frozen"), \
"Don't build binary versions without bsddb!"
use_db = False
def ustr(value):
"""This method is similar to the builtin `str` method, except
it will return Unicode string.
@param value: the value to convert
@rtype: unicode
@return: unicode string
"""
if isinstance(value, unicode):
return value
if hasattr(value, '__unicode__'):
return unicode(value)
if not isinstance(value, str):
value = str(value)
try: # first try utf-8
return unicode(value, 'utf-8')
except:
pass
try: # then extened iso-8858
return unicode(value, 'iso-8859-15')
except:
pass
filesystem_encoding = sys.getfilesystemencoding()
d = unicode(value, filesystem_encoding)
return d
class OpenERPManager:
def __init__(self, config_base="default", outlook=None, verbose=0):
self.outlook = outlook
self.dialog_parser = None
self.application_directory = os.path.dirname(this_filename)
self.windows_data_directory = self.LocateDataDirectory()
self.data_directory = self.windows_data_directory
self.default_objects = [('Partners','res.partner',''),('Account Invoices','account.invoice',''), \
('Products', 'product.product',''),('Sale Orders','sale.order',''), \
('Leads','crm.lead','')]
self.config=self.LoadConfig()
def WorkerThreadStarting(self):
pythoncom.CoInitialize()
def WorkerThreadEnding(self):
pythoncom.CoUninitialize()
def LocateDataDirectory(self):
# Locate the best directory for our data files.
from win32com.shell import shell, shellcon
try:
appdata = shell.SHGetFolderPath(0,shellcon.CSIDL_APPDATA,0,0)
path = os.path.join(appdata, "OpenERP-Plugin")
if not os.path.isdir(path):
os.makedirs(path)
return path
except pythoncom.com_error:
# Function doesn't exist on early win95,
# and it may just fail anyway!
return self.application_directory
except EnvironmentError:
# Can't make the directory.
return self.application_directory
def ShowManager(self, id="IDD_MANAGER"):
import dialogs
dialogs.ShowDialog(0, self, self.config, id)
def LoadConfig(self):
import win32ui
path = os.path.join(self.data_directory, 'tiny.ini')
data = {'server' : 'localhost', 'port' : '8069', 'protocol' : 'http://', 'database' : '', 'objects' : self.default_objects, 'uname':'admin', 'pwd':'a', 'login':False,'webserver':'localhost','webport':'8080', 'webprotocol' : 'http:\\'}
if os.path.exists(path):
fp = open(path, 'r')
data = fp.readlines()
try:
data = eval(data[0])
return data
except e:
return data
else:
return data
def SaveConfig(self):
path = os.path.join(self.data_directory, 'tiny.ini')
fp = open(path, 'w')
fp.write(str(self.config))
fp.close()
_mgr = None
def GetManager(outlook = None):
global _mgr
if _mgr is None:
if outlook is None:
outlook = win32com.client.Dispatch("Outlook.Application")
_mgr = OpenERPManager(outlook=outlook)
return _mgr
def ShowManager(mgr):
mgr.c()
def main(verbose_level = 1):
mgr = GetManager()
ShowManager(mgr)
return 0
def usage():
print "Usage: manager [-v ...]"
sys.exit(1)
if __name__=='__main__':
verbose = 1
import getopt
opts, args = getopt.getopt(sys.argv[1:], "v")
if args:
usage()
for opt, val in opts:
if opt=="-v":
verbose += 1
else:
usage()
sys.exit(main(verbose))
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,105 +0,0 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{AF02E62E-3A5A-4E86-B4CF-03F2B2AC25BF}
AppName=Openerp Outlook Addin
AppVersion=1.0
AppVerName=Openerp Outlook Addin 1.0
AppPublisher=Openerp SA
AppPublisherURL=http://www.openerp.com/
AppSupportURL=http://www.openerp.com/
AppUpdatesURL=http://www.openerp.com/
DefaultDirName={pf}\Openerp Outlook Addin
DefaultGroupName=Openerp Outlook Addin
DisableProgramGroupPage=true
OutputBaseFilename=openerp-outlook-addin
Compression=lzma
SolidCompression=true
UserInfoPage=true
UninstallDisplayIcon={app}\*
VersionInfoVersion=1.0
VersionInfoCompany=OpenERP
VersionInfoDescription=OpenERP Outlook Addin
ChangesAssociations=true
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "basque"; MessagesFile: "compiler:Languages\Basque.isl"
Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl"
Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl"
Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl"
Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl"
Name: "hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl"
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "slovak"; MessagesFile: "compiler:Languages\Slovak.isl"
Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
[Files]
Source: "C:\openerp-outlook-plugin\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Messages]
AboutSetupNote=Inno Setup Preprocessor home page:%nhttp://ispp.sourceforge.net/
[Run]
Filename: "{app}\Register-plugin.bat"; StatusMsg: "Registering Outlook Addin";
[UninstallDelete]
Type: files; Name: "{app}\Openerp Outlook Addin\*"
Type: dirifempty; Name: "{app}\Openerp Outlook Addin"
[UninstallRun]
Filename: "{app}\Unregister-plugin.bat"; StatusMsg: "Unregistering Outlook Addin";
[Code]
function InitializeSetup(): Boolean;
begin
Result := true;
if not RegKeyExists( HKLM, 'Software\Python\PythonCore') then begin
Result := MsgBox(
'Python appears to not be installed.' + #13 + #13 +
'This addin requires Python 2.5 or above installed with compatible pywin32 for python for working.'+ #13 + #13 +
'If you know that Python is installed, you may with to continue.' + #13 + #13 +
'Continue with installation?',
mbConfirmation, MB_YESNO) = idYes;
end;
if not RegKeyExists( HKCU, 'Software\Microsoft\Office\Outlook') then begin
Result := MsgBox(
'Outlook appears to not be installed.' + #13 + #13 +
'This addin only works with Microsoft Outlook 2000 and later - it' + #13 +
'does not work with Outlook express.' + #13 + #13 +
'If you know that Outlook is installed, you may with to continue.' + #13 + #13 +
'Continue with installation?',
mbConfirmation, MB_YESNO) = idYes;
end;
while Result do begin
if not CheckForMutexes('_outlook_mutex_') then
break;
Result := MsgBox(
'You must close Outlook before OpenERP Outlook Addin can be installed.' + #13 + #13 +
'Please close all Outlook Windows (using "File->Exit and Log off"' + #13 +
'if available) and click Retry, or click Cancel to exit the installation.'+ #13 + #13 +
'If this message persists after closing all Outlook windows, you may' + #13 +
'need to log off from Windows, and try again.',
mbConfirmation, MB_RETRYCANCEL) = idRetry;
end;
end;

View File

@ -1,573 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
import xmlrpclib
import binascii
import base64
import sys
import socket
import os
import time
from manager import ustr
from win32com.mapi import mapitags
import pythoncom
import win32com
import win32ui
waittime = 10
wait_count = 0
wait_limit = 12
def execute(connector, method, *args):
global wait_count
res = False
try:
res = getattr(connector,method)(*args)
except socket.error,e:
if e.args[0] == 111:
if wait_count > wait_limit:
print "Server is taking too long to start, it has exceeded the maximum limit of %d seconds."%(wait_limit)
clean()
sys.exit(1)
print 'Please wait %d sec to start server....'%(waittime)
wait_count += 1
time.sleep(waittime)
res = execute(connector, method, *args)
else:
return res
wait_count = 0
return res
class XMLRpcConn(object):
__name__ = 'XMLRpcConn'
_com_interfaces_ = ['_IDTExtensibility2']
_public_methods_ = ['GetDBList', 'login', 'GetAllObjects', 'GetObjList', 'InsertObj', 'DeleteObject', 'GetCSList', \
'ArchiveToOpenERP', 'IsCRMInstalled', 'GetPartners', 'GetObjectItems', \
'CreateCase', 'MakeAttachment', 'CreateContact', 'CreatePartner', 'getitem', 'setitem', \
'SearchPartnerDetail', 'WritePartnerValues', 'GetAllState', 'GetAllCountry', 'SearchPartner', 'SearchEmailResources', \
'GetCountry', 'GetStates', 'FindCountryForState','CreateEmailAttachment','SearchPartners']
_reg_clsctx_ = pythoncom.CLSCTX_INPROC_SERVER
_reg_clsid_ = "{C6399AFD-763A-400F-8191-7F9D0503CAE2}"
_reg_progid_ = "Python.OpenERP.XMLRpcConn"
_reg_policy_spec_ = "win32com.server.policy.EventHandlerPolicy"
def __init__(self,server='localhost',port=8069,uri='http://localhost:8069',webserver='localhost', webport=8080):
self._server=server
self._port=port
self._uri=uri
self._webserver=webserver
self._webport=webport
self._obj_list=[]
self._dbname=''
self._uname='admin'
self._pwd='a'
self._login=False
self._running=False
self._uid=False
self._iscrm=True
self.partner_id_list=None
self.protocol=None
self._webprotocol=None
self._weburi=None
def getitem(self, attrib):
v=self.__getattribute__(attrib)
return str(v)
def setitem(self, attrib, value):
return self.__setattr__(attrib, value)
def GetDBList(self):
conn = xmlrpclib.ServerProxy(self._uri + '/xmlrpc/db')
try:
db_list = execute(conn, 'list')
if db_list == False:
self._running=False
return []
else:
self._running=True
except:
db_list=-1
self._running=True
return db_list
def login(self,dbname, user, pwd):
self._dbname = dbname
self._uname = user
self._pwd = pwd
conn = xmlrpclib.ServerProxy(str(self._uri) + '/xmlrpc/common')
try:
uid = execute(conn,'login',dbname, ustr(user), ustr(pwd))
except:
return False
return uid
def GetAllObjects(self):
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','search',[])
objects = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','read',ids,['model'])
obj_list = [item['model'] for item in objects]
return obj_list
def GetObjList(self):
self._obj_list=list(self._obj_list)
self._obj_list.sort(reverse=True)
return self._obj_list
def InsertObj(self, obj_title,obj_name,image_path):
self._obj_list=list(self._obj_list)
self._obj_list.append((obj_title,obj_name,ustr(image_path)))
self._obj_list.sort(reverse=True)
def DeleteObject(self,sel_text):
self._obj_list=list(self._obj_list)
for obj in self._obj_list:
if obj[0] == sel_text:
self._obj_list.remove(obj)
break
def ArchiveToOpenERP(self, recs, mail):
import win32con
import win32ui
conn = xmlrpclib.ServerProxy(self._uri + '/xmlrpc/object')
flag = False
new_msg = ext_msg =""
message_id = referances = None
context = {}
try:
session = win32com.client.Dispatch("MAPI.session")
session.Logon('Outlook')
objMessage = session.GetMessage(mail.EntryID, mail.Parent.StoreID)
objFields = objMessage.Fields
strheader = objFields.Item(mapitags.PR_TRANSPORT_MESSAGE_HEADERS)
strheader = ustr(strheader).encode('iso-8859-1')
headers = {}
strheader = strheader.replace("\n ", " ").splitlines()
for line in strheader:
split_here = line.find(":")
headers[line[:split_here]] = line[split_here:]
temp1 = headers.get('Message-ID')
temp2 = headers.get('Message-Id')
referances = headers.get('References')
if temp1 == None: message_id = temp2
if temp2 == None: message_id = temp1
startCut = message_id.find("<")
endCut = message_id.find(">")
message_id = message_id[startCut:endCut+1]
if not referances == None:
startCut = referances.find("<")
endCut = referances.find(">")
referances = referances[startCut:endCut+1]
except Exception,e:
win32ui.MessageBox(str(e),"Archive To OpenERP")
return
attachments=mail.Attachments
for rec in recs: #[('res.partner', 3, 'Agrolait')]
model = rec[0]
res_id = rec[1]
#Check if mail installed
object_id = execute ( conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','search',[('model','=','mail.message')])
if not object_id:
win32ui.MessageBox("Mail is not installed on your configured database '%s' !!\n\nPlease install it to archive the mail."%(self._dbname),"Mail not installed",win32con.MB_ICONERROR)
return
object_ids = execute ( conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','search',[('model','=',model)])
object_name = execute( conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','read',object_ids,['name'])[0]['name']
#Reading the Object ir.model Name
ext_ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'mail.message','search',[('message_id','=',message_id),('model','=',model),('res_id','=',res_id)])
if ext_ids:
name = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,model,'read',res_id,['name'])['name']
ext_msg += """This mail is already archived to {0} '{1}'.\n""".format(object_name,name)
flag = True
continue
msg = {
'subject':mail.Subject,
'date':str(mail.ReceivedTime),
'body':mail.Body,
'cc':mail.CC,
'from':mail.SenderEmailAddress,
'to':mail.To,
'message-id':message_id,
'references':ustr(referances),
}
result = {}
context['thread_model'] = model
if attachments:
result = self.MakeAttachment([rec], mail)
execute(conn, 'execute', self. _dbname, int(self._uid), self._pwd,
'mail.thread','message_append',[res_id],
msg.get('subject', False),
msg.get('body', False),
msg.get('to', False),
msg.get('from', False),
msg.get('cc', False),
False, # BCC
False, #reply-to
msg.get('date', False),
msg.get('message-id'),\
msg.get('references', False),
result, #attachments
#FIXME: properly handle plaintext/html body variants?
False, #body_html
False, #subtype
False, #headers
False, #original
context)
new_msg += """- {0} : {1}\n""".format(object_name,str(rec[2]))
flag = True
if flag:
t = """Mail archived Successfully with attachments.\n"""+ext_msg
t += "\n"+new_msg
win32ui.MessageBox(t,"Archived to OpenERP",win32con.MB_ICONINFORMATION)
return flag
def IsCRMInstalled(self):
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
id = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','search',[('model','=','crm.lead')])
return id
def GetCSList(self):
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
ids = execute(conn,'execute',self._dbname,int(int(self._uid)),self._pwd,'crm.case.section','search',[])
objects = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'crm.case.section','read',ids,['name'])
obj_list = [ustr(item['name']).encode('iso-8859-1') for item in objects]
return obj_list
def GetPartners(self, search_partner=''):
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
ids=[]
obj_list=[]
domain = []
if not search_partner.strip() == '':
domain.append(('name','ilike',ustr(search_partner)))
ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.partner','search',domain)
if ids:
ids.sort()
obj_list.append((-999, ustr('')))
for id in ids:
object = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.partner','read',[id],['id','name'])[0]
obj_list.append((object['id'], ustr(object['name'])))
obj_list.sort(lambda x, y: cmp(x[1],y[1]))
return obj_list
def GetObjectItems(self, search_list=[], search_text=''):
res = []
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
for obj in search_list:
object_ids = execute ( conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','search',[('model','=',obj)])
object_name = execute( conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.model','read',object_ids,['name'])[0]['name']
if obj == "res.partner.address":
ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,obj,'search',['|',('name','ilike',ustr(search_text)),('email','ilike',ustr(search_text))])
recs = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,obj,'read',ids,['id','name','street','city'])
for rec in recs:
name = ustr(rec['name'])
if rec['street']:
name += ', ' + ustr(rec['street'])
if rec['city']:
name += ', ' + ustr(rec['city'])
res.append((obj,rec['id'],name,object_name))
else:
ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,obj,'search',[('name','ilike',ustr(search_text))])
recs = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,obj,'read',ids,['id','name'])
for rec in recs:
name = ustr(rec['name'])
res.append((obj,rec['id'],name,object_name))
return res
def CreateCase(self, section, mail, partner_ids, with_attachments=True):
import eml
flag = False
id = -1
try:
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
email, path = eml.generateEML(mail)
message_id = None
session = win32com.client.Dispatch("MAPI.session")
session.Logon('Outlook')
objMessage = session.GetMessage(mail.EntryID, mail.Parent.StoreID)
objFields = objMessage.Fields
strheader = objFields.Item(mapitags.PR_TRANSPORT_MESSAGE_HEADERS)
strheader = ustr(strheader).encode('iso-8859-1')
headers = {}
strheader = strheader.replace("\n ", " ").splitlines()
for line in strheader:
split_here = line.find(":")
headers[line[:split_here]] = line[split_here:]
temp1 = headers.get('Message-ID')
temp2 = headers.get('Message-Id')
if temp1 == None: message_id = temp2
if temp2 == None: message_id = temp1
startCut = message_id.find("<")
endCut = message_id.find(">")
message_id = message_id[startCut:endCut+1]
email.replace_header('Message-Id',message_id)
id = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'mail.thread','message_process',section, str(email))
if id > 0:
flag = True
return flag
else:
flag = False
return flag
except Exception,e:
win32ui.MessageBox("Create Case\n"+str(e),"Mail Reading Error")
return flag
def MakeAttachment(self, recs, mail):
attachments = mail.Attachments
attachment = {}
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
att_folder_path = os.path.abspath(os.path.dirname("%temp%\\"))
if not os.path.exists(att_folder_path):
os.makedirs(att_folder_path)
for rec in recs: #[('res.partner', 3, 'Agrolait')]
obj = rec[0]
obj_id = rec[1]
for i in xrange(1, attachments.Count+1):
fn = ustr(attachments[i].FileName)
if len(fn) > 64:
l = 64 - len(fn)
f = fn.split('.')
fn = f[0][0:l] + '.' + f[-1]
att_path = os.path.join(att_folder_path,fn)
attachments[i].SaveAsFile(att_path)
f=open(att_path,"rb")
content = "".join(f.readlines())
f.close()
attachment[fn] = content
return attachment
def CreateContact(self, res=None):
res=eval(str(res))
partner = res['partner_id']
state = res['state_id']
country = res['country_id']
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
if not partner.strip() == '':
partner_id = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner', 'search', [('name','=',ustr(partner))])
res.update({'partner_id' : partner_id[0]})
else:
res.pop('partner_id')
if not state == "":
country_id = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.country', 'search', [('name','=',ustr(country))])
res.update({'country_id' : country_id[0]})
else:
res.pop('country_id')
if not country == "":
state_id = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.country.state', 'search', [('name','=',ustr(state))])
res.update({'state_id' : state_id[0]})
else:
res.pop('state_id')
id = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.partner.address','create',res)
return id
def CreatePartner(self, res):
res=eval(str(res))
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.partner','search',[('name','=',res['name'])])
if ids:
return False
id = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.partner','create',res)
return id
def SearchPartnerDetail(self, search_email_id):
res_vals = []
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
address_id = execute(conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address', 'search', [('email','ilike',ustr(search_email_id))])
if not address_id :
return
address = execute(conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address','read',address_id[0],['id','partner_id','name','street','street2','city','state_id','country_id','phone','mobile','email','fax','zip'])
for key, vals in address.items():
res_vals.append([key,vals])
return res_vals
def WritePartnerValues(self, new_vals):
flag = -1
new_dict = dict(new_vals)
email=new_dict['email']
partner = new_dict['partner']
country_val = new_dict['country']
state_val = new_dict['state']
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
partner_id = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner', 'search', [('name','=',ustr(partner))])
country_id = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.country', 'search', [('name','=',ustr(country_val))])
state_id = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.country.state', 'search', [('name','=',ustr(state_val))])
address_id = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address', 'search', [('email','=',ustr(email))])
if not partner_id or not address_id or not country_id or not state_id:
return flag
vals_res_address={
'partner_id' : partner_id[0],
'name' : new_dict['name'],
'street':new_dict['street'],
'street2' : new_dict['street2'],
'city' : new_dict['city'],
'phone' : new_dict['phone'],
'mobile' : new_dict['mobile'],
'fax' : new_dict['fax'],
'zip' : new_dict['zip'],
'country_id' : country_id[0],
'state_id' : state_id[0]
}
temp = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address', 'write', address_id, vals_res_address)
if temp:
flag=1
else:
flag=0
return flag
def GetAllState(self):
state_list = []
state_ids = []
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
state_ids = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.country.state', 'search', [])
for state_id in state_ids:
obj = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.country.state', 'read', [state_id],['id','name'])[0]
state_list.append((obj['id'], ustr(obj['name'])))
return state_list
def GetAllCountry(self):
country_list = []
country_ids = []
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
country_ids = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.country', 'search', [])
for country_id in country_ids:
obj = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.country','read', [country_id], ['id','name'])[0]
country_list.append((obj['id'], ustr(obj['name'])))
return country_list
def SearchPartner(self, mail_id = ""):
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
address = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address', 'search', [('email','=',ustr(mail_id))])
if not address:
return False
add_rec = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'res.partner.address', 'read', address[0])
partner = add_rec.get('partner_id',False)
if partner: return partner[0]
else: return partner
def SearchEmailResources(self, message_id):
import win32ui
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
res_vals = []
mail_id = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'mail.message', 'search', [('message_id','=',message_id)])
ref_mail_id = None
if not mail_id:
ref_mail_id = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'mail.message', 'search', [('references','like','%'+message_id+'%')])
if ref_mail_id:
address = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'mail.message','read',ref_mail_id[0],['model','res_id'])
for key, vals in address.items():
res_vals.append([key,vals])
return res_vals
return None
address = execute( conn, 'execute', self._dbname, int(self._uid), self._pwd, 'mail.message','read',mail_id[0],['model','res_id'])
for key, vals in address.items():
res_vals.append([key,vals])
return res_vals
def GetCountry(self, country_search=''):
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
ids=[]
obj_list=[]
domain = []
if not country_search.strip() == '':
domain.append(('name','ilike',ustr(country_search)))
ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.country','search',domain)
if ids:
ids.sort()
for id in ids:
object = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.country','read',[id],['id','name'])[0]
obj_list.append((object['id'], ustr(object['name'])))
obj_list.sort(lambda x, y: cmp(x[1],y[1]))
return obj_list
def GetStates(self, state_search='', country=None):
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
ids = []
c_id = []
obj_list = []
domain = []
if not state_search.strip() == '':
domain.append(('name','ilike',ustr(state_search)))
if country == None:
ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.country.state','search',domain)
if not country == None:
c_id = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.country','search',[('name','=',ustr(country))])
domain.append(('country_id','=',c_id[0]))
ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.country.state','search',domain)
if ids:
ids.sort()
for id in ids:
object = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.country.state','read',[id],['id','name'])[0]
obj_list.append((object['id'], ustr(object['name'])))
obj_list.sort(lambda x, y: cmp(x[1],y[1]))
return obj_list
def FindCountryForState(self, state_search=''):
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.country.state','search',[('name','=',ustr(state_search))])
if not ids:
return None
object = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'res.country.state','read',ids)[0]
country = object['country_id'][1]
return country
def CreateEmailAttachment(self, rec, mail):
import eml
email, path = eml.generateEML(mail)
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
obj = rec[0]
obj_id = rec[1]
res = {}
res['res_model'] = obj
ls = ['*', '/', '\\', '<', '>', ':', '?', '"', '|', '\t', '\n',':','~']
fn = (mail.Subject).replace(' ','')
for c in ls:
fn = fn.replace(c,'')
if len(fn) > 64:
l = 64 - len(fn)
f = fn.split('-')
fn = '-'.join(f[1:])
if len(fn) > 64:
l = 64 - len(fn)
f = fn.split('.')
fn = f[0][0:l] + '.' + f[-1]
fn = fn[:-4]+".eml"
f = open(path)
content = "".join(f.readlines()).encode('base64')
f.close()
res['name'] = fn
res['datas_fname'] = fn
res['datas'] = content
res['res_id'] = obj_id
id = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,'ir.attachment','create',res)
return id
def SearchPartners(self):
res = []
conn = xmlrpclib.ServerProxy(self._uri+ '/xmlrpc/object')
obj = 'res.partner'
ids = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,obj,'search',[])
recs = execute(conn,'execute',self._dbname,int(self._uid),self._pwd,obj,'read',ids,['id','name'])
for rec in recs:
name = ustr(rec['name'])
res.append((obj,rec['id'],name,obj))
return res
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,78 @@
/*
OpenERP, Open Source Business Applications
Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
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 <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections;
using System.Linq;
namespace OpenERPClient
{
public class Model
{
public string model;
public string name;
protected OpenERPConnect openerp_connect;
public OpenERPConnect Connection
{
set
{
this.openerp_connect = value;
}
get
{
return this.openerp_connect;
}
}
public Model()
{
}
public Model(string model)
{
/*
It gives the model name only.
:param model : madel name
*/
this.model = model;
}
public Model(string model, string name)
{
/*
It gives the model names with their descriptions.
:param model : model name
:param name : description of model
*/
this.name = name;
this.model = model;
}
public override string ToString()
{
/*
It overrides the name of model into ToString.
:return : String
*/
if (this.name != null) return this.name;
return this.model;
}
}
}

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{8E62B8DF-E3A2-4429-A820-FB8A31C2EB00}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OpenERPClient</RootNamespace>
<AssemblyName>OpenERPClient</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Model.cs" />
<Compile Include="OpenERPConnect.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Record.cs" />
<Compile Include="XMLRPCClient.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\xml-rpc.net.2.5.0\src\xmlrpc.csproj">
<Project>{1B4B0A58-0AFB-4090-91DD-18912CC7DE65}</Project>
<Name>xmlrpc</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -0,0 +1,397 @@
/*
OpenERP, Open Source Business Applications
Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
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 <http://www.gnu.org/licenses/>.
*/
using System;
using System.Windows.Forms;
using System.Collections;
using CookComputing.XmlRpc;
namespace OpenERPClient
{
public class ServiceUrl : System.Attribute
{
string _url;
public ServiceUrl(string url)
{
/*
It will contain the ServiceUrl.
:param url : url with server and port.
*/
this._url = url;
}
public string Url
{
/*
It will get and return the Url for the connection.
:return : String
*/
get
{
return _url;
}
}
public override string ToString()
{
/*
It will override the Tostring and return the _url.
*/
return this._url;
}
}
public enum OpenERPService
{
[ServiceUrl("/xmlrpc/object")]
Object = 1,
[ServiceUrl("/xmlrpc/db")]
DB = 2,
[ServiceUrl("/xmlrpc/common")]
Common = 3
}
public class OpenERPConnect
{
int uid;
string url;
string dbname;
string login;
string pwd;
bool chkpwd;
string password;
public string URL
{
/*
It will get and set the value of the url.
:return : String
*/
get
{
return url;
}
set
{
url = value;
}
}
public string DBName
{
/*
It will get and set the value of the Database Name.
:return : String
*/
get
{
return dbname;
}
set
{
dbname = value;
}
}
public string UserId
{
/*
It will get and set the value of the UserId.
:return : String
*/
get
{
return login;
}
set
{
login = value;
}
}
public string pswrd
{
/*
It will get and set the value of the Password.
:return : String
*/
get
{
return password;
}
set
{
password = value;
}
}
public bool rempwd
{
/*
It will get and set the value of the Remember Password.
:return : True or False
*/
get
{
return chkpwd;
}
set
{
chkpwd = value;
}
}
public string version;
XMLRPCClient rpcclient;
public void Open(Enum service)
{
/*
It opens the connetion by the url and service url.
:param service : enum service.
*/
string url = null;
Type type = service.GetType();
ServiceUrl[] _urls =
type.GetField(service.ToString()).GetCustomAttributes(typeof(ServiceUrl),
false) as ServiceUrl[];
if (_urls.Length > 0)
{
url = _urls[0].Url;
}
this.Open(url);
}
void Open(string service_url)
{
/*
It opens rpcclient by service url.
:param service_url : service url
*/
this.rpcclient = new XMLRPCClient(this.url + service_url);
}
void Close()
{
/*
It closes rpcclient.
*/
this.rpcclient = null;
}
public OpenERPConnect()
{
}
public OpenERPConnect(string url)
{
/*
It will contain the url wit the server and port.
:param url : url with the server and port.
*/
this.url = url;
}
public OpenERPConnect(string url, string dbname, string login, string pwd)
{
/*
It will do the connection with OpenERP server.
:param url : url with the server and port.
:param dbname : the list of database.
:param login : user name.
:param pwd : password.
*/
this.url = url;
this.dbname = dbname;
this.login = login;
this.pwd = pwd;
this.version = ServerVersion();
}
public Boolean isLoggedIn
{
/*
It will check whether successfully login to OpenERP is done or not.
:return : True or False.
*/
get
{
if (this.uid > 0) { return true; }
return false;
}
}
public int Login(string dbname, string userid, string pwd)
{
/*
It will check whether the entered dbname, userid and password are correct or not
and on that basis it will allow the user for connecting to OpenERP.
:param dbname : list of database
:param userid : userid
:param pwd : password of the user
:return : Integer
*/
this.Open(OpenERPClient.OpenERPService.Common);
object isLogin = this.rpcclient.Login(dbname, userid, pwd);
this.uid = 0;
if (Convert.ToBoolean(isLogin))
{
this.uid = Convert.ToInt32(isLogin);
}
this.pwd = pwd;
if (this.uid <= 0)
{
MessageBox.Show("Authentication Error!\nBad username and password.", Form.ActiveForm.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
this.Close();
return this.uid;
}
XmlRpcStruct ConvertAs(Hashtable value)
{
/*
It will convert the Hashtable into XmlRpcStruct and vise-versa.
:param value : Hasheable value.
:retutn : Hashtable values and vise versa the XmlRpcStruct value.
*/
XmlRpcStruct new_value;
new_value = new XmlRpcStruct();
foreach (string key in value.Keys)
{
object res;
if (value[key] == null)
{
res = "";
}
if (value[key].GetType() == typeof(Hashtable))
{
res = this.ConvertAs((Hashtable)value[key]);
}
else
{
res = value[key];
}
new_value.Add(key, res);
}
return new_value;
}
object[] ConvertArgs(object[] args)
{
/*
It will convert the arguments which are of type Hashtable into new arguments.
:param args : Objet value of arguments
:return : Object value of arguments.
*/
for (int i = 0; i < args.Length; i++)
{
object arg = args[i];
XmlRpcStruct new_arg;
if (arg.GetType() == typeof(Hashtable))
{
new_arg = this.ConvertAs((Hashtable)arg);
args[i] = new_arg;
}
}
return args;
}
public object Execute(string model, string method, params object[] args)
{
/*
It executes the model name, the method name and also the list of arrays arguments.
:param model : model name.
:param method : method name.
:params args : list of arrays of arguments.
:return : Object
*/
args = this.ConvertArgs(args);
this.Open(OpenERPClient.OpenERPService.Object);
object res = this.rpcclient.Execute(this.dbname, this.uid, this.pwd, model, method, args);
this.Close();
return res;
}
public object[] DBList()
{
/*
It will return the list of the database which will be created.
:return : Database List
*/
this.Open(OpenERPClient.OpenERPService.DB);
object[] res = this.rpcclient.DBList();
this.Close();
return res;
}
public string ServerVersion()
{
/*
It will give the version of the server which the user is using.
:return : String
*/
this.Open(OpenERPClient.OpenERPService.DB);
string version = this.rpcclient.ServerVersion();
this.Close();
return version;
}
public bool check_connectivity()
{
/*
It will check connection on given server url.
:return : True or False.
*/
this.Open(OpenERPClient.OpenERPService.Common);
bool flag = this.rpcclient.check_connectivity();
this.Close();
return flag;
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenERPClient")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OpenERPClient")]
[assembly: AssemblyCopyright("Copyright © 2011")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("0b69b9a4-1bfc-45d5-9788-983fbf57a505")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,69 @@
/*
OpenERP, Open Source Business Applications
Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
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 <http://www.gnu.org/licenses/>.
*/
using System.Collections;
namespace OpenERPClient
{
public class Record
{
public long id;
public string name;
public Model model;
public Hashtable columns;
public Record(long id, string name, Model model)
{
/*
It gives the record of id, name and model.
:param id : record id.
:param name : record name.
:param model : model name.
*/
this.id = id;
this.name = name;
this.model = model;
}
public Record(Hashtable columns, Model model)
{
/*
It gives the records in hashtable columns and also model name.
:param columns : hashtable column values.
:param model : model name.
*/
this.id = long.Parse(columns["id"].ToString());
if (columns.ContainsKey("name"))
{
this.name = columns["name"].ToString();
}
this.model = model;
this.columns = columns;
}
public override string ToString()
{
/*
It will override the Tostring.
*/
if (this.name != null) return this.name;
return this.id.ToString();
}
}
}

View File

@ -0,0 +1,388 @@
/*
OpenERP, Open Source Business Applications
Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
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 <http://www.gnu.org/licenses/>.
*/
using System;
using System.Text;
using CookComputing.XmlRpc;
namespace OpenERPClient
{
public interface IOpenERPCommon : IXmlRpcProxy
{
[XmlRpcMethod("login")]
object Login(string dbname, string username, string pwd);
}
public interface IOpenERPObject : IXmlRpcProxy
{
[XmlRpcMethod("execute")]
Object Execute(string dbName, long userId, string pwd, string model, string method, params Object[] args);
}
public interface IOpenERPDB : IXmlRpcProxy
{
[XmlRpcMethod("list")]
Object[] DBList();
[XmlRpcMethod("server_version")]
string ServerVersion();
[XmlRpcMethod("check_connectivity")]
bool check_connectivity();
}
public interface Ixmlrpcconnect : IOpenERPCommon, IOpenERPDB, IOpenERPObject
{
}
public class XMLRPCClient : Ixmlrpcconnect
{
Ixmlrpcconnect rpcclient = (Ixmlrpcconnect)XmlRpcProxyGen.Create(typeof(Ixmlrpcconnect));
public XMLRPCClient(string ServiceUrl)
{
rpcclient.Url = ServiceUrl;
}
#region Ixmlrpcconnect Members
public object Login(string dbname, string username, string pwd)
{
return rpcclient.Login(dbname, username, pwd);
}
public object Execute(string dbName, long userId, string pwd, string model, string method, params object[] args)
{
return rpcclient.Execute(dbName, userId, pwd, model, method, args);
}
public object[] DBList()
{
return rpcclient.DBList();
}
public string ServerVersion()
{
return rpcclient.ServerVersion();
}
public bool check_connectivity()
{
return rpcclient.check_connectivity();
}
#endregion
#region IXmlRpcProxy Members
public bool AllowAutoRedirect
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public System.Security.Cryptography.X509Certificates.X509CertificateCollection ClientCertificates
{
get { throw new NotImplementedException(); }
}
public string ConnectionGroupName
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public System.Net.CookieContainer CookieContainer
{
get { throw new NotImplementedException(); }
}
public System.Net.ICredentials Credentials
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public bool EnableCompression
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public bool Expect100Continue
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public System.Net.WebHeaderCollection Headers
{
get { throw new NotImplementedException(); }
}
public Guid Id
{
get { throw new NotImplementedException(); }
}
public int Indentation
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public bool KeepAlive
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public XmlRpcNonStandard NonStandard
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public bool PreAuthenticate
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public Version ProtocolVersion
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public System.Net.IWebProxy Proxy
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public System.Net.CookieCollection ResponseCookies
{
get { throw new NotImplementedException(); }
}
public System.Net.WebHeaderCollection ResponseHeaders
{
get { throw new NotImplementedException(); }
}
public int Timeout
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public string Url
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public bool UseEmptyParamsTag
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public bool UseIndentation
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public bool UseIntTag
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public bool UseStringTag
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public string UserAgent
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public Encoding XmlEncoding
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public string XmlRpcMethod
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public string[] SystemListMethods()
{
throw new NotImplementedException();
}
public object[] SystemMethodSignature(string MethodName)
{
throw new NotImplementedException();
}
public string SystemMethodHelp(string MethodName)
{
throw new NotImplementedException();
}
public event XmlRpcRequestEventHandler RequestEvent;
public event XmlRpcResponseEventHandler ResponseEvent;
#endregion
}
}

View File

@ -0,0 +1,36 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenERPOutlookPlugin", "OpenERPOutlookPlugin\OpenERPOutlookPlugin.csproj", "{F4B2219B-F235-400F-81B4-92F15250BBA4}"
EndProject
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "OpenERPOutlookPluginSetup", "OpenERPOutlookPluginSetup\OpenERPOutlookPluginSetup.vdproj", "{96333293-0156-4998-9065-42721CEB0368}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenERPClient", "OpenERPClient\OpenERPClient.csproj", "{8E62B8DF-E3A2-4429-A820-FB8A31C2EB00}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "xmlrpc", "xml-rpc.net.2.5.0\src\xmlrpc.csproj", "{1B4B0A58-0AFB-4090-91DD-18912CC7DE65}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F4B2219B-F235-400F-81B4-92F15250BBA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F4B2219B-F235-400F-81B4-92F15250BBA4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F4B2219B-F235-400F-81B4-92F15250BBA4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F4B2219B-F235-400F-81B4-92F15250BBA4}.Release|Any CPU.Build.0 = Release|Any CPU
{96333293-0156-4998-9065-42721CEB0368}.Debug|Any CPU.ActiveCfg = Debug
{96333293-0156-4998-9065-42721CEB0368}.Release|Any CPU.ActiveCfg = Release
{8E62B8DF-E3A2-4429-A820-FB8A31C2EB00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8E62B8DF-E3A2-4429-A820-FB8A31C2EB00}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E62B8DF-E3A2-4429-A820-FB8A31C2EB00}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8E62B8DF-E3A2-4429-A820-FB8A31C2EB00}.Release|Any CPU.Build.0 = Release|Any CPU
{1B4B0A58-0AFB-4090-91DD-18912CC7DE65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1B4B0A58-0AFB-4090-91DD-18912CC7DE65}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B4B0A58-0AFB-4090-91DD-18912CC7DE65}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B4B0A58-0AFB-4090-91DD-18912CC7DE65}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,52 @@
using System.Reflection;
using System.Runtime.CompilerServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Revision
// Build Number
//
// You can specify all the value or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified - the assembly cannot be signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine.
// (*) If the key file and a key name attributes are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP - that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the file is installed into the CSP and used.
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

View File

@ -0,0 +1,55 @@
/*
OpenERP, Open Source Business Applications
Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
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 <http://www.gnu.org/licenses/>.
*/
using System.Collections;
using OpenERPClient;
namespace OpenERPOutlookPlugin
{
static public class Cache
{
static private OpenERPOutlookPlugin _openerp;
static public OpenERPOutlookPlugin OpenERPOutlookPlugin
{
get
{
return _openerp;
}
set
{
_openerp = value;
}
}
static private Model[] document_models;
static public Model[] DocumentModelList
{
get
{
return document_models;
}
set
{
document_models = value;
}
}
}
}

View File

@ -0,0 +1,109 @@
/*
OpenERP, Open Source Business Applications
Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
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 <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using OpenERPClient;
namespace OpenERPOutlookPlugin
{
public class ConfigManager
{
string openerp_config_file = "openerp_config.ini";
public void SaveConfigurationSetting()
{
string filepath = Tools.GetAppFolderPath();
OpenERPOutlookPlugin openerp_outlook = Cache.OpenERPOutlookPlugin;
OpenERPConnect openerp_connect = openerp_outlook.Connection;
filepath = Path.Combine(filepath, openerp_config_file);
string[] datas = { "url=" + openerp_connect.URL, "userid=" + openerp_connect.UserId, "dbname=" + openerp_connect.DBName,"rempwd="+openerp_connect.rempwd,"pswrd=" + openerp_connect.pswrd };
StreamWriter userfile = new StreamWriter(filepath, false);
foreach (string data in datas)
{
userfile.WriteLine(data);
}
userfile.Close();
}
public void LoadConfigurationSetting()
{
string filePath = Tools.GetAppFolderPath();
filePath = Path.Combine(filePath, this.openerp_config_file);
OpenERPConnect openerp_connect=null;
OpenERPOutlookPlugin openerp_outlook=null;
openerp_outlook = Cache.OpenERPOutlookPlugin;
if (openerp_outlook == null)
{
openerp_outlook = new OpenERPOutlookPlugin(openerp_connect);
}
openerp_connect = openerp_outlook.Connection;
if (openerp_connect == null)
{
openerp_connect = new OpenERPConnect();
}
if (File.Exists(filePath))
{
string line;
using (StreamReader file = new StreamReader(filePath))
{
while ((line = file.ReadLine()) != null)
{
char[] delimiters = new char[] { '=' };
string[] parts = line.Split(delimiters, 2);
for (int i = 0; i < parts.Length; i += 2)
{
if (parts[i] == "url")
openerp_connect.URL = parts[i + 1].Trim();
else if (parts[i] == "userid")
openerp_connect.UserId = parts[i + 1].Trim();
else if (parts[i] == "dbname")
openerp_connect.DBName = parts[i + 1].Trim();
else if (parts[i] == "pswrd")
openerp_connect.pswrd = parts[i + 1].Trim();
else if (parts[i] == "rempwd")
{
openerp_connect.rempwd = false;
if (parts[i + 1].Trim().ToLower() == "true")
openerp_connect.rempwd = true;
}
}
}
file.Close();
}
}
openerp_outlook.Connection = openerp_connect;
Cache.OpenERPOutlookPlugin = openerp_outlook;
}
}
}

View File

@ -0,0 +1,354 @@
/*
OpenERP, Open Source Business Applications
Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
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 <http://www.gnu.org/licenses/>.
*/
namespace OpenERPOutlookPlugin
{
using System;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using office = Microsoft.Office.Core;
using outlook = Microsoft.Office.Interop.Outlook;
using OpenERPClient;
#region Read me for Add-in installation and setup information.
// When run, the Add-in wizard prepared the registry for the Add-in.
// At a later time, if the Add-in becomes unavailable for reasons such as:
// 1) You moved this project to a computer other than which is was originally created on.
// 2) You chose 'Yes' when presented with a message asking if you wish to remove the Add-in.
// 3) Registry corruption.
// you will need to re-register the Add-in by building the OpenERPOutlookPluginSetup project,
// right click the project in the Solution Explorer, then choose install.
#endregion
/// <summary>
/// The object for implementing an Add-in.
/// </summary>
/// <seealso class='IDTExtensibility2' />
[GuidAttribute("C86B5760-1254-4F40-BD25-2094A2A678C4"), ProgId("OpenERPOutlookPlugin.Connect")]
public class Connect : Object, Extensibility.IDTExtensibility2
{
/// <summary>
/// Implements the constructor for the Add-in object.
/// Place your initialization code within this method.
/// </summary>
public Connect()
{
}
public int cnt_mail = 0;
/// <summary>
/// Implements the OnConnection method of the IDTExtensibility2 interface.
/// Receives notification that the Add-in is being loaded.
/// </summary>
/// <param term='application'>
/// Root object of the host application.
/// </param>
/// <param term='connectMode'>
/// Describes how the Add-in is being loaded.
/// </param>
/// <param term='addInInst'>
/// Object representing this Add-in.
/// </param>
/// <seealso class='IDTExtensibility2' />
public void OnConnection(object application, Extensibility.ext_ConnectMode connectMode, object addInInst, ref System.Array custom)
{
applicationObject = application;
addInInstance = addInInst;
if (connectMode != Extensibility.ext_ConnectMode.ext_cm_Startup)
{
OnStartupComplete(ref custom);
}
}
/// <summary>
/// Implements the OnDisconnection method of the IDTExtensibility2 interface.
/// Receives notification that the Add-in is being unloaded.
/// </summary>
/// <param term='disconnectMode'>
/// Describes how the Add-in is being unloaded.
/// </param>
/// <param term='custom'>
/// Array of parameters that are host application specific.
/// </param>
/// <seealso class='IDTExtensibility2' />
public void OnDisconnection(Extensibility.ext_DisconnectMode disconnectMode, ref System.Array custom)
{
if (disconnectMode != Extensibility.ext_DisconnectMode.ext_dm_HostShutdown)
{
OnBeginShutdown(ref custom);
}
applicationObject = null;
}
/// <summary>
/// Implements the OnAddInsUpdate method of the IDTExtensibility2 interface.
/// Receives notification that the collection of Add-ins has changed.
/// </summary>
/// <param term='custom'>
/// Array of parameters that are host application specific.
/// </param>
/// <seealso class='IDTExtensibility2' />
public void OnAddInsUpdate(ref System.Array custom)
{
}
/// <summary>
/// Implements the OnStartupComplete method of the IDTExtensibility2 interface.
/// Receives notification that the host application has completed loading.
/// </summary>
/// <param term='custom'>
/// Array of parameters that are host application specific.
/// </param>
/// <seealso class='IDTExtensibility2' />
///
private office.CommandBarButton btn_open_partner;
private office.CommandBarButton btn_open_document;
private office.CommandBarButton btn_open_configuration_form;
private office.CommandBars oCommandBars;
private office.CommandBar menuBar;
private office.CommandBarPopup newMenuBar;
public int countMail()
{
/*
* Gives the number of selected mail.
* returns: Number of selected mail.
*/
cnt_mail = 0;
Microsoft.Office.Interop.Outlook.Application app = null;
app = new Microsoft.Office.Interop.Outlook.Application();
foreach (var selection in app.ActiveExplorer().Selection)
{
cnt_mail = app.ActiveExplorer().Selection.Count;
}
return cnt_mail;
}
public void OnStartupComplete(ref System.Array custom)
{
/*
* When outlook is opened it loads a Menu if Outlook plugin is installed.
* OpenERP - > Push, Partner ,Documents, Configuration
*/
Microsoft.Office.Interop.Outlook.Application app = null;
try
{
app = new Microsoft.Office.Interop.Outlook.Application();
object omissing = System.Reflection.Missing.Value;
menuBar = app.ActiveExplorer().CommandBars.ActiveMenuBar;
ConfigManager config = new ConfigManager();
config.LoadConfigurationSetting();
OpenERPOutlookPlugin openerp_outlook = Cache.OpenERPOutlookPlugin;
OpenERPConnect openerp_connect = openerp_outlook.Connection;
try
{
if (openerp_connect.URL != null && openerp_connect.DBName != null && openerp_connect.UserId != null && openerp_connect.pswrd != "")
{
string decodpwd = Tools.DecryptB64Pwd(openerp_connect.pswrd);
openerp_connect.Login(openerp_connect.DBName, openerp_connect.UserId, decodpwd);
}
}
catch(Exception )
{
MessageBox.Show("Unable to connect remote Server ' " + openerp_connect.URL + " '.", "OpenERP Connection",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
}
newMenuBar = (office.CommandBarPopup)menuBar.Controls.Add(office.MsoControlType.msoControlPopup, omissing, omissing, omissing, true);
if (newMenuBar != null)
{
newMenuBar.Caption = "OpenERP";
newMenuBar.Tag = "My";
btn_open_partner = (office.CommandBarButton)newMenuBar.Controls.Add(office.MsoControlType.msoControlButton, omissing, omissing, 1, true);
btn_open_partner.Style = office.MsoButtonStyle.msoButtonIconAndCaption;
btn_open_partner.Caption = "Contact";
//Face ID will use to show the ICON in the left side of the menu.
btn_open_partner.FaceId = 3710;
newMenuBar.Visible = true;
btn_open_partner.Click += new Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler(this.btn_open_partner_Click);
btn_open_document = (office.CommandBarButton)newMenuBar.Controls.Add(office.MsoControlType.msoControlButton, omissing, omissing, 2, true);
btn_open_document.Style = office.MsoButtonStyle.msoButtonIconAndCaption;
btn_open_document.Caption = "Documents";
//Face ID will use to show the ICON in the left side of the menu.
btn_open_document.FaceId = 258;
newMenuBar.Visible = true;
btn_open_document.Click += new Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler(this.btn_open_document_Click);
btn_open_configuration_form = (office.CommandBarButton)newMenuBar.Controls.Add(office.MsoControlType.msoControlButton, omissing, omissing, 3, true);
btn_open_configuration_form.Style = office.MsoButtonStyle.msoButtonIconAndCaption;
btn_open_configuration_form.Caption = "Configuration";
//Face ID will use to show the ICON in the left side of the menu.
btn_open_configuration_form.FaceId = 5644;
newMenuBar.Visible = true;
btn_open_configuration_form.Click += new Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler(this.btn_open_configuration_form_Click);
}
}
catch (Exception)
{
object oActiveExplorer;
oActiveExplorer = applicationObject.GetType().InvokeMember("ActiveExplorer", BindingFlags.GetProperty, null, applicationObject, null);
oCommandBars = (office.CommandBars)oActiveExplorer.GetType().InvokeMember("CommandBars", BindingFlags.GetProperty, null, oActiveExplorer, null);
}
}
void btn_open_configuration_form_Click(Microsoft.Office.Core.CommandBarButton Ctrl, ref bool CancelDefault)
{
frm_openerp_configuration frm_config = new frm_openerp_configuration();
frm_config.Show();
}
public static bool isLoggedIn()
{
/*
* This will check that it is connecting with server or not.
* If wrong server name or port is given then it will throw the message.
* returns true If conneted with server, otherwise False.
*/
if (Cache.OpenERPOutlookPlugin == null || Cache.OpenERPOutlookPlugin.isLoggedIn == false)
{
throw new Exception("OpenERP Server is not connected!\nPlease connect OpenERP Server from Configuration Menu.");
}
return true;
}
public static void handleException(Exception e)
{
string Title;
if (Form.ActiveForm != null)
{
Title = Form.ActiveForm.Text;
}
else
{
Title = "OpenERP Addin";
}
MessageBox.Show(e.Message, Title, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
public static void displayMessage(string message)
{
string Title;
if (Form.ActiveForm != null)
{
Title = Form.ActiveForm.Text;
}
else
{
Title = "OpenERP Addin";
}
MessageBox.Show(message, Title, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
public void CheckMailCount()
{
if (countMail() == 0)
{
throw new Exception("No email selected.\nPlease select one email.");
}
if (countMail() > 1)
{
throw new Exception("Multiple selction is not allowed.\nPlease select only one email.");
}
}
void btn_open_partner_Click(Microsoft.Office.Core.CommandBarButton Ctrl, ref bool CancelDefault)
{
try
{
Connect.isLoggedIn();
this.CheckMailCount();
if (countMail() == 1)
{
foreach (outlook.MailItem mailitem in Tools.MailItems())
{
Object[] contact = Cache.OpenERPOutlookPlugin.RedirectPartnerPage(mailitem);
if ((int)contact[1] > 0)
{
Cache.OpenERPOutlookPlugin.RedirectWeb(contact[2]);
}
else
{
frm_contact contact_form = new frm_contact(mailitem.SenderName, mailitem.SenderEmailAddress);
contact_form.Show();
}
}
}
}
catch (Exception e)
{
Connect.handleException(e);
}
}
void btn_open_document_Click(Microsoft.Office.Core.CommandBarButton Ctrl, ref bool CancelDefault)
{
try
{
Connect.isLoggedIn();
this.CheckMailCount();
if (countMail() == 1)
{
frm_choose_document_opt frm_doc = new frm_choose_document_opt();
}
}
catch (Exception e)
{
Connect.handleException(e);
}
}
public void OnBeginShutdown(ref System.Array custom)
{
}
private object applicationObject;
private object addInInstance;
}
}

View File

@ -0,0 +1,223 @@
/*
OpenERP, Open Source Business Applications
Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
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 <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections;
using System.Linq;
using OpenERPClient;
using outlook = Microsoft.Office.Interop.Outlook;
using System.Windows.Forms;
namespace OpenERPOutlookPlugin
{
public class OpenERPOutlookPlugin : Model
{
public Boolean isLoggedIn
{
/*
* This will check that user is logged in or not and gets the value
* returns : True if loggedIn, False otherwise.
*/
get
{
if (this.Connection != null) { return this.Connection.isLoggedIn; }
return false;
}
}
public OpenERPOutlookPlugin(OpenERPConnect connection)
{
this.Connection = connection;
//this.set_server_method();
}
public Record[] SearchRecord(string name,string model)
{
/*
* Gives name and model for search record.
*/
ArrayList object_list = new ArrayList();
Model parent_model;
parent_model = new Model(model);
ArrayList args = new ArrayList();
args.Add(parent_model.model);
if (name != null)
{
args.Add(name);
}
else
{
args.Add("");
}
object[] objects = (object[])this.openerp_connect.Execute("plugin.handler", "list_document_get", args.ToArray());
foreach (object obj in objects)
{
Hashtable document = new Hashtable();
object[] names = (object[])obj;
document.Add("id", names[0].ToString());
document.Add("name", names[1].ToString());
object_list.Add(new Record(document,parent_model));
}
return (Record[])object_list.ToArray(typeof(Record));
}
public string Name_get(outlook.MailItem mail)
{
string email = Tools.GetHeader(mail);
object doc = this.openerp_connect.Execute("plugin.handler", "document_get", email);
object[] name = (object[])doc;
return name[3].ToString();
}
public void RedirectWeb(object web_url)
{
/*
* Will open the url into the web browser.
*/
System.Diagnostics.Process.Start(web_url.ToString());
}
public object[] RedirectPartnerPage(outlook.MailItem mail)
{
/*
* Will Redirect to the web-browser and open partner.
* If it will not found partner in res.partner.address (in contact) then
it will open the contact form to create a partner.
:Param outlook.MailItem mailItem : Outlook Mail item
*/
string email_id = mail.SenderEmailAddress.ToString();
Object[] contact = (Object[])this.openerp_connect.Execute("plugin.handler", "partner_get", email_id);
return contact;
}
public void Open_Document(outlook.MailItem mail)
{
/*
* To open document attached in a url.returns the model_id and res_id of the document
:Param outlook.MailItem mail: Outlook mails.
*/
string email = Tools.GetHeader(mail);
object doc = this.openerp_connect.Execute("plugin.handler", "document_get", email);
object[] url = (object[])doc;
this.RedirectWeb(url[2].ToString());
}
public Boolean PushMail(outlook.MailItem mail, string model, int thread_id)
{
/*
* This will push the mail as per the selected items from the list.
:Param outlook.MailItem mail: selected mail from the outlook.
:Param string model : Model name to push.
:Param int thread_id : Thread id of the mail.
* If mail pushed successfully then it returns true.
* return False if mail Already Exist.
*/
OpenERPOutlookPlugin openerp_outlook = Cache.OpenERPOutlookPlugin;
OpenERPConnect openerp_connect = openerp_outlook.Connection;
ArrayList args = new ArrayList();
Hashtable vals = new Hashtable();
string email = Tools.GetHeader(mail); //TODO: Outlook.MailItem Should be Converted into MIME Message
args.Add(model);
args.Add(email.ToString());
args.Add(thread_id);
Hashtable attachments = Tools.GetAttachments(mail);
args.Add(mail.Body);
args.Add(mail.HTMLBody);
args.Add(attachments);
object push_mail = this.Connection.Execute("plugin.handler", "push_message_outlook", args.ToArray());
object[] push = (object[])push_mail;
this.RedirectWeb(push[2].ToString());
return true;
}
public long CreatePartnerRecord(string name)
{
/*
* Creates a partner record in res.partner as per the name given in the plugin form.
:Param String name: Name given to create a partner in the database.
* Returns a Long value : Partner id.
*/
Record[] partenr_list = this.SearchRecord(name,"res.partner");
int partner_id = 0;
foreach (Record partner in partenr_list)
{
partner_id = Convert.ToInt16(partner.id);
}
return partner_id;
}
public void CreateContactRecord(int partner_id, string name, string email_id)
{
/*
* Creates a Contact record in the res.partner.address as per the details given in the
plugin form of openERP outlook Plugin.
:Param string partner_id : Partner id for which it creates a contact
:Param string name : Contact name
:Param string email_id : Email address
*/
Hashtable values = new Hashtable();
values.Add("name", name);
values.Add("email", email_id);
ArrayList args = new ArrayList();
args.Add(values);
args.Add(partner_id);
object[] contact = (object[])this.openerp_connect.Execute("plugin.handler", "contact_create", args.ToArray());
this.RedirectWeb(contact[2].ToString());
}
public Model[] GetMailModels()
{
/*
* function to get objects to display in combo box
* returns the Array list of models.
*/
ArrayList obj_list = new ArrayList();
object mail_models = this.Connection.Execute("plugin.handler", "document_type");
foreach (object model in (object[])mail_models)
{
Model open_model;
string[] models = (string[])model;
open_model = new Model(models[0], models[1]);
open_model.Connection = this.Connection;
obj_list.Add(open_model);
}
return (Model[])obj_list.ToArray(typeof(Model));
}
}
}

Some files were not shown because too many files have changed in this diff Show More