[MERGE] merge with latest trunk

bzr revid: amb@tinyerp.com-20130812121219-4opfk262kgmakvsb
This commit is contained in:
Amit Bhavsar (Open ERP) 2013-08-12 17:42:19 +05:30
commit 028d62c391
253 changed files with 23198 additions and 4947 deletions

View File

@ -719,7 +719,7 @@ class account_journal(osv.osv):
'user_id': fields.many2one('res.users', 'User', help="The user responsible for this journal"),
'groups_id': fields.many2many('res.groups', 'account_journal_group_rel', 'journal_id', 'group_id', 'Groups'),
'currency': fields.many2one('res.currency', 'Currency', help='The currency used to enter statement'),
'entry_posted': fields.boolean('Skip \'Draft\' State for Manual Entries', help='Check this box if you don\'t want new journal entries to pass through the \'draft\' state and instead goes directly to the \'posted state\' without any manual validation. \nNote that journal entries that are automatically created by the system are always skipping that state.'),
'entry_posted': fields.boolean('Autopost Created Moves', help='Check this box to automatically post entries of this journal. Note that legally, some entries may be automatically posted when the source document is validated (Invoices), whatever the status of this field.'),
'company_id': fields.many2one('res.company', 'Company', required=True, select=1, help="Company related to this journal"),
'allow_date':fields.boolean('Check Date in Period', help= 'If set to True then do not accept the entry if the entry date is not into the period dates'),

View File

@ -612,6 +612,13 @@
</field>
</page>
</notebook>
<group class="oe_subtotal_footer oe_right" colspan="2" name="sale_total">
<div class="oe_subtotal_footer_separator oe_inline">
<label for="balance_end" />
</div>
<field name="balance_end" nolabel="1" class="oe_subtotal_footer_separator" widget='monetary' options="{'currency_field': 'currency_id'}"/>
</group>
<div class="oe_clear"/>
</sheet>
</form>
</field>

10849
addons/account/i18n/is.po Normal file

File diff suppressed because it is too large Load Diff

View File

@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-12-21 17:04+0000\n"
"PO-Revision-Date: 2013-06-27 14:01+0000\n"
"PO-Revision-Date: 2013-07-02 06:32+0000\n"
"Last-Translator: Chertykov Denis <chertykov@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2013-06-28 05:42+0000\n"
"X-Generator: Launchpad (build 16681)\n"
"X-Launchpad-Export-Date: 2013-07-03 05:14+0000\n"
"X-Generator: Launchpad (build 16692)\n"
#. module: account
#: model:process.transition,name:account.process_transition_supplierreconcilepaid0
@ -4707,7 +4707,7 @@ msgstr "Месяц"
#: code:addons/account/account.py:668
#, python-format
msgid "You cannot change the code of account which contains journal items!"
msgstr ""
msgstr "Нальзя изменить код счета который содержит проводки!"
#. module: account
#: field:account.config.settings,purchase_sequence_prefix:0
@ -4826,7 +4826,7 @@ msgstr "Отметьте, если хотите выводить счета с 0
#. module: account
#: field:account.move.reconcile,opening_reconciliation:0
msgid "Opening Entries Reconciliation"
msgstr ""
msgstr "Сверка проводок открытия"
#. module: account
#. openerp-web

View File

@ -366,12 +366,13 @@ class aged_trial_report(report_sxw.rml_parse, common_report_header):
return period or 0.0
def _get_partners(self,data):
# TODO: deprecated, to remove in trunk
if data['form']['result_selection'] == 'customer':
return 'Receivable Accounts'
return self._translate('Receivable Accounts')
elif data['form']['result_selection'] == 'supplier':
return 'Payable Accounts'
return self._translate('Payable Accounts')
elif data['form']['result_selection'] == 'customer_supplier':
return 'Receivable and Payable Accounts'
return self._translate('Receivable and Payable Accounts')
return ''
report_sxw.report_sxw('report.account.aged_trial_balance', 'res.partner',

View File

@ -147,7 +147,9 @@
<para style="terp_default_Centre_8">[[ data['form']['period_length'] ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ get_partners(data) ]]</para>
<para style="terp_default_Centre_8">Receivable Accounts[[ data['form']['result_selection'] == 'customer' or removeParentNode('para') ]]</para>
<para style="terp_default_Centre_8">Payable Accounts[[ data['form']['result_selection'] == 'supplier' or removeParentNode('para') ]]</para>
<para style="terp_default_Centre_8">Receivable and Payable Accounts[[ data['form']['result_selection'] == 'customer_supplier' or removeParentNode('para') ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ data['form']['direction_selection'] ]]</para>
@ -166,7 +168,8 @@
<para style="terp_tblheader_Details">Partners</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ data['form']['direction_selection'] == 'future' and 'Due' or 'Not due' ]]</para>
<para style="terp_tblheader_Details_Right">Due[[ data['form']['direction_selection'] == 'future' and ' ' or removeParentNode('para') ]]</para>
<para style="terp_tblheader_Details_Right">Not due[[ data['form']['direction_selection'] != 'future' and ' ' or removeParentNode('para') ]]</para>
</td>
<td>
<para style="terp_tblheader_Details_Right">[[ data['form']['4']['name'] ]]</para>

View File

@ -211,8 +211,10 @@
</para>
<blockTable colWidths="130.0,80.0,100.0,140.0,90.0" style="Table8">
<tr>
<td><para style="terp_tblheader_General_Centre">[[ data['model']=='account.account' and 'Company'or removeParentNode('para') ]]</para>
<para style="terp_tblheader_General_Centre"> [[ data['model']=='ir.ui.menu' and 'Chart of Accounts' or removeParentNode('para') ]]</para></td>
<td>
<para style="terp_tblheader_General_Centre">Company[[ data['model']=='account.account' and ' ' or removeParentNode('para') ]]</para>
<para style="terp_tblheader_General_Centre">Chart of Accounts[[ data['model']=='ir.ui.menu' and ' ' or removeParentNode('para') ]]</para>
</td>
<td>
<para style="terp_tblheader_General_Centre">Fiscal Year</para>
</td>
@ -233,7 +235,11 @@
<td>
<para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para>
</td>
<td><para style="terp_default_Centre_8">[[ (data['form']['display_account']=='all' and 'All') or (data['form']['display_account']=='movement' and 'With movements') or 'With balance is not equal to 0']]</para></td>
<td>
<para style="terp_default_Centre_7">All[[ data['form']['display_account']=='all' and ' ' or removeParentNode('para') ]]</para>
<para style="terp_default_Centre_7">With movements[[ data['form']['display_account']=='movement' and ' ' or removeParentNode('para') ]]</para>
<para style="terp_default_Centre_7">With balance is not equal to 0[[ data['form']['display_account']=='not_zero' and ' ' or removeParentNode('para') ]]</para>
</td>
<td> <para style="terp_default_Centre_8">[[ data['form']['filter']=='filter_no' and get_filter(data) or removeParentNode('para') ]] </para>
<blockTable colWidths="60.0,60.0" style="Table5">[[ data['form']['filter']=='filter_date' or removeParentNode('blockTable') ]]
<tr>

View File

@ -220,8 +220,8 @@
</blockTable>
<blockTable colWidths="80.0,100,80.0,150.0,100.0" style="Table2">
<tr>
<td><para style="terp_tblheader_General_Centre">[[ data['model']=='account.journal.period' and 'Company' or removeParentNode('para') ]]</para>
<para style="terp_tblheader_General_Centre"> [[ data['model']=='ir.ui.menu' and 'Chart of Accounts' or removeParentNode('para') ]]</para></td>
<td><para style="terp_tblheader_General_Centre">Company[[ data['model']=='account.journal.period' and ' ' or removeParentNode('para') ]]</para>
<para style="terp_tblheader_General_Centre">Chart of Accounts[[ data['model']=='ir.ui.menu' and ' ' or removeParentNode('para') ]]</para></td>
<td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
<td><para style="terp_tblheader_General_Centre">Journals</para></td>
<td><para style="terp_tblheader_General_Centre">Filter By [[ data['form']['filter']!='filter_no' and get_filter(data) ]]</para></td>

View File

@ -360,9 +360,8 @@
<blockTable colWidths="110.0,110.0,110.0,110.0,128.0,93.0,110.0" style="Table1">
<tr>
<td>
<para style="terp_tblheader_General_Centre">[[ data['model']=='account.account' and 'Company' or removeParentNode('para') ]]</para>
<para style="terp_tblheader_General_Centre">[[ data['model']=='ir.ui.menu' and 'Chart of Accounts' or removeParentNode('para') ]]</para>
</td>
<para style="terp_tblheader_General_Centre">Company[[ data['model']=='account.account' and ' ' or removeParentNode('para') ]]</para>
<para style="terp_tblheader_General_Centre">Chart of Accounts[[ data['model']=='ir.ui.menu' and ' ' or removeParentNode('para') ]]</para></td>
<td>
<para style="terp_tblheader_General_Centre">Fiscal Year</para>
</td>
@ -395,7 +394,9 @@
<para style="terp_default_Centre_7">[[', '.join([ lt or '' for lt in get_journal(data) ]) ]]</para>
</td>
<td>
<para style="terp_default_Centre_7">[[ (data['form']['display_account']=='all' and 'All') or (data['form']['display_account']=='movement' and 'With movements') or 'With balance is not equal to 0']]</para>
<para style="terp_default_Centre_7">All[[ data['form']['display_account']=='all' and ' ' or removeParentNode('para') ]]</para>
<para style="terp_default_Centre_7">With movements[[ data['form']['display_account']=='movement' and ' ' or removeParentNode('para') ]]</para>
<para style="terp_default_Centre_7">With balance is not equal to 0[[ data['form']['display_account']=='not_zero' and ' ' or removeParentNode('para') ]]</para>
</td>
<td>
<para style="terp_default_Centre_7">[[ data['form']['filter']=='filter_no' and get_filter(data) or removeParentNode('para') ]]</para>

View File

@ -189,11 +189,12 @@ class journal_print(report_sxw.rml_parse, common_report_header):
return data['form']['amount_currency']
def _get_sortby(self, data):
# TODO: deprecated, to remove in trunk
if self.sort_selection == 'date':
return 'Date'
return self._translate('Date')
elif self.sort_selection == 'ref':
return 'Reference Number'
return 'Date'
return self._translate('Reference Number')
return self._translate('Date')
report_sxw.report_sxw('report.account.journal.period.print', 'account.journal.period', 'addons/account/report/account_journal.rml', parser=journal_print, header='external')
report_sxw.report_sxw('report.account.journal.period.print.sale.purchase', 'account.journal.period', 'addons/account/report/account_journal_sale_purchase.rml', parser=journal_print, header='external')

View File

@ -186,8 +186,8 @@
</para>
<blockTable colWidths="85.0,80.0,80.0,120.0,70.0,100.0" style="Table2">
<tr>
<td><para style="terp_tblheader_General_Centre"> [[ data['model']=='account.journal.period'and 'Company' or removeParentNode('para') ]]</para>
<para style="terp_tblheader_General_Centre">[[ data['model']=='ir.ui.menu' and 'Chart of Accounts' or removeParentNode('para') ]]</para></td>
<td><para style="terp_tblheader_General_Centre">Company[[ data['model']=='account.journal.period'and ' ' or removeParentNode('para') ]]</para>
<para style="terp_tblheader_General_Centre">Chart of Accounts[[ data['model']=='ir.ui.menu' and ' ' or removeParentNode('para') ]]</para></td>
<td><para style="terp_tblheader_General_Centre">Fiscal Year</para></td>
<td><para style="terp_tblheader_General_Centre">Journal</para></td>
<td><para style="terp_tblheader_General_Centre">Period</para></td>
@ -199,8 +199,10 @@
<td><para style="terp_default_Centre_8">[[ get_fiscalyear(data) or '' ]]</para></td>
<td><para style="terp_default_Centre_8">[[ o.journal_id.name ]]</para></td>
<td><para style="terp_default_Centre_8">[[ o.period_id.name ]] </para></td>
<td><para style="terp_default_Centre_8">[[ get_sortby(data) ]]</para></td>
<td><para style="terp_default_Centre_8">[[ get_target_move(data) ]] </para></td>
<td>
<para style="terp_default_Centre_8">Date[[ data['form'].get('sort_selection', 'date') == 'date' and ' ' or removeParentNode('para') ]]</para>
<para style="terp_default_Centre_8">Reference Number[[ data['form'].get('sort_selection', 'date') == 'ref' and ' ' or removeParentNode('para') ]]</para>
</td>
</tr>
</blockTable>
<para style="P9">

View File

@ -267,12 +267,13 @@ class third_party_ledger(report_sxw.rml_parse, common_report_header):
return result_tmp + result_init
def _get_partners(self):
# TODO: deprecated, to remove in trunk
if self.result_selection == 'customer':
return 'Receivable Accounts'
return _('Receivable Accounts')
elif self.result_selection == 'supplier':
return 'Payable Accounts'
return _('Payable Accounts')
elif self.result_selection == 'customer_supplier':
return 'Receivable and Payable Accounts'
return _('Receivable and Payable Accounts')
return ''
def _sum_currency_amount_account(self, account, form):

View File

@ -423,7 +423,9 @@
</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ get_partners() ]]</para>
<para style="terp_default_Centre_8">Receivable Accounts[[ data['form'].get('result_selection', 'customer') == 'customer' or removeParentNode('para') ]]</para>
<para style="terp_default_Centre_8">Payable Accounts[[ data['form'].get('result_selection', 'customer') == 'supplier' or removeParentNode('para') ]]</para>
<para style="terp_default_Centre_8">Receivable and Payable Accounts[[ data['form'].get('result_selection', 'customer') == 'customer_supplier' or removeParentNode('para') ]]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ get_target_move(data) ]]</para>

View File

@ -17,7 +17,7 @@ By far the most beautiful and full featured accounting software. OpenERP Account
Activate features on demand, from integrated analytic accounting to budget, assets and multiple companies consolidation.
</p>
<div class="oe_centeralign oe_websiteonly">
<a href="http://www.openerp.com/start" class="oe_button oe_big oe_tacky">Start your <span class="oe_emph">free</span> trial</a>
<a href="http://www.openerp.com/start?app=account" class="oe_button oe_big oe_tacky">Start your <span class="oe_emph">free</span> trial</a>
</div>
</div>
</div>

View File

@ -84,7 +84,7 @@ openerp.account.quickadd = function (instance) {
},
search_by_journal_period: function() {
var self = this;
var domain = [];
var domain = ['|',['debit', '!=', 0], ['credit', '!=', 0]];
if (self.current_journal !== null) domain.push(["journal_id", "=", self.current_journal]);
if (self.current_period !== null) domain.push(["period_id", "=", self.current_period]);
self.last_context["journal_id"] = self.current_journal === null ? false : self.current_journal;

View File

@ -175,7 +175,7 @@ class account_common_report(osv.osv_memory):
data['form'][field] = data['form'][field][0]
used_context = self._build_contexts(cr, uid, ids, data, context=context)
data['form']['periods'] = used_context.get('periods', False) and used_context['periods'] or []
data['form']['used_context'] = used_context
data['form']['used_context'] = dict(used_context, lang=context.get('lang', 'en_US'))
return self._print_report(cr, uid, ids, data, context=context)

View File

@ -8,19 +8,19 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-12-21 17:04+0000\n"
"PO-Revision-Date: 2012-04-13 22:35+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"PO-Revision-Date: 2013-07-30 22:25+0000\n"
"Last-Translator: Masaki Yamaya <Unknown>\n"
"Language-Team: Japanese <ja@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: 2013-03-16 05:47+0000\n"
"X-Generator: Launchpad (build 16532)\n"
"X-Launchpad-Export-Date: 2013-07-31 05:16+0000\n"
"X-Generator: Launchpad (build 16718)\n"
#. module: account_accountant
#: model:ir.actions.client,name:account_accountant.action_client_account_menu
msgid "Open Accounting Menu"
msgstr ""
msgstr "会計メニューを開く"
#~ msgid ""
#~ "\n"

View File

@ -248,9 +248,12 @@
<field name="model">account.analytic.default</field>
<field name="inherit_id" ref="account_analytic_default.view_account_analytic_default_tree"/>
<field name="arch" type="xml">
<field name="analytic_id" required="1" position="replace">
<xpath expr="//field[@name='analytic_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='analytic_id']" position="after">
<field name="analytics_id" required="1"/>
</field>
</xpath>
</field>
</record>

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: 2012-12-21 17:04+0000\n"
"PO-Revision-Date: 2013-05-15 10:09+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"PO-Revision-Date: 2013-07-24 08:53+0000\n"
"Last-Translator: Sumonchai ( เหลา ) <sumonchai@gmail.com>\n"
"Language-Team: Thai <th@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: 2013-05-16 05:12+0000\n"
"X-Generator: Launchpad (build 16626)\n"
"X-Launchpad-Export-Date: 2013-07-25 05:13+0000\n"
"X-Generator: Launchpad (build 16700)\n"
#. module: account_asset
#: view:account.asset.asset:0
@ -42,7 +42,7 @@ msgstr ""
#. module: account_asset
#: view:asset.asset.report:0
msgid "Group By..."
msgstr ""
msgstr "จัดกลุ่มตาม..."
#. module: account_asset
#: field:asset.asset.report,gross_value:0
@ -58,7 +58,7 @@ msgstr ""
#: field:asset.asset.report,asset_id:0
#: model:ir.model,name:account_asset.model_account_asset_asset
msgid "Asset"
msgstr ""
msgstr "สินทรัพย์"
#. module: account_asset
#: help:account.asset.asset,prorata:0
@ -72,7 +72,7 @@ msgstr ""
#: selection:account.asset.asset,method:0
#: selection:account.asset.category,method:0
msgid "Linear"
msgstr ""
msgstr "เชิงเส้น"
#. module: account_asset
#: field:account.asset.asset,company_id:0
@ -80,24 +80,24 @@ msgstr ""
#: view:asset.asset.report:0
#: field:asset.asset.report,company_id:0
msgid "Company"
msgstr ""
msgstr "บริษัท"
#. module: account_asset
#: view:asset.modify:0
msgid "Modify"
msgstr ""
msgstr "ปรับเปลี่ยน"
#. module: account_asset
#: selection:account.asset.asset,state:0
#: view:asset.asset.report:0
#: selection:asset.asset.report,state:0
msgid "Running"
msgstr ""
msgstr "กำลังทำงานอยู่"
#. module: account_asset
#: view:account.asset.asset:0
msgid "Set to Draft"
msgstr ""
msgstr "กำหนดให้เป็นแบบร่าง"
#. module: account_asset
#: view:asset.asset.report:0
@ -110,7 +110,7 @@ msgstr ""
#. module: account_asset
#: field:asset.modify,name:0
msgid "Reason"
msgstr ""
msgstr "เหตุผล"
#. module: account_asset
#: field:account.asset.asset,method_progress_factor:0
@ -122,7 +122,7 @@ msgstr ""
#: model:ir.actions.act_window,name:account_asset.action_account_asset_asset_list_normal
#: model:ir.ui.menu,name:account_asset.menu_action_account_asset_asset_list_normal
msgid "Asset Categories"
msgstr ""
msgstr "หมวดหมู่สินทรัพย์"
#. module: account_asset
#: view:account.asset.asset:0
@ -173,7 +173,7 @@ msgstr ""
#: model:ir.ui.menu,name:account_asset.menu_finance_assets
#: model:ir.ui.menu,name:account_asset.menu_finance_config_assets
msgid "Assets"
msgstr ""
msgstr "สินทรัพย์"
#. module: account_asset
#: field:account.asset.category,account_depreciation_id:0
@ -187,7 +187,7 @@ msgstr ""
#: view:asset.modify:0
#: field:asset.modify,note:0
msgid "Notes"
msgstr ""
msgstr "บันทึกย่อ"
#. module: account_asset
#: field:account.asset.depreciation.line,move_id:0
@ -221,7 +221,7 @@ msgstr ""
#. module: account_asset
#: field:account.asset.asset,code:0
msgid "Reference"
msgstr ""
msgstr "อ้างถึง"
#. module: account_asset
#: view:account.asset.asset:0
@ -246,7 +246,7 @@ msgstr ""
#: view:asset.asset.report:0
#: selection:asset.asset.report,state:0
msgid "Draft"
msgstr ""
msgstr "ฉบับร่าง"
#. module: account_asset
#: view:asset.asset.report:0
@ -273,13 +273,13 @@ msgstr ""
#. module: account_asset
#: field:account.asset.category,account_analytic_id:0
msgid "Analytic account"
msgstr ""
msgstr "วิเคราะห์บัญชี"
#. module: account_asset
#: field:account.asset.asset,method:0
#: field:account.asset.category,method:0
msgid "Computation Method"
msgstr ""
msgstr "วิธีการคำนวณ"
#. module: account_asset
#: constraint:account.asset.asset:0
@ -308,7 +308,7 @@ msgstr ""
#. module: account_asset
#: field:account.asset.asset,salvage_value:0
msgid "Salvage Value"
msgstr ""
msgstr "มูลค่าซาก"
#. module: account_asset
#: field:account.asset.asset,category_id:0
@ -364,20 +364,20 @@ msgstr ""
#: field:account.asset.category,method_time:0
#: field:account.asset.history,method_time:0
msgid "Time Method"
msgstr ""
msgstr "วิธีการจัดการเวลา"
#. module: account_asset
#: view:asset.depreciation.confirmation.wizard:0
#: view:asset.modify:0
msgid "or"
msgstr ""
msgstr "หรือ"
#. module: account_asset
#: field:account.asset.asset,note:0
#: field:account.asset.category,note:0
#: field:account.asset.history,note:0
msgid "Note"
msgstr ""
msgstr "บันทึกย่อ"
#. module: account_asset
#: help:account.asset.history,method_time:0
@ -409,7 +409,7 @@ msgstr ""
#. module: account_asset
#: view:account.asset.asset:0
msgid "Closed"
msgstr ""
msgstr "ปิด"
#. module: account_asset
#: help:account.asset.asset,state:0
@ -425,13 +425,13 @@ msgstr ""
#: field:account.asset.asset,state:0
#: field:asset.asset.report,state:0
msgid "Status"
msgstr ""
msgstr "สถานะ"
#. module: account_asset
#: field:account.asset.asset,partner_id:0
#: field:asset.asset.report,partner_id:0
msgid "Partner"
msgstr ""
msgstr "พาร์ทเนอร์"
#. module: account_asset
#: view:asset.asset.report:0
@ -451,7 +451,7 @@ msgstr ""
#. module: account_asset
#: field:account.asset.history,user_id:0
msgid "User"
msgstr ""
msgstr "ผู้ใช้"
#. module: account_asset
#: field:account.asset.category,account_asset_id:0
@ -482,12 +482,12 @@ msgstr ""
#. module: account_asset
#: field:account.asset.asset,active:0
msgid "Active"
msgstr ""
msgstr "เปิดใช้งาน"
#. module: account_asset
#: field:account.asset.depreciation.line,parent_state:0
msgid "State of Asset"
msgstr ""
msgstr "สถานะของสินทรัพย์"
#. module: account_asset
#: field:account.asset.depreciation.line,name:0
@ -498,12 +498,12 @@ msgstr ""
#: view:account.asset.asset:0
#: field:account.asset.asset,history_ids:0
msgid "History"
msgstr ""
msgstr "ประวัติ"
#. module: account_asset
#: view:asset.depreciation.confirmation.wizard:0
msgid "Compute Asset"
msgstr ""
msgstr "คำนวณสินทรัพย์"
#. module: account_asset
#: field:asset.depreciation.confirmation.wizard,period_id:0
@ -513,7 +513,7 @@ msgstr ""
#. module: account_asset
#: view:account.asset.asset:0
msgid "General"
msgstr ""
msgstr "ทั่วไป"
#. module: account_asset
#: field:account.asset.asset,prorata:0
@ -524,7 +524,7 @@ msgstr ""
#. module: account_asset
#: model:ir.model,name:account_asset.model_account_invoice
msgid "Invoice"
msgstr ""
msgstr "ใบแจ้งหนี้"
#. module: account_asset
#: view:account.asset.asset:0
@ -535,13 +535,13 @@ msgstr ""
#: view:asset.depreciation.confirmation.wizard:0
#: view:asset.modify:0
msgid "Cancel"
msgstr ""
msgstr "ยกเลิก"
#. module: account_asset
#: selection:account.asset.asset,state:0
#: selection:asset.asset.report,state:0
msgid "Close"
msgstr ""
msgstr "ปิด"
#. module: account_asset
#: model:ir.model,name:account_asset.model_account_move_line
@ -558,7 +558,7 @@ msgstr ""
#: view:asset.asset.report:0
#: field:asset.asset.report,purchase_date:0
msgid "Purchase Date"
msgstr ""
msgstr "วันที่ซื้อ"
#. module: account_asset
#: selection:account.asset.asset,method:0
@ -606,7 +606,7 @@ msgstr ""
#. module: account_asset
#: field:account.asset.asset,currency_id:0
msgid "Currency"
msgstr ""
msgstr "สกุลเงิน"
#. module: account_asset
#: field:account.asset.category,journal_id:0
@ -637,7 +637,7 @@ msgstr ""
#: view:asset.asset.report:0
#: field:asset.asset.report,move_check:0
msgid "Posted"
msgstr ""
msgstr "ลงบัญชีแล้ว"
#. module: account_asset
#: model:ir.actions.act_window,help:account_asset.action_asset_asset_report
@ -660,7 +660,7 @@ msgstr ""
#. module: account_asset
#: field:account.asset.category,name:0
msgid "Name"
msgstr ""
msgstr "ชื่อ"
#. module: account_asset
#: help:account.asset.category,open_asset:0
@ -672,7 +672,7 @@ msgstr ""
#. module: account_asset
#: field:asset.asset.report,name:0
msgid "Year"
msgstr ""
msgstr "ปี"
#. module: account_asset
#: model:ir.model,name:account_asset.model_account_asset_depreciation_line
@ -693,7 +693,7 @@ msgid "Amount of Depreciation Lines"
msgstr ""
#. module: account_asset
#: code:addons/account_asset/wizard/wizard_asset_compute.py:49
#: code:addons/account_asset/wizard/wizard_asset_compute.py:50
#, python-format
msgid "Created Asset Moves"
msgstr ""
@ -701,7 +701,7 @@ msgstr ""
#. module: account_asset
#: field:account.asset.depreciation.line,sequence:0
msgid "Sequence"
msgstr ""
msgstr "ลำดับ"
#. module: account_asset
#: help:account.asset.category,method_period:0
@ -711,7 +711,7 @@ msgstr ""
#. module: account_asset
#: field:account.asset.history,date:0
msgid "Date"
msgstr ""
msgstr "วันที่"
#. module: account_asset
#: field:account.asset.asset,method_number:0

View File

@ -0,0 +1,361 @@
# Russian translation for openobject-addons
# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-12-21 17:05+0000\n"
"PO-Revision-Date: 2013-08-05 10:40+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Russian <ru@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: 2013-08-06 04:47+0000\n"
"X-Generator: Launchpad (build 16718)\n"
#. module: account_bank_statement_extensions
#: help:account.bank.statement.line.global,name:0
msgid "Originator to Beneficiary Information"
msgstr "Информация от плательщика получателю"
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line:0
#: selection:account.bank.statement.line,state:0
msgid "Confirmed"
msgstr "Подтверждено"
#. module: account_bank_statement_extensions
#: view:account.bank.statement:0
#: view:account.bank.statement.line:0
msgid "Glob. Id"
msgstr ""
#. module: account_bank_statement_extensions
#: selection:account.bank.statement.line.global,type:0
msgid "CODA"
msgstr ""
#. module: account_bank_statement_extensions
#: field:account.bank.statement.line.global,parent_id:0
msgid "Parent Code"
msgstr "Основной код"
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line:0
msgid "Debit"
msgstr "Дебет"
#. module: account_bank_statement_extensions
#: view:cancel.statement.line:0
#: model:ir.actions.act_window,name:account_bank_statement_extensions.action_cancel_statement_line
#: model:ir.model,name:account_bank_statement_extensions.model_cancel_statement_line
msgid "Cancel selected statement lines"
msgstr "Отмена выбранных позиций выписки"
#. module: account_bank_statement_extensions
#: field:account.bank.statement.line,val_date:0
msgid "Value Date"
msgstr "Дата зачисления"
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line:0
msgid "Group By..."
msgstr "Группировать по ..."
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line:0
#: selection:account.bank.statement.line,state:0
msgid "Draft"
msgstr "Черновик"
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line:0
msgid "Statement"
msgstr "Выписка"
#. module: account_bank_statement_extensions
#: view:confirm.statement.line:0
#: model:ir.actions.act_window,name:account_bank_statement_extensions.action_confirm_statement_line
#: model:ir.model,name:account_bank_statement_extensions.model_confirm_statement_line
msgid "Confirm selected statement lines"
msgstr "Подтверждение выбранных позиций выписки"
#. module: account_bank_statement_extensions
#: report:bank.statement.balance.report:0
#: model:ir.actions.report.xml,name:account_bank_statement_extensions.bank_statement_balance_report
msgid "Bank Statement Balances Report"
msgstr "Отчет об остатках банковской выписки"
#. module: account_bank_statement_extensions
#: view:cancel.statement.line:0
msgid "Cancel Lines"
msgstr "Отменить позиции"
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line.global:0
#: model:ir.model,name:account_bank_statement_extensions.model_account_bank_statement_line_global
msgid "Batch Payment Info"
msgstr ""
#. module: account_bank_statement_extensions
#: field:account.bank.statement.line,state:0
msgid "Status"
msgstr "Статус"
#. module: account_bank_statement_extensions
#: code:addons/account_bank_statement_extensions/account_bank_statement.py:129
#, python-format
msgid ""
"Delete operation not allowed. Please go to the associated bank "
"statement in order to delete and/or modify bank statement line."
msgstr ""
"Операция удаления запрещена. Пожалуйста, обратитесь к соответствующей "
"банковской выписке для удаления/изменения позиции."
#. module: account_bank_statement_extensions
#: view:confirm.statement.line:0
msgid "or"
msgstr "или"
#. module: account_bank_statement_extensions
#: view:confirm.statement.line:0
msgid "Confirm Lines"
msgstr "Подтвердить позиции"
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line.global:0
msgid "Transactions"
msgstr "Операции"
#. module: account_bank_statement_extensions
#: field:account.bank.statement.line.global,type:0
msgid "Type"
msgstr "Тип"
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line:0
#: report:bank.statement.balance.report:0
msgid "Journal"
msgstr "Журнал"
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line:0
msgid "Confirmed Statement Lines."
msgstr "Подтвержденные позиции выписки."
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line:0
msgid "Credit Transactions."
msgstr "Операции по кредиту"
#. module: account_bank_statement_extensions
#: model:ir.actions.act_window,help:account_bank_statement_extensions.action_cancel_statement_line
msgid "cancel selected statement lines."
msgstr "отменить выбранные позиции выписки"
#. module: account_bank_statement_extensions
#: field:account.bank.statement.line,counterparty_number:0
msgid "Counterparty Number"
msgstr "Число контрагентов"
#. module: account_bank_statement_extensions
#: report:bank.statement.balance.report:0
msgid "Closing Balance"
msgstr "Итоговый баланс"
#. module: account_bank_statement_extensions
#: report:bank.statement.balance.report:0
msgid "Date"
msgstr "Дата"
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line:0
#: field:account.bank.statement.line,globalisation_amount:0
msgid "Glob. Amount"
msgstr ""
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line:0
msgid "Debit Transactions."
msgstr "Операции по дебету"
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line:0
msgid "Extended Filters..."
msgstr "Расширенные фильтры..."
#. module: account_bank_statement_extensions
#: view:confirm.statement.line:0
msgid "Confirmed lines cannot be changed anymore."
msgstr "Нельзя изменить подтвержденные позиции."
#. module: account_bank_statement_extensions
#: view:cancel.statement.line:0
msgid "Are you sure you want to cancel the selected Bank Statement lines ?"
msgstr ""
"Вы уверены, что хотите отменить выбранные позиции банковской выписки ?"
#. module: account_bank_statement_extensions
#: report:bank.statement.balance.report:0
msgid "Name"
msgstr "Название"
#. module: account_bank_statement_extensions
#: field:account.bank.statement.line.global,name:0
msgid "OBI"
msgstr "Назначение"
#. module: account_bank_statement_extensions
#: selection:account.bank.statement.line.global,type:0
msgid "ISO 20022"
msgstr "ISO 20022"
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line:0
msgid "Notes"
msgstr "Примечания"
#. module: account_bank_statement_extensions
#: selection:account.bank.statement.line.global,type:0
msgid "Manual"
msgstr "Ручной"
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line:0
msgid "Bank Transaction"
msgstr "Банковские операции"
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line:0
msgid "Credit"
msgstr "Кредит"
#. module: account_bank_statement_extensions
#: field:account.bank.statement.line.global,amount:0
msgid "Amount"
msgstr "Сумма"
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line:0
msgid "Fin.Account"
msgstr "Фин. Счет"
#. module: account_bank_statement_extensions
#: field:account.bank.statement.line,counterparty_currency:0
msgid "Counterparty Currency"
msgstr "Валюта контрагента"
#. module: account_bank_statement_extensions
#: field:account.bank.statement.line,counterparty_bic:0
msgid "Counterparty BIC"
msgstr "БИК контрагента"
#. module: account_bank_statement_extensions
#: field:account.bank.statement.line.global,child_ids:0
msgid "Child Codes"
msgstr "Субкоды"
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line:0
msgid "Search Bank Transactions"
msgstr "Поиск банковских операций"
#. module: account_bank_statement_extensions
#: view:confirm.statement.line:0
msgid "Are you sure you want to confirm the selected Bank Statement lines ?"
msgstr ""
"Вы уверены, что хотите, подтвердить выбранные позиции банковской выписки ?"
#. module: account_bank_statement_extensions
#: help:account.bank.statement.line,globalisation_id:0
msgid ""
"Code to identify transactions belonging to the same globalisation level "
"within a batch payment"
msgstr ""
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line:0
msgid "Draft Statement Lines."
msgstr "Черновики позиций выписки."
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line:0
msgid "Glob. Am."
msgstr ""
#. module: account_bank_statement_extensions
#: model:ir.model,name:account_bank_statement_extensions.model_account_bank_statement_line
msgid "Bank Statement Line"
msgstr "Позиция банковской выписки"
#. module: account_bank_statement_extensions
#: field:account.bank.statement.line.global,code:0
msgid "Code"
msgstr "Код"
#. module: account_bank_statement_extensions
#: field:account.bank.statement.line,counterparty_name:0
msgid "Counterparty Name"
msgstr "Название контрагента"
#. module: account_bank_statement_extensions
#: model:ir.model,name:account_bank_statement_extensions.model_res_partner_bank
msgid "Bank Accounts"
msgstr "Банковские счета"
#. module: account_bank_statement_extensions
#: model:ir.model,name:account_bank_statement_extensions.model_account_bank_statement
msgid "Bank Statement"
msgstr "Банковская выписка"
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line:0
msgid "Statement Line"
msgstr "Позиция выписки"
#. module: account_bank_statement_extensions
#: sql_constraint:account.bank.statement.line.global:0
msgid "The code must be unique !"
msgstr "Код должен быть уникальным !"
#. module: account_bank_statement_extensions
#: field:account.bank.statement.line.global,bank_statement_line_ids:0
#: model:ir.actions.act_window,name:account_bank_statement_extensions.action_bank_statement_line
#: model:ir.ui.menu,name:account_bank_statement_extensions.bank_statement_line
msgid "Bank Statement Lines"
msgstr "Позиции банковской выписки"
#. module: account_bank_statement_extensions
#: code:addons/account_bank_statement_extensions/account_bank_statement.py:129
#, python-format
msgid "Warning!"
msgstr "Внимание!"
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line.global:0
msgid "Child Batch Payments"
msgstr ""
#. module: account_bank_statement_extensions
#: view:confirm.statement.line:0
msgid "Cancel"
msgstr "Отмена"
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line:0
msgid "Statement Lines"
msgstr "Позиции выписки"
#. module: account_bank_statement_extensions
#: view:account.bank.statement.line:0
msgid "Total Amount"
msgstr "Итоговая сумма"
#. module: account_bank_statement_extensions
#: field:account.bank.statement.line,globalisation_id:0
msgid "Globalisation ID"
msgstr ""

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: 2012-12-21 17:05+0000\n"
"PO-Revision-Date: 2012-06-13 17:16+0000\n"
"Last-Translator: Akira Hiyama <Unknown>\n"
"PO-Revision-Date: 2013-07-30 22:29+0000\n"
"Last-Translator: Masaki Yamaya <Unknown>\n"
"Language-Team: Japanese <ja@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: 2013-03-16 05:34+0000\n"
"X-Generator: Launchpad (build 16532)\n"
"X-Launchpad-Export-Date: 2013-07-31 05:16+0000\n"
"X-Generator: Launchpad (build 16718)\n"
#. module: account_budget
#: view:account.budget.analytic:0
@ -418,7 +418,7 @@ msgstr "からの分析"
#. module: account_budget
#: view:crossovered.budget:0
msgid "Draft Budgets"
msgstr "ドラフト予算"
msgstr "予算"
#, python-format
#~ msgid "The General Budget '%s' has no Accounts!"

View File

@ -0,0 +1,23 @@
# Ukrainian translation for openobject-addons
# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-12-21 17:05+0000\n"
"PO-Revision-Date: 2013-08-01 11:11+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Ukrainian <uk@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: 2013-08-02 05:38+0000\n"
"X-Generator: Launchpad (build 16718)\n"
#. module: account_cancel
#: view:account.invoice:0
msgid "Cancel"
msgstr ""

View File

@ -0,0 +1,246 @@
# Bosnian translation for openobject-addons
# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-12-21 17:05+0000\n"
"PO-Revision-Date: 2013-08-08 22:05+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Bosnian <bs@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: 2013-08-09 05:06+0000\n"
"X-Generator: Launchpad (build 16723)\n"
#. module: account_check_writing
#: selection:res.company,check_layout:0
msgid "Check on Top"
msgstr "Ček na vrhu"
#. module: account_check_writing
#: report:account.print.check.top:0
msgid "Open Balance"
msgstr "Otvoreno saldo"
#. module: account_check_writing
#: view:account.check.write:0
#: view:account.voucher:0
msgid "Print Check"
msgstr "Štampaj ček"
#. module: account_check_writing
#: selection:res.company,check_layout:0
msgid "Check in middle"
msgstr "Ćek u sredini"
#. module: account_check_writing
#: help:res.company,check_layout:0
msgid ""
"Check on top is compatible with Quicken, QuickBooks and Microsoft Money. "
"Check in middle is compatible with Peachtree, ACCPAC and DacEasy. Check on "
"bottom is compatible with Peachtree, ACCPAC and DacEasy only"
msgstr ""
"Ček na vrhu je kompatibilan sa Quicken, QuickBooks i Microsoft Money. Ček u "
"sredini je kompatibilan sa Peachtree, ACCPAC i DacEasy. Ček na dnu je "
"kompatibilan sa Peachtree, ACCPAC i DacEasy samo"
#. module: account_check_writing
#: selection:res.company,check_layout:0
msgid "Check on bottom"
msgstr "Ćek na dnu"
#. module: account_check_writing
#: model:ir.actions.act_window,name:account_check_writing.action_account_check_write
msgid "Print Check in Batch"
msgstr "Štampaj čekove grupno"
#. module: account_check_writing
#: code:addons/account_check_writing/wizard/account_check_batch_printing.py:59
#, python-format
msgid "One of the printed check already got a number."
msgstr "Jedan od odštampanih čekova je već dobio broj."
#. module: account_check_writing
#: help:account.journal,allow_check_writing:0
msgid "Check this if the journal is to be used for writing checks."
msgstr ""
"Označite ovo ako će se za pisanje čekova koristiti dnevnik knjiženja."
#. module: account_check_writing
#: field:account.journal,allow_check_writing:0
msgid "Allow Check writing"
msgstr "Dozvoli pisanje čekova"
#. module: account_check_writing
#: report:account.print.check.bottom:0
#: report:account.print.check.middle:0
#: report:account.print.check.top:0
msgid "Description"
msgstr "Opis"
#. module: account_check_writing
#: model:ir.model,name:account_check_writing.model_account_journal
msgid "Journal"
msgstr "Dnevnik knjiženja"
#. module: account_check_writing
#: model:ir.actions.act_window,name:account_check_writing.action_write_check
#: model:ir.ui.menu,name:account_check_writing.menu_action_write_check
msgid "Write Checks"
msgstr "Piši čekove"
#. module: account_check_writing
#: report:account.print.check.bottom:0
#: report:account.print.check.middle:0
#: report:account.print.check.top:0
msgid "Discount"
msgstr "Popust"
#. module: account_check_writing
#: report:account.print.check.bottom:0
#: report:account.print.check.middle:0
#: report:account.print.check.top:0
msgid "Original Amount"
msgstr "Originalni iznos"
#. module: account_check_writing
#: field:res.company,check_layout:0
msgid "Check Layout"
msgstr "Raspored čeka"
#. module: account_check_writing
#: field:account.voucher,allow_check:0
msgid "Allow Check Writing"
msgstr "Dozvoli pisanje čeka"
#. module: account_check_writing
#: report:account.print.check.bottom:0
#: report:account.print.check.middle:0
#: report:account.print.check.top:0
msgid "Payment"
msgstr "Plaćanje"
#. module: account_check_writing
#: field:account.journal,use_preprint_check:0
msgid "Use Preprinted Check"
msgstr "Koristi pred-odštampane čekove"
#. module: account_check_writing
#: model:ir.actions.report.xml,name:account_check_writing.account_print_check_bottom
msgid "Print Check (Bottom)"
msgstr "Štampaj ček (donji)"
#. module: account_check_writing
#: model:ir.actions.act_window,help:account_check_writing.action_write_check
msgid ""
"<p class=\"oe_view_nocontent_create\">\n"
" Click to create a new check. \n"
" </p><p>\n"
" The check payment form allows you to track the payment you "
"do\n"
" to your suppliers using checks. When you select a supplier, "
"the\n"
" payment method and an amount for the payment, OpenERP will\n"
" propose to reconcile your payment with the open supplier\n"
" invoices or bills.\n"
" </p>\n"
" "
msgstr ""
"<p class=\"oe_view_nocontent_create\">\n"
" Kliknite da kreirate nove čekove. \n"
" </p><p>\n"
" Forma plaćanje čekom omogućava vam da pratite plaćanja koja "
"izvršavate\n"
" vašim dobavljačima koristeći čekove. Kada odaberete "
"dobavljača,\n"
" metodu plaćanja i iznos za plaćanje, OpenERP će predložiti "
"da izravna\n"
" vašu uplatu sa otvorenom fakturom ili računom dobavljača.\n"
" </p>\n"
" "
#. module: account_check_writing
#: report:account.print.check.bottom:0
#: report:account.print.check.middle:0
#: report:account.print.check.top:0
msgid "Due Date"
msgstr "Datum dospijeća"
#. module: account_check_writing
#: model:ir.actions.report.xml,name:account_check_writing.account_print_check_middle
msgid "Print Check (Middle)"
msgstr "Štampaj ček (srednji)"
#. module: account_check_writing
#: model:ir.model,name:account_check_writing.model_res_company
msgid "Companies"
msgstr "Kompanije"
#. module: account_check_writing
#: code:addons/account_check_writing/wizard/account_check_batch_printing.py:59
#, python-format
msgid "Error!"
msgstr "Greška!"
#. module: account_check_writing
#: help:account.check.write,check_number:0
msgid "The number of the next check number to be printed."
msgstr "Broj sljedećeg čeka za štampanje."
#. module: account_check_writing
#: report:account.print.check.bottom:0
#: report:account.print.check.middle:0
msgid "Balance Due"
msgstr "Saldo valute"
#. module: account_check_writing
#: model:ir.actions.report.xml,name:account_check_writing.account_print_check_top
msgid "Print Check (Top)"
msgstr "Štampaj ček (na vrhu)"
#. module: account_check_writing
#: report:account.print.check.bottom:0
#: report:account.print.check.middle:0
#: report:account.print.check.top:0
msgid "Check Amount"
msgstr "Iznos čeka"
#. module: account_check_writing
#: model:ir.model,name:account_check_writing.model_account_voucher
msgid "Accounting Voucher"
msgstr "Računovodstveni vaučer"
#. module: account_check_writing
#: view:account.check.write:0
msgid "or"
msgstr "ili"
#. module: account_check_writing
#: field:account.voucher,amount_in_word:0
msgid "Amount in Word"
msgstr "Pisani iznos"
#. module: account_check_writing
#: model:ir.model,name:account_check_writing.model_account_check_write
msgid "Prin Check in Batch"
msgstr "Štampaj čekove grupno"
#. module: account_check_writing
#: view:account.check.write:0
msgid "Cancel"
msgstr "Otkaži"
#. module: account_check_writing
#: field:account.check.write,check_number:0
msgid "Next Check Number"
msgstr "Sljedeći broj čeka"
#. module: account_check_writing
#: view:account.check.write:0
msgid "Check"
msgstr "Ček"

View File

@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-12-21 17:04+0000\n"
"PO-Revision-Date: 2013-04-26 16:01+0000\n"
"PO-Revision-Date: 2013-07-10 09:54+0000\n"
"Last-Translator: Els Van Vossel (Agaplan) <Unknown>\n"
"Language-Team: Els Van Vossel\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2013-04-27 05:44+0000\n"
"X-Generator: Launchpad (build 16580)\n"
"X-Launchpad-Export-Date: 2013-07-11 05:17+0000\n"
"X-Generator: Launchpad (build 16696)\n"
"Language: nl\n"
#. module: account_voucher
@ -28,7 +28,7 @@ msgid "account.config.settings"
msgstr "account.config.settings"
#. module: account_voucher
#: code:addons/account_voucher/account_voucher.py:369
#: code:addons/account_voucher/account_voucher.py:417
#, python-format
msgid "Write-Off"
msgstr "Afschrijving"
@ -132,7 +132,7 @@ msgid "Voucher Statistics"
msgstr "Boekingsstatistieken"
#. module: account_voucher
#: code:addons/account_voucher/account_voucher.py:1547
#: code:addons/account_voucher/account_voucher.py:1641
#, python-format
msgid ""
"You can not change the journal as you already reconciled some statement "
@ -233,8 +233,8 @@ msgid "Journal Item"
msgstr "Boekingslijn"
#. module: account_voucher
#: code:addons/account_voucher/account_voucher.py:508
#: code:addons/account_voucher/account_voucher.py:981
#: code:addons/account_voucher/account_voucher.py:558
#: code:addons/account_voucher/account_voucher.py:1073
#, python-format
msgid "Error!"
msgstr "Fout"
@ -261,7 +261,7 @@ msgid "Cancelled"
msgstr "Geannuleerd"
#. module: account_voucher
#: code:addons/account_voucher/account_voucher.py:1153
#: code:addons/account_voucher/account_voucher.py:1249
#, python-format
msgid ""
"You have to configure account base code and account tax code on the '%s' tax!"
@ -313,7 +313,7 @@ msgid "Tax"
msgstr "Btw"
#. module: account_voucher
#: code:addons/account_voucher/account_voucher.py:879
#: code:addons/account_voucher/account_voucher.py:971
#, python-format
msgid "Invalid Action!"
msgstr "Ongeldige actie"
@ -366,10 +366,10 @@ msgid "Import Invoices"
msgstr "Facturen importeren"
#. module: account_voucher
#: code:addons/account_voucher/account_voucher.py:1112
#: code:addons/account_voucher/account_voucher.py:1208
#, python-format
msgid "Wrong voucher line"
msgstr ""
msgstr "Verkeerde betalingsregel"
#. module: account_voucher
#: selection:account.voucher,pay_now:0
@ -385,7 +385,7 @@ msgid "Receipt"
msgstr "Reçu"
#. module: account_voucher
#: code:addons/account_voucher/account_voucher.py:1018
#: code:addons/account_voucher/account_voucher.py:1110
#, python-format
msgid ""
"You should configure the 'Gain Exchange Rate Account' in the accounting "
@ -409,7 +409,7 @@ msgstr "Periode"
#. module: account_voucher
#: view:account.voucher:0
#: code:addons/account_voucher/account_voucher.py:211
#: code:addons/account_voucher/account_voucher.py:231
#, python-format
msgid "Supplier"
msgstr "Leverancier"
@ -430,7 +430,7 @@ msgid "Debit"
msgstr "Debet"
#. module: account_voucher
#: code:addons/account_voucher/account_voucher.py:1547
#: code:addons/account_voucher/account_voucher.py:1641
#, python-format
msgid "Unable to change journal !"
msgstr "Het dagboek kan niet worden gewijzigd"
@ -469,6 +469,12 @@ msgid ""
" </p>\n"
" "
msgstr ""
"<p class=\"oe_view_nocontent_create\">\n"
" Klik hier als u een nieuwe leveranciersbetaling wilt maken.\n"
" </p><p>\n"
" Met OpenERP kunt u betalingen aan leveranciers opvolgen.\n"
" </p>\n"
" "
#. module: account_voucher
#: view:account.voucher:0
@ -536,7 +542,7 @@ msgid "Pay Invoice"
msgstr "Factuur betalen"
#. module: account_voucher
#: code:addons/account_voucher/account_voucher.py:1153
#: code:addons/account_voucher/account_voucher.py:1249
#, python-format
msgid "No Account Base Code and Account Tax Code!"
msgstr "Geen rekening voor basisvak en btw-vak"
@ -590,15 +596,15 @@ msgid "To Review"
msgstr "Te controleren"
#. module: account_voucher
#: code:addons/account_voucher/account_voucher.py:1025
#: code:addons/account_voucher/account_voucher.py:1039
#: code:addons/account_voucher/account_voucher.py:1194
#: code:addons/account_voucher/account_voucher.py:1120
#: code:addons/account_voucher/account_voucher.py:1134
#: code:addons/account_voucher/account_voucher.py:1286
#, python-format
msgid "change"
msgstr "wijzigen"
#. module: account_voucher
#: code:addons/account_voucher/account_voucher.py:1014
#: code:addons/account_voucher/account_voucher.py:1106
#, python-format
msgid ""
"You should configure the 'Loss Exchange Rate Account' in the accounting "
@ -656,6 +662,7 @@ msgstr "Maand"
#. module: account_voucher
#: field:account.voucher,currency_id:0
#: field:account.voucher.line,currency_id:0
#: model:ir.model,name:account_voucher.model_res_currency
#: field:sale.receipt.report,currency_id:0
msgid "Currency"
msgstr "Munt"
@ -699,7 +706,7 @@ msgid "Reconcile Payment Balance"
msgstr "Betalingssaldo afpunten"
#. module: account_voucher
#: code:addons/account_voucher/account_voucher.py:975
#: code:addons/account_voucher/account_voucher.py:1067
#, python-format
msgid "Configuration Error !"
msgstr "Configuratiefout"
@ -764,7 +771,7 @@ msgid "October"
msgstr "Oktober"
#. module: account_voucher
#: code:addons/account_voucher/account_voucher.py:976
#: code:addons/account_voucher/account_voucher.py:1068
#, python-format
msgid "Please activate the sequence of selected journal !"
msgstr "Gelieve de nummering van het gekozen journaal te activeren."
@ -844,7 +851,7 @@ msgid "Previous Payments ?"
msgstr "Vorige betalingen?"
#. module: account_voucher
#: code:addons/account_voucher/account_voucher.py:1112
#: code:addons/account_voucher/account_voucher.py:1208
#, python-format
msgid "The invoice you are willing to pay is not valid anymore."
msgstr "De factuur die u wilt betalen, is niet meer geldig."
@ -876,7 +883,7 @@ msgid "Active"
msgstr "Actief"
#. module: account_voucher
#: code:addons/account_voucher/account_voucher.py:982
#: code:addons/account_voucher/account_voucher.py:1074
#, python-format
msgid "Please define a sequence on the journal."
msgstr "Gelieve een reeks in te stellen voor het journaal."
@ -1004,7 +1011,7 @@ msgid "Journal Items"
msgstr "Boekingslijnen"
#. module: account_voucher
#: code:addons/account_voucher/account_voucher.py:508
#: code:addons/account_voucher/account_voucher.py:558
#, python-format
msgid "Please define default credit/debit accounts on the journal \"%s\"."
msgstr "Stel een standaard debet-/creditrekening in voor journaal \"%s\"."
@ -1221,7 +1228,7 @@ msgstr ""
"Het bedrag van het reçu moet gelijk zijn aan het bedrag op de uittreksellijn."
#. module: account_voucher
#: code:addons/account_voucher/account_voucher.py:879
#: code:addons/account_voucher/account_voucher.py:971
#, python-format
msgid "Cannot delete voucher(s) which are already opened or paid."
msgstr "Een openstaand of betaald reçu kan niet meer worden verwijderd."
@ -1284,8 +1291,8 @@ msgid "Status <b>changed</b>"
msgstr "Status <b>vgewijzigd</b>"
#. module: account_voucher
#: code:addons/account_voucher/account_voucher.py:1014
#: code:addons/account_voucher/account_voucher.py:1018
#: code:addons/account_voucher/account_voucher.py:1106
#: code:addons/account_voucher/account_voucher.py:1110
#, python-format
msgid "Insufficient Configuration!"
msgstr "Niet volledig geconfigureerd"

View File

@ -17,7 +17,7 @@
automatically based on your activities.
</p>
<div class="oe_centeralign oe_websiteonly">
<a href="http://www.openerp.com/start" class="oe_button oe_big oe_tacky">Start your <span class="oe_emph">free</span> trial</a>
<a href="http://www.openerp.com/start?app=account_voucher" class="oe_button oe_big oe_tacky">Start your <span class="oe_emph">free</span> trial</a>
</div>
</div>
</div>

View File

@ -42,7 +42,7 @@ class Controller(http.Controller):
}
return config
@http.route('/auth_signup/retrieve', type='json', auth="user")
@http.route('/auth_signup/retrieve', type='json', auth="none")
def retrieve(self, dbname, token):
""" retrieve the user info (name, login or email) corresponding to a signup token """
registry = RegistryManager.get(dbname)
@ -51,7 +51,7 @@ class Controller(http.Controller):
user_info = res_partner.signup_retrieve_info(cr, openerp.SUPERUSER_ID, token)
return user_info
@http.route('/auth_signup/signup', type='json', auth="user")
@http.route('/auth_signup/signup', type='json', auth="none")
def signup(self, dbname, token, **values):
""" sign up a user (new or existing)"""
try:
@ -66,7 +66,7 @@ class Controller(http.Controller):
res_users = registry.get('res.users')
res_users.signup(cr, openerp.SUPERUSER_ID, values, token)
@http.route('/auth_signup/reset_password', type='json', auth="user")
@http.route('/auth_signup/reset_password', type='json', auth="none")
def reset_password(self, dbname, login):
""" retrieve user, and perform reset password """
registry = RegistryManager.get(dbname)

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: 2012-12-21 17:05+0000\n"
"PO-Revision-Date: 2013-04-16 04:33+0000\n"
"Last-Translator: Key <key.diagram@gmail.com>\n"
"PO-Revision-Date: 2013-07-02 08:11+0000\n"
"Last-Translator: DWXXX <Unknown>\n"
"Language-Team: Chinese (Simplified) <zh_CN@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: 2013-04-17 05:15+0000\n"
"X-Generator: Launchpad (build 16567)\n"
"X-Launchpad-Export-Date: 2013-07-03 05:14+0000\n"
"X-Generator: Launchpad (build 16692)\n"
#. module: auth_signup
#: field:res.partner,signup_type:0
@ -29,7 +29,7 @@ msgstr "允许外部用户登录"
#. module: auth_signup
#. openerp-web
#: code:addons/auth_signup/static/src/xml/auth_signup.xml:16
#: code:addons/auth_signup/static/src/xml/auth_signup.xml:19
#, python-format
msgid "Confirm Password"
msgstr "确认密码"
@ -37,7 +37,7 @@ msgstr "确认密码"
#. module: auth_signup
#: help:base.config.settings,auth_signup_uninvited:0
msgid "If unchecked, only invited users may sign up."
msgstr ""
msgstr "如果不勾选,只有被邀请用户才能注册。"
#. module: auth_signup
#: model:ir.model,name:auth_signup.model_base_config_settings
@ -45,15 +45,15 @@ msgid "base.config.settings"
msgstr "base.config.settings"
#. module: auth_signup
#: code:addons/auth_signup/res_users.py:265
#: code:addons/auth_signup/res_users.py:266
#, python-format
msgid "Cannot send email: user has no email address."
msgstr ""
msgstr "无法发送邮件:用户邮件地址为空。"
#. module: auth_signup
#. openerp-web
#: code:addons/auth_signup/static/src/xml/auth_signup.xml:24
#: code:addons/auth_signup/static/src/xml/auth_signup.xml:28
#: code:addons/auth_signup/static/src/xml/auth_signup.xml:27
#: code:addons/auth_signup/static/src/xml/auth_signup.xml:31
#, python-format
msgid "Reset password"
msgstr "重设密码"
@ -70,7 +70,7 @@ msgstr "重置密码"
#. module: auth_signup
#. openerp-web
#: code:addons/auth_signup/static/src/js/auth_signup.js:117
#: code:addons/auth_signup/static/src/js/auth_signup.js:120
#, python-format
msgid "Please enter a password and confirm it."
msgstr "请输入密码并确认。"
@ -78,12 +78,12 @@ msgstr "请输入密码并确认。"
#. module: auth_signup
#: view:res.users:0
msgid "Send an email to the user to (re)set their password."
msgstr ""
msgstr "向用户发送重置密码邮件。"
#. module: auth_signup
#. openerp-web
#: code:addons/auth_signup/static/src/xml/auth_signup.xml:23
#: code:addons/auth_signup/static/src/xml/auth_signup.xml:26
#: code:addons/auth_signup/static/src/xml/auth_signup.xml:29
#, python-format
msgid "Sign Up"
msgstr "注册"
@ -119,10 +119,10 @@ msgstr ""
#. module: auth_signup
#. openerp-web
#: code:addons/auth_signup/static/src/js/auth_signup.js:111
#: code:addons/auth_signup/static/src/js/auth_signup.js:114
#, python-format
msgid "Please enter a name."
msgstr ""
msgstr "请输入名字"
#. module: auth_signup
#: model:ir.model,name:auth_signup.model_res_users
@ -136,10 +136,10 @@ msgstr "注册 URL"
#. module: auth_signup
#. openerp-web
#: code:addons/auth_signup/static/src/js/auth_signup.js:114
#: code:addons/auth_signup/static/src/js/auth_signup.js:117
#, python-format
msgid "Please enter a username."
msgstr ""
msgstr "请输入您的用户名"
#. module: auth_signup
#: selection:res.users,state:0
@ -147,7 +147,7 @@ msgid "Active"
msgstr "启用"
#. module: auth_signup
#: code:addons/auth_signup/res_users.py:269
#: code:addons/auth_signup/res_users.py:270
#, python-format
msgid ""
"Cannot send email: no outgoing email server configured.\n"
@ -170,10 +170,10 @@ msgstr "姓名"
#. module: auth_signup
#. openerp-web
#: code:addons/auth_signup/static/src/js/auth_signup.js:170
#: code:addons/auth_signup/static/src/js/auth_signup.js:173
#, python-format
msgid "Please enter a username or email address."
msgstr ""
msgstr "请输入用户名和邮件地址"
#. module: auth_signup
#: selection:res.users,state:0
@ -199,7 +199,7 @@ msgstr ""
#. module: auth_signup
#. openerp-web
#: code:addons/auth_signup/static/src/xml/auth_signup.xml:22
#: code:addons/auth_signup/static/src/xml/auth_signup.xml:25
#, python-format
msgid "Log in"
msgstr "登录"
@ -211,35 +211,35 @@ msgstr "注册令牌( Token )是有效的"
#. module: auth_signup
#. openerp-web
#: code:addons/auth_signup/static/src/js/auth_signup.js:108
#: code:addons/auth_signup/static/src/js/auth_signup.js:111
#: code:addons/auth_signup/static/src/js/auth_signup.js:114
#: code:addons/auth_signup/static/src/js/auth_signup.js:117
#: code:addons/auth_signup/static/src/js/auth_signup.js:120
#: code:addons/auth_signup/static/src/js/auth_signup.js:167
#: code:addons/auth_signup/static/src/js/auth_signup.js:123
#: code:addons/auth_signup/static/src/js/auth_signup.js:170
#: code:addons/auth_signup/static/src/js/auth_signup.js:173
#, python-format
msgid "Login"
msgstr ""
#. module: auth_signup
#. openerp-web
#: code:addons/auth_signup/static/src/js/auth_signup.js:94
#: code:addons/auth_signup/static/src/js/auth_signup.js:97
#, python-format
msgid "Invalid signup token"
msgstr ""
#. module: auth_signup
#. openerp-web
#: code:addons/auth_signup/static/src/js/auth_signup.js:120
#: code:addons/auth_signup/static/src/js/auth_signup.js:123
#, python-format
msgid "Passwords do not match; please retype them."
msgstr ""
#. module: auth_signup
#. openerp-web
#: code:addons/auth_signup/static/src/js/auth_signup.js:108
#: code:addons/auth_signup/static/src/js/auth_signup.js:167
#: code:addons/auth_signup/static/src/js/auth_signup.js:111
#: code:addons/auth_signup/static/src/js/auth_signup.js:170
#, python-format
msgid "No database selected !"
msgstr ""
@ -256,7 +256,7 @@ msgstr ""
#. module: auth_signup
#. openerp-web
#: code:addons/auth_signup/static/src/xml/auth_signup.xml:27
#: code:addons/auth_signup/static/src/xml/auth_signup.xml:30
#, python-format
msgid "Back to Login"
msgstr "返回登录页面"
@ -266,12 +266,12 @@ msgstr "返回登录页面"
#: code:addons/auth_signup/static/src/xml/auth_signup.xml:22
#, python-format
msgid "Sign up"
msgstr ""
msgstr "注册"
#. module: auth_signup
#: model:ir.model,name:auth_signup.model_res_partner
msgid "Partner"
msgstr "业务伙伴"
msgstr "合作伙伴"
#. module: auth_signup
#: field:res.partner,signup_token:0

View File

@ -1510,7 +1510,7 @@ rule or repeating pattern of time to exclude from the recurring rule."),
continue
if r['class']=='private':
for f in r.keys():
if f not in ('id','date','date_deadline','duration','user_id','state'):
if f not in ('id','date','date_deadline','duration','user_id','state','interval','count'):
if isinstance(r[f], list):
r[f] = []
else:

View File

@ -20,6 +20,5 @@
##############################################################################
import base_state
import base_stage
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -24,11 +24,10 @@
'version': '1.0',
'category': 'Hidden',
'description': """
This module handles state and stage. It is derived from the crm_base and crm_case classes from crm.
===================================================================================================
This module handles state. It is derived from the crm_base and crm_case classes from crm.
==========================================================================================
* ``base_state``: state management
* ``base_stage``: stage management
""",
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',

View File

@ -1,264 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-today OpenERP SA (<http://www.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/>.
#
##############################################################################
from openerp.osv import fields, osv
from openerp.tools.translate import _
class base_stage(object):
""" Base utility mixin class for objects willing to manage their stages.
Object that inherit from this class should inherit from mailgate.thread
to have access to the mail gateway, as well as Chatter. Objects
subclassing this class should define the following colums:
- ``date_open`` (datetime field)
- ``date_closed`` (datetime field)
- ``user_id`` (many2one to res.users)
- ``partner_id`` (many2one to res.partner)
- ``stage_id`` (many2one to a stage definition model)
- ``state`` (selection field, related to the stage_id.state)
"""
def _get_default_partner(self, cr, uid, context=None):
""" Gives id of partner for current user
:param context: if portal not in context returns False
"""
if context is None:
context = {}
if context.get('portal'):
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
return user.partner_id.id
return False
def _get_default_email(self, cr, uid, context=None):
""" Gives default email address for current user
:param context: if portal not in context returns False
"""
if context is None:
context = {}
if context.get('portal'):
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
return user.email
return False
def _get_default_user(self, cr, uid, context=None):
""" Gives current user id
:param context: if portal not in context returns False
"""
if context is None:
context = {}
if not context or context.get('portal'):
return False
return uid
def onchange_partner_address_id(self, cr, uid, ids, add, email=False, context=None):
""" This function returns value of partner email based on Partner Address
:param add: Id of Partner's address
:param email: Partner's email ID
"""
data = {'value': {'email_from': False, 'phone':False}}
if add:
address = self.pool.get('res.partner').browse(cr, uid, add)
data['value'] = {'partner_name': address and address.name or False,
'email_from': address and address.email or False,
'phone': address and address.phone or False,
'street': address and address.street or False,
'street2': address and address.street2 or False,
'city': address and address.city or False,
'state_id': address.state_id and address.state_id.id or False,
'zip': address and address.zip or False,
'country_id': address.country_id and address.country_id.id or False,
}
fields = self.fields_get(cr, uid, context=context or {})
for key in data['value'].keys():
if key not in fields:
del data['value'][key]
return data
def onchange_partner_id(self, cr, uid, ids, part, email=False):
""" This function returns value of partner address based on partner
:param part: Partner's id
:param email: Partner's email ID
"""
data={}
if part:
addr = self.pool.get('res.partner').address_get(cr, uid, [part], ['contact'])
data.update(self.onchange_partner_address_id(cr, uid, ids, addr['contact'])['value'])
return {'value': data}
def _get_default_section_id(self, cr, uid, context=None):
""" Gives default section """
return False
def _get_default_stage_id(self, cr, uid, context=None):
""" Gives default stage_id """
return self.stage_find(cr, uid, [], None, [('state', '=', 'draft')], context=context)
def stage_find(self, cr, uid, cases, section_id, domain=[], order='sequence', context=None):
""" Find stage, with a given (optional) domain on the search,
ordered by the order parameter. If several stages match the
search criterions, the first one will be returned, according
to the requested search order.
This method is meant to be overriden by subclasses. That way
specific behaviors can be achieved for every class inheriting
from base_stage.
:param cases: browse_record of cases
:param section_id: section limitating the search, given for
a generic search (for example default search).
A section models concepts such as Sales team
(for CRM), ou departments (for HR).
:param domain: a domain on the search of stages
:param order: order of the search
"""
return False
def stage_set_with_state_name(self, cr, uid, cases, state_name, context=None):
""" Set a new stage, with a state_name instead of a stage_id
:param cases: browse_record of cases
"""
if isinstance(cases, (int, long)):
cases = self.browse(cr, uid, cases, context=context)
for case in cases:
stage_id = self.stage_find(cr, uid, [case], None, [('state', '=', state_name)], context=context)
if stage_id:
self.stage_set(cr, uid, [case.id], stage_id, context=context)
return True
def stage_set(self, cr, uid, ids, stage_id, context=None):
""" Set the new stage. This methods is the right method to call
when changing states. It also checks whether an onchange is
defined, and execute it.
"""
value = {}
if hasattr(self, 'onchange_stage_id'):
value = self.onchange_stage_id(cr, uid, ids, stage_id, context=context)['value']
value['stage_id'] = stage_id
return self.write(cr, uid, ids, value, context=context)
def stage_change(self, cr, uid, ids, op, order, context=None):
""" Change the stage and take the next one, based on a condition
writen for the 'sequence' field and an operator. This methods
checks whether the case has a current stage, and takes its
sequence. Otherwise, a default 0 sequence is chosen and this
method will therefore choose the first available stage.
For example if op is '>' and current stage has a sequence of
10, this will call stage_find, with [('sequence', '>', '10')].
"""
for case in self.browse(cr, uid, ids, context=context):
seq = 0
if case.stage_id:
seq = case.stage_id.sequence or 0
section_id = None
next_stage_id = self.stage_find(cr, uid, [case], None, [('sequence', op, seq)],order, context=context)
if next_stage_id:
return self.stage_set(cr, uid, [case.id], next_stage_id, context=context)
return False
def stage_next(self, cr, uid, ids, context=None):
""" This function computes next stage for case from its current stage
using available stage for that case type
"""
return self.stage_change(cr, uid, ids, '>','sequence', context)
def stage_previous(self, cr, uid, ids, context=None):
""" This function computes previous stage for case from its current
stage using available stage for that case type
"""
return self.stage_change(cr, uid, ids, '<', 'sequence desc', context)
def copy(self, cr, uid, id, default=None, context=None):
""" Overrides orm copy method to avoid copying messages,
as well as date_closed and date_open columns if they
exist."""
if default is None:
default = {}
if hasattr(self, '_columns'):
if self._columns.get('date_closed'):
default.update({ 'date_closed': False, })
if self._columns.get('date_open'):
default.update({ 'date_open': False })
return super(base_stage, self).copy(cr, uid, id, default, context=context)
def case_escalate(self, cr, uid, ids, context=None):
""" Escalates case to parent level """
for case in self.browse(cr, uid, ids, context=context):
data = {'active': True}
if case.section_id.parent_id:
data['section_id'] = case.section_id.parent_id.id
if case.section_id.parent_id.change_responsible:
if case.section_id.parent_id.user_id:
data['user_id'] = case.section_id.parent_id.user_id.id
else:
raise osv.except_osv(_('Error!'), _("You are already at the top level of your sales-team category.\nTherefore you cannot escalate furthermore."))
self.write(cr, uid, [case.id], data, context=context)
return True
def case_open(self, cr, uid, ids, context=None):
""" Opens case """
cases = self.browse(cr, uid, ids, context=context)
for case in cases:
data = {'active': True}
if not case.user_id:
data['user_id'] = uid
self.case_set(cr, uid, [case.id], 'open', data, context=context)
return True
def case_close(self, cr, uid, ids, context=None):
""" Closes case """
return self.case_set(cr, uid, ids, 'done', {'active': True, 'date_closed': fields.datetime.now()}, context=context)
def case_cancel(self, cr, uid, ids, context=None):
""" Cancels case """
return self.case_set(cr, uid, ids, 'cancel', {'active': True}, context=context)
def case_pending(self, cr, uid, ids, context=None):
""" Set case as pending """
return self.case_set(cr, uid, ids, 'pending', {'active': True}, context=context)
def case_reset(self, cr, uid, ids, context=None):
""" Resets case as draft """
return self.case_set(cr, uid, ids, 'draft', {'active': True}, context=context)
def case_set(self, cr, uid, ids, new_state_name=None, values_to_update=None, new_stage_id=None, context=None):
""" Generic method for setting case. This methods wraps the update
of the record.
:params new_state_name: the new state of the record; this method
will call ``stage_set_with_state_name``
that will find the stage matching the
new state, using the ``stage_find`` method.
:params new_stage_id: alternatively, you may directly give the
new stage of the record
:params state_name: the new value of the state, such as
'draft' or 'close'.
:params update_values: values that will be added with the state
update when writing values to the record.
"""
cases = self.browse(cr, uid, ids, context=context)
# 1. update the stage
if new_state_name:
self.stage_set_with_state_name(cr, uid, cases, new_state_name, context=context)
elif not (new_stage_id is None):
self.stage_set(cr, uid, ids, new_stage_id, context=context)
# 2. update values
if values_to_update:
self.write(cr, uid, ids, values_to_update, context=context)
return True

View File

@ -0,0 +1,80 @@
# Bosnian translation for openobject-addons
# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-12-21 17:05+0000\n"
"PO-Revision-Date: 2013-08-08 22:20+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Bosnian <bs@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: 2013-08-09 05:06+0000\n"
"X-Generator: Launchpad (build 16723)\n"
#. module: base_status
#: code:addons/base_status/base_state.py:107
#, python-format
msgid "Error !"
msgstr "Greška !"
#. module: base_status
#: code:addons/base_status/base_state.py:166
#, python-format
msgid "%s has been <b>opened</b>."
msgstr "%s je bio <b>otvoren</b>."
#. module: base_status
#: code:addons/base_status/base_state.py:199
#, python-format
msgid "%s has been <b>renewed</b>."
msgstr "%s je bio <b>obnovljen</b>."
#. module: base_status
#: code:addons/base_status/base_stage.py:210
#, python-format
msgid "Error!"
msgstr "Greška!"
#. module: base_status
#: code:addons/base_status/base_state.py:107
#, python-format
msgid ""
"You can not escalate, you are already at the top level regarding your sales-"
"team category."
msgstr ""
"Ne možete eskalirati, već ste na najvišem nivou u odnosu na kategoriju "
"prodajnog tima."
#. module: base_status
#: code:addons/base_status/base_state.py:193
#, python-format
msgid "%s is now <b>pending</b>."
msgstr "%s je sad <b>Na čekanju</b>."
#. module: base_status
#: code:addons/base_status/base_state.py:187
#, python-format
msgid "%s has been <b>canceled</b>."
msgstr "%s je bio <b>otkazan</b>."
#. module: base_status
#: code:addons/base_status/base_stage.py:210
#, python-format
msgid ""
"You are already at the top level of your sales-team category.\n"
"Therefore you cannot escalate furthermore."
msgstr ""
"Već ste na najvišem nivou vaše kategorije prodajnog tima.\n"
"Zato ne možete dalje eskalirati."
#. module: base_status
#: code:addons/base_status/base_state.py:181
#, python-format
msgid "%s has been <b>closed</b>."
msgstr "%s je bio <b>zatvoren</b>."

View File

@ -0,0 +1,79 @@
# Swedish translation for openobject-addons
# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-12-21 17:05+0000\n"
"PO-Revision-Date: 2013-07-08 15:10+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Swedish <sv@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: 2013-07-09 05:16+0000\n"
"X-Generator: Launchpad (build 16696)\n"
#. module: base_status
#: code:addons/base_status/base_state.py:107
#, python-format
msgid "Error !"
msgstr "Fel !"
#. module: base_status
#: code:addons/base_status/base_state.py:166
#, python-format
msgid "%s has been <b>opened</b>."
msgstr "%s har <b>öppnats</b>."
#. module: base_status
#: code:addons/base_status/base_state.py:199
#, python-format
msgid "%s has been <b>renewed</b>."
msgstr "%s har <b>förnyats</b>."
#. module: base_status
#: code:addons/base_status/base_stage.py:210
#, python-format
msgid "Error!"
msgstr "Fel!"
#. module: base_status
#: code:addons/base_status/base_state.py:107
#, python-format
msgid ""
"You can not escalate, you are already at the top level regarding your sales-"
"team category."
msgstr ""
"Du kan inte eskalera längre, du har nått toppen för denna säljlags-kategori."
#. module: base_status
#: code:addons/base_status/base_state.py:193
#, python-format
msgid "%s is now <b>pending</b>."
msgstr "%s är nu <b>pågående</b>."
#. module: base_status
#: code:addons/base_status/base_state.py:187
#, python-format
msgid "%s has been <b>canceled</b>."
msgstr "%s har <b>avbrutits</b>."
#. module: base_status
#: code:addons/base_status/base_stage.py:210
#, python-format
msgid ""
"You are already at the top level of your sales-team category.\n"
"Therefore you cannot escalate furthermore."
msgstr ""
"Du har nått översta nivån för din säljlagskategori.\n"
"Det går därför inte att eskalera ytterligare."
#. module: base_status
#: code:addons/base_status/base_state.py:181
#, python-format
msgid "%s has been <b>closed</b>."
msgstr "%s har <b>stängts</b>."

View File

@ -116,6 +116,7 @@ Dashboard for CRM will include:
'test/crm_lead_onchange.yml',
'test/crm_lead_copy.yml',
'test/crm_lead_unlink.yml',
'test/crm_lead_find_stage.yml',
],
'css': [
'static/src/css/crm.css'

View File

@ -19,7 +19,11 @@
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_opportunity_stage_graph"/>
<field name="domain">[('state', 'not in', ('done', 'cancel')), ('type', '=', 'opportunity')]</field>
<!-- avoid done / cancelled -->
<field name="domain">['|',
'!', '&amp;', ('probability', '=', 100), ('stage_id.on_change', '=', 1),
'!', '&amp;', ('probability', '=', 0), ('stage_id.sequence', '!=', 1),
('type', '=', 'opportunity')]</field>
<field name="context">{'search_default_Stage':1}</field>
</record>
@ -43,8 +47,9 @@
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_opportunity_user_stage_graph"/>
<field name="domain">[('state','!=','cancel'),('opening_date','&gt;',context_today().strftime("%Y-%m-%d"))]</field>
<field name="context">{'search_default_Stage':1}</field>
<!-- avoid cancelled -->
<field name="domain">['!', '&amp;', ('probability', '=', 0), ('stage_id.sequence', '!=', 1)]</field>
<field name="context">{'search_default_user': 1, 'search_default_Stage': 1}</field>
</record>
<record model="ir.ui.view" id="board_crm_statistical_form">

View File

@ -26,15 +26,6 @@ from openerp import tools
from openerp.osv import fields
from openerp.osv import osv
MAX_LEVEL = 15
AVAILABLE_STATES = [
('draft', 'New'),
('cancel', 'Cancelled'),
('open', 'In Progress'),
('pending', 'Pending'),
('done', 'Closed')
]
AVAILABLE_PRIORITIES = [
('1', 'Highest'),
('2', 'High'),
@ -72,16 +63,13 @@ class crm_case_stage(osv.osv):
'probability': fields.float('Probability (%)', required=True, help="This percentage depicts the default/average probability of the Case for this stage to be a success"),
'on_change': fields.boolean('Change Probability Automatically', help="Setting this stage will change the probability automatically on the opportunity."),
'requirements': fields.text('Requirements'),
'section_ids':fields.many2many('crm.case.section', 'section_stage_rel', 'stage_id', 'section_id', string='Sections',
'section_ids': fields.many2many('crm.case.section', 'section_stage_rel', 'stage_id', 'section_id', string='Sections',
help="Link between stages and sales teams. When set, this limitate the current stage to the selected sales teams."),
'state': fields.selection(AVAILABLE_STATES, 'Related Status', required=True,
help="The status of your document will automatically change regarding the selected stage. " \
"For example, if a stage is related to the status 'Close', when your document reaches this stage, it is automatically closed."),
'case_default': fields.boolean('Default to New Sales Team',
help="If you check this field, this stage will be proposed by default on each sales team. It will not assign this stage to existing teams."),
'fold': fields.boolean('Fold by Default',
help="This stage is not visible, for example in status bar or kanban view, when there are no records in that stage to display."),
'type': fields.selection([ ('lead','Lead'),
'type': fields.selection([('lead', 'Lead'),
('opportunity', 'Opportunity'),
('both', 'Both')],
string='Type', size=16, required=True,
@ -91,7 +79,7 @@ class crm_case_stage(osv.osv):
_defaults = {
'sequence': lambda *args: 1,
'probability': lambda *args: 0.0,
'state': 'open',
'on_change': True,
'fold': False,
'type': 'both',
'case_default': True,

View File

@ -5,7 +5,7 @@
<record id="filter_draft_lead" model="ir.filters">
<field name="name">Draft Leads</field>
<field name="model_id">crm.lead</field>
<field name="domain">[('state','=','draft')]</field>
<field name="domain">[('stage_id.sequence', '=', 1)]</field>
<field name="user_id" eval="False"/>
</record>
<record id="action_email_reminder_lead" model="ir.actions.server">
@ -14,13 +14,7 @@
<field name="condition">True</field>
<field name="type">ir.actions.server</field>
<field name="state">email</field>
<field name="email">object.user_id.email</field>
<field name="subject">Reminder on Lead: [[object.id ]] [[object.partner_id and 'of ' +object.partner_id.name or '']]</field>
<field name="message">Warning unprocessed incoming lead is more than 5 day old.
Name: [[object.name ]]
ID: [[object.id ]]
Description: [[object.description]]
</field>
<field name="template_id" ref="email_template_opportunity_reminder_mail"/>
</record>
<record id="rule_set_reminder_lead" model="base.action.rule">
<field name="name">Set Auto Reminder on leads which are not open since 5 days.</field>

View File

@ -19,18 +19,16 @@
#
##############################################################################
from openerp.addons.base_status.base_stage import base_stage
import crm
from datetime import datetime
from operator import itemgetter
from openerp.osv import fields, osv, orm
import time
from openerp import SUPERUSER_ID
from openerp import tools
from openerp.tools.translate import _
from openerp.tools import html2plaintext
from openerp.addons.base.res.res_partner import format_address
from openerp.osv import fields, osv, orm
from openerp.tools import html2plaintext
from openerp.tools.translate import _
CRM_LEAD_FIELDS_TO_MERGE = ['name',
'partner_id',
@ -62,13 +60,9 @@ CRM_LEAD_FIELDS_TO_MERGE = ['name',
'email_from',
'email_cc',
'partner_name']
CRM_LEAD_PENDING_STATES = (
crm.AVAILABLE_STATES[2][0], # Cancelled
crm.AVAILABLE_STATES[3][0], # Done
crm.AVAILABLE_STATES[4][0], # Pending
)
class crm_lead(base_stage, format_address, osv.osv):
class crm_lead(format_address, osv.osv):
""" CRM Lead Case """
_name = "crm.lead"
_description = "Lead/Opportunity"
@ -76,13 +70,11 @@ class crm_lead(base_stage, format_address, osv.osv):
_inherit = ['mail.thread', 'ir.needaction_mixin']
_track = {
'state': {
'crm.mt_lead_create': lambda self, cr, uid, obj, ctx=None: obj.state in ['new', 'draft'],
'crm.mt_lead_won': lambda self, cr, uid, obj, ctx=None: obj.state == 'done',
'crm.mt_lead_lost': lambda self, cr, uid, obj, ctx=None: obj.state == 'cancel',
},
'stage_id': {
'crm.mt_lead_stage': lambda self, cr, uid, obj, ctx=None: obj.state not in ['new', 'draft', 'cancel', 'done'],
'crm.mt_lead_create': lambda self, cr, uid, obj, ctx=None: obj.probability == 0 and obj.stage_id and obj.stage_id.sequence == 1,
'crm.mt_lead_stage': lambda self, cr, uid, obj, ctx=None: (obj.stage_id and obj.stage_id.sequence != 1) and obj.probability < 100,
'crm.mt_lead_won': lambda self, cr, uid, obj, ctx=None: obj.probability == 100 and obj.stage_id and obj.stage_id.on_change,
'crm.mt_lead_lost': lambda self, cr, uid, obj, ctx=None: obj.probability == 0 and obj.stage_id and obj.stage_id.sequence != 1,
},
}
@ -93,20 +85,6 @@ class crm_lead(base_stage, format_address, osv.osv):
context['empty_list_help_document_name'] = _("leads")
return super(crm_lead, self).get_empty_list_help(cr, uid, help, context=context)
def create(self, cr, uid, vals, context=None):
if context is None:
context = {}
if not vals.get('stage_id'):
ctx = context.copy()
if vals.get('section_id'):
ctx['default_section_id'] = vals['section_id']
if vals.get('type'):
ctx['default_type'] = vals['type']
vals['stage_id'] = self._get_default_stage_id(cr, uid, context=ctx)
# context: no_log, because subtype already handle this
create_context = dict(context, mail_create_nolog=True)
return super(crm_lead, self).create(cr, uid, vals, context=create_context)
def _get_default_section_id(self, cr, uid, context=None):
""" Gives default section by checking if present in the context """
return self._resolve_section_id_from_context(cr, uid, context=context) or False
@ -114,7 +92,7 @@ class crm_lead(base_stage, format_address, osv.osv):
def _get_default_stage_id(self, cr, uid, context=None):
""" Gives default stage_id """
section_id = self._get_default_section_id(cr, uid, context=context)
return self.stage_find(cr, uid, [], section_id, [('state', '=', 'draft')], context=context)
return self.stage_find(cr, uid, [], section_id, [('sequence', '=', '1')], context=context)
def _resolve_section_id_from_context(self, cr, uid, context=None):
""" Returns ID of section based on the value of 'section_id'
@ -126,8 +104,7 @@ class crm_lead(base_stage, format_address, osv.osv):
if type(context.get('default_section_id')) in (int, long):
return context.get('default_section_id')
if isinstance(context.get('default_section_id'), basestring):
section_name = context['default_section_id']
section_ids = self.pool.get('crm.case.section').name_search(cr, uid, name=section_name, context=context)
section_ids = self.pool.get('crm.case.section').name_search(cr, uid, name=context['default_section_id'], context=context)
if len(section_ids) == 1:
return int(section_ids[0][0])
return None
@ -166,7 +143,7 @@ class crm_lead(base_stage, format_address, osv.osv):
stage_ids = stage_obj._search(cr, uid, search_domain, order=order, access_rights_uid=access_rights_uid, context=context)
result = stage_obj.name_get(cr, access_rights_uid, stage_ids, context=context)
# restore order of the search
result.sort(lambda x,y: cmp(stage_ids.index(x[0]), stage_ids.index(y[0])))
result.sort(lambda x, y: cmp(stage_ids.index(x[0]), stage_ids.index(y[0])))
fold = {}
for stage in stage_obj.browse(cr, access_rights_uid, stage_ids, context=context):
@ -174,7 +151,7 @@ class crm_lead(base_stage, format_address, osv.osv):
return result, fold
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
res = super(crm_lead,self).fields_view_get(cr, user, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
res = super(crm_lead, self).fields_view_get(cr, user, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
if view_type == 'form':
res['arch'] = self.fields_view_get_address(cr, user, res['arch'], context=context)
return res
@ -236,17 +213,6 @@ class crm_lead(base_stage, format_address, osv.osv):
res[lead.id][field] = abs(int(duration))
return res
def _history_search(self, cr, uid, obj, name, args, context=None):
res = []
msg_obj = self.pool.get('mail.message')
message_ids = msg_obj.search(cr, uid, [('email_from','!=',False), ('subject', args[0][1], args[0][2])], context=context)
lead_ids = self.search(cr, uid, [('message_ids', 'in', message_ids)], context=context)
if lead_ids:
return [('id', 'in', lead_ids)]
else:
return [('id', '=', '0')]
_columns = {
'partner_id': fields.many2one('res.partner', 'Partner', ondelete='set null', track_visibility='onchange',
select=True, help="Linked partner (optional). Usually created when converting the lead."),
@ -259,10 +225,10 @@ class crm_lead(base_stage, format_address, osv.osv):
'email_from': fields.char('Email', size=128, help="Email address of the contact", select=1),
'section_id': fields.many2one('crm.case.section', 'Sales Team',
select=True, track_visibility='onchange', help='When sending mails, the default email address is taken from the sales team.'),
'create_date': fields.datetime('Creation Date' , readonly=True),
'email_cc': fields.text('Global CC', size=252 , help="These email addresses will be added to the CC field of all inbound and outbound emails for this record before being sent. Separate multiple email addresses with a comma"),
'create_date': fields.datetime('Creation Date', readonly=True),
'email_cc': fields.text('Global CC', help="These email addresses will be added to the CC field of all inbound and outbound emails for this record before being sent. Separate multiple email addresses with a comma"),
'description': fields.text('Notes'),
'write_date': fields.datetime('Update Date' , readonly=True),
'write_date': fields.datetime('Update Date', readonly=True),
'categ_ids': fields.many2many('crm.case.categ', 'crm_lead_category_rel', 'lead_id', 'category_id', 'Categories', \
domain="['|',('section_id','=',section_id),('section_id','=',False), ('object_id.model', '=', 'crm.lead')]"),
'type_id': fields.many2one('crm.case.resource.type', 'Campaign', \
@ -280,17 +246,15 @@ class crm_lead(base_stage, format_address, osv.osv):
domain="['&', ('section_ids', '=', section_id), '|', ('type', '=', type), ('type', '=', 'both')]"),
'user_id': fields.many2one('res.users', 'Salesperson', select=True, track_visibility='onchange'),
'referred': fields.char('Referred By', size=64),
'date_open': fields.datetime('Opened', readonly=True),
'date_open': fields.datetime('Assigned', readonly=True),
'day_open': fields.function(_compute_day, string='Days to Open', \
multi='day_open', type="float", store=True),
'day_close': fields.function(_compute_day, string='Days to Close', \
multi='day_close', type="float", store=True),
'state': fields.related('stage_id', 'state', type="selection", store=True,
selection=crm.AVAILABLE_STATES, string="Status", readonly=True,
help='The Status is set to \'Draft\', when a case is created. If the case is in progress the Status is set to \'Open\'. When the case is over, the Status is set to \'Done\'. If the case needs to be reviewed then the Status is set to \'Pending\'.'),
'date_last_stage_update': fields.datetime('Last Stage Update', select=True),
# Only used for type opportunity
'probability': fields.float('Success Rate (%)',group_operator="avg"),
'probability': fields.float('Success Rate (%)', group_operator="avg"),
'planned_revenue': fields.float('Expected Revenue', track_visibility='always'),
'ref': fields.reference('Reference', selection=crm._links_get, size=128),
'ref2': fields.reference('Reference 2', selection=crm._links_get, size=128),
@ -326,13 +290,13 @@ class crm_lead(base_stage, format_address, osv.osv):
_defaults = {
'active': 1,
'type': 'lead',
'user_id': lambda s, cr, uid, c: s._get_default_user(cr, uid, c),
'email_from': lambda s, cr, uid, c: s._get_default_email(cr, uid, c),
'user_id': lambda s, cr, uid, c: uid,
'stage_id': lambda s, cr, uid, c: s._get_default_stage_id(cr, uid, c),
'section_id': lambda s, cr, uid, c: s._get_default_section_id(cr, uid, c),
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.lead', context=c),
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
'color': 0,
'date_last_stage_update': fields.datetime.now(),
}
_sql_constraints = [
@ -341,30 +305,29 @@ class crm_lead(base_stage, format_address, osv.osv):
def onchange_stage_id(self, cr, uid, ids, stage_id, context=None):
if not stage_id:
return {'value':{}}
stage = self.pool.get('crm.case.stage').browse(cr, uid, stage_id, context)
return {'value': {}}
stage = self.pool.get('crm.case.stage').browse(cr, uid, stage_id, context=context)
if not stage.on_change:
return {'value':{}}
return {'value':{'probability': stage.probability}}
return {'value': {}}
return {'value': {'probability': stage.probability}}
def on_change_partner(self, cr, uid, ids, partner_id, context=None):
result = {}
def on_change_partner_id(self, cr, uid, ids, partner_id, context=None):
values = {}
if partner_id:
partner = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
values = {
'partner_name' : partner.name,
'street' : partner.street,
'street2' : partner.street2,
'city' : partner.city,
'state_id' : partner.state_id and partner.state_id.id or False,
'country_id' : partner.country_id and partner.country_id.id or False,
'email_from' : partner.email,
'phone' : partner.phone,
'mobile' : partner.mobile,
'fax' : partner.fax,
'partner_name': partner.name,
'street': partner.street,
'street2': partner.street2,
'city': partner.city,
'state_id': partner.state_id and partner.state_id.id or False,
'country_id': partner.country_id and partner.country_id.id or False,
'email_from': partner.email,
'phone': partner.phone,
'mobile': partner.mobile,
'fax': partner.fax,
}
return {'value' : values}
return {'value': values}
def on_change_user(self, cr, uid, ids, user_id, context=None):
""" When changing the user, also set a section_id or restrict section id
@ -376,22 +339,6 @@ class crm_lead(base_stage, format_address, osv.osv):
section_id = section_ids[0]
return {'value': {'section_id': section_id}}
def _check(self, cr, uid, ids=False, context=None):
""" Override of the base.stage method.
Function called by the scheduler to process cases for date actions
Only works on not done and cancelled cases
"""
cr.execute('select * from crm_case \
where (date_action_last<%s or date_action_last is null) \
and (date_action_next<=%s or date_action_next is null) \
and state not in (\'cancel\',\'done\')',
(time.strftime("%Y-%m-%d %H:%M:%S"),
time.strftime('%Y-%m-%d %H:%M:%S')))
ids2 = map(lambda x: x[0], cr.fetchall() or [])
cases = self.browse(cr, uid, ids2, context=context)
return self._action(cr, uid, cases, False, context=context)
def stage_find(self, cr, uid, cases, section_id, domain=None, order='sequence', context=None):
""" Override of the base.stage method
Parameter of the stage search taken from the lead:
@ -403,16 +350,16 @@ class crm_lead(base_stage, format_address, osv.osv):
if isinstance(cases, (int, long)):
cases = self.browse(cr, uid, cases, context=context)
# collect all section_ids
section_ids = []
section_ids = set()
types = ['both']
if not cases :
type = context.get('default_type')
types += [type]
if not cases:
ctx_type = context.get('default_type')
types += [ctx_type]
if section_id:
section_ids.append(section_id)
section_ids.add(section_id)
for lead in cases:
if lead.section_id:
section_ids.append(lead.section_id.id)
section_ids.add(lead.section_id.id)
if lead.type not in types:
types.append(lead.type)
# OR all section_ids and OR with case_default
@ -421,8 +368,7 @@ class crm_lead(base_stage, format_address, osv.osv):
search_domain += [('|')] * len(section_ids)
for section_id in section_ids:
search_domain.append(('section_ids', '=', section_id))
else:
search_domain.append(('case_default', '=', True))
search_domain.append(('case_default', '=', True))
# AND with cases types
search_domain.append(('type', 'in', types))
# AND with the domain in parameter
@ -433,48 +379,58 @@ class crm_lead(base_stage, format_address, osv.osv):
return stage_ids[0]
return False
def case_cancel(self, cr, uid, ids, context=None):
""" Overrides case_cancel from base_stage to set probability """
res = super(crm_lead, self).case_cancel(cr, uid, ids, context=context)
self.write(cr, uid, ids, {'probability' : 0.0}, context=context)
return res
def case_reset(self, cr, uid, ids, context=None):
""" Overrides case_reset from base_stage to set probability """
res = super(crm_lead, self).case_reset(cr, uid, ids, context=context)
self.write(cr, uid, ids, {'probability': 0.0}, context=context)
return res
def case_mark_lost(self, cr, uid, ids, context=None):
""" Mark the case as lost: state=cancel and probability=0 """
for lead in self.browse(cr, uid, ids):
stage_id = self.stage_find(cr, uid, [lead], lead.section_id.id or False, [('probability', '=', 0.0),('on_change','=',True)], context=context)
stage_id = self.stage_find(cr, uid, [lead], lead.section_id.id or False, [('probability', '=', 0.0), ('on_change', '=', True), ('sequence', '>', 1)], context=context)
if stage_id:
self.case_set(cr, uid, [lead.id], values_to_update={'probability': 0.0}, new_stage_id=stage_id, context=context)
return True
return self.write(cr, uid, [lead.id], {'stage_id': stage_id}, context=context)
else:
raise osv.except_osv(_('Warning!'),
_('To relieve your sales pipe and group all Lost opportunities, configure one of your sales stage as follow:\n'
'probability = 0 %, select "Change Probability Automatically".\n'
'Create a specific stage or edit an existing one by editing columns of your opportunity pipe.'))
def case_mark_won(self, cr, uid, ids, context=None):
""" Mark the case as won: state=done and probability=100 """
for lead in self.browse(cr, uid, ids):
stage_id = self.stage_find(cr, uid, [lead], lead.section_id.id or False, [('probability', '=', 100.0),('on_change','=',True)], context=context)
stage_id = self.stage_find(cr, uid, [lead], lead.section_id.id or False, [('probability', '=', 100.0), ('on_change', '=', True), ('sequence', '>', 1)], context=context)
if stage_id:
self.case_set(cr, uid, [lead.id], values_to_update={'probability': 100.0}, new_stage_id=stage_id, context=context)
return self.write(cr, uid, [lead.id], {'stage_id': stage_id}, context=context)
else:
raise osv.except_osv(_('Warning!'),
_('To relieve your sales pipe and group all Won opportunities, configure one of your sales stage as follow:\n'
'probability = 100 % and select "Change Probability Automatically".\n'
'Create a specific stage or edit an existing one by editing columns of your opportunity pipe.'))
def case_escalate(self, cr, uid, ids, context=None):
""" Escalates case to parent level """
for case in self.browse(cr, uid, ids, context=context):
data = {'active': True}
if case.section_id.parent_id:
data['section_id'] = case.section_id.parent_id.id
if case.section_id.parent_id.change_responsible:
if case.section_id.parent_id.user_id:
data['user_id'] = case.section_id.parent_id.user_id.id
else:
raise osv.except_osv(_('Error!'), _("You are already at the top level of your sales-team category.\nTherefore you cannot escalate furthermore."))
self.write(cr, uid, [case.id], data, context=context)
return True
def set_priority(self, cr, uid, ids, priority):
def set_priority(self, cr, uid, ids, priority, context=None):
""" Set lead priority
"""
return self.write(cr, uid, ids, {'priority' : priority})
return self.write(cr, uid, ids, {'priority': priority}, context=context)
def set_high_priority(self, cr, uid, ids, context=None):
""" Set lead priority to high
"""
return self.set_priority(cr, uid, ids, '1')
return self.set_priority(cr, uid, ids, '1', context=context)
def set_normal_priority(self, cr, uid, ids, context=None):
""" Set lead priority to normal
"""
return self.set_priority(cr, uid, ids, '3')
return self.set_priority(cr, uid, ids, '3', context=context)
def _merge_get_result_type(self, cr, uid, opps, context=None):
"""
@ -631,7 +587,7 @@ class crm_lead(base_stage, format_address, osv.osv):
attachment.write(values)
return True
def merge_opportunity(self, cr, uid, ids, context=None):
def merge_opportunity(self, cr, uid, ids, user_id=False, section_id=False, context=None):
"""
Different cases of merge:
- merge leads together = 1 new lead
@ -650,7 +606,8 @@ class crm_lead(base_stage, format_address, osv.osv):
sequenced_opps = []
for opportunity in opportunities:
sequence = -1
if opportunity.stage_id and opportunity.stage_id.state != 'cancel':
# TDE: was "if opportunity.stage_id and opportunity.stage_id.state != 'cancel':"
if opportunity.probability == 0 and opportunity.stage_id and opportunity.stage_id.sequence != 1 and opportunity.stage_id.fold:
sequence = opportunity.stage_id.sequence
sequenced_opps.append(((int(sequence != -1 and opportunity.type == 'opportunity'), sequence, -opportunity.id), opportunity))
@ -665,6 +622,11 @@ class crm_lead(base_stage, format_address, osv.osv):
fields = list(CRM_LEAD_FIELDS_TO_MERGE)
merged_data = self._merge_data(cr, uid, ids, highest, fields, context=context)
if user_id:
merged_data['user_id'] = user_id
if section_id:
merged_data['section_id'] = section_id
# Merge messages and attachements into the first opportunity
self._merge_opportunity_history(cr, uid, highest.id, tail_opportunities, context=context)
self._merge_opportunity_attachments(cr, uid, highest.id, tail_opportunities, context=context)
@ -706,7 +668,7 @@ class crm_lead(base_stage, format_address, osv.osv):
'phone': customer and customer.phone or lead.phone,
}
if not lead.stage_id or lead.stage_id.type=='lead':
val['stage_id'] = self.stage_find(cr, uid, [lead], section_id, [('state', '=', 'draft'),('type', 'in', ('opportunity','both'))], context=context)
val['stage_id'] = self.stage_find(cr, uid, [lead], section_id, [('sequence', '=', '1'), ('type', 'in', ('opportunity','both'))], context=context)
return val
def convert_opportunity(self, cr, uid, ids, partner_id, user_ids=False, section_id=False, context=None):
@ -715,7 +677,8 @@ class crm_lead(base_stage, format_address, osv.osv):
partner = self.pool.get('res.partner')
customer = partner.browse(cr, uid, partner_id, context=context)
for lead in self.browse(cr, uid, ids, context=context):
if lead.state in ('done', 'cancel'):
# TDE: was if lead.state in ('done', 'cancel'):
if (lead.probability == '100') or (lead.probability == '0' and lead.stage_id.sequence != '1'):
continue
vals = self._convert_opportunity_data(cr, uid, lead, customer, section_id, context=context)
self.write(cr, uid, [lead.id], vals, context=context)
@ -932,49 +895,27 @@ class crm_lead(base_stage, format_address, osv.osv):
}
return res
def write(self, cr, uid, ids, vals, context=None):
if vals.get('stage_id') and not vals.get('probability'):
# change probability of lead(s) if required by stage
stage = self.pool.get('crm.case.stage').browse(cr, uid, vals['stage_id'], context=context)
if stage.on_change:
vals['probability'] = stage.probability
return super(crm_lead, self).write(cr, uid, ids, vals, context=context)
def new_mail_send(self, cr, uid, ids, context=None):
'''
This function opens a window to compose an email, with the edi sale template message loaded by default
'''
assert len(ids) == 1, 'This option should only be used for a single id at a time.'
ir_model_data = self.pool.get('ir.model.data')
try:
template_id = ir_model_data.get_object_reference(cr, uid, 'crm', 'email_template_opportunity_mail')[1]
except ValueError:
template_id = False
try:
compose_form_id = ir_model_data.get_object_reference(cr, uid, 'mail', 'email_compose_message_wizard_form')[1]
except ValueError:
compose_form_id = False
def create(self, cr, uid, vals, context=None):
if context is None:
context = {}
ctx = context.copy()
ctx.update({
'default_model': 'crm.lead',
'default_res_id': ids[0],
'default_use_template': bool(template_id),
'default_template_id': template_id,
'default_composition_mode': 'comment',
})
return {
'name': _('Compose Email'),
'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'mail.compose.message',
'views': [(compose_form_id, 'form')],
'view_id': compose_form_id,
'target': 'new',
'context': ctx,
}
if vals.get('type') and not context.get('default_type'):
context['default_type'] = vals.get('type')
if vals.get('section_id') and not context.get('default_section_id'):
context['default_section_id'] = vals.get('section_id')
# context: no_log, because subtype already handle this
create_context = dict(context, mail_create_nolog=True)
return super(crm_lead, self).create(cr, uid, vals, context=create_context)
def write(self, cr, uid, ids, vals, context=None):
# stage change: update date_last_stage_update
if 'stage_id' in vals:
vals['date_last_stage_update'] = fields.datetime.now()
# stage change with new stage: update probability
if vals.get('stage_id') and not vals.get('probability'):
onchange_stage_values = self.onchange_stage_id(cr, uid, ids, vals.get('stage_id'), context=context)['value']
vals.update(onchange_stage_values)
return super(crm_lead, self).write(cr, uid, ids, vals, context=context)
# ----------------------------------------
# Mail Gateway
@ -1024,7 +965,7 @@ class crm_lead(base_stage, format_address, osv.osv):
'user_id': False,
}
if msg.get('author_id'):
defaults.update(self.on_change_partner(cr, uid, None, msg.get('author_id'), context=context)['value'])
defaults.update(self.on_change_partner_id(cr, uid, None, msg.get('author_id'), context=context)['value'])
if msg.get('priority') in dict(crm.AVAILABLE_PRIORITIES):
defaults['priority'] = msg.get('priority')
defaults.update(custom_values)

View File

@ -5,71 +5,57 @@
<!-- Crm stages -->
<record model="crm.case.stage" id="stage_lead1">
<field name="name">New</field>
<field eval="1" name="case_default"/>
<field name="state">draft</field>
<field eval="0" name="probability"/>
<field eval="10" name="sequence"/>
<field name="case_default">1</field>
<field name="probability">0</field>
<field name="on_change">1</field>
<field name="sequence">1</field>
<field name="type">both</field>
</record>
<record model="crm.case.stage" id="stage_lead2">
<field name="name">Opportunity</field>
<field eval="1" name="case_default"/>
<field name="state">open</field>
<field eval="20" name="probability"/>
<field eval="20" name="sequence"/>
<field name="type">lead</field>
</record>
<record model="crm.case.stage" id="stage_lead7">
<field name="name">Dead</field>
<field eval="1" name="case_default"/>
<field eval="False" name="fold"/>
<field name="state">cancel</field>
<field eval="0" name="probability"/>
<field eval="30" name="sequence"/>
<field name="case_default">1</field>
<field name="probability">0</field>
<field name="on_change">1</field>
<field name="sequence">30</field>
<field name="type">lead</field>
</record>
<record model="crm.case.stage" id="stage_lead3">
<field name="name">Qualification</field>
<field eval="1" name="case_default"/>
<field name="state">open</field>
<field eval="20" name="probability"/>
<field eval="100" name="sequence"/>
<field name="case_default">1</field>
<field name="probability">20</field>
<field name="on_change">1</field>
<field name="sequence">40</field>
<field name="type">opportunity</field>
</record>
<record model="crm.case.stage" id="stage_lead4">
<field name="name">Proposition</field>
<field eval="1" name="case_default"/>
<field name="state">open</field>
<field eval="40" name="probability"/>
<field eval="110" name="sequence"/>
<field name="case_default">1</field>
<field name="probability">40</field>
<field name="sequence">50</field>
<field name="type">opportunity</field>
</record>
<record model="crm.case.stage" id="stage_lead5">
<field name="name">Negotiation</field>
<field eval="1" name="case_default"/>
<field name="state">open</field>
<field eval="60" name="probability"/>
<field eval="120" name="sequence"/>
<field name="case_default">1</field>
<field name="probability">60</field>
<field name="sequence">60</field>
<field name="type">opportunity</field>
</record>
<record model="crm.case.stage" id="stage_lead6">
<field name="name">Won</field>
<field eval="True" name="fold"/>
<field eval="1" name="case_default"/>
<field name="state">done</field>
<field eval="100" name="probability"/>
<field eval="130" name="sequence"/>
<field eval="1" name="on_change"/>
<field name="case_default">1</field>
<field name="probability">100</field>
<field name="on_change">1</field>
<field name="sequence">70</field>
<field name="type">opportunity</field>
</record>
<record model="crm.case.stage" id="stage_lead8">
<record model="crm.case.stage" id="stage_lead7">
<field name="name">Lost</field>
<field eval="1" name="case_default"/>
<field eval="True" name="fold"/>
<field eval="1" name="on_change"/>
<field name="state">cancel</field>
<field eval="0" name="probability"/>
<field eval="140" name="sequence"/>
<field name="case_default">1</field>
<field name="fold">1</field>
<field name="probability">0</field>
<field name="on_change">1</field>
<field name="sequence">80</field>
<field name="type">opportunity</field>
</record>
@ -77,7 +63,7 @@
<field name="stage_ids" eval="[ (4, ref('stage_lead1')), (4, ref('stage_lead2')),
(4, ref('stage_lead3')), (4, ref('stage_lead4')),
(4, ref('stage_lead5')), (4, ref('stage_lead6')),
(4, ref('stage_lead7')), (4, ref('stage_lead8'))]"/>
(4, ref('stage_lead7'))]"/>
</record>
<!-- Crm campain -->
@ -161,7 +147,7 @@
<field name="name">Lead Created</field>
<field name="res_model">crm.lead</field>
<field name="default" eval="False"/>
<field name="description">Opportunity created</field>
<field name="description">Lead created</field>
</record>
<record id="mt_lead_stage" model="mail.message.subtype">
<field name="name">Stage Changed</field>
@ -220,6 +206,20 @@
<field name="email_to">${not object.partner_id and object.email_from}</field>
<field name="body_html"></field>
</record>
<record id="email_template_opportunity_reminder_mail" model="email.template">
<field name="name">Reminder to User</field>
<field name="model_id" ref="crm.model_crm_lead"/>
<field name="auto_delete" eval="True"/>
<field name="email_from">admin@example.com</field>
<field name="email_to">${object.user_id != False and object.user_id.email}</field>
<field name="subject">Reminder on Lead: ${object.id} from ${object.partner_id != False and object.partner_id.name or object.contact_name}</field>
<field name="body_html"><![CDATA[<p>This opportunity did not have any activity since at least 5 days. Here are some details:</p>
<ul>
<li>Name: ${object.name}</li>
<li>ID: ${object.id}</li>
<li>Description: ${object.description}</field></li>
</ul>]]></field>
</record>
</data>
</openerp>

View File

@ -6,9 +6,9 @@
<record id="crm_case_1" model="crm.lead">
<field name="type">lead</field>
<field name="name">Plan to Attend a Training</field>
<field name="contact_name">Jason Dunagan</field>
<field name="contact_name">Jacques Dunagan</field>
<field name="partner_name">Le Club SARL</field>
<field name="email_from">jason@leclub.fr</field>
<field name="email_from">jdunagan@leclub.fr</field>
<field name="partner_id" ref=""/>
<field name="function">Training Manager</field>
<field name="street">73, rue Léon Dierx</field>
@ -20,14 +20,25 @@
<field name="categ_ids" eval="[(6, 0, [categ_oppor6])]"/>
<field name="channel_id" ref="crm_case_channel_email"/>
<field name="priority">1</field>
<field name="section_id" ref="crm_case_section_2"/>
<field name="section_id" ref="section_sales_department"/>
<field name="user_id" ref="base.user_root"/>
<field name="stage_id" ref="stage_lead1"/>
<field name="description">Hello,
I am Jason from Le Club SARL.
I am intertested to attend a training organized in your company.
Can you send me the details ?</field>
<field eval="1" name="active"/>
I am Jacques from Le Club SARL.
I am interested to attend a training organized in your company.
Could you please send me the details ?</field>
</record>
<record id="crm_case_1" model="crm.lead">
<field name="create_date" eval="(DateTime.today() - relativedelta(months=2)).strftime('%Y-%m-%d %H:%M')"/>
</record>
<record id="msg_case1_1" model="mail.message">
<field name="subject">Inquiry</field>
<field name="model">crm.lead</field>
<field name="res_id" ref="crm_case_1"/>
<field name="body"><![CDATA[<p>Hello,<br />
I am Jacques from Le Club SARL. I am interested to attend a training organized in your company.<br />
Can you send me the details ?</p>]]></field>
<field name="type">email</field>
</record>
<record id="crm_case_2" model="crm.lead">
@ -44,10 +55,20 @@ Can you send me the details ?</field>
<field name="categ_ids" eval="[(6, 0, [categ_oppor2])]"/>
<field name="channel_id" ref="crm_case_channel_website"/>
<field name="priority">4</field>
<field name="section_id" ref="crm_case_section_2"/>
<field name="section_id" ref="section_sales_department"/>
<field name="user_id" ref="base.user_root"/>
<field name="stage_id" ref="stage_lead1"/>
<field eval="1" name="active"/>
</record>
<record id="crm_case_2" model="crm.lead">
<field name="create_date" eval="(DateTime.today() - relativedelta(months=1)).strftime('%Y-%m-%d %H:%M')"/>
</record>
<record id="msg_case2_1" model="mail.message">
<field name="subject">Need Details</field>
<field name="model">crm.lead</field>
<field name="author_id" ref="base.partner_demo"/>
<field name="res_id" ref="crm_case_2"/>
<field name="body">Want to know features and benefits to use the new software.</field>
<field name="type">comment</field>
</record>
<record id="crm_case_3" model="crm.lead">
@ -65,8 +86,10 @@ Can you send me the details ?</field>
<field name="priority">2</field>
<field name="section_id" ref="crm_case_section_1"/>
<field name="user_id" ref="base.user_demo"/>
<field name="stage_id" ref="stage_lead2"/>
<field eval="1" name="active"/>
<field name="stage_id" ref="stage_lead1"/>
</record>
<record id="crm_case_2" model="crm.lead">
<field name="create_date" eval="(DateTime.today() - relativedelta(months=1)).strftime('%Y-%m-%d %H:%M')"/>
</record>
<record id="crm_case_4" model="crm.lead">
@ -82,10 +105,12 @@ Can you send me the details ?</field>
<field name="categ_ids" eval="[(6, 0, [categ_oppor5])]"/>
<field name="channel_id" ref=""/>
<field name="priority">3</field>
<field name="section_id" ref="crm_case_section_1"/>
<field name="user_id" ref=""/>
<field name="stage_id" ref="stage_lead7"/>
<field eval="1" name="active"/>
<field name="section_id" ref="crm_case_section_2"/>
<field name="user_id" ref="base.user_demo"/>
<field name="stage_id" ref="stage_lead6"/>
</record>
<record id="crm_case_2" model="crm.lead">
<field name="create_date" eval="(DateTime.today() - relativedelta(months=1)).strftime('%Y-%m-%d %H:%M')"/>
</record>
<record id="crm_case_5" model="crm.lead">
@ -105,8 +130,8 @@ Can you send me the details ?</field>
<field name="categ_ids" eval="[(6, 0, [categ_oppor1])]"/>
<field name="channel_id" ref="crm_case_channel_website"/>
<field name="priority">3</field>
<field name="section_id" ref="section_sales_department"/>
<field name="user_id" ref="base.user_root"/>
<field name="section_id" ref="crm_case_section_1"/>
<field name="user_id" ref=""/>
<field name="stage_id" ref="stage_lead1"/>
<field name="description">Hi,
Can you send me a quotation for 20 computers with speakers?
@ -116,7 +141,6 @@ Purchase Manager
Stonage IT,
Franklinville
Contact: +1 813 494 5005</field>
<field eval="1" name="active"/>
</record>
<record id="crm_case_6" model="crm.lead">
@ -134,9 +158,8 @@ Contact: +1 813 494 5005</field>
<field name="channel_id" ref=""/>
<field name="priority">3</field>
<field name="section_id" ref="crm_case_section_2"/>
<field name="user_id" ref="base.user_root"/>
<field name="user_id" ref=""/>
<field name="stage_id" ref="stage_lead1"/>
<field eval="1" name="active"/>
</record>
<record id="crm_case_7" model="crm.lead">
@ -153,9 +176,8 @@ Contact: +1 813 494 5005</field>
<field name="channel_id" ref=""/>
<field name="priority">5</field>
<field name="section_id" ref="crm_case_section_2"/>
<field name="user_id" ref="base.user_demo"/>
<field name="stage_id" ref="stage_lead7"/>
<field eval="1" name="active"/>
<field name="user_id" ref="base.user_root"/>
<field name="stage_id" ref="stage_lead1"/>
</record>
<record id="crm_case_8" model="crm.lead">
@ -173,9 +195,8 @@ Contact: +1 813 494 5005</field>
<field name="channel_id" ref=""/>
<field name="priority">4</field>
<field name="section_id" ref="section_sales_department"/>
<field name="user_id" ref="base.user_demo"/>
<field name="stage_id" ref="stage_lead7"/>
<field eval="1" name="active"/>
<field name="user_id" ref="base.user_root"/>
<field name="stage_id" ref="stage_lead1"/>
</record>
<record id="crm_case_9" model="crm.lead">
@ -193,12 +214,8 @@ Contact: +1 813 494 5005</field>
<field name="channel_id" ref="crm_case_channel_phone"/>
<field name="priority">2</field>
<field name="section_id" ref="section_sales_department"/>
<field name="user_id" ref="base.user_root"/>
<field name="user_id" ref="base.user_demo"/>
<field name="stage_id" ref="stage_lead1"/>
<field eval="1" name="active"/>
</record>
<record id="crm_case_9" model="crm.lead">
<field name="create_date" eval="(DateTime.today() - relativedelta(months=1)).strftime('%Y-%m-%d %H:%M')"/>
</record>
<record id="crm_case_10" model="crm.lead">
@ -215,14 +232,13 @@ Contact: +1 813 494 5005</field>
<field name="channel_id" ref="crm_case_channel_email"/>
<field name="priority">2</field>
<field name="section_id" ref="crm_case_section_2"/>
<field name="user_id" ref=""/>
<field name="user_id" ref="base.user_demo"/>
<field name="stage_id" ref="stage_lead1"/>
<field name="description">Hi,
I would like to know more about specification and cost of laptops of your company.
Thanks,
Andrew</field>
<field eval="1" name="active"/>
</record>
<record id="crm_case_11" model="crm.lead">
@ -239,9 +255,8 @@ Andrew</field>
<field name="channel_id" ref="crm_case_channel_direct"/>
<field name="priority">3</field>
<field name="section_id" ref="crm_case_section_1"/>
<field name="user_id" ref="base.user_demo"/>
<field name="user_id" ref=""/>
<field name="stage_id" ref="stage_lead1"/>
<field eval="1" name="active"/>
</record>
<record id="crm_case_12" model="crm.lead">
@ -258,22 +273,23 @@ Andrew</field>
<field name="channel_id" ref="crm_case_channel_website"/>
<field name="priority">2</field>
<field name="section_id" ref="section_sales_department"/>
<field name="user_id" ref="base.user_demo"/>
<field name="stage_id" ref="stage_lead2"/>
<field eval="1" name="active"/>
<field name="user_id" ref=""/>
<field name="stage_id" ref="stage_lead1"/>
</record>
<!-- Call Function to Cancel the leads (set as Dead) -->
<function model="crm.lead" name="case_cancel"
eval="[ ref('crm_case_12'), ref('crm_case_7'),
ref('crm_case_3'), ref('crm_case_8')],
{'install_mode': True}"
<function model="crm.lead" name="write"
eval="[ ref('crm_case_7'), ref('crm_case_8'),
ref('crm_case_9'), ref('crm_case_10'),
ref('crm_case_11'), ref('crm_case_12')],
{'stage_id': ref('stage_lead2')},
{'install_mode': True}"
/>
<!-- Call Function to set the leads as Unread -->
<function model="crm.lead" name="message_mark_as_unread"
eval="[ ref('crm_case_1'), ref('crm_case_2'),
ref('crm_case_5'), ref('crm_case_11')], {}"
ref('crm_case_5'), ref('crm_case_6')], {}"
/>
<!-- Demo Opportunities -->
@ -296,8 +312,7 @@ Andrew</field>
<field name="title_action">Meeting for pricing information.</field>
<field name="section_id" ref="section_sales_department"/>
<field name="user_id" ref="base.user_root"/>
<field name="stage_id" ref="crm.stage_lead3"/>
<field eval="1" name="active"/>
<field name="stage_id" ref="crm.stage_lead1"/>
</record>
<record id="crm_case_14" model="crm.lead">
@ -323,7 +338,6 @@ Andrew</field>
<field name="section_id" ref="section_sales_department"/>
<field name="user_id" ref="base.user_demo"/>
<field name="stage_id" ref="crm.stage_lead3"/>
<field eval="1" name="active"/>
</record>
<record id="crm_case_15" model="crm.lead">
@ -344,10 +358,12 @@ Andrew</field>
<field name="title_action">Call to ask system requirement</field>
<field name="section_id" ref="section_sales_department"/>
<field name="user_id" ref="base.user_demo"/>
<field name="stage_id" ref="crm.stage_lead6"/>
<field eval="1" name="active"/>
<field name="stage_id" ref="crm.stage_lead3"/>
<field name="date_closed" eval="(DateTime.today() - relativedelta(months=2)).strftime('%Y-%m-%d %H:%M')"/>
</record>
<record id="crm_case_15" model="crm.lead">
<field name="message_follower_ids" eval="[(3, ref('base.partner_root')), (4, ref('base.partner_demo'))]"/>
</record>
<record id="crm_case_16" model="crm.lead">
<field name="type">opportunity</field>
@ -369,8 +385,7 @@ Andrew</field>
<field name="title_action">Convert to quote</field>
<field name="section_id" ref="crm_case_section_1"/>
<field name="user_id" ref="base.user_demo"/>
<field name="stage_id" ref="crm.stage_lead6"/>
<field eval="1" name="active"/>
<field name="stage_id" ref="crm.stage_lead3"/>
<field name="date_closed" eval="(DateTime.today() - relativedelta(hours=1)).strftime('%Y-%m-%d %H:%M')"/>
</record>
@ -395,10 +410,12 @@ Andrew</field>
<field name="title_action">Send price list regarding our interventions</field>
<field name="section_id" ref="crm_case_section_1"/>
<field name="user_id" ref="base.user_demo"/>
<field name="stage_id" ref="crm.stage_lead6"/>
<field eval="1" name="active"/>
<field name="stage_id" ref="crm.stage_lead4"/>
<field name="date_closed" eval="(DateTime.today() - relativedelta(hours=1)).strftime('%Y-%m-%d %H:%M')"/>
</record>
<record id="crm_case_17" model="crm.lead">
<field name="message_follower_ids" eval="[(3, ref('base.partner_root')), (4, ref('base.partner_demo'))]"/>
</record>
<record id="crm_case_18" model="crm.lead">
<field name="type">opportunity</field>
@ -420,9 +437,12 @@ Andrew</field>
<field name="title_action">Call to define real needs about training</field>
<field name="section_id" ref="crm_case_section_1"/>
<field name="user_id" ref="base.user_demo"/>
<field name="stage_id" ref="crm.stage_lead3"/>
<field name="stage_id" ref="crm.stage_lead4"/>
<field eval="1" name="active"/>
</record>
<record id="crm_case_18" model="crm.lead">
<field name="message_follower_ids" eval="[(4, ref('base.partner_demo'))]"/>
</record>
<record id="crm_case_19" model="crm.lead">
<field name="type">opportunity</field>
@ -444,8 +464,7 @@ Andrew</field>
<field name="title_action">Ask for the good receprion of the proposition</field>
<field name="section_id" ref="crm_case_section_1"/>
<field name="user_id" ref="base.user_root"/>
<field name="stage_id" ref="crm.stage_lead6"/>
<field eval="1" name="active"/>
<field name="stage_id" ref="crm.stage_lead4"/>
<field name="date_closed" eval="(DateTime.today() - relativedelta(months=3)).strftime('%Y-%m-%d %H:%M')"/>
</record>
@ -462,8 +481,7 @@ Andrew</field>
<field name="priority">2</field>
<field name="section_id" ref="crm_case_section_1"/>
<field name="user_id" ref="base.user_demo"/>
<field name="stage_id" ref="crm.stage_lead1"/>
<field eval="1" name="active"/>
<field name="stage_id" ref="crm.stage_lead4"/>
</record>
<record id="crm_case_21" model="crm.lead">
@ -477,8 +495,7 @@ Andrew</field>
<field name="priority">3</field>
<field name="section_id" ref="crm_case_section_2"/>
<field name="user_id" ref="base.user_root"/>
<field name="stage_id" ref="crm.stage_lead6"/>
<field eval="1" name="active"/>
<field name="stage_id" ref="crm.stage_lead4"/>
<field name="date_closed" eval="(DateTime.today() - relativedelta(months=1)).strftime('%Y-%m-%d %H:%M')"/>
</record>
@ -496,8 +513,7 @@ Andrew</field>
<field name="priority">3</field>
<field name="section_id" ref="crm_case_section_2"/>
<field name="user_id" ref="base.user_root"/>
<field name="stage_id" ref="crm.stage_lead8"/>
<field eval="1" name="active"/>
<field name="stage_id" ref="crm.stage_lead5"/>
</record>
<record id="crm_case_23" model="crm.lead">
@ -512,8 +528,7 @@ Andrew</field>
<field name="priority">5</field>
<field name="section_id" ref="section_sales_department"/>
<field name="user_id" ref="base.user_demo"/>
<field name="stage_id" ref="crm.stage_lead6"/>
<field eval="1" name="active"/>
<field name="stage_id" ref="crm.stage_lead5"/>
<field name="date_closed" eval="(DateTime.today() - relativedelta(hours=1)).strftime('%Y-%m-%d %H:%M')"/>
</record>
@ -532,8 +547,7 @@ Andrew</field>
<field eval="time.strftime('%Y-%m-6')" name="date_deadline"/>
<field name="section_id" ref="section_sales_department"/>
<field name="user_id" ref="base.user_root"/>
<field name="stage_id" ref="crm.stage_lead6"/>
<field eval="1" name="active"/>
<field name="stage_id" ref="crm.stage_lead5"/>
<field name="date_closed" eval="(DateTime.today() - relativedelta(month=1)).strftime('%Y-%m-%d %H:%M')"/>
</record>
@ -556,8 +570,7 @@ Andrew</field>
<field name="title_action">Conf call with technical service</field>
<field name="section_id" ref="crm_case_section_1"/>
<field name="user_id" ref="base.user_root"/>
<field name="stage_id" ref="crm.stage_lead4"/>
<field eval="1" name="active"/>
<field name="stage_id" ref="crm.stage_lead5"/>
</record>
<record id="crm_case_26" model="crm.lead">
@ -581,21 +594,10 @@ Andrew</field>
<field name="title_action">Send Catalogue by Email</field>
<field name="section_id" ref="crm_case_section_2"/>
<field name="user_id" ref="base.user_demo"/>
<field name="stage_id" ref="crm.stage_lead6"/>
<field eval="1" name="active"/>
<field name="date_closed" eval="(DateTime.today() - relativedelta(hours=1)).strftime('%Y-%m-%d %H:%M')"/>
<field name="stage_id" ref="crm.stage_lead5"/>
<!-- <field name="date_closed" eval="(DateTime.today() - relativedelta(hours=1)).strftime('%Y-%m-%d %H:%M')"/> -->
</record>
<!-- Unsubscribe Admin from case15, subscribe Demo -->
<record id="crm_case_15" model="crm.lead">
<field name="message_follower_ids" eval="[(3, ref('base.partner_root')), (4, ref('base.partner_demo'))]"/>
</record>
<record id="crm_case_17" model="crm.lead">
<field name="message_follower_ids" eval="[(3, ref('base.partner_root')), (4, ref('base.partner_demo'))]"/>
</record>
<record id="crm_case_18" model="crm.lead">
<field name="message_follower_ids" eval="[(4, ref('base.partner_demo'))]"/>
</record>
<!-- Some messages linked to the previous opportunities -->
<record id="msg_case15_attach1" model="ir.attachment">
<field name="datas">bWlncmF0aW9uIHRlc3Q=</field>
@ -689,26 +691,9 @@ Andrew</field>
<field name="parent_id" ref="msg_case18_1"/>
<field name="author_id" ref="base.partner_demo"/>
</record>
<record id="msg_case1_1" model="mail.message">
<field name="subject">Inquiry</field>
<field name="model">crm.lead</field>
<field name="res_id" ref="crm_case_1"/>
<field name="body"><![CDATA[<p>Hello,<br />
I am Jason from Le Club SARL. I am interested to attend a training organized in your company.<br />
Can you send me the details ?</p>]]></field>
<field name="type">email</field>
</record>
<record id="msg_case2_1" model="mail.message">
<field name="subject">Need Details</field>
<field name="model">crm.lead</field>
<field name="res_id" ref="crm_case_2"/>
<field name="body">Want to know features and benefits to use the new software.</field>
<field name="type">comment</field>
</record>
<function model="mail.message" name="set_message_starred"
eval="[ ref('msg_case18_1'), ref('msg_case18_2')], True, {}"
/>
</data>
</openerp>

View File

@ -12,9 +12,10 @@
<field name="model">crm.case.stage</field>
<field name="arch" type="xml">
<search string="Stage Search">
<field name="name" string="Stage Name"/>
<field name="state"/>
<field name="name"/>
<field name="type"/>
<field name="sequence"/>
<field name="probability"/>
</search>
</field>
</record>
@ -94,11 +95,8 @@
<form string="Leads Form" version="7.0">
<header>
<button name="%(crm.action_crm_lead2opportunity_partner)d" string="Convert to Opportunity" type="action"
states="draft,open,pending" help="Convert to Opportunity" class="oe_highlight"/>
<button name="case_reset" string="Reset" type="object"
states="cancel"/>
<button name="case_cancel" string="Cancel Case" type="object"
states="draft,open,pending"/>
attrs="{'invisible': [('probability', '=', 100)]}"
help="Convert to Opportunity" class="oe_highlight"/>
<field name="stage_id" widget="statusbar" clickable="True"
domain="['&amp;', '|', ('case_default', '=', True), ('section_ids', '=', section_id), '|', ('type', '=', type), ('type', '=', 'both')]"
on_change="onchange_stage_id(stage_id)"/>
@ -118,7 +116,7 @@
<field name="partner_name" string="Company Name"/>
<!-- Preload all the partner's information -->
<field name="partner_id" string="Customer"
on_change="on_change_partner(partner_id)"
on_change="on_change_partner_id(partner_id)"
options='{"create_name_field": "name"}'
context="{'default_name': contact_name, 'default_street': street, 'default_city': city, 'default_state_id': state_id, 'default_zip': zip, 'default_country_id': country_id, 'default_function': function, 'default_phone': phone, 'default_mobile': mobile, 'default_fax': fax, 'default_email': email_from, 'default_user_id': user_id, 'default_section_id': section_id}"/>
<label for="street" string="Address"/>
@ -144,12 +142,6 @@
<field name="phone"/>
<field name="mobile"/>
<field name="fax"/>
<!--
This should be integrated in Open Chatter
<button string="Mail"
name="%(mail.action_email_compose_message_wizard)d"
icon="terp-mail-message-new" type="action" colspan="1"/>
-->
</group>
<group>
<field name="user_id" on_change="on_change_user(user_id, context)"
@ -159,7 +151,7 @@
<field name="section_id"/>
<button name="case_escalate" string="Escalate"
type="object" class="oe_link"
attrs="{'invisible': ['|', ('section_id','=',False), ('state', 'not in', ['draft','open','pending'])]}"/>
attrs="{'invisible': ['|', ('section_id','=',False), ('probability', '=', 100)]}"/>
</div>
<field name="type" invisible="1"/>
</group>
@ -177,20 +169,24 @@
<field name="description"/>
</page>
<page string="Extra Info">
<group>
<group string="Categorization" groups="base.group_multi_company,base.group_no_one" name="categorization">
<field name="company_id"
groups="base.group_multi_company"
widget="selection" colspan="2"/>
<field name="state" groups="base.group_no_one"/>
</group>
<group string="Mailings">
<field name="opt_out"/>
</group>
<group string="Misc">
<group string="Categorization" groups="base.group_multi_company,base.group_no_one" name="categorization">
<field name="company_id"
groups="base.group_multi_company"
widget="selection" colspan="2"/>
</group>
<group string="Mailings">
<field name="opt_out"/>
</group>
<group string="Misc">
<group>
<field name="probability" groups="base.group_no_one"/>
<field name="active"/>
<field name="referred"/>
</group>
<group>
<field name="date_open" groups="base.group_no_one"/>
<field name="date_closed" groups="base.group_no_one"/>
</group>
</group>
</page>
</notebook>
@ -220,7 +216,7 @@
<field name="name">Leads</field>
<field name="model">crm.lead</field>
<field name="arch" type="xml">
<tree string="Leads" fonts="bold:message_unread==True" colors="grey:state in ('cancel', 'done')">
<tree string="Leads" fonts="bold:message_unread==True" colors="grey:probability == 100">
<field name="date_deadline" invisible="1"/>
<field name="create_date"/>
<field name="name"/>
@ -232,7 +228,7 @@
<field name="user_id" invisible="1"/>
<field name="partner_id" invisible="1"/>
<field name="section_id" invisible="context.get('invisible_section', True)" groups="base.group_multi_salesteams"/>
<field name="state" invisible="1"/>
<field name="probability" invisible="1"/>
<field name="type_id" invisible="1"/>
<field name="referred" invisible="1"/>
<field name="channel_id" invisible="1"/>
@ -262,7 +258,6 @@
<field name="model">crm.lead</field>
<field name="arch" type="xml">
<kanban default_group_by="stage_id">
<field name="state" groups="base.group_no_one"/>
<field name="stage_id"/>
<field name="color"/>
<field name="priority"/>
@ -335,16 +330,17 @@
<field name="create_date"/>
<field name="country_id" context="{'invisible_country': False}"/>
<separator/>
<filter string="Open" name="open" domain="[('state','!=','cancel')]" help="Open Leads"/>
<filter string="Dead" name="dead" domain="[('state','=','cancel')]"/>
<filter string="Unassigned" name="unassigned" domain="[('user_id','=', False)]" help="No salesperson"/>
<filter string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]" help="Unread messages"/>
<filter string="Unassigned" name="unassigned"
domain="[('user_id','=', False)]"
help="No salesperson"/>
<filter string="Assigned to Me"
domain="[('user_id','=',uid)]" context="{'invisible_section': False}"
help="Leads that are assigned to me"/>
<filter string="Assigned to My Team(s)"
<filter string="Assigned to My Team(s)" groups="base.group_multi_salesteams"
domain="[('section_id.member_ids', 'in', [uid])]" context="{'invisible_section': False}"
help="Leads that are assigned to any sales teams I am member of" groups="base.group_multi_salesteams"/>
help="Leads that are assigned to any sales teams I am member of"/>
<filter string="Dead" name="dead"
domain="[('probability', '=', '0'), ('stage_id.sequence', '!=', 1)]"/>
<separator />
<filter string="Available for mass mailing"
name='not_opt_out' domain="[('opt_out', '=', False)]"
@ -382,20 +378,19 @@
<field name="arch" type="xml">
<form string="Opportunities" version="7.0">
<header>
<button name="case_mark_won" string="Mark Won" type="object"
states="draft,open,pending" class="oe_highlight"/>
<button name="case_mark_lost" string="Mark Lost" type="object"
states="draft,open" class="oe_highlight"/>
<field name="stage_id" widget="statusbar" clickable="True"/>
<button name="case_mark_won" string="Mark Won" type="object" class="oe_highlight"
attrs="{'invisible': [('probability', '=', 100)]}"/>
<button name="case_mark_lost" string="Mark Lost" type="object" class="oe_highlight"
attrs="{'invisible': ['|', ('probability', '=', 0), ('probability', '=', 100)]}"/>
<field name="stage_id" widget="statusbar" clickable="True"
domain="['&amp;', ('section_ids', '=', section_id), '|', ('type', '=', type), ('type', '=', 'both')]"/>
</header>
<sheet>
<div class="oe_right oe_button_box">
<button string="Schedule/Log Call"
name="%(opportunity2phonecall_act)d"
type="action"/>
<button string="Meeting"
<button string="Schedule/Log Call" type="action"
name="%(opportunity2phonecall_act)d"/>
<button string="Meeting" type="object"
name="action_makeMeeting"
type="object"
context="{'search_default_attendee_id': active_id, 'default_attendee_id' : active_id}"/>
</div>
<div class="oe_title">
@ -412,7 +407,7 @@
<group>
<group>
<field name="partner_id"
on_change="onchange_partner_id(partner_id, email_from)"
on_change="on_change_partner_id(partner_id)"
string="Customer"
context="{'default_name': partner_name, 'default_email': email_from, 'default_phone': phone}"/>
<field name="email_from" string="Email"/>
@ -434,7 +429,8 @@
<label for="section_id" groups="base.group_multi_salesteams"/>
<div groups="base.group_multi_salesteams">
<field name="section_id" widget="selection"/>
<button name="case_escalate" string="Escalate" type="object" class="oe_link" attrs="{'invisible': ['|', ('section_id','=',False), ('state', 'not in', ['draft','open','pending'])]}"/>
<button name="case_escalate" string="Escalate" type="object" class="oe_link"
attrs="{'invisible': ['|', ('section_id','=',False), ('probability', '=', 100)]}"/>
</div>
</group>
<group>
@ -485,7 +481,6 @@
<field name="day_open" groups="base.group_no_one"/>
<field name="day_close" groups="base.group_no_one"/>
<field name="referred"/>
<field name="state" invisible="1"/>
<field name="type" invisible="1"/>
</group>
<group string="References">
@ -515,7 +510,7 @@
<field name="name">Opportunities Tree</field>
<field name="model">crm.lead</field>
<field name="arch" type="xml">
<tree string="Opportunities" fonts="bold:message_unread==True" colors="gray:state in ('cancel', 'done');red:date_deadline and (date_deadline &lt; current_date)">
<tree string="Opportunities" fonts="bold:message_unread==True" colors="gray:probability == 100;red:date_deadline and (date_deadline &lt; current_date)">
<field name="date_deadline" invisible="1"/>
<field name="create_date"/>
<field name="name" string="Opportunity"/>
@ -533,7 +528,8 @@
<field name="referred" invisible="1"/>
<field name="priority" invisible="1"/>
<field name="message_unread" invisible="1"/>
<field name="state" invisible="1"/>
<field name="probability" invisible="1"/>
<field name="write_date" invisible="1"/>
</tree>
</field>
</record>
@ -550,15 +546,19 @@
<field name="section_id" context="{'invisible_section': False}" groups="base.group_multi_salesteams"/>
<field name="user_id"/>
<field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/>
<field name="stage_id" domain="[]"/>
<field name="probability"/>
<separator/>
<filter string="New" name="new" domain="[('state','=','draft')]" help="New Opportunities"/>
<filter string="In Progress" name="open" domain="[('state','=','open')]" help="Open Opportunities"/>
<filter string="Won" name="won" domain="[('state','=','done')]"/>
<filter string="Lost" name="lost" domain="[('state','=','cancel')]"/>
<filter string="Unassigned" name="unassigned" domain="[('user_id','=', False)]" help="No salesperson"/>
<filter string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]" help="Unread messages"/>
<filter string="New" name="new"
domain="[('probability', '=', 0), ('stage_id.sequence', '=', 1)]"/>
<filter string="Won" name="won"
domain="[('probability', '=', 100), ('stage_id.on_change', '=', 1)]"/>
<filter string="Lost" name="lost"
domain="[('probability', '=', 0), ('stage_id.sequence', '!=', 1)]"/>
<filter string="Unassigned" name="unassigned"
domain="[('user_id','=', False)]" help="No salesperson"/>
<filter string="My Opportunities" name="assigned_to_me"
domain="[('user_id','=',uid)]" context="{'invisible_section': False}"
domain="[('user_id', '=', uid)]" context="{'invisible_section': False}"
help="Opportunities that are assigned to me"/>
<filter string="Assigned to My Team(s)"
domain="[('section_id.member_ids', 'in', [uid])]" context="{'invisible_section': False}"
@ -576,6 +576,7 @@
<filter string="Campaign" domain="[]" context="{'group_by':'type_id'}"/>
<filter string="Channel" domain="[]" context="{'group_by':'channel_id'}"/>
<filter string="Creation" domain="[]" context="{'group_by':'create_date'}"/>
<filter string="Last Update Month" domain="[]" context="{'group_by':'write_date'}"/>
</group>
<group string="Display">
<filter string="Show Sales Team" context="{'invisible_section': False}" domain="[]" help="Show Sales Team" groups="base.group_multi_salesteams"/>
@ -617,7 +618,7 @@
<field name="state">code</field>
<field name="code">
if context.get('active_model') == 'crm.lead' and context.get('active_ids'):
self.case_cancel(cr, uid, context['active_ids'], context=context)
self.case_mark_lost(cr, uid, context['active_ids'], context=context)
</field>
<field name="groups_id" eval="[(4,ref('base.group_sale_salesman'))]"/>
</record>

View File

@ -58,7 +58,7 @@
<field name="view_mode">tree,calendar</field>
<field name="view_id" ref="crm_case_inbound_phone_tree_view"/>
<field name="domain">[]</field>
<field name="context">{}</field>
<field name="context">{'default_state': 'done'}</field>
<field name="search_view_id" ref="crm.view_crm_case_phonecalls_filter"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">

View File

@ -80,7 +80,6 @@
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="probability"/>
<field name="state"/>
<field name="type"/>
</tree>
</field>
@ -96,7 +95,6 @@
<form string="Stage" version="7.0">
<group col="4">
<field name="name"/>
<field name="state"/>
<field name="probability"/>
<field name="type"/>
<field name="on_change"/>

View File

@ -0,0 +1,17 @@
.. _changelog:
Changelog
=========
`trunk (saas-2)`
----------------
- Stage/state update
- ``crm.lead``: removed ``state`` field. Added ``date_last_stage_update`` field
holding last stage_id modification. Updated reports.
- ``crm.case.stage``: removed ``state`` field.
- ``crm``, ``crm_claim``: removed inheritance from ``base_stage`` class. Missing
methods have been added into ``crm`` and ``crm_claim``. Also removed inheritance
in ``crm_helpdesk`` because it uses states, not stages.

18
addons/crm/doc/index.rst Normal file
View File

@ -0,0 +1,18 @@
CRM module documentation
========================
CRM documentation topics
'''''''''''''''''''''''''
.. toctree::
:maxdepth: 1
stage_status.rst
Changelog
'''''''''
.. toctree::
:maxdepth: 1
changelog.rst

View File

@ -0,0 +1,61 @@
.. _stage_status:
Stage and Status
================
.. versionchanged:: 8.0 saas-2 state/stage cleaning
Stage
+++++
This revision removed the concept of state on crm.lead objects. The ``state``
field has been totally removed and replaced by stages, using ``stage_id``. The
following models are impacted:
- ``crm.lead`` now use only stages. However conventions still exist about
'New', 'Won' and 'Lost' stages. Those conventions are:
- ``new``: ``stage_id and stage_id.sequence = 1``
- ``won``: ``stage_id and stage_id.probability = 100 and stage_id.on_change = True``
- ``lost``: ``stage_id and stage_id.probability = 0 and stage_id.on_change = True
and stage_id.sequence != 1``
- ``crm.case.stage`` do not have any ``state`` field anymore.
- ``crm.lead.report`` do not have any ``state`` field anymore.
By default a newly created lead is in a new stage. It means that it will
fetch the stage having ``sequence = 1``. Stage mangement is done using the
kanban view or the clikable statusbar. It is not done using buttons anymore.
Stage analysis
++++++++++++++
Stage analysis can be performed using the newly introduced ``date_last_stage_update``
datetime field. This field is updated everytime ``stage_id`` is updated.
``crm.lead.report`` model also uses the ``date_last_stage_update`` field.
This allows to group and analyse the time spend in the various stages.
Open / Assignation date
+++++++++++++++++++++++
The ``date_open`` field meaning has been updated. It is now set when the ``user_id``
(responsible) is set. It is therefore the assignation date.
Subtypes
++++++++
The following subtypes are triggered on ``crm.lead``:
- ``mt_lead_create``: new leads. Condition: ``obj.probability == 0 and obj.stage_id
and obj.stage_id.sequence == 1``
- ``mt_lead_stage``: stage changed. Condition: ``(obj.stage_id and obj.stage_id.sequence != 1)
and obj.probability < 100``
- ``mt_lead_won``: lead/oportunity is won. condition: `` obj.probability == 100
and obj.stage_id and obj.stage_id.on_change``
- ``mt_lead_lost``: lead/opportunity is lost. Condition: ``obj.probability == 0
and obj.stage_id and obj.stage_id.sequence != 1'``
Those subtypes are also available on the ``crm.case.section`` model and are used
for the auto subscription.

View File

@ -7,14 +7,19 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-12-21 17:04+0000\n"
"PO-Revision-Date: 2013-06-21 07:11+0000\n"
"PO-Revision-Date: 2013-07-25 13:52+0000\n"
"Last-Translator: krnkris <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2013-06-22 05:36+0000\n"
"X-Generator: Launchpad (build 16677)\n"
"X-Launchpad-Export-Date: 2013-07-26 05:14+0000\n"
"X-Generator: Launchpad (build 16700)\n"
#. module: crm
#: model:crm.case.stage,name:crm.stage_lead3
msgid "Qualification"
msgstr "Besorolás"
#. module: crm
#: view:crm.lead.report:0
@ -236,7 +241,7 @@ msgstr "Kilép"
#: view:crm.lead:0
#: field:crm.lead,state_id:0
msgid "State"
msgstr "Állapot"
msgstr "Állam/Megye"
#. module: crm
#: field:res.partner,meeting_count:0
@ -2686,11 +2691,6 @@ msgstr "Valószínűség automatikus változtatása"
msgid "My Phone Calls"
msgstr "Telefonhívásaim"
#. module: crm
#: model:crm.case.stage,name:crm.stage_lead3
msgid "Qualification"
msgstr "Besorolás"
#. module: crm
#: field:crm.lead2opportunity.partner,name:0
#: field:crm.lead2opportunity.partner.mass,name:0
@ -3961,9 +3961,19 @@ msgstr ""
#~ msgid "Can not add note!"
#~ msgstr "Nem lehet hozzáadni megjegyzést!"
#, python-format
#~ msgid ""
#~ "Opportunity must have Partner assigned before merging with other Opportunity."
#~ msgstr ""
#~ "Csak a Partnerhez rendelt Lehetőséget lehet más Lehetőséggel összefűzni."
#~ msgid "_Merge"
#~ msgstr "Össze_fésülés"
#, python-format
#~ msgid "The opportunity '%s' has been marked as lost."
#~ msgstr "A '%s' lehetőséget elvesztettnek jelöltem."
#, python-format
#~ msgid "Lead '%s' has been converted to an opportunity."
#~ msgstr "A '%s'"
@ -3991,3 +4001,17 @@ msgstr ""
#~ msgid "Convert To Opportunity"
#~ msgstr "Átalakítás lehetőséggé"
#~ msgid "Edit all Occurrences of recurrent Meeting."
#~ msgstr "Az ismétlődő találkozók összes eseményének szerkesztése."
#~ msgid ""
#~ "Leads Analysis allows you to check different CRM related information. Check "
#~ "for treatment delays, number of responses given and emails sent. You can "
#~ "sort out your leads analysis by different groups to get accurate grained "
#~ "analysis."
#~ msgstr ""
#~ "Az érdeklődések elemzése több CRM-hez kapcsolódó információt nyújt. "
#~ "Ellenőrizhetjük az eljárás elnapolását, a kiküldött válaszok és e-mailek "
#~ "számát. A részletes eredmény érdekében az érdeklődéseket különféle "
#~ "csoportosítások szerint is elemezhetjük."

File diff suppressed because it is too large Load Diff

View File

@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-12-21 17:04+0000\n"
"PO-Revision-Date: 2012-12-19 07:22+0000\n"
"Last-Translator: Wei \"oldrev\" Li <oldrev@gmail.com>\n"
"PO-Revision-Date: 2013-08-06 09:41+0000\n"
"Last-Translator: fanvil <fanvil@hotmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2013-03-16 05:10+0000\n"
"X-Generator: Launchpad (build 16532)\n"
"X-Launchpad-Export-Date: 2013-08-07 04:46+0000\n"
"X-Generator: Launchpad (build 16721)\n"
#. module: crm
#: view:crm.lead.report:0
@ -29,7 +29,7 @@ msgid ""
msgstr "允许你设置接收邮件服务器,并从收到的邮件中创建线索"
#. module: crm
#: code:addons/crm/crm_lead.py:881
#: code:addons/crm/crm_lead.py:898
#: selection:crm.case.stage,type:0
#: view:crm.lead:0
#: selection:crm.lead,type:0
@ -54,6 +54,11 @@ msgid ""
"Description: [[object.description]]\n"
" "
msgstr ""
"警告收到的新线索已超过5天未处理\n"
"名称:[[object.name]]\n"
"编号:[[object.id]]\n"
"描述:[[object.description]]\n"
" "
#. module: crm
#: field:crm.opportunity2phonecall,action:0
@ -64,7 +69,7 @@ msgstr "动作"
#. module: crm
#: model:ir.actions.server,name:crm.action_set_team_sales_department
msgid "Set team to Sales Department"
msgstr ""
msgstr "设置团队 到销售部"
#. module: crm
#: view:crm.lead2opportunity.partner.mass:0
@ -151,7 +156,7 @@ msgstr "规则名称"
#: code:addons/crm/crm_phonecall.py:280
#, python-format
msgid "It's only possible to convert one phonecall at a time."
msgstr ""
msgstr "每次只能转换一个电话呼叫"
#. module: crm
#: view:crm.case.resource.type:0
@ -180,11 +185,11 @@ msgstr "预计结束月份"
msgid ""
"Holds the Chatter summary (number of messages, ...). This summary is "
"directly in html format in order to be inserted in kanban views."
msgstr ""
msgstr "保留复杂的摘要(消息数量,……等)。这一摘要直接是是HTML格式以便插入到看板视图。"
#. module: crm
#: code:addons/crm/crm_lead.py:624
#: code:addons/crm/crm_lead.py:744
#: code:addons/crm/crm_lead.py:640
#: code:addons/crm/crm_lead.py:761
#: code:addons/crm/crm_phonecall.py:280
#, python-format
msgid "Warning!"
@ -232,7 +237,7 @@ msgstr "状态"
#. module: crm
#: field:res.partner,meeting_count:0
msgid "# Meetings"
msgstr ""
msgstr "#会议"
#. module: crm
#: model:ir.actions.server,name:crm.action_email_reminder_lead
@ -252,7 +257,7 @@ msgstr "排除的答案:"
#. module: crm
#: model:ir.model,name:crm.model_crm_merge_opportunity
msgid "Merge opportunities"
msgstr ""
msgstr "合并商机"
#. module: crm
#: view:crm.lead.report:0
@ -265,7 +270,7 @@ msgstr "线索分析"
#: code:addons/crm/crm_lead.py:1010
#, python-format
msgid "<b>%s a call</b> for the <em>%s</em>."
msgstr ""
msgstr "<b>%s 一个电话</b> 为了 <em>%s</em>."
#. module: crm
#: model:ir.actions.act_window,name:crm.crm_case_resource_type_act
@ -293,7 +298,7 @@ msgid "Prospect Partner"
msgstr "潜在业务伙伴"
#. module: crm
#: code:addons/crm/crm_lead.py:982
#: code:addons/crm/crm_lead.py:1002
#, python-format
msgid "No Subject"
msgstr "无主题"
@ -323,6 +328,18 @@ msgid ""
" </p>\n"
" "
msgstr ""
"<p class=\"oe_view_nocontent_create\">\n"
" "
"点击创建新客户分组\n"
" </p><p>\n"
" "
"创建指定的分类用于赋值给你的联系人\n"
" "
"以便更好管理你和他们的联系。分组工具\n"
" "
"可以根据你预设的条件给联系人分配组。\n"
" </p>\n"
" "
#. module: crm
#: field:crm.opportunity2phonecall,contact_name:0
@ -445,16 +462,16 @@ msgid "#Opportunities"
msgstr "#商机"
#. module: crm
#: code:addons/crm/crm_lead.py:624
#: code:addons/crm/crm_lead.py:640
#, python-format
msgid ""
"Please select more than one element (lead or opportunity) from the list view."
msgstr ""
msgstr "请从列表视图中选择一个以上元素(线索或机会)。"
#. module: crm
#: view:crm.lead:0
msgid "Leads that are assigned to one of the sale teams I manage, or to me"
msgstr ""
msgstr "分配给我锁管理的某个销售队伍,或给我的线索。"
#. module: crm
#: field:crm.lead,partner_address_email:0
@ -473,6 +490,16 @@ msgid ""
" </p>\n"
" "
msgstr ""
"<p class=\"oe_view_nocontent_create\">\n"
" "
"点击创建新的销售团队\n"
" <p></p>\n"
" "
"使用销售团队,把不同销售员或部门组织成独立的团队。\n"
" "
"每个团队会使用自己的商机列表工作。\n"
" </p>\n"
" "
#. module: crm
#: model:process.transition,note:crm.process_transition_opportunitymeeting0
@ -511,7 +538,7 @@ msgstr "邮件"
#. module: crm
#: model:mail.message.subtype,description:crm.mt_lead_stage
msgid "Stage changed"
msgstr ""
msgstr "任务阶段已改变"
#. module: crm
#: selection:crm.lead.report,creation_month:0
@ -556,6 +583,7 @@ msgid ""
" If the call needs to be done then the status is set "
"to 'Not Held'."
msgstr ""
"当一个案子新建时,状态被设为‘待处理’,当案子进行中,状态被设为‘打开’,当电话结束,状态被设为‘挂起’。如果需要电话,状态设为‘未挂起’"
#. module: crm
#: field:crm.case.section,message_summary:0
@ -572,7 +600,7 @@ msgstr "合并"
#. module: crm
#: model:email.template,subject:crm.email_template_opportunity_mail
msgid "Opportunity ${object.name | h})"
msgstr ""
msgstr "商机${object.name | h})"
#. module: crm
#: view:crm.case.categ:0
@ -590,6 +618,8 @@ msgid ""
"Reminder on Lead: [[object.id ]] [[object.partner_id and 'of ' "
"+object.partner_id.name or '']]"
msgstr ""
"线索:[[object.id ]] [[object.partner_id and 'of ' +object.partner_id.name or "
"'']]的提醒"
#. module: crm
#: view:crm.segmentation:0
@ -630,6 +660,13 @@ msgid ""
" </p>\n"
" "
msgstr ""
"<p class=\"oe_view_nocontent_create\">\n"
" 点击创建新类型\n"
" </p><p>\n"
" "
"创建指定的电话类型,更好地定义系统中记录的电话类型\n"
" </p>\n"
" "
#. module: crm
#: help:crm.case.section,reply_to:0
@ -712,7 +749,7 @@ msgid "Statistics Dashboard"
msgstr "统计控制台"
#. module: crm
#: code:addons/crm/crm_lead.py:861
#: code:addons/crm/crm_lead.py:878
#: model:crm.case.stage,name:crm.stage_lead2
#: selection:crm.case.stage,type:0
#: view:crm.lead:0
@ -738,7 +775,7 @@ msgstr "转为商机"
#. module: crm
#: model:ir.model,name:crm.model_sale_config_settings
msgid "sale.config.settings"
msgstr ""
msgstr "sale.config.settings"
#. module: crm
#: view:crm.segmentation:0
@ -759,7 +796,7 @@ msgstr "查询电话访问"
#: view:crm.lead.report:0
msgid ""
"Leads/Opportunities that are assigned to one of the sale teams I manage"
msgstr ""
msgstr "分配给我所管理的某个销售团队的线索/商机。"
#. module: crm
#: field:calendar.attendee,categ_id:0
@ -772,7 +809,7 @@ msgid "Exclusive"
msgstr "唯一的"
#. module: crm
#: code:addons/crm/crm_lead.py:584
#: code:addons/crm/crm_lead.py:600
#, python-format
msgid "From %s : %s"
msgstr "发自: %s:%s"
@ -807,7 +844,7 @@ msgstr "参考2"
msgid ""
"Link between stages and sales teams. When set, this limitate the current "
"stage to the selected sales teams."
msgstr ""
msgstr "在阶段和销售团队之间建立链接。设置后将限制此阶段只能用于被选中的销售团队。"
#. module: crm
#: view:crm.case.stage:0
@ -866,7 +903,7 @@ msgstr "标记为已赢得"
#. module: crm
#: model:ir.filters,name:crm.filter_usa_lead
msgid "Leads from USA"
msgstr ""
msgstr "来自USA的线索"
#. module: crm
#: view:crm.lead:0
@ -917,7 +954,7 @@ msgstr "参考"
msgid ""
"Opportunities that are assigned to either me or one of the sale teams I "
"manage"
msgstr ""
msgstr "分配给我或者我管理的某个销售团队的商机。"
#. module: crm
#: help:crm.case.section,resource_calendar_id:0
@ -940,10 +977,10 @@ msgid "Next Action"
msgstr "下一动作"
#. module: crm
#: code:addons/crm/crm_lead.py:763
#: code:addons/crm/crm_lead.py:780
#, python-format
msgid "<b>Partner</b> set to <em>%s</em>."
msgstr ""
msgstr "<b>业务伙伴</b> 设给 <em>%s</em>."
#. module: crm
#: selection:crm.lead.report,state:0
@ -983,6 +1020,8 @@ msgid ""
"Allows you to track your customers/suppliers claims and grievances.\n"
" This installs the module crm_claim."
msgstr ""
"允许你记录客户/供应商的索赔和抱怨。\n"
" 将安装crm_claim模块"
#. module: crm
#: model:crm.case.stage,name:crm.stage_lead6
@ -1030,10 +1069,10 @@ msgid "Creation Date"
msgstr "创建日期"
#. module: crm
#: code:addons/crm/crm_lead.py:698
#: code:addons/crm/crm_lead.py:715
#, python-format
msgid "Lead <b>converted into an Opportunity</b>"
msgstr ""
msgstr "线索 <b>已转换成商机</b>"
#. module: crm
#: selection:crm.segmentation.line,expr_name:0
@ -1094,7 +1133,7 @@ msgstr "删除"
#. module: crm
#: model:mail.message.subtype,description:crm.mt_lead_create
msgid "Opportunity created"
msgstr ""
msgstr "商机已创建"
#. module: crm
#: view:crm.lead:0
@ -1123,6 +1162,17 @@ msgid ""
" </p>\n"
" "
msgstr ""
"<p class=\"oe_view_nocontent_create\">\n"
" 点击创建新的商机\n"
" </p><p>\n"
" OpenERP帮你记录你的销售管道\n"
" 跟踪潜在销售并更好地预测未来收益\n"
" </p><p>\n"
" 你可以对商机安排会议或电话,\n"
" 将他们转化成报价单,附上相关\n"
" 文档,跟踪所有的讨论等等。\n"
" </p>\n"
" "
#. module: crm
#: field:crm.segmentation,partner_id:0
@ -1186,13 +1236,13 @@ msgstr "如果你勾选了这里,这个阶段会作为每个销售团队的默
msgid ""
"This field is used to distinguish stages related to Leads from stages "
"related to Opportunities, or to specify stages available for both types."
msgstr ""
msgstr "此域用于区分用于线索的阶段和用于商机的阶段,或者指示同时可用于两个类型。"
#. module: crm
#: model:mail.message.subtype,name:crm.mt_lead_create
#: model:mail.message.subtype,name:crm.mt_salesteam_lead
msgid "Lead Created"
msgstr ""
msgstr "线索已创建"
#. module: crm
#: help:crm.segmentation,sales_purchase_active:0
@ -1217,7 +1267,9 @@ msgid "Days to Close"
msgstr "结束日期"
#. module: crm
#: code:addons/crm/crm_lead.py:1057
#: field:crm.case.section,complete_name:0
#, python-format
msgid "unknown"
msgstr "未知"
@ -1264,7 +1316,7 @@ msgid ""
"progress the Status is set to 'Open'. When the case is over, the Status is "
"set to 'Done'. If the case needs to be reviewed then the Status is set to "
"'Pending'."
msgstr ""
msgstr "当一个创建时,状态设为‘草稿’。如果此案在进行中,被设为‘打开‘。当案子结束,状态被设为’结束‘。如果需要被审阅,状态被设为’等待‘"
#. module: crm
#: model:crm.case.section,name:crm.crm_case_section_1
@ -1287,7 +1339,7 @@ msgstr "发送邮件的时候,默认的邮件地址来自销售团队。"
msgid ""
"Phone Calls Assigned to the current user or with a team having the current "
"user as team leader"
msgstr ""
msgstr "被分配给当前用户或者当前用户领导的销售团队的电话沟通任务。"
#. module: crm
#: view:crm.segmentation:0
@ -1300,7 +1352,7 @@ msgid "Lead Description"
msgstr "销售线索描述"
#. module: crm
#: code:addons/crm/crm_lead.py:565
#: code:addons/crm/crm_lead.py:581
#, python-format
msgid "Merged opportunities"
msgstr "合并商机"
@ -1373,7 +1425,7 @@ msgstr "待办事项"
#. module: crm
#: model:mail.message.subtype,description:crm.mt_lead_lost
msgid "Opportunity lost"
msgstr ""
msgstr "丢掉的商机"
#. module: crm
#: field:crm.lead2opportunity.partner,action:0
@ -1422,7 +1474,7 @@ msgstr "用户"
#. module: crm
#: model:mail.message.subtype,name:crm.mt_lead_stage
msgid "Stage Changed"
msgstr ""
msgstr "阶段已改变"
#. module: crm
#: field:crm.case.stage,section_ids:0
@ -1495,7 +1547,7 @@ msgstr "信息和通信历史记录"
#. module: crm
#: view:crm.lead:0
msgid "Show Countries"
msgstr ""
msgstr "显示国家"
#. module: crm
#: view:crm.lead:0
@ -1567,7 +1619,7 @@ msgid ""
"The status of your document will automatically change regarding the selected "
"stage. For example, if a stage is related to the status 'Close', when your "
"document reaches this stage, it is automatically closed."
msgstr ""
msgstr "文档的状态会根据选中的阶段自动改变。如果一个阶段关联了‘关闭’状态,当文档到达这个阶段就自动被关闭。"
#. module: crm
#: view:crm.lead2opportunity.partner.mass:0
@ -1588,7 +1640,7 @@ msgstr "通话月份"
#: code:addons/crm/crm_phonecall.py:290
#, python-format
msgid "Partner has been <b>created</b>."
msgstr ""
msgstr "合作伙伴已<b>创建</b>"
#. module: crm
#: field:sale.config.settings,module_crm_claim:0
@ -1602,6 +1654,7 @@ msgid ""
"the treatment delays or number of leads per state. You can sort out your "
"leads analysis by different groups to get accurate grained analysis."
msgstr ""
"线索分析允许你检查不同的关联CRM的信息例如延迟或每个状态的线索的数量。你可以使用不同的分组对线索分析进行整理已获得精确细致的分析结果。"
#. module: crm
#: model:crm.case.categ,name:crm.categ_oppor3
@ -1822,7 +1875,7 @@ msgstr "销售团队"
#. module: crm
#: field:crm.case.stage,case_default:0
msgid "Default to New Sales Team"
msgstr ""
msgstr "默认分配给新建销售团队"
#. module: crm
#: view:crm.lead:0
@ -1861,10 +1914,10 @@ msgid "Leads"
msgstr "线索"
#. module: crm
#: code:addons/crm/crm_lead.py:563
#: code:addons/crm/crm_lead.py:579
#, python-format
msgid "Merged leads"
msgstr ""
msgstr "合并的线索"
#. module: crm
#: model:crm.case.categ,name:crm.categ_oppor5
@ -1887,7 +1940,7 @@ msgstr "待办"
#: model:mail.message.subtype,name:crm.mt_lead_convert_to_opportunity
#: model:mail.message.subtype,name:crm.mt_salesteam_lead_opportunity
msgid "Lead to Opportunity"
msgstr ""
msgstr "线索到商机"
#. module: crm
#: field:crm.lead,user_email:0
@ -1955,7 +2008,6 @@ msgid "Global CC"
msgstr "完整抄送"
#. module: crm
#: view:crm.lead:0
#: view:crm.phonecall:0
#: model:ir.actions.act_window,name:crm.crm_case_categ_phone0
#: model:ir.ui.menu,name:crm.menu_crm_case_phone
@ -2089,7 +2141,7 @@ msgstr "转换选项"
msgid ""
"Follow this salesteam to automatically track the events associated to users "
"of this team."
msgstr ""
msgstr "跟踪此销售团队,自动跟踪此团队中用户关联的事件。"
#. module: crm
#: view:crm.lead:0
@ -2101,7 +2153,7 @@ msgstr "地址"
msgid ""
"The email address associated with this team. New emails received will "
"automatically create new leads assigned to the team."
msgstr ""
msgstr "此邮件地址关联此团队。收到的新邮件将自动创建线索并分配给此团队。"
#. module: crm
#: view:crm.lead:0
@ -2193,13 +2245,24 @@ msgid ""
" </p>\n"
" "
msgstr ""
"<p class=\"oe_view_nocontent_create\">\n"
" 点击安排一个销售电话\n"
" </p><p>\n"
" "
"OpenERP允许你容易地定义销售团队要打的\n"
" 电话并根据跟踪处理。 "
" \n"
" </p><p> \n"
" 你可以使用导入功能来导入新列表\n"
" </p>\n"
" "
#. module: crm
#: help:crm.case.stage,fold:0
msgid ""
"This stage is not visible, for example in status bar or kanban view, when "
"there are no records in that stage to display."
msgstr ""
msgstr "此阶段无记录可显示时,在状态栏或看板视图等处不可见。"
#. module: crm
#: field:crm.lead.report,nbr:0
@ -2245,7 +2308,7 @@ msgstr "运行中"
#. module: crm
#: model:mail.message.subtype,description:crm.mt_lead_convert_to_opportunity
msgid "Lead converted into an opportunity"
msgstr ""
msgstr "装换成商机的线索"
#. module: crm
#: view:crm.lead:0
@ -2255,7 +2318,7 @@ msgstr "未分配的线索"
#. module: crm
#: model:mail.message.subtype,description:crm.mt_lead_won
msgid "Opportunity won"
msgstr ""
msgstr "获胜的商机"
#. module: crm
#: field:crm.case.categ,object_id:0
@ -2321,7 +2384,7 @@ msgstr "在这报表中,你能分析你的销售团队在电话访问上的业
#. module: crm
#: field:crm.case.stage,fold:0
msgid "Fold by Default"
msgstr ""
msgstr "默认折叠"
#. module: crm
#: field:crm.case.stage,state:0
@ -2357,7 +2420,7 @@ msgstr "已确认"
#. module: crm
#: model:ir.model,name:crm.model_crm_partner_binding
msgid "Handle partner binding or generation in CRM wizards."
msgstr ""
msgstr "在CRM向导中处理合作伙伴的绑定或生成。"
#. module: crm
#: model:ir.actions.act_window,name:crm.act_oppor_stage_user
@ -2408,11 +2471,23 @@ msgid ""
" </p>\n"
" "
msgstr ""
"<p class=\"oe_view_nocontent_create\">\n"
" 点击创建一个未验证的线索。\n"
" </p><p>\n"
" 如果你在创建一个商机或者客户前\n"
" 需要验证,使用线索。可以是一张收到的\n"
" 名片,网站上收到的一个联系方式,或者\n"
" 你导入系统的一个文件数据。\n"
" </p><p>\n"
" 一旦被确定,线索可以被装换成商机\n"
" 以及/或者你的地址簿中的新客户。\n"
" </p>\n"
" "
#. module: crm
#: field:sale.config.settings,fetchmail_lead:0
msgid "Create leads from incoming mails"
msgstr ""
msgstr "从收到的邮件创建线索"
#. module: crm
#: view:crm.lead:0
@ -2480,6 +2555,19 @@ msgid ""
" </p>\n"
" "
msgstr ""
"<p class=\"oe_view_nocontent_create\">\n"
" 点击创建电话总结\n"
" </p><p>\n"
" OpenERP "
"允许你快速记录打入的电话,用来\n"
" "
"跟踪与用户沟通的历史,或通知另一个销售团队。\n"
" </p><p>\n"
" "
"为了跟踪处理一个电话,你可以触发请求另一次电话,\n"
" 一次会议或者一个商机。\n"
" </p>\n"
" "
#. module: crm
#: model:process.node,note:crm.process_node_leads0
@ -2526,6 +2614,20 @@ msgid ""
" </p>\n"
" "
msgstr ""
"<p class=\"oe_view_nocontent_create\">\n"
" "
"点击新建一个销售标签\n"
" </p><p>\n"
" "
"创建指定的适合公司活动的标签\n"
" "
"用于更好地分析你的线索和商机。\n"
" "
"标签分类可以反映你的商品结构或者\n"
" "
"不同的销售类型。\n"
" </p>\n"
" "
#. module: crm
#: selection:crm.lead.report,creation_month:0
@ -2538,7 +2640,7 @@ msgstr "8月"
#: model:mail.message.subtype,name:crm.mt_lead_lost
#: model:mail.message.subtype,name:crm.mt_salesteam_lead_lost
msgid "Opportunity Lost"
msgstr ""
msgstr "丢失的商机"
#. module: crm
#: field:crm.lead.report,deadline_month:0
@ -2634,7 +2736,7 @@ msgstr "通话日志"
#: model:mail.message.subtype,name:crm.mt_lead_won
#: model:mail.message.subtype,name:crm.mt_salesteam_lead_won
msgid "Opportunity Won"
msgstr ""
msgstr "获胜的商机"
#. module: crm
#: model:ir.actions.act_window,name:crm.crm_case_section_act_tree
@ -2773,7 +2875,7 @@ msgstr "电话访问"
#. module: crm
#: view:crm.phonecall.report:0
msgid "Phone calls that are assigned to one of the sale teams I manage"
msgstr ""
msgstr "分配给某个我所管理的销售团队的电话。"
#. module: crm
#: view:crm.lead:0
@ -2783,7 +2885,7 @@ msgstr "发现日期"
#. module: crm
#: view:crm.lead:0
msgid "at"
msgstr ""
msgstr ""
#. module: crm
#: model:crm.case.stage,name:crm.stage_lead1
@ -2848,6 +2950,19 @@ msgid ""
" </p>\n"
" "
msgstr ""
"<p class=\"oe_view_nocontent_create\">\n"
" "
"点击定义一个新渠道\n"
" </p><p>\n"
" "
"使用渠道来记录你的线索和商机的来源。\n"
" "
"主要用于市场工作相关的销售分析报告。\n"
" </p><p>\n"
" "
"渠道例子:公司网站,电话,市场活动,经销商等\n"
" <p>\n"
" "
#. module: crm
#: view:crm.lead:0
@ -2885,7 +3000,7 @@ msgid "Working Hours"
msgstr "工作时间"
#. module: crm
#: code:addons/crm/crm_lead.py:968
#: code:addons/crm/crm_lead.py:986
#: view:crm.lead:0
#: field:crm.lead2opportunity.partner,partner_id:0
#: field:crm.lead2opportunity.partner.mass,partner_id:0
@ -3007,7 +3122,7 @@ msgstr "时事通信"
#. module: crm
#: model:mail.message.subtype,name:crm.mt_salesteam_lead_stage
msgid "Opportunity Stage Changed"
msgstr ""
msgstr "商机状态已改变"
#. module: crm
#: model:ir.actions.act_window,help:crm.crm_lead_stage_act
@ -3021,6 +3136,16 @@ msgid ""
" </p>\n"
" "
msgstr ""
"<p class=\"oe_view_nocontent_create\">\n"
" "
"点击设置你的线索/商机管道的新阶段。\n"
" </p><p>\n"
" "
"阶段允许销售人员记录特定的线索或商机\n"
" "
"在销售循环中的位置。\n"
" </p>\n"
" "
#~ msgid "My Draft "
#~ msgstr "我的草稿 "

View File

@ -19,17 +19,9 @@
#
##############################################################################
from openerp.osv import fields,osv
from openerp.osv import fields, osv
from openerp import tools
from .. import crm
AVAILABLE_STATES = [
('draft','Draft'),
('open','Open'),
('cancel', 'Cancelled'),
('done', 'Closed'),
('pending','Pending')
]
from openerp.addons.crm import crm
MONTHS = [
('01', 'January'),
@ -66,11 +58,12 @@ class crm_lead_report(osv.osv):
# other date fields
'create_date': fields.datetime('Create Date', readonly=True),
'opening_date': fields.date('Opening Date', readonly=True),
'opening_date': fields.date('Assignation Date', readonly=True),
'date_closed': fields.date('Close Date', readonly=True),
'date_last_stage_update': fields.datetime('Last Stage Update', readonly=True),
# durations
'delay_open': fields.float('Delay to Open',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to open the case"),
'delay_open': fields.float('Delay to Assign',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to open the case"),
'delay_close': fields.float('Delay to Close',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"),
'delay_expected': fields.float('Overpassed Deadline',digits=(16,2),readonly=True, group_operator="avg"),
@ -79,7 +72,6 @@ class crm_lead_report(osv.osv):
'section_id':fields.many2one('crm.case.section', 'Sales Team', readonly=True),
'channel_id':fields.many2one('crm.case.channel', 'Channel', readonly=True),
'type_id':fields.many2one('crm.case.resource.type', 'Campaign', readonly=True),
'state': fields.selection(AVAILABLE_STATES, 'Status', size=16, readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'probability': fields.float('Probability',digits=(16,2),readonly=True, group_operator="avg"),
'planned_revenue': fields.float('Planned Revenue',digits=(16,2),readonly=True),
@ -94,10 +86,7 @@ class crm_lead_report(osv.osv):
('opportunity','Opportunity'),
],'Type', help="Type is used to separate Leads and Opportunities"),
}
def init(self, cr):
"""
@ -109,7 +98,6 @@ class crm_lead_report(osv.osv):
CREATE OR REPLACE VIEW crm_lead_report AS (
SELECT
id,
to_char(c.date_deadline, 'YYYY') as deadline_year,
to_char(c.date_deadline, 'MM') as deadline_month,
to_char(c.date_deadline, 'YYYY-MM-DD') as deadline_day,
@ -121,7 +109,8 @@ class crm_lead_report(osv.osv):
to_char(c.date_open, 'YYYY-MM-DD') as opening_date,
to_char(c.date_closed, 'YYYY-mm-dd') as date_closed,
c.state,
date_trunc('day',c.date_last_stage_update) as date_last_stage_update,
c.user_id,
c.probability,
c.stage_id,

View File

@ -13,7 +13,7 @@
<field name="creation_month" invisible="1"/>
<field name="creation_day" invisible="1"/>
<field name="deadline_month" invisible="1"/>
<field name="state" invisible="1"/>
<field name="date_last_stage_update" invisible="1"/>
<field name="stage_id" invisible="1"/>
<field name="type_id" invisible="1"/>
<field name="channel_id" invisible="1"/>
@ -69,10 +69,12 @@
<filter icon="terp-personal" name="lead" string="Lead" domain="[('type','=', 'lead')]" help="Show only lead"/>
<filter icon="terp-personal+" string="Opportunity" name="opportunity" domain="[('type','=','opportunity')]" help="Show only opportunity"/>
<separator/>
<filter icon="terp-check" string="New" domain="[('state','=','draft')]" help="Leads/Opportunities which are in New state"/>
<filter icon="terp-camera_test" string="Open" domain="[('state','=','open')]" help="Leads/Opportunities which are in open state"/>
<filter icon="gtk-media-pause" string="Pending" domain="[('state','=','pending')]" help="Leads/Opportunities which are in pending state"/>
<filter icon="terp-dialog-close" string="Closed" domain="[('state','=','done')]" help="Leads/Opportunities which are in done state"/>
<filter string="New" name="new"
domain="[('probability', '=', 0), ('stage_id.sequence', '=', 1)]"/>
<filter string="Won" name="won"
domain="[('probability', '=', 100), ('stage_id.on_change', '=', 1)]"/>
<filter string="Lost" name="lost"
domain="[('probability', '=', 0), ('stage_id.sequence', '!=', 1)]"/>
<separator/>
<filter string="My Sales Team(s)" icon="terp-personal+" context="{'invisible_section': False}" domain="[('section_id.user_id','=',uid)]"
help="Leads/Opportunities that are assigned to one of the sale teams I manage" groups="base.group_multi_salesteams"/>
@ -120,6 +122,7 @@
<separator orientation="vertical" />
<filter string="Exp. Closing" icon="terp-go-month"
domain="[]" context="{'group_by':'deadline_month'}"/>
<filter string="Last Stage Update" context="{'group_by':'date_last_stage_update'}" />
</group>
</search>
</field>
@ -131,7 +134,7 @@
<field name="name">crm.lead.report.tree</field>
<field name="model">crm.lead.report</field>
<field name="arch" type="xml">
<tree colors="blue:state == 'draft';black:state in ('open','pending','done');gray:state == 'cancel' " create="false" string="Opportunities Analysis">
<tree create="false" string="Opportunities Analysis">
<field name="creation_year" invisible="1"/>
<field name="creation_month" invisible="1"/>
<field name="creation_day" invisible="1"/>
@ -141,7 +144,6 @@
<field name="user_id" invisible="1"/>
<field name="partner_id" invisible="1"/>
<field name="country_id" invisible="1"/>
<field name="state" invisible="1"/>
<field name="stage_id" invisible="1"/>
<field name="priority" invisible="1"/>
<field name="type_id" invisible="1"/>
@ -150,8 +152,9 @@
<field name="company_id" invisible="1" groups="base.group_multi_company"/>
<field name="nbr" string="#Opportunities" sum="#Opportunities"/>
<field name="planned_revenue" sum="Planned Revenues"/>
<field name="delay_open" sum='Delay to open'/>
<field name="delay_open" sum='Delay to Assign'/>
<field name="delay_close" sum='Delay to close'/>
<field name="date_last_stage_update"/>
<field name="delay_expected"/>
<field name="probability" widget="progressbar"/>
<field name="probable_revenue"/>

View File

@ -19,16 +19,16 @@
#
##############################################################################
from openerp.osv import fields,osv
from openerp import tools
from .. import crm
from openerp.addons.crm import crm
from openerp.osv import fields, osv
AVAILABLE_STATES = [
('draft','Draft'),
('open','Todo'),
('draft', 'Draft'),
('open', 'Todo'),
('cancel', 'Cancelled'),
('done', 'Held'),
('pending','Pending')
('pending', 'Pending')
]

View File

@ -23,7 +23,7 @@
<field name="nbr" string="#Phone calls" sum="#Phone calls"/>
<field name="duration" avg="Duration"/>
<field name="delay_close" avg="Avg Closing Delay"/>
<field name="delay_open" sum='Delay to open'/>
<field name="delay_open" sum='Delay to Assign'/>
</tree>
</field>
</record>

View File

@ -41,7 +41,7 @@ class res_partner(osv.osv):
_columns = {
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
'opportunity_ids': fields.one2many('crm.lead', 'partner_id',\
'Leads and Opportunities', domain=[('state','in', ('draft','open','pending'))]),
'Leads and Opportunities', domain=[('probability' 'not in', ['0', '100'])]),
'meeting_ids': fields.many2many('crm.meeting', 'crm_meeting_partner_rel','partner_id', 'meeting_id',
'Meetings'),
'phonecall_ids': fields.one2many('crm.phonecall', 'partner_id',\
@ -56,7 +56,7 @@ class res_partner(osv.osv):
default.update({'opportunity_ids': [], 'meeting_ids' : [], 'phonecall_ids' : []})
super(res_partner, self).copy(cr, uid, record_id, default, context)
return super(res_partner, self).copy(cr, uid, record_id, default, context)
def redirect_partner_form(self, cr, uid, partner_id, context=None):
search_view = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base', 'view_res_partner_filter')
@ -87,7 +87,6 @@ class res_partner(osv.osv):
'probability' : probability,
'partner_id' : partner_id,
'categ_ids' : categ_ids and categ_ids[0:1] or [],
'state' :'draft',
'type': 'opportunity'
}, context=context)
opportunity_ids[partner_id] = opportunity_id

View File

@ -17,7 +17,7 @@
Manage your sales funnel with no effort. Attract leads, follow-up on phone calls and meetings. Analyse the quality of your leads to make informed decisions and save time by integrating emails directly into the application.
</p>
<div class="oe_centeralign oe_websiteonly">
<a href="http://www.openerp.com/start" class="oe_button oe_big oe_tacky">Start your <span class="oe_emph">free</span> trial</a>
<a href="http://www.openerp.com/start?app=crm" class="oe_button oe_big oe_tacky">Start your <span class="oe_emph">free</span> trial</a>
</div>
</div>
</div>

View File

@ -1,40 +1,14 @@
-
I set a new sale team (with Marketing at parent) and I cancel unqualified lead .
I set a new sale team (with Marketing at parent) .
-
!python {model: crm.lead}: |
section_id = self.pool.get('crm.case.section').create(cr, uid, {'name': "Phone Marketing", 'parent_id': ref("crm.crm_case_section_2")})
self.write(cr, uid, [ref("crm_case_1")], {'section_id': section_id})
self.case_cancel(cr, uid, [ref("crm_case_1")])
-
I check cancelled lead.
I check unqualified lead .
-
!python {model: crm.lead}: |
lead = self.browse(cr, uid, ref('crm_case_1'))
assert lead.stage_id.id == ref('crm.stage_lead7'), "Stage should be 'Dead' and is %s." % (lead.stage_id.name)
assert lead.state == 'cancel', "Opportunity is not in 'cancel' state."
assert lead.probability == 0.0, 'Opportunity is probably wrong and should be 0.0.'
-
I reset cancelled lead into unqualified lead.
-
!python {model: crm.lead}: |
self.case_reset(cr, uid, [ref("crm_case_1")])
-
I check unqualified lead after reset.
-
!assert {model: crm.lead, id: crm.crm_case_1, string: Lead is in draft state}:
- state == "draft"
-
I re-open the lead
-
!python {model: crm.lead}: |
self.case_open(cr, uid, [ref("crm_case_1")])
-
I check stage and state of the re-opened lead
-
!python {model: crm.lead}: |
lead = self.browse(cr, uid, ref('crm.crm_case_1'))
assert lead.stage_id.id == ref('crm.stage_lead2'), "Opportunity stage should be 'Qualification'."
assert lead.state == 'open', "Opportunity should be in 'open' state."
!assert {model: crm.lead, id: crm.crm_case_1, string: Lead is in new stage}:
- stage_id.sequence == 1
-
I escalate the lead to parent team.
-

View File

@ -0,0 +1,43 @@
-
I create a new lead.
-
!record {model: crm.lead, id: test_crm_lead_new}:
type: 'lead'
name: 'Test lead new'
partner_id: base.res_partner_1
description: This is the description of the test new lead.
section_id: crm.section_sales_department
-
I check default stage of lead.
-
!python {model: crm.lead}: |
stage = self.pool.get('crm.case.stage').search_read(cr,uid,[('sequence','=',1)],['id'],context)[0]
lead = self.browse(cr, uid, ref('test_crm_lead_new'))
stage_id = self.stage_find(cr, uid , [lead], lead.section_id.id or False,[], context)
assert stage_id == stage['id'], "Default stage of lead is incorrect!"
-
I change type from lead to opportunity.
-
!python {model: crm.lead}: |
self.convert_opportunity(cr, uid ,[ref("test_crm_lead_new")], ref("base.res_partner_2"))
-
Now I check default stage after change type.
-
!python {model: crm.lead}: |
stage = self.pool.get('crm.case.stage').search_read(cr,uid,[('sequence','=',1)],['id'],context)[0]
opp = self.browse(cr, uid, ref('test_crm_lead_new'))
stage_id = self.stage_find(cr, uid , [opp], opp.section_id.id or False,[], context)
assert stage_id == stage['id'], "Default stage of opportunity is incorrect!"
-
Now I change the stage of opportunity to won.
-
!python {model: crm.lead}: |
self.case_mark_won(cr, uid, [ref("test_crm_lead_new")])
-
I check statge of opp should won, after change stage.
-
!python {model: crm.lead}: |
opp = self.browse(cr, uid, ref('test_crm_lead_new'))
stage_id = self.stage_find(cr, uid , [opp], opp.section_id.id or False,[('probability','=',100.0)], context)
assert stage_id == opp.stage_id.id, "Stage of opportunity is incorrect!"

View File

@ -2,29 +2,29 @@
-
During a mixed merge (involving leads and opps), data should be handled a certain way following their type (m2o, m2m, text, ...) Start by creating two leads and an opp.
-
!record {model: crm.lead, id: test_crm_lead_01}:
type: 'lead'
name: 'Test lead 1'
partner_id: base.res_partner_1
stage_id: stage_lead1
description: This is the description of the test lead 1.
-
!record {model: crm.lead, id: test_crm_lead_02}:
type: 'lead'
name: 'Test lead 2'
partner_id: base.res_partner_3
stage_id: stage_lead1
description: This is the description of the test lead 2.
-
!record {model: crm.lead, id: test_crm_opp_01}:
!record {model: crm.lead, id: test_crm_opp_1}:
type: 'opportunity'
name: 'Test opportunity 1'
partner_id: base.res_partner_5
stage_id: stage_lead1
description: This is the description of the test opp 1.
-
!record {model: crm.lead, id: test_crm_lead_first}:
type: 'lead'
name: 'Test lead first'
partner_id: base.res_partner_1
stage_id: stage_lead1
description: This is the description of the test lead first.
-
!record {model: crm.lead, id: test_crm_lead_second}:
type: 'lead'
name: 'Test lead second'
partner_id: base.res_partner_1
stage_id: stage_lead1
description: This is the description of the test lead second.
-
!python {model: crm.lead}: |
lead_ids = [ref('test_crm_lead_01'), ref('test_crm_lead_02'), ref('test_crm_opp_01')]
lead_ids = [ref('test_crm_opp_1'), ref('test_crm_lead_first'), ref('test_crm_lead_second')]
context.update({'active_model': 'crm.lead', 'active_ids': lead_ids, 'active_id': lead_ids[0]})
-
I create a merge wizard and merge the leads and opp together in the first item of the list.
@ -38,18 +38,19 @@
-
!python {model: crm.lead}: |
merge_id = self.search(cr, uid, [('name', '=', 'Test opportunity 1'), ('partner_id','=', ref("base.res_partner_5"))])
assert merge_id, 'Fail to create merge opportunity wizard'
merge_result = self.browse(cr, uid, merge_id)[0]
assert merge_result.description == 'This is the description of the test opp 1.\n\nThis is the description of the test lead 1.\n\nThis is the description of the test lead 2.', 'Description mismatch: when merging leads/opps with different text values, these values should get concatenated and separated with line returns'
assert merge_result.description == 'This is the description of the test opp 1.\n\nThis is the description of the test lead first.\n\nThis is the description of the test lead second.', 'Description mismatch: when merging leads/opps with different text values, these values should get concatenated and separated with line returns'
assert merge_result.type == 'opportunity', 'Type mismatch: when at least one opp in involved in the merge, the result should be a new opp (instead of %s)' % merge_result.type
-
The other (tailing) leads/opps shouldn't exist anymore.
-
!python {model: crm.lead}: |
tailing_lead = self.search(cr, uid, [('id', '=', ref('test_crm_lead_01'))])
assert not tailing_lead, 'This tailing lead (id %s) should not exist anymore' % ref('test_crm_lead_02')
tailing_lead = self.search(cr, uid, [('id', '=', ref('test_crm_lead_first'))])
assert not tailing_lead, 'This tailing lead (id %s) should not exist anymore' % ref('test_crm_lead_second')
tailing_opp = self.search(cr, uid, [('id', '=', ref('test_crm_lead_02'))])
tailing_opp = self.search(cr, uid, [('id', '=', ref('test_crm_lead_second'))])
assert not tailing_opp, 'This tailing opp (id %s) should not exist anymore' % ref('test_crm_opp_01')
-
I want to test leads merge. Start by creating two leads (with the same partner).
@ -122,4 +123,4 @@
assert merge_result.partner_id.id == ref("base.res_partner_5"), 'Partner mismatch'
assert merge_result.type == 'opportunity', 'Type mismatch: when opps get merged together, the result should be a new opp (instead of %s)' % merge_result.type
tailing_opp = self.search(cr, uid, [('id', '=', ref('test_crm_opp_03'))])
assert not tailing_opp, 'This tailing opp (id %s) should not exist anymore' % ref('test_crm_opp_03')
assert not tailing_opp, 'This tailing opp (id %s) should not exist anymore' % ref('test_crm_opp_03')

View File

@ -6,23 +6,17 @@
partner_id: base.res_partner_2
type: opportunity
stage_id: crm.stage_lead1
state: draft
-
I create a lead record to call a mailing opt-out onchange method.
-
!record {model: crm.lead, id: crm_case_18}:
name: 'Need 20 Days of Consultancy'
type: opportunity
state: draft
stage_id: crm.stage_lead1
opt_out: True
-
I create a phonecall record to call a partner onchange method.
-
!record {model: crm.phonecall, id: crm_phonecall_5}:
name: 'Bad time'
partner_id: base.res_partner_5
-
I set the next stage to "New" for the lead.
-
!python {model: crm.lead}: |
self.stage_next(cr, uid, [ref("crm_case_4")], context={'stage_type': 'lead'})
partner_id: base.res_partner_5

View File

@ -1,25 +1,25 @@
-
In order to test the conversion of a lead into a opportunity,
-
I open a lead.
I set lead to open stage.
-
!python {model: crm.lead}: |
self.case_open(cr, uid, [ref("crm_case_4")])
self.write(cr, uid, [ref("crm_case_3")],{'stage_id':ref("stage_lead1")})
-
I check if the lead state is "Open".
I check if the lead stage is "Open".
-
!assert {model: crm.lead, id: crm.crm_case_4, string: Lead state is Open}:
- state == "open"
!assert {model: crm.lead, id: crm.crm_case_3, string: Lead stage is Open}:
- stage_id.sequence == 1
-
I convert lead into opportunity for exiting customer.
-
!python {model: crm.lead}: |
self.convert_opportunity(cr, uid ,[ref("crm_case_4")], ref("base.res_partner_2"))
self.convert_opportunity(cr, uid ,[ref("crm_case_3")], ref("base.res_partner_2"))
-
I check details of converted opportunity.
-
!python {model: crm.lead}: |
lead = self.browse(cr, uid, ref('crm_case_4'))
lead = self.browse(cr, uid, ref('crm_case_3'))
assert lead.type == 'opportunity', 'Lead is not converted to opportunity!'
assert lead.partner_id.id == ref("base.res_partner_2"), 'Partner mismatch!'
assert lead.stage_id.id == ref("stage_lead1"), 'Stage of opportunity is incorrect!'
@ -28,7 +28,7 @@
-
!python {model: crm.opportunity2phonecall}: |
import time
context.update({'active_model': 'crm.lead', 'active_ids': [ref('crm_case_4')]})
context.update({'active_model': 'crm.lead', 'active_ids': [ref('crm_case_3')]})
call_id = self.create(cr, uid, {'date': time.strftime('%Y-%m-%d %H:%M:%S'),
'name': "Bonjour M. Jean, Comment allez-vous? J'ai bien reçu votre demande, pourrions-nous en parler quelques minutes?"}, context=context)
self.action_schedule(cr, uid, [call_id], context=context)
@ -36,46 +36,46 @@
I check that phonecall is scheduled for that opportunity.
-
!python {model: crm.phonecall}: |
ids = self.search(cr, uid, [('opportunity_id', '=', ref('crm_case_4'))])
ids = self.search(cr, uid, [('opportunity_id', '=', ref('crm_case_3'))])
assert len(ids), 'Phonecall is not scheduled'
-
Now I schedule meeting with customer.
-
!python {model: crm.lead}: |
self.action_makeMeeting(cr, uid, [ref('crm_case_4')])
self.action_makeMeeting(cr, uid, [ref('crm_case_3')])
-
After communicated with customer, I put some notes with contract details.
-
!python {model: crm.lead}: |
self.message_post(cr, uid, [ref('crm_case_4')], subject='Test note', body='Détails envoyés par le client sur le FAX pour la qualité')
self.message_post(cr, uid, [ref('crm_case_3')], subject='Test note', body='Détails envoyés par le client sur le FAX pour la qualité')
-
I win this opportunity
-
!python {model: crm.lead}: |
self.case_mark_won(cr, uid, [ref("crm_case_4")])
self.case_mark_won(cr, uid, [ref("crm_case_3")])
-
I check details of the opportunity after having won the opportunity.
-
!python {model: crm.lead}: |
lead = self.browse(cr, uid, ref('crm_case_4'))
lead = self.browse(cr, uid, ref('crm_case_3'))
assert lead.stage_id.id == ref('crm.stage_lead6'), "Opportunity stage should be 'Won'."
assert lead.state == 'done', "Opportunity is not in 'done' state!"
assert lead.stage_id.probability == 100.0, "Opportunity is not 'done'"
assert lead.probability == 100.0, "Revenue probability should be 100.0!"
-
I convert mass lead into opportunity customer.
-
!python {model: crm.lead2opportunity.partner.mass}: |
context.update({'active_model': 'crm.lead', 'active_ids': [ref("crm_case_11"), ref("crm_case_2")], 'active_id': ref("crm_case_11")})
context.update({'active_model': 'crm.lead', 'active_ids': [ref("crm_case_13"), ref("crm_case_2")], 'active_id': ref("crm_case_13")})
id = self.create(cr, uid, {'user_ids': [(6, 0, [ref('base.user_root')])], 'section_id': ref('crm.section_sales_department')}, context=context)
self.mass_convert(cr, uid, [id], context=context)
-
Now I check first lead converted on opportunity.
-
!python {model: crm.lead}: |
opp = self.browse(cr, uid, ref('crm_case_11'))
assert opp.name == "Need estimated cost for new project", "Opportunity name not correct"
opp = self.browse(cr, uid, ref('crm_case_13'))
assert opp.name == "Plan to buy 60 keyboards and mouses", "Opportunity name not correct"
assert opp.type == 'opportunity', 'Lead is not converted to opportunity!'
expected_partner = "Thomas Passot"
expected_partner = "Will McEncroe"
assert opp.partner_id.name == expected_partner, 'Partner mismatch! %s vs %s' % (opp.partner_id.name, expected_partner)
assert opp.stage_id.id == ref("stage_lead1"), 'Stage of probability is incorrect!'
-
@ -96,8 +96,8 @@
-
!python {model: crm.lead}: |
lead = self.browse(cr, uid, ref('crm_case_2'))
assert lead.stage_id.id == ref('crm.stage_lead8'), "Opportunity stage should be 'Lost'."
assert lead.state == 'cancel', "Lost opportunity is not in 'cancel' state!"
assert lead.stage_id.id == ref('crm.stage_lead7'), "Opportunity stage should be 'Lost'."
assert lead.stage_id.sequence != 1 and lead.stage_id.probability == 0.0, "Lost opportunity is not in 'cancel' state!"
assert lead.probability == 0.0, "Revenue probability should be 0.0!"
-
I confirm review needs meeting.

View File

@ -21,7 +21,6 @@
from openerp.osv import fields, osv
from openerp.tools.translate import _
from openerp import tools
import re
class crm_lead2opportunity_partner(osv.osv_memory):
@ -35,6 +34,8 @@ class crm_lead2opportunity_partner(osv.osv_memory):
('merge', 'Merge with existing opportunities')
], 'Conversion Action', required=True),
'opportunity_ids': fields.many2many('crm.lead', string='Opportunities'),
'user_id': fields.many2one('res.users', 'Salesperson', select=True),
'section_id': fields.many2one('crm.case.section', 'Sales Team', select=True),
}
def default_get(self, cr, uid, fields, context=None):
@ -58,11 +59,11 @@ class crm_lead2opportunity_partner(osv.osv_memory):
if partner_id:
# Search for opportunities that have the same partner and that arent done or cancelled
ids = lead_obj.search(cr, uid, [('partner_id', '=', partner_id), ('state', '!=', 'done')])
ids = lead_obj.search(cr, uid, [('partner_id', '=', partner_id), ('probability', '<', '100')])
for id in ids:
tomerge.add(id)
if email:
ids = lead_obj.search(cr, uid, [('email_from', 'ilike', email[0]), ('state', '!=', 'done')])
ids = lead_obj.search(cr, uid, [('email_from', 'ilike', email[0]), ('probability', '<', '100')])
for id in ids:
tomerge.add(id)
@ -74,9 +75,27 @@ class crm_lead2opportunity_partner(osv.osv_memory):
res.update({'name' : len(tomerge) >= 2 and 'merge' or 'convert'})
if 'opportunity_ids' in fields and len(tomerge) >= 2:
res.update({'opportunity_ids': list(tomerge)})
if lead.user_id:
res.update({'user_id': lead.user_id.id})
if lead.section_id:
res.update({'section_id': lead.section_id.id})
return res
def on_change_user(self, cr, uid, ids, user_id, section_id, context=None):
""" When changing the user, also set a section_id or restrict section id
to the ones user_id is member of. """
if user_id:
if section_id:
user_in_section = self.pool.get('crm.case.section').search(cr, uid, [('id', '=', section_id), '|', ('user_id', '=', user_id), ('member_ids', '=', user_id)], context=context, count=True)
else:
user_in_section = False
if not user_in_section:
section_id = False
section_ids = self.pool.get('crm.case.section').search(cr, uid, ['|', ('user_id', '=', user_id), ('member_ids', '=', user_id)], context=context)
if section_ids:
section_id = section_ids[0]
return {'value': {'section_id': section_id}}
def view_init(self, cr, uid, fields, context=None):
"""
Check some preconditions before the wizard executes.
@ -85,8 +104,8 @@ class crm_lead2opportunity_partner(osv.osv_memory):
context = {}
lead_obj = self.pool.get('crm.lead')
for lead in lead_obj.browse(cr, uid, context.get('active_ids', []), context=context):
if lead.state in ['done', 'cancel']:
raise osv.except_osv(_("Warning!"), _("Closed/Cancelled leads cannot be converted into opportunities."))
if lead.probability == 100:
raise osv.except_osv(_("Warning!"), _("Closed/Dead leads cannot be converted into opportunities."))
return False
def _convert_opportunity(self, cr, uid, ids, vals, context=None):
@ -118,15 +137,15 @@ class crm_lead2opportunity_partner(osv.osv_memory):
w = self.browse(cr, uid, ids, context=context)[0]
opp_ids = [o.id for o in w.opportunity_ids]
if w.name == 'merge':
lead_id = self.pool.get('crm.lead').merge_opportunity(cr, uid, opp_ids, context=context)
lead_id = self.pool.get('crm.lead').merge_opportunity(cr, uid, opp_ids, w.user_id.id, w.section_id.id, context=context)
lead_ids = [lead_id]
lead = self.pool.get('crm.lead').read(cr, uid, lead_id, ['type'], context=context)
if lead['type'] == "lead":
context.update({'active_ids': lead_ids})
self._convert_opportunity(cr, uid, ids, {'lead_ids': lead_ids}, context=context)
self._convert_opportunity(cr, uid, ids, {'lead_ids': lead_ids, 'user_ids': [w.user_id.id], 'section_id': w.section_id.id}, context=context)
else:
lead_ids = context.get('active_ids', [])
self._convert_opportunity(cr, uid, ids, {'lead_ids': lead_ids}, context=context)
self._convert_opportunity(cr, uid, ids, {'lead_ids': lead_ids, 'user_ids': [w.user_id.id], 'section_id': w.section_id.id}, context=context)
return self.pool.get('crm.lead').redirect_opportunity_view(cr, uid, lead_ids[0], context=context)

View File

@ -10,6 +10,10 @@
<group name="name">
<field name="name" class="oe_inline"/>
</group>
<group string="Assign opportunities to">
<field name="user_id" class="oe_inline" on_change="on_change_user(user_id, section_id, context)"/>
<field name="section_id" class="oe_inline"/>
</group>
<group string="Opportunities">
<field name="opportunity_ids" attrs="{'invisible': [('name', '!=', 'merge')]}" nolabel="1">
<tree>
@ -56,6 +60,10 @@
attrs="{'required': [('action', '=', 'exist')], 'invisible':[('action','!=','exist')]}"
class="oe_inline"/>
</group>
<group string="Assign opportunities to" attrs="{'invisible': [('name', '=', '')]}">
<field name="section_id" groups="base.group_multi_salesteams"/>
<field name="user_ids" widget="many2many_tags"/>
</group>
<group string="Select Opportunities" attrs="{'invisible': [('name', '!=', 'merge')]}">
<field name="opportunity_ids" colspan="4" nolabel="1" attrs="{'invisible': [('name', '=', 'convert')]}">
<tree>
@ -72,12 +80,6 @@
</tree>
</field>
</group>
<group string="Assign opportunities to" attrs="{'invisible': [('name', '=', '')]}">
<field name="section_id" groups="base.group_multi_salesteams"/>
<field name="user_ids" widget="many2many_tags"/>
</group>
<footer>
<button name="mass_convert" string="Convert to Opportunities" type="object" class="oe_highlight"/>
or

View File

@ -34,6 +34,8 @@ class crm_merge_opportunity(osv.osv_memory):
_description = 'Merge opportunities'
_columns = {
'opportunity_ids': fields.many2many('crm.lead', rel='merge_opportunity_rel', id1='merge_id', id2='opportunity_id', string='Leads/Opportunities'),
'user_id': fields.many2one('res.users', 'Salesperson', select=True),
'section_id': fields.many2one('crm.case.section', 'Sales Team', select=True),
}
def action_merge(self, cr, uid, ids, context=None):
@ -47,7 +49,7 @@ class crm_merge_opportunity(osv.osv_memory):
#TODO: why is this passed through the context ?
context['lead_ids'] = [opportunity2merge_ids[0].id]
merge_id = lead_obj.merge_opportunity(cr, uid, [x.id for x in opportunity2merge_ids], context=context)
merge_id = lead_obj.merge_opportunity(cr, uid, [x.id for x in opportunity2merge_ids], wizard.user_id.id, wizard.section_id.id, context=context)
# The newly created lead might be a lead or an opp: redirect toward the right view
merge_result = lead_obj.browse(cr, uid, merge_id, context=context)
@ -60,8 +62,7 @@ class crm_merge_opportunity(osv.osv_memory):
def default_get(self, cr, uid, fields, context=None):
"""
Use active_ids from the context to fetch the leads/opps to merge.
In order to get merged, these leads/opps can't be in 'Done' or
'Cancel' state.
In order to get merged, these leads/opps can't be in 'Dead' or 'Closed'
"""
if context is None:
context = {}
@ -72,11 +73,26 @@ class crm_merge_opportunity(osv.osv_memory):
opp_ids = []
opps = self.pool.get('crm.lead').browse(cr, uid, record_ids, context=context)
for opp in opps:
if opp.state not in ('done', 'cancel'):
if opp.probability < 100:
opp_ids.append(opp.id)
if 'opportunity_ids' in fields:
res.update({'opportunity_ids': opp_ids})
return res
def on_change_user(self, cr, uid, ids, user_id, section_id, context=None):
""" When changing the user, also set a section_id or restrict section id
to the ones user_id is member of. """
if user_id:
if section_id:
user_in_section = self.pool.get('crm.case.section').search(cr, uid, [('id', '=', section_id), '|', ('user_id', '=', user_id), ('member_ids', '=', user_id)], context=context, count=True)
else:
user_in_section = False
if not user_in_section:
section_id = False
section_ids = self.pool.get('crm.case.section').search(cr, uid, ['|', ('user_id', '=', user_id), ('member_ids', '=', user_id)], context=context)
if section_ids:
section_id = section_ids[0]
return {'value': {'section_id': section_id}}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -8,20 +8,25 @@
<field name="model">crm.merge.opportunity</field>
<field name="arch" type="xml">
<form string="Merge Leads/Opportunities" version="7.0">
<separator string="Select Leads/Opportunities"/>
<field name="opportunity_ids">
<tree>
<field name="create_date"/>
<field name="name"/>
<field name="type"/>
<field name="contact_name"/>
<field name="email_from"/>
<field name="phone"/>
<field name="stage_id"/>
<field name="user_id"/>
<field name="section_id" groups="base.group_multi_salesteams"/>
</tree>
</field>
<group string="Assign opportunities to">
<field name="user_id" class="oe_inline" on_change="on_change_user(user_id, context)"/>
<field name="section_id" class="oe_inline"/>
</group>
<group string="Select Leads/Opportunities">
<field name="opportunity_ids" nolabel="1">
<tree>
<field name="create_date"/>
<field name="name"/>
<field name="type"/>
<field name="contact_name"/>
<field name="email_from"/>
<field name="phone"/>
<field name="stage_id"/>
<field name="user_id"/>
<field name="section_id" groups="base.group_multi_salesteams"/>
</tree>
</field>
</group>
<footer>
<button name="action_merge" type="object" string="Merge" class="oe_highlight"/>
or

View File

@ -19,20 +19,12 @@
#
##############################################################################
from openerp.addons.base_status.base_stage import base_stage
import binascii
from openerp.addons.crm import crm
from openerp.osv import fields, osv
import time
from openerp import tools
from openerp.tools.translate import _
from openerp.tools import html2plaintext
CRM_CLAIM_PENDING_STATES = (
crm.AVAILABLE_STATES[2][0], # Cancelled
crm.AVAILABLE_STATES[3][0], # Done
crm.AVAILABLE_STATES[4][0], # Pending
)
class crm_claim_stage(osv.osv):
""" Model for claim stages. This models the main stages of a claim
@ -50,9 +42,6 @@ class crm_claim_stage(osv.osv):
'sequence': fields.integer('Sequence', help="Used to order stages. Lower is better."),
'section_ids':fields.many2many('crm.case.section', 'section_claim_stage_rel', 'stage_id', 'section_id', string='Sections',
help="Link between stages and sales teams. When set, this limitate the current stage to the selected sales teams."),
'state': fields.selection(crm.AVAILABLE_STATES, 'Status', required=True, help="The related status for the stage. The status of your document will automatically change regarding the selected stage. For example, if a stage is related to the status 'Close', when your document reaches this stage, it will be automatically have the 'closed' status."),
'case_refused': fields.boolean('Refused stage',
help='Refused stages are specific stages for done.'),
'case_default': fields.boolean('Common to All Teams',
help="If you check this field, this stage will be proposed by default on each sales team. It will not assign this stage to existing teams."),
'fold': fields.boolean('Hide in Views when Empty',
@ -61,12 +50,10 @@ class crm_claim_stage(osv.osv):
_defaults = {
'sequence': lambda *args: 1,
'state': 'draft',
'fold': False,
'case_refused': False,
}
class crm_claim(base_stage, osv.osv):
class crm_claim(osv.osv):
""" Crm claim
"""
_name = "crm.claim"
@ -74,6 +61,15 @@ class crm_claim(base_stage, osv.osv):
_order = "priority,date desc"
_inherit = ['mail.thread']
def _get_default_section_id(self, cr, uid, context=None):
""" Gives default section by checking if present in the context """
return self.pool.get('crm.lead')._resolve_section_id_from_context(cr, uid, context=context) or False
def _get_default_stage_id(self, cr, uid, context=None):
""" Gives default stage_id """
section_id = self._get_default_section_id(cr, uid, context=context)
return self.stage_find(cr, uid, [], section_id, [('sequence', '=', '1')], context=context)
_columns = {
'id': fields.integer('ID', readonly=True),
'name': fields.char('Claim Subject', size=128, required=True),
@ -107,25 +103,16 @@ class crm_claim(base_stage, osv.osv):
'stage_id': fields.many2one ('crm.claim.stage', 'Stage', track_visibility='onchange',
domain="['|', ('section_ids', '=', section_id), ('case_default', '=', True)]"),
'cause': fields.text('Root Cause'),
'state': fields.related('stage_id', 'state', type="selection", store=True,
selection=crm.AVAILABLE_STATES, string="Status", readonly=True,
help='The status is set to \'Draft\', when a case is created.\
If the case is in progress the status is set to \'Open\'.\
When the case is over, the status is set to \'Done\'.\
If the case needs to be reviewed then the status is \
set to \'Pending\'.'),
}
_defaults = {
'user_id': lambda s, cr, uid, c: s._get_default_user(cr, uid, c),
'partner_id': lambda s, cr, uid, c: s._get_default_partner(cr, uid, c),
'email_from': lambda s, cr, uid, c: s._get_default_email(cr, uid, c),
'user_id': lambda s, cr, uid, c: uid,
'section_id': lambda s, cr, uid, c: s._get_default_section_id(cr, uid, c),
'date': fields.datetime.now,
'date': fields.datetime.now(),
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.case', context=c),
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
'active': lambda *a: 1,
'stage_id':lambda s, cr, uid, c: s._get_default_stage_id(cr, uid, c)
'stage_id': lambda s, cr, uid, c: s._get_default_stage_id(cr, uid, c)
}
def stage_find(self, cr, uid, cases, section_id, domain=[], order='sequence', context=None):
@ -158,27 +145,24 @@ class crm_claim(base_stage, osv.osv):
return stage_ids[0]
return False
def case_refuse(self, cr, uid, ids, context=None):
""" Mark the case as refused: state=done and case_refused=True """
for lead in self.browse(cr, uid, ids):
stage_id = self.stage_find(cr, uid, [lead], lead.section_id.id or False, ['&', ('state', '=', 'done'), ('case_refused', '=', True)], context=context)
if stage_id:
self.case_set(cr, uid, [lead.id], values_to_update={}, new_stage_id=stage_id, context=context)
return True
def onchange_partner_id(self, cr, uid, ids, part, email=False):
def onchange_partner_id(self, cr, uid, ids, partner_id, email=False, context=None):
"""This function returns value of partner address based on partner
:param part: Partner's id
:param email: ignored
"""
if not part:
return {'value': {'email_from': False,
'partner_phone': False
}
}
address = self.pool.get('res.partner').browse(cr, uid, part)
if not partner_id:
return {'value': {'email_from': False, 'partner_phone': False}}
address = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context)
return {'value': {'email_from': address.email, 'partner_phone': address.phone}}
def create(self, cr, uid, vals, context=None):
if context is None:
context = {}
if vals.get('section_id') and not context.get('default_section_id'):
context['default_section_id'] = vals.get('section_id')
# context: no_log, because subtype already handle this
return super(crm_claim, self).create(cr, uid, vals, context=context)
# -------------------------------------------------------
# Mail gateway
# -------------------------------------------------------

View File

@ -44,28 +44,23 @@
<record model="crm.claim.stage" id="stage_claim1">
<field name="name">New</field>
<field name="state">draft</field>
<field name="sequence">26</field>
<field name="sequence">1</field>
<field name="case_default" eval="True"/>
</record>
<record model="crm.claim.stage" id="stage_claim5">
<field name="name">In Progress</field>
<field name="state">open</field>
<field name="sequence">27</field>
<field name="case_default" eval="True"/>
</record>
<record model="crm.claim.stage" id="stage_claim2">
<field name="name">Settled</field>
<field name="state">done</field>
<field name="sequence">28</field>
<field name="case_default" eval="True"/>
</record>
<record model="crm.claim.stage" id="stage_claim3">
<field name="name">Rejected</field>
<field name="state">cancel</field>
<field name="sequence">29</field>
<field name="case_default" eval="True"/>
<field name="case_refused" eval="True"/>
<field name="fold" eval="True"/>
</record>

View File

@ -38,7 +38,6 @@
<tree string="Claim Stages">
<field name="sequence"/>
<field name="name"/>
<field name="state"/>
</tree>
</field>
</record>
@ -51,8 +50,6 @@
<field name="name"/>
<field name="case_default"/>
<field name="sequence"/>
<field name="state"/>
<field name="case_refused"/>
<field name="fold"/>
</form>
</field>
@ -80,7 +77,7 @@
<field name="name">CRM - Claims Tree</field>
<field name="model">crm.claim</field>
<field name="arch" type="xml">
<tree string="Claims" colors="blue:state=='pending' and not(date_deadline and (date_deadline &lt; current_date));gray:state in ('close', 'cancel');red:date_deadline and (date_deadline &lt; current_date)">
<tree string="Claims">
<field name="name"/>
<field name="partner_id"/>
<field name="user_id"/>
@ -91,7 +88,6 @@
<field name="categ_id" string="Type"/>
<field name="date_deadline" invisible="1"/>
<field name="date_closed" invisible="1"/>
<field name="state" groups="base.group_no_one"/>
</tree>
</field>
</record>
@ -102,10 +98,6 @@
<field name="arch" type="xml">
<form string="Claim" version="7.0">
<header>
<button name="case_close" string="Settle" type="object" class="oe_highlight"
states="draft,open,pending" groups="base.group_user"/>
<button name="case_cancel" string="Reject" type="object" groups="base.group_user"
states="draft,open,pending"/>
<field name="stage_id" widget="statusbar" clickable="True"/>
</header>
<sheet string="Claims">
@ -118,7 +110,6 @@
<field name="priority"/>
<field name="section_id" groups="base.group_multi_salesteams"/>
<field name="date_deadline"/>
<field name="state" groups="base.group_no_one"/>
</group>
<group colspan="4" col="4">
<notebook>
@ -196,9 +187,6 @@
<field name="arch" type="xml">
<search string="Search Claims">
<field name="name" string="Claims"/>
<filter icon="terp-check" string="New" name="current" domain="[('state','=','draft')]" help="New Claims"/>
<filter icon="terp-camera_test" string="In Progress" domain="[('state','=','open')]" help="In Progress Claims"/>
<filter icon="terp-gtk-media-pause" string="Pending" domain="[('state','=','pending')]"/>
<separator/>
<filter string="Unassigned Claims" icon="terp-personal-" domain="[('user_id','=', False)]" help="Unassigned Claims" />
<field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/>
@ -208,7 +196,6 @@
<filter string="Responsible" icon="terp-personal" domain="[]" help="Responsible User" context="{'group_by':'user_id'}"/>
<filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
<filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'categ_id'}"/>
<filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}" groups="base.group_no_one"/>
<filter string="Claim Date" icon="terp-go-month" domain="[]" help="Claim Date" context="{'group_by':'date'}"/>
<filter string="Deadline" icon="terp-go-month" domain="[]" context="{'group_by':'date_deadline'}"/>
<filter string="Closure" icon="terp-go-month" domain="[]" help="Date Closed" context="{'group_by':'date_closed'}" groups="base.group_no_one"/>

View File

@ -22,14 +22,6 @@
from openerp.osv import fields,osv
from openerp import tools
AVAILABLE_STATES = [
('draft','Draft'),
('open','Open'),
('cancel', 'Cancelled'),
('done', 'Closed'),
('pending','Pending')
]
AVAILABLE_PRIORITIES = [
('5', 'Lowest'),
('4', 'Low'),
@ -51,7 +43,6 @@ class crm_claim_report(osv.osv):
'user_id':fields.many2one('res.users', 'User', readonly=True),
'section_id':fields.many2one('crm.case.section', 'Section', readonly=True),
'nbr': fields.integer('# of Cases', readonly=True),
'state': fields.selection(AVAILABLE_STATES, 'Status', size=16, readonly=True),
'month':fields.selection([('01', 'January'), ('02', 'February'), \
('03', 'March'), ('04', 'April'),\
('05', 'May'), ('06', 'June'), \
@ -92,7 +83,6 @@ class crm_claim_report(osv.osv):
to_char(c.date, 'YYYY-MM-DD') as day,
to_char(c.date_closed, 'YYYY-MM-DD') as date_closed,
to_char(c.date_deadline, 'YYYY-MM-DD') as date_deadline,
c.state,
c.user_id,
c.stage_id,
c.section_id,
@ -109,7 +99,7 @@ class crm_claim_report(osv.osv):
from
crm_claim c
group by to_char(c.date, 'YYYY'), to_char(c.date, 'MM'),to_char(c.date, 'YYYY-MM-DD'),\
c.state, c.user_id,c.section_id, c.stage_id,\
c.user_id,c.section_id, c.stage_id,\
c.categ_id,c.partner_id,c.company_id,c.create_date,
c.priority,c.type_action,c.date_deadline,c.date_closed,c.id
)""")

View File

@ -21,7 +21,6 @@
<field name="email" sum="# Mails"/>
<field name="delay_close" avg="Avg Closing Delay"/>
<field name="delay_expected"/>
<field name="state" invisible="1"/>
<field name="stage_id" invisible="1"/>
<field name="categ_id" invisible="1"/>
<field name="priority" invisible="1"/>
@ -37,7 +36,6 @@
<field name="model">crm.claim.report</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="Claims" type="bar">
<field name="state"/>
<field name="nbr" operator="+"/>
<field group="True" name="user_id"/>
</graph>
@ -51,10 +49,6 @@
<field name="model">crm.claim.report</field>
<field name="arch" type="xml">
<search string="Search">
<filter icon="terp-document-new" string="New" domain="[('state','=','draft')]"/>
<filter icon="terp-camera_test" string="Open" domain="[('state','=','open')]"/>
<filter icon="terp-gtk-media-pause" string="Pending" domain="[('state','=','pending')]"/>
<separator/>
<filter string="My Sales Team(s)" icon="terp-personal+" context="{'invisible_section': False}" domain="[('section_id.user_id','=',uid)]" help="My Sales Team(s)" groups="base.group_multi_salesteams"/>
<separator/>
<filter string="My Company" icon="terp-go-home" context="{'invisible_section': False}" domain="[('section_id.user_id.company_id','=',uid)]" help="My company"/>
@ -73,8 +67,6 @@
<field name="create_date" />
<field name="date_closed" />
<field name="date_deadline" />
<filter icon="terp-dialog-close" string="Done" domain="[('state','=','done')]"/>
<filter icon="gtk-cancel" string="Cancel" domain="[('state','=','cancel')]"/>
</group>
<group expand="1" string="Group By...">
<filter string="Salesperson" name="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}" />
@ -84,7 +76,6 @@
<filter string="Priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}" />
<filter string="Category" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'categ_id'}" />
<filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type_action'}" help="Action Type"/>
<filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}" />
<filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<filter string="Day" icon="terp-go-today" domain="[]" context="{'group_by':'day'}" help="Date of claim"/>
<filter string="Month" icon="terp-go-month" domain="[]" context="{'group_by':'month'}" help="Month of claim"/>

View File

@ -21,25 +21,9 @@
-
!python {model: crm.claim}: |
claim_ids = self.search(cr, uid, [('email_from','=', 'Mr. John Right <info@customer.com>')])
self.case_open(cr, uid, claim_ids)
-
I check Claim Details after open.
I check Claim Details after open.
-
!python {model: crm.claim}: |
claim_ids = self.search(cr, uid, [('email_from','=', 'Mr. John Right <info@customer.com>')])
claim = self.browse(cr, uid, claim_ids[0])
assert claim.state == "open", "Claim is not in Open state"
assert claim.stage_id.id == ref("crm.stage_lead2"), "Claim is not in Qualification stage"
-
After complete all service from our side, I close this claim.
-
!python {model: crm.claim}: |
claim_ids = self.search(cr, uid, [('email_from','=', 'Mr. John Right <info@customer.com>')])
self.case_close(cr, uid, claim_ids)
-
I check Claim details after closed.
-
!python {model: crm.claim}: |
claim_ids = self.search(cr, uid, [('email_from','=', 'Mr. John Right <info@customer.com>')])
claim = self.browse(cr, uid, claim_ids[0])
assert claim.state == "done", "Claim is not in close state"

View File

@ -20,20 +20,22 @@
##############################################################################
from openerp.addons.base_status.base_state import base_state
from openerp.addons.base_status.base_stage import base_stage
from openerp.addons.crm import crm
from openerp.osv import fields, osv
from openerp import tools
from openerp.tools.translate import _
from openerp.tools import html2plaintext
CRM_HELPDESK_STATES = (
crm.AVAILABLE_STATES[2][0], # Cancelled
crm.AVAILABLE_STATES[3][0], # Done
crm.AVAILABLE_STATES[4][0], # Pending
)
AVAILABLE_STATES = [
('draft', 'New'),
('cancel', 'Cancelled'),
('open', 'In Progress'),
('pending', 'Pending'),
('done', 'Closed')
]
class crm_helpdesk(base_state, base_stage, osv.osv):
class crm_helpdesk(base_state, osv.osv):
""" Helpdesk Cases """
_name = "crm.helpdesk"
@ -71,7 +73,7 @@ class crm_helpdesk(base_state, base_stage, osv.osv):
domain="['|',('section_id','=',False),('section_id','=',section_id),\
('object_id.model', '=', 'crm.helpdesk')]"),
'duration': fields.float('Duration', states={'done': [('readonly', True)]}),
'state': fields.selection(crm.AVAILABLE_STATES, 'Status', size=16, readonly=True,
'state': fields.selection(AVAILABLE_STATES, 'Status', size=16, readonly=True,
help='The status is set to \'Draft\', when a case is created.\
\nIf the case is in progress the status is set to \'Open\'.\
\nWhen the case is over, the status is set to \'Done\'.\
@ -80,9 +82,7 @@ class crm_helpdesk(base_state, base_stage, osv.osv):
_defaults = {
'active': lambda *a: 1,
'user_id': lambda s, cr, uid, c: s._get_default_user(cr, uid, c),
'partner_id': lambda s, cr, uid, c: s._get_default_partner(cr, uid, c),
'email_from': lambda s, cr, uid, c: s._get_default_email(cr, uid, c),
'user_id': lambda s, cr, uid, c: uid,
'state': lambda *a: 'draft',
'date': lambda *a: fields.datetime.now(),
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.helpdesk', context=c),

View File

@ -38,7 +38,7 @@ You can also use the geolocalization without using the GPS coordinates.
""",
'author': 'OpenERP SA',
'depends': ['crm', 'account', 'portal'],
'demo': ['res_partner_demo.xml'],
'demo': ['res_partner_demo.xml', 'crm_lead_demo.xml'],
'data': [
'security/ir.model.access.csv',
'res_partner_view.xml',

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data noupdate="1">
<!-- Demo Leads -->
<record id="crm_case_partner_assign_1" model="crm.lead">
<field name="type">lead</field>
<field name="name">Specifications and price of your phones</field>
<field name="contact_name">Steve Martinez</field>
<field name="partner_name"></field>
<field name="partner_id" ref=""/>
<field name="function">Reseller</field>
<field name="country_id" ref="base.uk"/>
<field name="city">Edinburgh</field>
<field name="type_id" ref="crm.type_lead8"/>
<field name="categ_ids" eval="[(6, 0, [ref('crm.categ_oppor1')])]"/>
<field name="channel_id" ref="crm.crm_case_channel_email"/>
<field name="priority">2</field>
<field name="section_id" ref="crm.crm_case_section_2"/>
<field name="user_id" ref=""/>
<field name="stage_id" ref="crm.stage_lead1"/>
<field name="description">Hi,
Please, can you give me more details about your phones, including their specifications and their prices.
Regards,
Steve</field>
<field eval="1" name="active"/>
<field name="partner_assigned_id" ref="portal.partner_demo_portal"/>
</record>
</data>
</openerp>

View File

@ -49,7 +49,8 @@
<field name="arch" type="xml">
<field name="partner_id" position="after">
<field name="partner_assigned_id"/>
</field>
<field name="date_assign" invisible="1"/>
</field>
</field>
</record>
@ -60,6 +61,9 @@
<field name="arch" type="xml">
<filter string="Team" position="after">
<filter string="Assigned Partner" icon="terp-personal" domain="[]" context="{'group_by':'partner_assigned_id'}"/>
<filter string="Assigned Month" icon="terp-go-month"
domain="[]" context="{'group_by':'date_assign'}"/>
</filter>
<field name="partner_id" position="after">
<field name="partner_assigned_id"/>

View File

@ -6,7 +6,7 @@
<field name="model">crm.lead</field>
<field name="priority" eval="32"/>
<field name="arch" type="xml">
<tree string="Leads" colors="blue:state=='pending';grey:state in ('cancel', 'done');red:stage_id[1]=='Disinterested';black:stage_id[1]=='Interested'">
<tree string="Leads" colors="red:stage_id[1]=='Disinterested';black:stage_id[1]=='Interested'">
<field name="date_deadline" invisible="1"/>
<field name="create_date"/>
<field name="name" string="Subject"/>
@ -18,7 +18,6 @@
<field name="type_id" invisible="1"/>
<field name="referred" invisible="1"/>
<field name="channel_id" invisible="1"/>
<field name="state" invisible="1"/>
<field name="section_id" invisible="context.get('invisible_section', True)" />
<button string="I'm interested" name="case_interested" icon="gtk-index" type="object"/>
@ -69,7 +68,7 @@
<field name="model">crm.lead</field>
<field name="priority" eval="32"/>
<field name="arch" type="xml">
<tree string="Leads" colors="blue:state=='pending';grey:state in ('cancel', 'done')">
<tree string="Leads">
<field name="date_deadline" invisible="1"/>
<field name="create_date" groups="base.group_no_one"/>
<field name="name" string="Opportunity"/>
@ -83,7 +82,6 @@
<field name="probability" widget="progressbar" avg="Avg. of Probability"/>
<field name="section_id" invisible="context.get('invisible_section', True)" />
<field name="priority" invisible="1"/>
<field name="state" invisible="1"/>
</tree>
</field>
</record>

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: 2012-12-21 17:05+0000\n"
"PO-Revision-Date: 2012-12-14 13:50+0000\n"
"Last-Translator: 盈通 ccdos <ccdos@163.com>\n"
"PO-Revision-Date: 2013-07-23 06:22+0000\n"
"Last-Translator: fanvil <fanvil@hotmail.com>\n"
"Language-Team: Chinese (Simplified) <zh_CN@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: 2013-03-16 05:47+0000\n"
"X-Generator: Launchpad (build 16532)\n"
"X-Launchpad-Export-Date: 2013-07-24 05:31+0000\n"
"X-Generator: Launchpad (build 16700)\n"
#. module: crm_partner_assign
#: field:crm.lead.report.assign,delay_close:0
@ -37,7 +37,7 @@ msgstr "计划收入"
msgid ""
"Message type: email for email message, notification for system message, "
"comment for other messages such as user replies"
msgstr ""
msgstr "消息类型Email 用于 邮件消息, 通知用户系统消息,评论用于其他消息,例如用户回复。"
#. module: crm_partner_assign
#: field:crm.lead.report.assign,nbr:0
@ -53,7 +53,7 @@ msgstr "分组..."
#. module: crm_partner_assign
#: help:crm.lead.forward.to.partner,body:0
msgid "Automatically sanitized HTML contents"
msgstr ""
msgstr "自动整理HTML内容"
#. module: crm_partner_assign
#: view:crm.lead:0
@ -68,7 +68,7 @@ msgstr "geolocalization定位"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,starred:0
msgid "Starred"
msgstr ""
msgstr "加星号的邮件"
#. module: crm_partner_assign
#: view:crm.lead.forward.to.partner:0
@ -80,7 +80,7 @@ msgstr "正文"
msgid ""
"Email address of the sender. This field is set when no matching partner is "
"found for incoming emails."
msgstr ""
msgstr "发送者的Email地址。当收取的email没有对应的合作伙伴时此字段被设置"
#. module: crm_partner_assign
#: view:crm.partner.report.assign:0
@ -111,7 +111,7 @@ msgstr "公司"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,notification_ids:0
msgid "Notifications"
msgstr ""
msgstr "通知"
#. module: crm_partner_assign
#: field:crm.lead.report.assign,date_assign:0
@ -123,7 +123,7 @@ msgstr "业务伙伴日期"
#: view:crm.partner.report.assign:0
#: view:res.partner:0
msgid "Salesperson"
msgstr ""
msgstr "销售员"
#. module: crm_partner_assign
#: selection:crm.lead.report.assign,priority:0
@ -170,7 +170,7 @@ msgstr "指派的geolocalization"
#. module: crm_partner_assign
#: model:ir.model,name:crm_partner_assign.model_crm_lead_forward_to_partner
msgid "Email composition wizard"
msgstr ""
msgstr "Email撰写向导"
#. module: crm_partner_assign
#: field:crm.partner.report.assign,turnover:0
@ -192,7 +192,7 @@ msgstr "为线索指定一个业务伙伴的概率0表示没指派"
#. module: crm_partner_assign
#: view:res.partner:0
msgid "Partner Activation"
msgstr ""
msgstr "激活合作伙伴"
#. module: crm_partner_assign
#: selection:crm.lead.forward.to.partner,type:0
@ -203,7 +203,7 @@ msgstr "系统通知"
#: code:addons/crm_partner_assign/wizard/crm_forward_to_partner.py:74
#, python-format
msgid "Lead forward"
msgstr ""
msgstr "转发的线索"
#. module: crm_partner_assign
#: field:crm.lead.report.assign,probability:0
@ -284,7 +284,7 @@ msgstr "最低"
#. module: crm_partner_assign
#: view:crm.partner.report.assign:0
msgid "Date Invoice"
msgstr ""
msgstr "发票排程"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,template_id:0
@ -309,7 +309,7 @@ msgstr "创建日期"
#. module: crm_partner_assign
#: model:ir.model,name:crm_partner_assign.model_res_partner_activation
msgid "res.partner.activation"
msgstr ""
msgstr "res.partner.activation"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,parent_id:0
@ -344,7 +344,7 @@ msgstr "7月"
#. module: crm_partner_assign
#: view:crm.partner.report.assign:0
msgid "Date Review"
msgstr ""
msgstr "回顾排程"
#. module: crm_partner_assign
#: view:crm.lead.report.assign:0
@ -356,12 +356,12 @@ msgstr "阶段"
#: view:crm.lead.report.assign:0
#: field:crm.lead.report.assign,state:0
msgid "Status"
msgstr ""
msgstr "状态"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,to_read:0
msgid "To read"
msgstr ""
msgstr "查看"
#. module: crm_partner_assign
#: code:addons/crm_partner_assign/wizard/crm_forward_to_partner.py:74
@ -416,12 +416,12 @@ msgstr "到期天数"
#: help:crm.lead.forward.to.partner,notified_partner_ids:0
msgid ""
"Partners that have a notification pushing this message in their mailboxes"
msgstr ""
msgstr "推送此通知消息进他们邮箱的合作伙伴"
#. module: crm_partner_assign
#: selection:crm.lead.forward.to.partner,type:0
msgid "Comment"
msgstr ""
msgstr "评论"
#. module: crm_partner_assign
#: field:res.partner,partner_weight:0
@ -449,7 +449,7 @@ msgstr "12月"
#. module: crm_partner_assign
#: help:crm.lead.forward.to.partner,vote_user_ids:0
msgid "Users that voted for this message"
msgstr ""
msgstr "投票给这条消息的用户"
#. module: crm_partner_assign
#: view:crm.lead.report.assign:0
@ -465,13 +465,13 @@ msgstr "开启日期"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,child_ids:0
msgid "Child Messages"
msgstr ""
msgstr "子信息"
#. module: crm_partner_assign
#: field:crm.partner.report.assign,date_review:0
#: field:res.partner,date_review:0
msgid "Latest Partner Review"
msgstr ""
msgstr "最新合作伙伴评论"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,subject:0
@ -481,17 +481,17 @@ msgstr "主题"
#. module: crm_partner_assign
#: view:crm.lead.forward.to.partner:0
msgid "or"
msgstr ""
msgstr ""
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,body:0
msgid "Contents"
msgstr ""
msgstr "内容"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,vote_user_ids:0
msgid "Votes"
msgstr ""
msgstr "投票"
#. module: crm_partner_assign
#: view:crm.lead.report.assign:0
@ -501,13 +501,13 @@ msgstr "#商机"
#. module: crm_partner_assign
#: help:crm.lead.forward.to.partner,starred:0
msgid "Current user has a starred notification linked to this message"
msgstr ""
msgstr "当前用户用 星号 提醒关联到这条消息"
#. module: crm_partner_assign
#: field:crm.partner.report.assign,date_partnership:0
#: field:res.partner,date_partnership:0
msgid "Partnership Date"
msgstr ""
msgstr "合作关系日期"
#. module: crm_partner_assign
#: view:crm.lead:0
@ -661,7 +661,7 @@ msgstr ""
#. module: crm_partner_assign
#: field:crm.partner.report.assign,period_id:0
msgid "Invoice Period"
msgstr ""
msgstr "发票期间"
#. module: crm_partner_assign
#: model:ir.model,name:crm_partner_assign.model_res_partner_grade
@ -682,7 +682,7 @@ msgstr "附件"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,record_name:0
msgid "Message Record Name"
msgstr ""
msgstr "消息记录名称"
#. module: crm_partner_assign
#: field:res.partner.activation,sequence:0
@ -696,7 +696,7 @@ msgstr "序列"
msgid ""
"Cannot contact geolocation servers. Please make sure that your internet "
"connection is up and running (%s)."
msgstr ""
msgstr "无法连接地理信息服务器。请确保你的互联网链接畅通(%s)。"
#. module: crm_partner_assign
#: selection:crm.lead.report.assign,month:0
@ -722,7 +722,7 @@ msgstr "开启"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,subtype_id:0
msgid "Subtype"
msgstr ""
msgstr "子类型"
#. module: crm_partner_assign
#: field:res.partner,date_localization:0
@ -737,12 +737,12 @@ msgstr "当前的"
#. module: crm_partner_assign
#: model:ir.model,name:crm_partner_assign.model_crm_lead
msgid "Lead/Opportunity"
msgstr ""
msgstr "线索/商机"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,notified_partner_ids:0
msgid "Notified partners"
msgstr ""
msgstr "已通知的合作伙伴"
#. module: crm_partner_assign
#: view:crm.lead.forward.to.partner:0
@ -773,7 +773,7 @@ msgstr "可能收入"
#: field:res.partner,activation:0
#: view:res.partner.activation:0
msgid "Activation"
msgstr ""
msgstr "激活"
#. module: crm_partner_assign
#: view:crm.lead:0
@ -784,12 +784,12 @@ msgstr "指定的业务伙伴"
#. module: crm_partner_assign
#: field:res.partner,grade_id:0
msgid "Partner Level"
msgstr ""
msgstr "合作伙伴级别"
#. module: crm_partner_assign
#: help:crm.lead.forward.to.partner,to_read:0
msgid "Current user has an unread notification linked to this message"
msgstr ""
msgstr "当前用户有关联到这条消息的未读的提醒"
#. module: crm_partner_assign
#: selection:crm.lead.report.assign,type:0
@ -815,7 +815,7 @@ msgstr "名称"
#: model:ir.actions.act_window,name:crm_partner_assign.res_partner_activation_act
#: model:ir.ui.menu,name:crm_partner_assign.res_partner_activation_config_mi
msgid "Partner Activations"
msgstr ""
msgstr "合作伙伴激活"
#. module: crm_partner_assign
#: view:crm.lead.report.assign:0
@ -872,7 +872,7 @@ msgstr "客户关系管理 线索报表"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,composition_mode:0
msgid "Composition mode"
msgstr ""
msgstr "写作模式"
#. module: crm_partner_assign
#: field:crm.lead.forward.to.partner,model:0

View File

@ -23,13 +23,6 @@ from openerp.osv import fields,osv
from openerp import tools
from openerp.addons.crm import crm
AVAILABLE_STATES = [
('draft','Draft'),
('open','Open'),
('cancel', 'Cancelled'),
('done', 'Closed'),
('pending','Pending')
]
class crm_lead_report_assign(osv.osv):
""" CRM Lead Report """
@ -43,7 +36,6 @@ class crm_lead_report_assign(osv.osv):
'user_id':fields.many2one('res.users', 'User', readonly=True),
'country_id':fields.many2one('res.country', 'Country', readonly=True),
'section_id':fields.many2one('crm.case.section', 'Sales Team', readonly=True),
'state': fields.selection(AVAILABLE_STATES, 'Status', size=16, readonly=True),
'month':fields.selection([('01', 'January'), ('02', 'February'), \
('03', 'March'), ('04', 'April'),\
('05', 'May'), ('06', 'June'), \
@ -54,7 +46,7 @@ class crm_lead_report_assign(osv.osv):
'date_assign': fields.date('Partner Date', readonly=True),
'create_date': fields.datetime('Create Date', readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'delay_open': fields.float('Delay to Open',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to open the case"),
'delay_open': fields.float('Delay to Assign',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to open the case"),
'delay_close': fields.float('Delay to Close',digits=(16,2),readonly=True, group_operator="avg",help="Number of Days to close the case"),
'delay_expected': fields.float('Overpassed Deadline',digits=(16,2),readonly=True, group_operator="avg"),
'probability': fields.float('Avg Probability',digits=(16,2),readonly=True, group_operator="avg"),
@ -91,7 +83,6 @@ class crm_lead_report_assign(osv.osv):
to_char(c.create_date, 'YYYY-MM-DD') as creation_date,
to_char(c.date_open, 'YYYY-MM-DD') as opening_date,
to_char(c.date_closed, 'YYYY-mm-dd') as date_closed,
c.state,
c.date_assign,
c.user_id,
c.probability,
@ -110,7 +101,7 @@ class crm_lead_report_assign(osv.osv):
c.planned_revenue*(c.probability/100) as probable_revenue,
1 as nbr,
date_trunc('day',c.create_date) as create_date,
extract('epoch' from (c.date_closed-c.create_date))/(3600*24) as delay_close,
extract('epoch' from (c.write_date-c.create_date))/(3600*24) as delay_close,
extract('epoch' from (c.date_deadline - c.date_closed))/(3600*24) as delay_expected,
extract('epoch' from (c.date_open-c.create_date))/(3600*24) as delay_open
FROM

View File

@ -8,8 +8,6 @@
<field name="model">crm.lead.report.assign</field>
<field name="arch" type="xml">
<search string="Leads Analysis">
<filter icon="terp-check" string="Current" domain="[('state','in',('draft','open'))]"/>
<filter icon="terp-dialog-close" string="Closed" domain="[('state','=','done')]"/>
<field name="section_id" context="{'invisible_section': False}" groups="base.group_multi_salesteams"/>
<field name="grade_id"/>
<field name="user_id"/>
@ -36,7 +34,6 @@
domain="[]" context="{'group_by':'grade_id'}" />
<filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
<filter string="Priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}" />
<filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}" />
<filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" />
<filter string="Assign Date" icon="terp-go-today" domain="[]" name="group_partner_date" context="{'group_by':'date_assign'}"/>
<filter string="Day" icon="terp-go-today" domain="[]" context="{'group_by':'day'}"/>
@ -54,7 +51,6 @@
<field name="model">crm.lead.report.assign</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="Lead Assign" type="bar">
<field name="state"/>
<field name="nbr" operator="+"/>
<field group="True" name="user_id"/>
</graph>
@ -76,14 +72,13 @@
<field name="partner_id" invisible="1"/>
<field name="country_id" invisible="1"/>
<field name="day" invisible="1"/>
<field name="state" invisible="1"/>
<field name="stage_id" invisible="1"/>
<field name="priority" invisible="1"/>
<field name="type" invisible="1"/>
<field name="company_id" invisible="1" groups="base.group_multi_company"/>
<field name="nbr" string="#Opportunities" sum="#Opportunities"/>
<field name="planned_revenue" sum="Planned Revenues"/>
<field name="delay_open" sum='Delay to open'/>
<field name="delay_open" sum='Delay to Assign'/>
<field name="delay_close" sum='Delay to close'/>
<field name="delay_expected"/>
<field name="probability" widget="progressbar"/>

View File

@ -33,134 +33,130 @@
<field name="view_mode">tree,form</field>
</record>
<menuitem id="res_partner_activation_config_mi" parent="base.menu_config_address_book" action="res_partner_activation_act" groups="base.group_no_one" />
<menuitem id="res_partner_activation_config_mi" parent="base.menu_config_address_book" action="res_partner_activation_act" groups="base.group_no_one"/>
<!--Partner Grade -->
<!--Partner Grade -->
<record id="view_partner_grade_tree" model="ir.ui.view">
<field name="name">res.partner.grade.tree</field>
<field name="model">res.partner.grade</field>
<field name="arch" type="xml">
<tree string="Partner Grade">
<field name="sequence" invisible="1" />
<field name="name" />
</tree>
<record id="view_partner_grade_tree" model="ir.ui.view">
<field name="name">res.partner.grade.tree</field>
<field name="model">res.partner.grade</field>
<field name="arch" type="xml">
<tree string="Partner Grade">
<field name="sequence" invisible="1"/>
<field name="name"/>
</tree>
</field>
</record>
<record id="view_partner_grade_form" model="ir.ui.view">
<field name="name">res.partner.grade.form</field>
<field name="model">res.partner.grade</field>
<field name="arch" type="xml">
<form string="Partner Grade" version="7.0">
<group col="4">
<field name="name"/>
<field name="sequence"/>
<field name="active"/>
</group>
</form>
</field>
</record>
<record id="res_partner_grade_action" model="ir.actions.act_window">
<field name="name">Partner Grade</field>
<field name="res_model">res.partner.grade</field>
<field name="view_type">form</field>
</record>
<menuitem action="res_partner_grade_action" id="menu_res_partner_grade_action"
groups="base.group_no_one"
parent="base.menu_crm_config_lead" />
<!-- Partner form -->
<record id="view_res_partner_filter_assign_tree" model="ir.ui.view">
<field name="name">res.partner.geo.inherit.tree</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_tree"/>
<field name="arch" type="xml">
<field name="user_id" position="after">
<field name="date_review_next"/>
<field name="grade_id"/>
<field name="activation"/>
</field>
</record>
<record id="view_partner_grade_form" model="ir.ui.view">
<field name="name">res.partner.grade.form</field>
<field name="model">res.partner.grade</field>
<field name="arch" type="xml">
<form string="Partner Grade" version="7.0">
<group col="4">
</field>
</record>
<record id="view_res_partner_filter_assign" model="ir.ui.view">
<field name="name">res.partner.geo.inherit.search</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter"/>
<field name="arch" type="xml">
<filter string="Salesperson" position="after">
<filter string="Activation" context="{'group_by' : 'activation'}" domain="[]" icon="terp-personal" />
</filter>
<field name="category_id" position="after">
<field name="grade_id"/>
</field>
</field>
</record>
<record id="view_crm_partner_geo_form" model="ir.ui.view">
<field name="name">res.partner.geo.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//notebook[last()]" position="inside">
<page string="Geo Localization">
<group>
<group>
<field name="name" />
<field name="partner_weight" />
<div>
<p class="oe_grey">
Define a weight to this grade. The weight will be used as default in the partner form to compute the chance for this partner to get leads. For instance, for business purpose, you can define a target revenue for each grade. To give the same chance to each partner to get leads, keep 1 in this field.
</p>
</div>
<separator string="Partner Activation" colspan="2"/>
<field name="grade_id" widget="selection"/>
<field name="activation" widget="selection"/>
<field name="partner_weight"/>
</group>
<group>
<field name="sequence" />
<field name="active" />
<separator string="Partner Review" colspan="2"/>
<field name="date_review"/>
<field name="date_review_next"/>
<field name="date_partnership"/>
</group>
</group>
</form>
</field>
</record>
<record id="res_partner_grade_action" model="ir.actions.act_window">
<field name="name">Partner Grade</field>
<field name="res_model">res.partner.grade</field>
<field name="view_type">form</field>
</record>
<menuitem action="res_partner_grade_action" id="menu_res_partner_grade_action" groups="base.group_no_one" parent="base.menu_crm_config_lead" />
<group colspan="2" col="2">
<separator string="Geo Localization" colspan="2"/>
<button
string="Geo Localize"
name="geo_localize"
colspan="2"
icon="gtk-apply"
type="object"/>
<field name="partner_latitude"/>
<field name="partner_longitude"/>
<field name="date_localization"/>
</group>
<newline/>
<!-- Partner form -->
<record id="view_res_partner_filter_assign_tree" model="ir.ui.view">
<field name="name">res.partner.geo.inherit.tree</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_tree" />
<field name="arch" type="xml">
<field name="user_id" position="after">
<field name="date_review_next" />
<field name="grade_id" />
<field name="activation" />
</field>
</field>
</record>
<record id="view_res_partner_filter_assign" model="ir.ui.view">
<field name="name">res.partner.geo.inherit.search</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter" />
<field name="arch" type="xml">
<filter string="Salesperson" position="after">
<filter string="Activation" context="{'group_by' : 'activation'}" domain="[]" icon="terp-personal" />
</filter>
<field name="category_id" position="after">
<field name="grade_id" />
</field>
</field>
</record>
<record id="view_crm_partner_geo_form" model="ir.ui.view">
<field name="name">res.partner.geo.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<xpath expr="//notebook[last()]" position="inside">
<page string="Forwarded Leads">
<group>
<group string="Partner Activation">
<label for="partner_latitude" string="Geolocalisation" />
<div class="oe_title oe_inline">
<h3 class="oe_inline">
<span class="oe_grey">( </span>
<field name="partner_latitude" nolabel="1" readonly="1" class="oe_inline" />
<span class="oe_grey oe_inline" attrs="{'invisible':[('partner_latitude','&lt;=',0)]}">N </span>
<span class="oe_grey oe_inline" attrs="{'invisible':[('partner_latitude','&gt;=',0)]}">S </span>
<field name="partner_longitude" class="oe_inline" readonly="1" nolabel="1" />
<span class="oe_grey oe_inline" attrs="{'invisible':[('partner_longitude','&lt;=',0)]}">E </span>
<span class="oe_grey oe_inline" attrs="{'invisible':[('partner_longitude','&gt;=',0)]}">W </span>
<span class="oe_grey">) </span>
</h3>
<button string="Geolocalize" name="geo_localize" class="oe_inline" type="object" />
</div>
<field name="grade_id" widget="selection" on_change="onchange_grade_id(grade_id)" />
<field name="partner_weight" class="oe_inline" />
<div colspan="2">
<p class="oe_grey">
Higher is the value, higher is the probability for this partner to get more leads.
</p>
</div>
</group>
<group>
<separator string="Partner Review" colspan="2" />
<field name="date_review" />
<field name="date_review_next" />
<field name="date_partnership" />
</group>
<group>
</group>
</group>
<newline />
<separator string="Forwarded Leads" colspan="2" />
<field name="opportunity_assigned_ids" colspan="4" nolabel="1">
<tree string="Assigned Opportunities" colors="blue:state=='pending';gray:state=='cancel'">
<field name="name" />
<field name="contact_name" />
<field name="email_from" />
<field name="phone" />
<field name="stage_id" />
<field name="state" invisible="1" />
</tree>
</field>
</page>
</xpath>
</field>
</record>
<field name="opportunity_assigned_ids" colspan="4" nolabel="1">
<tree string="Assigned Opportunities">
<field name="create_date"/>
<field name="name"/>
<field name="type"/>
<field name="stage_id"/>
<field name="section_id"
invisible="context.get('invisible_section', True)"
groups="base.group_multi_salesteams"/>
<field name="user_id" />
<button string="Convert to Opportunity"
name="convert_opportunity"
type="object"
attrs="{'invisible':[('type','=','opportunity'),('probability', '=', 100)]}" />
<button name="case_escalate" string="Escalate"
type="object"
icon="gtk-go-up"
attrs="{'invisible':[('probability', '=', 100)]}" />
</tree>
</field>
</page>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@ -16,12 +16,8 @@
<field name="user_id"/>
<field string="Timebox" name="timebox_id"/>
<button name="prev_timebox" type="object" icon="gtk-go-back" string="Previous" states="draft,pending,open"/>
<button name="next_timebox" type="object" icon="gtk-go-forward" string="Next" states="draft,pending,open"/>
<field name="state"/>
<button name="do_cancel" states="draft,open,pending" string="Cancel" type="object" icon="gtk-cancel" help="For cancelling the task"/>
<button name="action_close" states="draft,pending,open" string="Done" type="object" icon="terp-dialog-close" help="For changing to done state"/>
<button name="prev_timebox" type="object" string="Previous"/>
<button name="next_timebox" type="object" string="Next"/>
</tree>
</field>
</page>

View File

@ -66,7 +66,7 @@ class document_page(osv.osv):
'create_date': fields.datetime("Created on", select=True, readonly=True),
'create_uid': fields.many2one('res.users', 'Author', select=True, readonly=True),
'write_date': fields.datetime("Modification Date", select=True, readonly=True),
'write_uid': fields.many2one('res.users', "Last Contributor", select=True),
'write_uid': fields.many2one('res.users', "Last Contributor", select=True, readonly=True),
}
_defaults = {
'type':'content',

87
addons/edi/i18n/is.po Normal file
View File

@ -0,0 +1,87 @@
# Icelandic translation for openobject-addons
# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-12-21 17:05+0000\n"
"PO-Revision-Date: 2013-07-10 12:09+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Icelandic <is@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: 2013-07-11 05:17+0000\n"
"X-Generator: Launchpad (build 16696)\n"
#. module: edi
#. openerp-web
#: code:addons/edi/static/src/js/edi.js:67
#, python-format
msgid "Reason:"
msgstr "Ástæða:"
#. module: edi
#. openerp-web
#: code:addons/edi/static/src/js/edi.js:60
#, python-format
msgid "The document has been successfully imported!"
msgstr ""
#. module: edi
#. openerp-web
#: code:addons/edi/static/src/js/edi.js:65
#, python-format
msgid "Sorry, the document could not be imported."
msgstr ""
#. module: edi
#: model:ir.model,name:edi.model_res_company
msgid "Companies"
msgstr ""
#. module: edi
#: model:ir.model,name:edi.model_res_currency
msgid "Currency"
msgstr "Gjaldmiðill"
#. module: edi
#. openerp-web
#: code:addons/edi/static/src/js/edi.js:71
#, python-format
msgid "Document Import Notification"
msgstr ""
#. module: edi
#: code:addons/edi/models/edi.py:130
#, python-format
msgid "Missing application."
msgstr ""
#. module: edi
#: code:addons/edi/models/edi.py:131
#, python-format
msgid ""
"The document you are trying to import requires the OpenERP `%s` application. "
"You can install it by connecting as the administrator and opening the "
"configuration assistant."
msgstr ""
#. module: edi
#: code:addons/edi/models/edi.py:47
#, python-format
msgid "'%s' is an invalid external ID"
msgstr ""
#. module: edi
#: model:ir.model,name:edi.model_res_partner
msgid "Partner"
msgstr "Viðskipta aðili"
#. module: edi
#: model:ir.model,name:edi.model_edi_edi
msgid "EDI Subsystem"
msgstr ""

View File

@ -22,5 +22,6 @@
import email_template
import wizard
import res_partner
import ir_actions
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -59,6 +59,7 @@ campaigns on any OpenERP document.
'wizard/email_template_preview_view.xml',
'email_template_view.xml',
'res_partner_view.xml',
'ir_actions_view.xml',
'wizard/mail_compose_message_view.xml',
'security/ir.model.access.csv'
],

View File

@ -0,0 +1,12 @@
.. _changelog:
Changelog
=========
`trunk (saas-2)`
----------------
- ``mail.compose.message``: added support of ``mail_server_id`` from template
- Server action update
- added `email` server action type, now entirely based on email templates.

View File

@ -0,0 +1,13 @@
Email Template module documentation
===================================
Email Template documentation topics
'''''''''''''''''''''''''''''''''''
Changelog
'''''''''
.. toctree::
:maxdepth: 1
changelog.rst

View File

@ -0,0 +1,86 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013 OpenERP S.A. <http://www.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/>.
#
##############################################################################
from openerp.osv import fields, osv
class actions_server(osv.Model):
""" Add email option in server actions. """
_name = 'ir.actions.server'
_inherit = ['ir.actions.server']
def _get_states(self, cr, uid, context=None):
res = super(actions_server, self)._get_states(cr, uid, context=context)
res.insert(0, ('email', 'Send Email'))
return res
_columns = {
'email_from': fields.char('From',
help="Sender address; define the template to see its value. If not set, the default "
"value will be the author's email alias if configured, or email address."),
'email_to': fields.char('To (Emails)',
help="Comma-separated recipient addresses; define the template to see its value"),
'partner_to': fields.char('To (Partners)',
help="Comma-separated ids of recipient partners; define the template to see its value"),
'subject': fields.char('Subject',
help="Email subject; define the template to see its value"),
'body_html': fields.text('Body',
help="Rich-text/HTML version of the message; define the template to see its value"),
'template_id': fields.many2one('email.template', 'Email Template', ondelete='set null',
help="Define the email template to use for the email to send.")
}
def on_change_template_id(self, cr, uid, ids, template_id, context=None):
""" Render the raw template in the server action fields. """
if template_id:
fields = ['subject', 'body_html', 'email_from', 'email_to', 'partner_to', 'email_cc', 'reply_to', 'attachment_ids']
template_values = self.pool.get('email.template').read(cr, uid, template_id, fields, context)
values = dict((field, template_values[field]) for field in fields if template_values.get(field))
if not values.get('email_from'):
return {'warning': {'title': 'Incomplete template', 'message': 'Your template should define email_from'}, 'value': values}
else:
values = self.default_get(cr, uid, ['subject', 'body_html', 'email_from', 'email_to', 'partner_to'], context=context)
return {'value': values}
def create(self, cr, uid, values, context=None):
if values.get('template_id'):
fields = ['subject', 'body_html', 'email_from', 'email_to', 'partner_to', 'email_cc', 'reply_to', 'attachment_ids']
template_values = self.pool.get('email.template').read(cr, uid, values.get('template_id'), fields, context)
values.update(dict((field, template_values[field]) for field in fields if template_values.get(field)))
return super(actions_server, self).create(cr, uid, values, context=context)
def write(self, cr, uid, ids, values, context=None):
if values.get('template_id'):
fields = ['subject', 'body_html', 'email_from', 'email_to', 'partner_to', 'email_cc', 'reply_to', 'attachment_ids']
template_values = self.pool.get('email.template').read(cr, uid, values.get('template_id'), fields, context)
values.update(dict((field, template_values[field]) for field in fields if template_values.get(field)))
return super(actions_server, self).write(cr, uid, ids, values, context=context)
def run_action_email(self, cr, uid, action, eval_context=None, context=None):
if not action.template_id or not context.get('active_id'):
return False
self.pool['email.template'].send_mail(cr, uid, action.template_id.id, context.get('active_id'),
force_send=False, raise_exception=False, context=context)
return False
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="view_server_action_form_template">
<field name="name">ir.actions.server.form</field>
<field name="model">ir.actions.server</field>
<field name="inherit_id" ref="base.view_server_action_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='code']" position="after">
<page string="Email" autofocus="autofocus"
attrs="{'invisible': [('state', '!=', 'email')]}">
<p attrs="{'invisible': [('model_id', '!=', False)]}">
Please set the Base Model before setting the action details.
</p>
<group attrs="{'invisible': [('model_id', '=', False)]}">
<field name="template_id"
on_change='on_change_template_id(template_id)'
domain="[('model_id', '=', model_id)]"
attrs="{'required': [('state', '=', 'email')]}"/>
<p colspan="2" attrs="{'invisible': [('template_id', '!=', False)]}">
Choose a template to display its values.
</p>
<p colspan="2" attrs="{'invisible': [('template_id', '=', False)]}">
The values displayed hereunder are informative. When sending the email, the values
will be taken from the email template.
</p>
</group>
<group attrs="{'invisible': ['|', ('model_id', '=', False), ('template_id', '=', False)]}">
<label for="email_from"/>
<div>
<field name="email_from" nolabel="1'" readonly="1"
attrs="{'required': [('state', '=', 'email')]}"/>
<p attrs="{'invisible': [('email_from', '!=', False)]}">
Your template does not defined any email_from. Please update your template.
</p>
</div>
<field name="email_to" readonly="1"/>
<field name="partner_to" readonly="1"/>
<field name="subject" readonly="1" attrs="{'required': [('state', '=', 'email')]}"/>
<field name="body_html" readonly="1" attrs="{'required': [('state', '=', 'email')]}"/>
</group>
</page>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@ -18,10 +18,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from . import test_mail
from . import test_mail, test_ir_actions
checks = [
test_mail,
test_ir_actions,
]
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,55 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://www.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/>.
#
##############################################################################
from openerp.addons.base.tests.test_ir_actions import TestServerActionsBase
class TestServerActionsEmail(TestServerActionsBase):
def test_00_state_email(self):
""" Test ir.actions.server email type """
cr, uid = self.cr, self.uid
# create email_template
template_id = self.registry('email.template').create(cr, uid, {
'name': 'TestTemplate',
'email_from': 'myself@example.com',
'email_to': 'brigitte@example.com',
'partner_to': '[%s]' % self.test_partner_id,
'model_id': self.res_partner_model_id,
'subject': 'About ${object.name}',
'body_html': '<p>Dear ${object.name}, your parent is ${object.parent_id and object.parent_id.name or "False"}</p>',
})
self.ir_actions_server.write(cr, uid, self.act_id, {
'state': 'email',
'template_id': template_id,
})
run_res = self.ir_actions_server.run(cr, uid, [self.act_id], context=self.context)
self.assertFalse(run_res, 'ir_actions_server: email server action correctly finished should return False')
# check an email is waiting for sending
mail_ids = self.registry('mail.mail').search(cr, uid, [('subject', '=', 'About TestingPartner')])
self.assertEqual(len(mail_ids), 1, 'ir_actions_server: TODO')
# check email content
mail = self.registry('mail.mail').browse(cr, uid, mail_ids[0])
self.assertEqual(mail.body, '<p>Dear TestingPartner, your parent is False</p>',
'ir_actions_server: TODO')

View File

@ -22,6 +22,7 @@
from openerp import tools
from openerp.osv import osv, fields
def _reopen(self, res_id, model):
return {'type': 'ir.actions.act_window',
'view_mode': 'form',
@ -34,7 +35,8 @@ def _reopen(self, res_id, model):
'context': {
'default_model': model,
},
}
}
class mail_compose_message(osv.TransientModel):
_inherit = 'mail.compose.message'
@ -58,7 +60,7 @@ class mail_compose_message(osv.TransientModel):
context = {}
wizard_context = dict(context)
for wizard in self.browse(cr, uid, ids, context=context):
if wizard.template_id and not wizard.template_id.user_signature:
if wizard.template_id:
wizard_context['mail_notify_user_signature'] = False # template user_signature is added when generating body_html
if not wizard.attachment_ids or wizard.composition_mode == 'mass_mail' or not wizard.template_id:
continue
@ -75,7 +77,7 @@ class mail_compose_message(osv.TransientModel):
""" - mass_mailing: we cannot render, so return the template values
- normal mode: return rendered values """
if template_id and composition_mode == 'mass_mail':
fields = ['subject', 'body_html', 'email_from', 'email_to', 'partner_to', 'email_cc', 'reply_to', 'attachment_ids']
fields = ['subject', 'body_html', 'email_from', 'email_to', 'partner_to', 'email_cc', 'reply_to', 'attachment_ids', 'mail_server_id']
template_values = self.pool.get('email.template').read(cr, uid, template_id, fields, context)
values = dict((field, template_values[field]) for field in fields if template_values.get(field))
elif template_id:
@ -95,7 +97,7 @@ class mail_compose_message(osv.TransientModel):
}
values['attachment_ids'].append(ir_attach_obj.create(cr, uid, data_attach, context=context))
else:
values = self.default_get(cr, uid, ['subject', 'body', 'email_from', 'email_to', 'email_cc', 'partner_to', 'reply_to', 'attachment_ids'], context=context)
values = self.default_get(cr, uid, ['subject', 'body', 'email_from', 'email_to', 'email_cc', 'partner_to', 'reply_to', 'attachment_ids', 'mail_server_id'], context=context)
if values.get('body_html'):
values['body'] = values.pop('body_html')
@ -150,7 +152,7 @@ class mail_compose_message(osv.TransientModel):
mail.compose.message, transform email_cc and email_to into partner_ids """
template_values = self.pool.get('email.template').generate_email(cr, uid, template_id, res_id, context=context)
# filter template values
fields = ['subject', 'body_html', 'email_from', 'email_to', 'partner_to', 'email_cc', 'reply_to', 'attachment_ids', 'attachments']
fields = ['subject', 'body_html', 'email_from', 'email_to', 'partner_to', 'email_cc', 'reply_to', 'attachment_ids', 'attachments', 'mail_server_id']
values = dict((field, template_values[field]) for field in fields if template_values.get(field))
values['body'] = values.pop('body_html', '')

View File

@ -28,7 +28,7 @@ import urllib2
import simplejson
class google_service(osv.osv):
class google_service(osv.osv_memory):
_name = 'google.service'
def generate_refresh_token(self, cr, uid, service, authorization_code, context=None):
@ -51,10 +51,10 @@ class google_service(osv.osv):
content = simplejson.loads(content)
return content.get('refresh_token')
def _get_google_token_uri(self, cr, uid, service, context=None):
def _get_google_token_uri(self, cr, uid, service, scope, context=None):
ir_config = self.pool['ir.config_parameter']
params = {
'scope': 'https://www.googleapis.com/auth/drive',
'scope': scope,
'redirect_uri': ir_config.get_param(cr, SUPERUSER_ID, 'google_redirect_uri'),
'client_id': ir_config.get_param(cr, SUPERUSER_ID, 'google_%s_client_id' % service),
'response_type': 'code',

View File

@ -54,58 +54,69 @@ class config(osv.osv):
attachment = attach_pool.browse(cr, uid, attach_ids[0], context)
url = attachment.url
else:
url = self.copy_doc(cr, uid, res_id, template_id, name_gdocs, model.model, context)
url = self.copy_doc(cr, uid, res_id, template_id, name_gdocs, model.model, context).get('url')
return url
def copy_doc(self, cr, uid, res_id, template_id, name_gdocs, res_model, context=None):
def get_access_token(self, cr, uid, scope=None, context=None):
ir_config = self.pool['ir.config_parameter']
google_drive_refresh_token = ir_config.get_param(cr, SUPERUSER_ID, 'google_drive_refresh_token')
group_config = self.pool['ir.model.data'].get_object_reference(cr, uid, 'base', 'group_erp_manager')[1]
user = self.pool['res.users'].read(cr, uid, uid, "groups_id")
if not google_drive_refresh_token:
raise self.pool.get('res.config.settings').get_config_warning(cr, _("You haven't configured 'Authorization Code' generated from google, Please generate and configure it in %(menu:base_setup.menu_general_configuration)s."), context=context)
if group_config in user['groups_id']:
raise self.pool.get('res.config.settings').get_config_warning(cr, _("You haven't configured 'Authorization Code' generated from google, Please generate and configure it in %(menu:base_setup.menu_general_configuration)s."), context=context)
else:
raise osv.except_osv(_('Error!'), _("Google Drive is not yet configured. Please contact your administrator."))
google_drive_client_id = ir_config.get_param(cr, SUPERUSER_ID, 'google_drive_client_id')
google_drive_client_secret = ir_config.get_param(cr, SUPERUSER_ID, 'google_drive_client_secret')
google_web_base_url = ir_config.get_param(cr, SUPERUSER_ID, 'web.base.url')
#For Getting New Access Token With help of old Refresh Token
headers = {"Content-type": "application/x-www-form-urlencoded", "Accept-Encoding": "gzip, deflate"}
data = dict(client_id=google_drive_client_id,
refresh_token=google_drive_refresh_token,
client_secret=google_drive_client_secret,
grant_type="refresh_token")
data = urllib.urlencode(data)
data = urllib.urlencode(dict(client_id=google_drive_client_id,
refresh_token=google_drive_refresh_token,
client_secret=google_drive_client_secret,
grant_type="refresh_token",
scope=scope or 'https://www.googleapis.com/auth/drive'))
headers = {"Content-type": "application/x-www-form-urlencoded", "Accept-Encoding": "gzip, deflate"}
try:
req = urllib2.Request('https://accounts.google.com/o/oauth2/token', data, headers)
content = urllib2.urlopen(req).read()
except urllib2.HTTPError:
raise self.pool.get('res.config.settings').get_config_warning(cr, _("Something went wrong during the token generation. Please request again an authorization code in %(menu:base_setup.menu_general_configuration)s."), context=context)
if group_config in user['groups_id']:
raise self.pool.get('res.config.settings').get_config_warning(cr, _("Something went wrong during the token generation. Please request again an authorization code in %(menu:base_setup.menu_general_configuration)s."), context=context)
else:
raise osv.except_osv(_('Error!'), _("Google Drive is not yet configured. Please contact your administrator."))
content = json.loads(content)
return content.get('access_token')
def copy_doc(self, cr, uid, res_id, template_id, name_gdocs, res_model, context=None):
ir_config = self.pool['ir.config_parameter']
google_web_base_url = ir_config.get_param(cr, SUPERUSER_ID, 'web.base.url')
access_token = self.get_access_token(cr, uid, context=context)
# Copy template in to drive with help of new access token
if 'access_token' in content:
request_url = "https://www.googleapis.com/drive/v2/files/%s?fields=parents/id&access_token=%s" % (template_id, content['access_token'])
try:
req = urllib2.Request(request_url, None, headers)
parents = urllib2.urlopen(req).read()
except urllib2.HTTPError:
raise self.pool.get('res.config.settings').get_config_warning(cr, _("The Google Template cannot be found. Maybe it has been deleted."), context=context)
parents_dict = json.loads(parents)
request_url = "https://www.googleapis.com/drive/v2/files/%s?fields=parents/id&access_token=%s" % (template_id, access_token)
headers = {"Content-type": "application/x-www-form-urlencoded", "Accept-Encoding": "gzip, deflate"}
try:
req = urllib2.Request(request_url, None, headers)
parents = urllib2.urlopen(req).read()
except urllib2.HTTPError:
raise self.pool.get('res.config.settings').get_config_warning(cr, _("The Google Template cannot be found. Maybe it has been deleted."), context=context)
parents_dict = json.loads(parents)
record_url = "Click on link to open Record in OpenERP\n %s/?db=%s#id=%s&model=%s" % (google_web_base_url, cr.dbname, res_id, res_model)
data = {"title": name_gdocs, "description": record_url, "parents": parents_dict['parents']}
request_url = "https://www.googleapis.com/drive/v2/files/%s/copy?access_token=%s" % (template_id, content['access_token'])
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
data_json = json.dumps(data)
# resp, content = Http().request(request_url, "POST", data_json, headers)
req = urllib2.Request(request_url, data_json, headers)
content = urllib2.urlopen(req).read()
content = json.loads(content)
res = False
if 'alternateLink' in content.keys():
attach_pool = self.pool.get("ir.attachment")
attach_vals = {'res_model': res_model, 'name': name_gdocs, 'res_id': res_id, 'type': 'url', 'url': content['alternateLink']}
attach_pool.create(cr, uid, attach_vals)
res = content['alternateLink']
record_url = "Click on link to open Record in OpenERP\n %s/?db=%s#id=%s&model=%s" % (google_web_base_url, cr.dbname, res_id, res_model)
data = {"title": name_gdocs, "description": record_url, "parents": parents_dict['parents']}
request_url = "https://www.googleapis.com/drive/v2/files/%s/copy?access_token=%s" % (template_id, access_token)
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
data_json = json.dumps(data)
# resp, content = Http().request(request_url, "POST", data_json, headers)
req = urllib2.Request(request_url, data_json, headers)
content = urllib2.urlopen(req).read()
content = json.loads(content)
res = {}
if content.get('alternateLink'):
attach_pool = self.pool.get("ir.attachment")
attach_vals = {'res_model': res_model, 'name': name_gdocs, 'res_id': res_id, 'type': 'url', 'url': content['alternateLink']}
res['id'] = attach_pool.create(cr, uid, attach_vals)
res['url'] = content['alternateLink']
return res
def get_google_drive_config(self, cr, uid, res_model, res_id, context=None):
@ -166,6 +177,7 @@ class config(osv.osv):
'google_drive_resource_id': fields.function(_resource_get, type="char", string='Resource Id'),
'google_drive_client_id': fields.function(_client_id_get, type="char", string='Google Client '),
'name_template': fields.char('Google Drive Name Pattern', size=64, help='Choose how the new google drive will be named, on google side. Eg. gdoc_%(field_name)s', required=True),
'active': fields.boolean('Active'),
}
def onchange_model_id(self, cr, uid, ids, model_id, context=None):
@ -179,6 +191,7 @@ class config(osv.osv):
_defaults = {
'name_template': 'Document %(name)s',
'active': True,
}
def _check_model_id(self, cr, uid, ids, context=None):
@ -191,6 +204,9 @@ class config(osv.osv):
(_check_model_id, 'Model of selected filter is not matching with model of current template.', ['model_id', 'filter_id']),
]
def get_google_scope(self):
return 'https://www.googleapis.com/auth/drive'
config()
@ -202,7 +218,7 @@ class base_config_settings(osv.osv):
'google_drive_uri': fields.char('URI', readonly=True, help="The URL to generate the authorization code from Google"),
}
_defaults = {
'google_drive_uri': lambda s, cr, uid, c: s.pool['google.service']._get_google_token_uri(cr, uid, 'drive', context=c),
'google_drive_uri': lambda s, cr, uid, c: s.pool['google.service']._get_google_token_uri(cr, uid, 'drive', scope=s.pool['google.drive.config'].get_google_scope(), context=c),
}
def set_google_authorization_code(self, cr, uid, ids, context=None):

View File

@ -4,12 +4,12 @@
<record id="config_google_drive_client_id" model="ir.config_parameter">
<field name="key">google_drive_client_id</field>
<field name="value">39623646228-eg3ggo3mk6o40m7rguobi3rkl9frh4tb.apps.googleusercontent.com</field>
<field name="value">598905559630.apps.googleusercontent.com</field>
</record>
<record id="config_google_drive_client_secret" model="ir.config_parameter">
<field name="key">google_drive_client_secret</field>
<field name="value">Ul-PtmnSWs3euWs20fdono0e</field>
<field name="value">vTmou73c-njP-1qCxm7qx7QE</field>
</record>
</data>

View File

@ -8,19 +8,19 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2013-06-27 16:03+0000\n"
"PO-Revision-Date: 2012-12-12 12:51+0000\n"
"Last-Translator: Pedro Manuel Baeza <pedro.baeza@gmail.com>\n"
"PO-Revision-Date: 2013-08-07 02:00+0000\n"
"Last-Translator: Alejandro Santana <alejandrosantana@anubia.es>\n"
"Language-Team: Spanish <es@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: 2013-06-28 05:42+0000\n"
"X-Generator: Launchpad (build 16681)\n"
"X-Launchpad-Export-Date: 2013-08-08 04:39+0000\n"
"X-Generator: Launchpad (build 16723)\n"
#. module: google_drive
#: model:ir.ui.menu,name:google_drive.menu_google_drive_config
msgid "Google Drive configuration"
msgstr ""
msgstr "Configuración de Google Drive"
#. module: google_drive
#: code:addons/google_drive/google_drive.py:48
@ -39,6 +39,11 @@ msgid ""
"in your Google Drive and in OpenERP attachment will be named\n"
" 'Agrolait_SO0001_Sales'."
msgstr ""
"El nombre del documento adjunto puede contener información fija o variable. "
"Para distinguir documentos en Google Drive, use palabras y campos fijos. "
"Así, en el ejemplo anterior, si se escribió 'Agrolait_%(name)s_Sales' en el "
"campo de nombre de GoogleDrive, el documento en su Google Drive y en los "
"adjuntos de OpenERP se llamarán 'Agrolait_SO0001_Sales'."
#. module: google_drive
#: view:google.drive.config:0
@ -46,16 +51,18 @@ msgid ""
"- If filter is not specified, link of google document will appear in "
"\"More\" option for all users for all opportunities."
msgstr ""
"- Si no especifica un filtro, el enlace del documento de Google aparecerá en "
"la opción \"Más\" para todos los usuarios para todas las oportunidades."
#. module: google_drive
#: view:google.drive.config:0
msgid "To create a new filter:"
msgstr ""
msgstr "Para crear un nuevo filtro:"
#. module: google_drive
#: model:ir.model,name:google_drive.model_base_config_settings
msgid "base.config.settings"
msgstr ""
msgstr "base.config.settings"
#. module: google_drive
#: model:ir.actions.act_window,help:google_drive.action_google_drive_users_config
@ -73,17 +80,29 @@ msgid ""
" </p>\n"
" "
msgstr ""
"<p class=\"oe_view_nocontent_create\">\n"
" Pulse para añadir una plantilla.\n"
" </p>\n"
" <p>\n"
" Enlace sus propias plantillas de Google Drive a "
"cualquier registro de OpenERP. Si tiene documentos realmente específicos que "
"quiere que su colaborador rellene (como usar una hoja de cálculo para "
"controlar la calidad de su producto o revisar los detalles de entrega de "
"cada pedido en un país extranjero,...) es muy sencillo gestionarlo. "
"Enlácelos en OpenERP y úselos para colaborar con sus empleados.\n"
" </p>\n"
" "
#. module: google_drive
#: code:addons/google_drive/google_drive.py:150
#, python-format
msgid "Incorrect URL!"
msgstr ""
msgstr "¡URL incorrecta!"
#. module: google_drive
#: view:base.config.settings:0
msgid "Configure your templates"
msgstr ""
msgstr "Configure sus plantillas"
#. module: google_drive
#: help:google.drive.config,name_template:0
@ -91,6 +110,8 @@ msgid ""
"Choose how the new google drive will be named, on google side. Eg. "
"gdoc_%(field_name)s"
msgstr ""
"Elija el nombre de la nueva unidad de Google Drive, en el lado de Google. "
"P.ej.: gdoc_%(field_name)s"
#. module: google_drive
#: view:google.drive.config:0
@ -98,6 +119,8 @@ msgid ""
"- Go to the OpenERP document you want to filter. For instance, go to "
"Opportunities and search on Sales Department."
msgstr ""
"- Vaya al documento de OpenERP que quiera filtrar. Por ejemplo, vaya a "
"Oportunidades y busque en el Departamento de ventas."
#. module: google_drive
#: view:google.drive.config:0
@ -105,6 +128,8 @@ msgid ""
"- In this \"Search\" view, select the option \"Save Current Filter\", enter "
"the name (Ex: Sales Department)"
msgstr ""
"- En esta vista de \"Búsqueda\", seleccione la opción \"Guardar filtro "
"actual\" e introduzca el nombre (p.ej.: Departamento de ventas)"
#. module: google_drive
#: view:google.drive.config:0
@ -113,6 +138,9 @@ msgid ""
"\"More\" options will appear for all users in opportunities of Sales "
"Department."
msgstr ""
"- Si selecciona \"Compartir con todos los usuarios\", el enlace al documento "
"de Google en la opción \"Más\" aparecerá para todos los usuarios en las "
"oportunidades del Departamento de ventas."
#. module: google_drive
#: view:google.drive.config:0
@ -121,23 +149,28 @@ msgid ""
"\"More\" options will not appear for other users in opportunities of Sales "
"Department."
msgstr ""
"- Si no selecciona \"Compartir con todos los usuarios\", el enlace al "
"documento de Google en la opción \"Más\" no aparecerá para otros usuarios en "
"las oportunidades del Departamento de ventas."
#. module: google_drive
#: code:addons/google_drive/google_drive.py:48
#, python-format
msgid "At least one key cannot be found in your Google Drive name pattern"
msgstr ""
"No se ha podido encontrar al menos una clave de su patrón de nombres de "
"Google Drive"
#. module: google_drive
#: code:addons/google_drive/google_drive.py:150
#, python-format
msgid "Please enter a valid Google Document URL."
msgstr ""
msgstr "Por favor, introduzca una URL de documento de Google válida."
#. module: google_drive
#: field:google.drive.config,google_drive_client_id:0
msgid "Google Client "
msgstr ""
msgstr "Cliente de Google "
#. module: google_drive
#: view:google.drive.config:0
@ -145,43 +178,45 @@ msgid ""
"https://docs.google.com/document/d/1vOtpJK9scIQz6taD9tJRIETWbEw3fSiaQHArsJYcu"
"a4/edit"
msgstr ""
"https://docs.google.com/document/d/1vOtpJK9scIQz6taD9tJRIETWbEw3fSiaQHArsJYcu"
"a4/edit"
#. module: google_drive
#: field:google.drive.config,filter_id:0
msgid "Filter"
msgstr ""
msgstr "Filtro"
#. module: google_drive
#: field:google.drive.config,name_template:0
msgid "Google Drive Name Pattern"
msgstr ""
msgstr "Patrón de nombres de Google Drive"
#. module: google_drive
#: help:base.config.settings,google_drive_uri:0
msgid "The URL to generate the authorization code from Google"
msgstr ""
msgstr "La URL para generar el código de autorización de Google"
#. module: google_drive
#: model:ir.filters,name:google_drive.filter_partner
msgid "Customer"
msgstr ""
msgstr "Cliente"
#. module: google_drive
#: field:google.drive.config,google_drive_resource_id:0
msgid "Resource Id"
msgstr ""
msgstr "ID del recurso"
#. module: google_drive
#: code:addons/google_drive/google_drive.py:91
#, python-format
msgid "The Google Template cannot be found. Maybe it has been deleted."
msgstr ""
msgstr "No se encuentra la plantilla de Google. Tal vez se haya eliminado."
#. module: google_drive
#: model:ir.actions.act_window,name:google_drive.action_google_drive_users_config
#: model:ir.ui.menu,name:google_drive.menu_google_drive_model_config
msgid "Google Drive Templates"
msgstr ""
msgstr "Plantillas de Google Drive"
#. module: google_drive
#: code:addons/google_drive/google_drive.py:81
@ -190,23 +225,27 @@ msgid ""
"Something went wrong during the token generation. Please request again an "
"authorization code in %(menu:base_setup.menu_general_configuration)s."
msgstr ""
"Algo ha ido mal durante la creación del testigo. Por favor, solicite un "
"código de autorización otra vez en "
"%(menu:base_setup.menu_general_configuration)s."
#. module: google_drive
#: code:addons/google_drive/google_drive.py:124
#, python-format
msgid "Google Drive Error!"
msgstr ""
msgstr "¡Error de Google Drive!"
#. module: google_drive
#: field:base.config.settings,google_drive_uri:0
msgid "URI"
msgstr ""
msgstr "URI"
#. module: google_drive
#: code:addons/google_drive/google_drive.py:124
#, python-format
msgid "Creating google drive may only be done by one at a time."
msgstr ""
"Es posible que la creación de Google Drive sólo se pueda hacer de una en una."
#. module: google_drive
#: field:google.drive.config,model:0
@ -217,38 +256,40 @@ msgstr "Modelo"
#. module: google_drive
#: view:google.drive.config:0
msgid "Google Drive Configuration"
msgstr ""
msgstr "Configuración de Google Drive"
#. module: google_drive
#: field:google.drive.config,name:0
msgid "Template Name"
msgstr ""
msgstr "Nombre de la plantilla"
#. module: google_drive
#: constraint:google.drive.config:0
msgid ""
"Model of selected filter is not matching with model of current template."
msgstr ""
"El modelo del filtro seleccionado no coincide con el modelo de la plantilla "
"actual."
#. module: google_drive
#: field:google.drive.config,google_drive_template_url:0
msgid "Template URL"
msgstr ""
msgstr "URL de la plantilla"
#. module: google_drive
#: view:base.config.settings:0
msgid "and paste it here"
msgstr ""
msgstr "y péguela aquí"
#. module: google_drive
#: field:base.config.settings,google_drive_authorization_code:0
msgid "Authorization Code"
msgstr ""
msgstr "Cídigo de autorización"
#. module: google_drive
#: model:ir.model,name:google_drive.model_google_drive_config
msgid "Google Drive templates config"
msgstr ""
msgstr "Configuración de plantillas de Google Drive"
#. module: google_drive
#: code:addons/google_drive/google_drive.py:64
@ -257,3 +298,6 @@ msgid ""
"You haven't configured 'Authorization Code' generated from google, Please "
"generate and configure it in %(menu:base_setup.menu_general_configuration)s."
msgstr ""
"No ha configurado el 'código de autorización' generado por Google. Por "
"favor, genérelo y configúrelo en "
"%(menu:base_setup.menu_general_configuration)s."

View File

@ -8,20 +8,19 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2013-06-27 16:03+0000\n"
"PO-Revision-Date: 2012-12-07 22:47+0000\n"
"Last-Translator: Fábio Martinelli - http://zupy.com.br "
"<webmaster@guaru.net>\n"
"PO-Revision-Date: 2013-07-20 22:32+0000\n"
"Last-Translator: Claudio de Araujo Santos <claudioaraujosantos@gmail.com>\n"
"Language-Team: Brazilian Portuguese <pt_BR@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: 2013-06-28 05:42+0000\n"
"X-Generator: Launchpad (build 16681)\n"
"X-Launchpad-Export-Date: 2013-07-22 05:34+0000\n"
"X-Generator: Launchpad (build 16696)\n"
#. module: google_drive
#: model:ir.ui.menu,name:google_drive.menu_google_drive_config
msgid "Google Drive configuration"
msgstr ""
msgstr "Configuração do Google Drive"
#. module: google_drive
#: code:addons/google_drive/google_drive.py:48
@ -40,6 +39,13 @@ msgid ""
"in your Google Drive and in OpenERP attachment will be named\n"
" 'Agrolait_SO0001_Sales'."
msgstr ""
"O nome do documento em anexo pode usar dados fixos ou variáveis. Para "
"distinguir entre documentos\n"
" Google Drive, usar palavras fixos e campos. "
"Por exemplo, no exemplo acima, se escreveu Agrolait_% (nome) s_Sales\n"
" no campo Nome da unidade do Google, o "
"documento em seu Google Drive e em OpenERP anexo será nomeado\n"
" 'Agrolait_SO0001_Sales \"."
#. module: google_drive
#: view:google.drive.config:0
@ -47,16 +53,18 @@ msgid ""
"- If filter is not specified, link of google document will appear in "
"\"More\" option for all users for all opportunities."
msgstr ""
"- Se o filtro não for especificado, ligação de documento google aparecerá na "
"opção \"Mais\" para todos os usuários de todas as oportunidades."
#. module: google_drive
#: view:google.drive.config:0
msgid "To create a new filter:"
msgstr ""
msgstr "Para criar um novo filtro:"
#. module: google_drive
#: model:ir.model,name:google_drive.model_base_config_settings
msgid "base.config.settings"
msgstr ""
msgstr "base.config.settings"
#. module: google_drive
#: model:ir.actions.act_window,help:google_drive.action_google_drive_users_config
@ -74,17 +82,30 @@ msgid ""
" </p>\n"
" "
msgstr ""
"<p class=\"oe_view_nocontent_create\">\n"
" Clique para adicionar um novo modelo.\n"
" </ P>\n"
" <p>\n"
" Vincular seus próprios modelos Google Drive para "
"qualquer registro de OpenERP. Se você tem documentos específicos que você "
"realmente deseja que seu colaborador preencher, por exemplo, usar uma "
"planilha para controlar a qualidade do seu produto ou rever a lista de "
"entrega para cada ordem em um país estrangeiro, ... É muito fácil de "
"gerenciá-los, associá-los a OpenERP e usá-los para colaborar com seus "
"empregados.\n"
" </ P>\n"
" "
#. module: google_drive
#: code:addons/google_drive/google_drive.py:150
#, python-format
msgid "Incorrect URL!"
msgstr ""
msgstr "URL incorreto!"
#. module: google_drive
#: view:base.config.settings:0
msgid "Configure your templates"
msgstr ""
msgstr "Configure seus modelos"
#. module: google_drive
#: help:google.drive.config,name_template:0
@ -92,6 +113,8 @@ msgid ""
"Choose how the new google drive will be named, on google side. Eg. "
"gdoc_%(field_name)s"
msgstr ""
"Escolha como a nova unidade google será nomeado, no lado google. Por "
"exemplo. gdoc_% (field_name) s"
#. module: google_drive
#: view:google.drive.config:0
@ -99,6 +122,8 @@ msgid ""
"- Go to the OpenERP document you want to filter. For instance, go to "
"Opportunities and search on Sales Department."
msgstr ""
"- Vá para o documento OpenERP você deseja filtrar. Por exemplo, ir para "
"Oportunidades e de pesquisa no Departamento de Vendas."
#. module: google_drive
#: view:google.drive.config:0
@ -106,6 +131,8 @@ msgid ""
"- In this \"Search\" view, select the option \"Save Current Filter\", enter "
"the name (Ex: Sales Department)"
msgstr ""
"- Neste ponto de vista \"Pesquisar\", selecione a opção \"Salvar Filtro "
"Atual\", digite o nome (Ex: Departamento de Vendas)"
#. module: google_drive
#: view:google.drive.config:0
@ -114,6 +141,9 @@ msgid ""
"\"More\" options will appear for all users in opportunities of Sales "
"Department."
msgstr ""
"- Se você selecionar \"Compartilhar com todos os usuários\", ligação de "
"documento google na opção \"Mais\" será exibido para todos os usuários em "
"oportunidades do Departamento de Vendas."
#. module: google_drive
#: view:google.drive.config:0
@ -122,23 +152,28 @@ msgid ""
"\"More\" options will not appear for other users in opportunities of Sales "
"Department."
msgstr ""
"- Se você não selecionar \"Compartilhar com todos os usuários\", link do "
"documento google em \"More\" opções não aparecerá para outros usuários em "
"oportunidades do Departamento de Vendas."
#. module: google_drive
#: code:addons/google_drive/google_drive.py:48
#, python-format
msgid "At least one key cannot be found in your Google Drive name pattern"
msgstr ""
"Pelo menos uma chave não pode ser encontrado em seu padrão de nome de Google "
"Drive"
#. module: google_drive
#: code:addons/google_drive/google_drive.py:150
#, python-format
msgid "Please enter a valid Google Document URL."
msgstr ""
msgstr "Por favor insira um URL Documento Google válida."
#. module: google_drive
#: field:google.drive.config,google_drive_client_id:0
msgid "Google Client "
msgstr ""
msgstr "Google Cliente "
#. module: google_drive
#: view:google.drive.config:0
@ -146,43 +181,46 @@ msgid ""
"https://docs.google.com/document/d/1vOtpJK9scIQz6taD9tJRIETWbEw3fSiaQHArsJYcu"
"a4/edit"
msgstr ""
"https://docs.google.com/document/d/1vOtpJK9scIQz6taD9tJRIETWbEw3fSiaQHArsJYcu"
"a4/edit"
#. module: google_drive
#: field:google.drive.config,filter_id:0
msgid "Filter"
msgstr ""
msgstr "Filtro"
#. module: google_drive
#: field:google.drive.config,name_template:0
msgid "Google Drive Name Pattern"
msgstr ""
msgstr "Nome Padrão Google Drive"
#. module: google_drive
#: help:base.config.settings,google_drive_uri:0
msgid "The URL to generate the authorization code from Google"
msgstr ""
msgstr "O URL para gerar o código de autorização do Google"
#. module: google_drive
#: model:ir.filters,name:google_drive.filter_partner
msgid "Customer"
msgstr ""
msgstr "Cliente"
#. module: google_drive
#: field:google.drive.config,google_drive_resource_id:0
msgid "Resource Id"
msgstr ""
msgstr "ID Recurso"
#. module: google_drive
#: code:addons/google_drive/google_drive.py:91
#, python-format
msgid "The Google Template cannot be found. Maybe it has been deleted."
msgstr ""
"O modelo do Google não pode ser encontrado. Talvez tenha sido excluído."
#. module: google_drive
#: model:ir.actions.act_window,name:google_drive.action_google_drive_users_config
#: model:ir.ui.menu,name:google_drive.menu_google_drive_model_config
msgid "Google Drive Templates"
msgstr ""
msgstr "Templates do Google Drive"
#. module: google_drive
#: code:addons/google_drive/google_drive.py:81
@ -191,23 +229,25 @@ msgid ""
"Something went wrong during the token generation. Please request again an "
"authorization code in %(menu:base_setup.menu_general_configuration)s."
msgstr ""
"Algo deu errado durante a geração de token. Por favor, solicite novamente um "
"código de autorização em%(menu:base_setup.menu_general_configuration)s."
#. module: google_drive
#: code:addons/google_drive/google_drive.py:124
#, python-format
msgid "Google Drive Error!"
msgstr ""
msgstr "Google Drive Error!"
#. module: google_drive
#: field:base.config.settings,google_drive_uri:0
msgid "URI"
msgstr ""
msgstr "URL"
#. module: google_drive
#: code:addons/google_drive/google_drive.py:124
#, python-format
msgid "Creating google drive may only be done by one at a time."
msgstr ""
msgstr "Criação de unidade google só pode ser feito por um de cada vez."
#. module: google_drive
#: field:google.drive.config,model:0
@ -218,38 +258,40 @@ msgstr "Modelo"
#. module: google_drive
#: view:google.drive.config:0
msgid "Google Drive Configuration"
msgstr ""
msgstr "Configuração do acionamento Google"
#. module: google_drive
#: field:google.drive.config,name:0
msgid "Template Name"
msgstr ""
msgstr "Nome do modelo"
#. module: google_drive
#: constraint:google.drive.config:0
msgid ""
"Model of selected filter is not matching with model of current template."
msgstr ""
"Modelo de filtro selecionado não está combinando com o modelo do modelo "
"atual."
#. module: google_drive
#: field:google.drive.config,google_drive_template_url:0
msgid "Template URL"
msgstr ""
msgstr "Modelo de URL"
#. module: google_drive
#: view:base.config.settings:0
msgid "and paste it here"
msgstr ""
msgstr "e cole-o aqui"
#. module: google_drive
#: field:base.config.settings,google_drive_authorization_code:0
msgid "Authorization Code"
msgstr ""
msgstr "Código de Autorização"
#. module: google_drive
#: model:ir.model,name:google_drive.model_google_drive_config
msgid "Google Drive templates config"
msgstr ""
msgstr "Google Drive templates de configuração"
#. module: google_drive
#: code:addons/google_drive/google_drive.py:64
@ -258,3 +300,6 @@ msgid ""
"You haven't configured 'Authorization Code' generated from google, Please "
"generate and configure it in %(menu:base_setup.menu_general_configuration)s."
msgstr ""
"Você não configurou \"Código de Autorização\" gerado a partir do Google, por "
"favor, gerar e configurá-lo em "
"%(menu:base_setup.menu_general_configuration)s."

View File

@ -23,6 +23,7 @@
<field name="model" invisible="1" />
<group>
<field name="name" />
<field name="active" />
<field name="model_id" on_change="onchange_model_id(model_id)" />
<label for='filter_id' />
<div>
@ -54,7 +55,7 @@
</record>
<record model='ir.actions.act_window' id='action_google_drive_users_config'>
<field name='name'>Google Drive Templates</field>
<field name='name'>Templates</field>
<field name='res_model'>google.drive.config</field>
<field name='type'>ir.actions.act_window</field>
<field name='view_type'>form</field>
@ -87,7 +88,7 @@
</field>
</record>
<menuitem name='Google Drive configuration' id='menu_google_drive_config' parent='base.menu_administration' />
<menuitem name='Google Drive' id='menu_google_drive_config' parent='base.menu_administration' />
<menuitem id='menu_google_drive_model_config' parent='menu_google_drive_config' action='action_google_drive_users_config' />
</data>
</openerp>

View File

@ -29,19 +29,24 @@ openerp.google_drive = function (instance, m) {
ds.call('get_google_drive_config', [view.dataset.model, res_id, context]).done(function (r) {
if (!_.isEmpty(r)) {
_.each(r, function (res) {
var g_item = _.indexOf(_.pluck(self.items.other, 'label'), res.name);
if (g_item !== -1) {
self.items.other.splice(g_item, 1);
var already_there = false;
for (var i = 0;i < self.items.other.length;i++){
if (self.items.other[i].classname === "oe_share_gdoc" && self.items.other[i].label.indexOf(res.name) > -1){
already_there = true;
break;
}
}
if (!already_there){
self.add_items('other', [{
label: res.name+ '<img style="position:absolute;right:5px;height:20px;width:20px;" title="Google Drive" src="google_drive/static/src/img/drive_icon.png"/>',
config_id: res.id,
res_id: res_id,
res_model: view.dataset.model,
callback: self.on_google_doc,
classname: 'oe_share_gdoc'
},
]);
}
self.add_items('other', [{
label: res.name+ '<img style="position:absolute;right:5px;height:20px;width:20px;" title="Google Drive" src="google_drive/static/src/img/drive_icon.png"/>',
config_id: res.id,
res_id: res_id,
res_model: view.dataset.model,
callback: self.on_google_doc,
classname: 'oe_share_gdoc'
},
]);
})
}
});

View File

@ -0,0 +1 @@
import google_spreadsheet

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': 'Google Spreadsheet',
'version': '1.0',
'category': 'Tools',
'description': """
The module adds the possibility to display data from OpenERP in Google Spreadsheets in real time.
========================================
""",
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'depends': ['board', 'google_drive'],
'js': [
'static/src/js/search.js',
],
'qweb': ['static/src/xml/*.xml'],
'data': ['google_spreadsheet_view.xml', 'google_spreadsheet_data.xml'],
'demo': [],
'installable': True,
'auto_install': False,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

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