[MERGE]sync with trunk

bzr revid: sgo@tinyerp.com-20130722064546-5algtla91hpnaanb
This commit is contained in:
sgo@tinyerp.com 2013-07-22 12:15:46 +05:30
commit a241bec4bf
157 changed files with 15331 additions and 2557 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 checked, the entry won\'t be created if the entry date is not included into the selected period'),
'profit_account_id' : fields.many2one('account.account', 'Profit Account'),

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

@ -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

@ -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

@ -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

@ -19,7 +19,6 @@
#
##############################################################################
from openerp.addons.base_status.base_stage import base_stage
import crm
from datetime import datetime
from operator import itemgetter
@ -68,7 +67,7 @@ CRM_LEAD_PENDING_STATES = (
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"
@ -93,20 +92,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
@ -126,8 +111,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
@ -326,8 +310,7 @@ 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),
@ -341,30 +324,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':{}}
return {'value': {}}
stage = self.pool.get('crm.case.stage').browse(cr, uid, stage_id, 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
@ -405,7 +387,7 @@ class crm_lead(base_stage, format_address, osv.osv):
# collect all section_ids
section_ids = []
types = ['both']
if not cases :
if not cases:
type = context.get('default_type')
types += [type]
if section_id:
@ -433,24 +415,18 @@ 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 stage_set(self, cr, uid, ids, stage_id, context=None):
""" Set the new stage. Now just writes the stage.
TDE TODO: remove me when removing state
"""
return self.write(cr, uid, ids, {'stage_id': stage_id}, context=context)
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)
if stage_id:
self.case_set(cr, uid, [lead.id], values_to_update={'probability': 0.0}, new_stage_id=stage_id, context=context)
self.stage_set(cr, uid, [lead.id], stage_id, context=context)
return True
def case_mark_won(self, cr, uid, ids, context=None):
@ -458,7 +434,21 @@ class crm_lead(base_stage, format_address, osv.osv):
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)
if stage_id:
self.case_set(cr, uid, [lead.id], values_to_update={'probability': 100.0}, new_stage_id=stage_id, context=context)
self.stage_set(cr, uid, [lead.id], stage_id, context=context)
return True
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):
@ -631,7 +621,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
@ -665,6 +655,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)
@ -932,12 +927,22 @@ class crm_lead(base_stage, format_address, osv.osv):
}
return res
def create(self, cr, uid, vals, context=None):
if context is None:
context = {}
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):
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
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)
def new_mail_send(self, cr, uid, ids, context=None):
@ -1024,7 +1029,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

@ -263,13 +263,6 @@ Andrew</field>
<field eval="1" name="active"/>
</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}"
/>
<!-- 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'),

View File

@ -95,10 +95,6 @@
<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"/>
<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 +114,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"/>
@ -617,7 +613,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

@ -0,0 +1,11 @@
.. _changelog:
Changelog
=========
`trunk (saas-2)`
----------------
- ``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.

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

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

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-09 07:36+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-10 05:25+0000\n"
"X-Generator: Launchpad (build 16696)\n"
#. module: crm
#: model:crm.case.stage,name:crm.stage_lead3
msgid "Qualification"
msgstr "Besorolás"
#. module: crm
#: view:crm.lead.report: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."

View File

@ -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')

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

@ -4,37 +4,6 @@
!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.
-
!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."
-
I escalate the lead to parent team.
-

View File

@ -20,9 +20,4 @@
-
!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,15 @@
-
In order to test the conversion of a lead into a opportunity,
-
I open a lead.
-
!python {model: crm.lead}: |
self.case_open(cr, uid, [ref("crm_case_4")])
-
I check if the lead state is "Open".
-
!assert {model: crm.lead, id: crm.crm_case_4, string: Lead state is Open}:
- state == "open"
-
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_1")], 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_1'))
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 +18,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_1')]})
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,28 +26,28 @@
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_1'))])
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_1')])
-
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_1')], 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_1")])
-
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_1'))
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.probability == 100.0, "Revenue probability should be 100.0!"
@ -104,7 +94,6 @@
-
!python {model: crm.meeting}: |
context.update({'active_model': 'crm.meeting'})
self.case_open(cr, uid, [ref('base_calendar.crm_meeting_4')])
-
I invite a user for meeting.
-

View File

@ -35,6 +35,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):
@ -74,9 +76,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.
@ -118,15 +138,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)
@ -79,4 +81,19 @@ class crm_merge_opportunity(osv.osv_memory):
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
@ -51,8 +43,6 @@ class crm_claim_stage(osv.osv):
'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',
@ -63,10 +53,9 @@ class crm_claim_stage(osv.osv):
'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 +63,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, [('state', '=', 'draft')], context=context)
_columns = {
'id': fields.integer('ID', readonly=True),
'name': fields.char('Claim Subject', size=128, required=True),
@ -117,15 +115,13 @@ class crm_claim(base_stage, osv.osv):
}
_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 +154,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

@ -52,7 +52,6 @@
<field name="case_default"/>
<field name="sequence"/>
<field name="state"/>
<field name="case_refused"/>
<field name="fold"/>
</form>
</field>
@ -102,10 +101,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">

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,14 @@
##############################################################################
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
)
class crm_helpdesk(base_state, base_stage, osv.osv):
class crm_helpdesk(base_state, osv.osv):
""" Helpdesk Cases """
_name = "crm.helpdesk"
@ -80,9 +74,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

@ -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

@ -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

@ -17,7 +17,7 @@ Get all your HR operations managed easily: knowledge sharing, recruitments, appr
Each need is provided by a specific app that you activate on demand.
</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=hr" class="oe_button oe_big oe_tacky">Start your <span class="oe_emph">free</span> trial</a>
</div>
</div>
</div>

View File

@ -86,7 +86,7 @@
</group>
<notebook>
<page string="Description">
<field name="line_ids" context="{'currency_id': currency_id, 'default_analytic_account': context.get('analytic_account')}">
<field name="line_ids" context="{'currency_id': currency_id, 'default_analytic_account': context.get('analytic_account', '')}">
<form string="Expense Lines" version="7.0">
<group>
<group>

View File

@ -322,7 +322,7 @@
</tree>
</field>
</page>
<page string="Other Information">
<page string="Accounting Information">
<group>
<group string="Miscellaneous">
<field name="company_id" groups="base.group_multi_company"/>

View File

@ -47,7 +47,6 @@ You can define the different phases of interviews and easily rate the applicant
'fetchmail',
],
'data': [
'wizard/hr_recruitment_employee_hired.xml',
'wizard/hr_recruitment_create_partner_job_view.xml',
'hr_recruitment_view.xml',
'hr_recruitment_menu.xml',

View File

@ -22,7 +22,7 @@
<field name="res_model">hr.applicant</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','in',('draft','open'))]</field>
<field name="domain">[('stage_id.fold', '!=', True)]</field>
<field name="view_id" ref="view_applicants_status_tree"/>
</record>

View File

@ -0,0 +1,16 @@
.. _changelog:
Changelog
=========
`trunk (saas-2)`
----------------
- Stage/state update
- ``hr.applicant``: removed inheritance from ``base_stage`` class and removed
``state`` field. Added ``date_last_stage_update`` field holding last stage_id
modification. Removed ``date`` field not used anywhere. Updated reports.
- ``hr.recruitment.stage``: removed ``state`` field.
- Removed ``hired.employee`` wizard.

View File

@ -0,0 +1,22 @@
=====================
HR Recruitment DevDoc
=====================
Hr Recruitment module documentation
===================================
Documentation topics
''''''''''''''''''''
.. toctree::
:maxdepth: 1
stage_status.rst
Changelog
'''''''''
.. toctree::
:maxdepth: 1
changelog.rst

View File

@ -0,0 +1,54 @@
.. _stage_status:
Stage and Status
================
.. versionchanged:: 8.0 saas-2 state/stage cleaning
Stage
+++++
This revision removed the concept of state on hr.applicant objects. The ``state``
field has been totally removed and replaced by stages, using ``stage_id``. The
following models are impacted:
- ``hr.applicant`` now use only stages. However a convention still exists about
'New' stage. An applicant is consdered as ``new`` when it has the following
properties:
- ``stage_id and stage_id.sequence = 1``
- ``hr.recruitment.stage`` do not have any ``state`` field anymore.
- ``hr.recruitment.report`` do not have any ``state`` field anymore.
By default a newly created applicant be 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.
Employee creation is still feasible directly from a link button in the form view.
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.
``hr.recruitment.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 ``hr.applicant``:
- ``mt_applicant_new``: new applicants. Condition: ``obj.stage_id and obj.stage_id.sequence == 1``
- ``mt_applicant_stage_changed``: stage changed. Condition: ``obj.stage_id and obj.stage_id.sequence != 1``
The following subtype is trigerred on ``hr.job``:
- ``mt_job_new_applicant``: new applicant in the job.

View File

@ -19,23 +19,13 @@
#
##############################################################################
import time
from openerp import tools
from openerp.addons.base_status.base_stage import base_stage
from datetime import datetime
from openerp.osv import fields, osv
from openerp.tools.translate import _
from openerp.tools import html2plaintext
AVAILABLE_STATES = [
('draft', 'New'),
('cancel', 'Refused'),
('open', 'In Progress'),
('pending', 'Pending'),
('done', 'Hired')
]
AVAILABLE_PRIORITIES = [
('', ''),
('5', 'Not Good'),
@ -62,13 +52,11 @@ class hr_recruitment_stage(osv.osv):
'name': fields.char('Name', size=64, required=True, translate=True),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of stages."),
'department_id':fields.many2one('hr.department', 'Specific to a Department', help="Stages of the recruitment process may be different per department. If this stage is common to all departments, keep this field empty."),
'state': fields.selection(AVAILABLE_STATES, 'Status', required=True, help="The related status for the stage. The status of your document will automatically change according to the selected stage. Example, a stage is related to the status 'Close', when your document reach this stage, it will be automatically closed."),
'fold': fields.boolean('Hide in views if empty', help="This stage is not visible, for example in status bar or kanban view, when there are no records in that stage to display."),
'requirements': fields.text('Requirements'),
}
_defaults = {
'sequence': 1,
'state': 'draft',
'fold': False,
}
@ -87,18 +75,15 @@ class hr_recruitment_degree(osv.osv):
('name_uniq', 'unique (name)', 'The name of the Degree of Recruitment must be unique!')
]
class hr_applicant(base_stage, osv.Model):
class hr_applicant(osv.Model):
_name = "hr.applicant"
_description = "Applicant"
_order = "id desc"
_inherit = ['mail.thread', 'ir.needaction_mixin']
_track = {
'state': {
'hr_recruitment.mt_applicant_hired': lambda self, cr, uid, obj, ctx=None: obj.state == 'done',
'hr_recruitment.mt_applicant_refused': lambda self, cr, uid, obj, ctx=None: obj.state == 'cancel',
},
'stage_id': {
'hr_recruitment.mt_stage_changed': lambda self, cr, uid, obj, ctx=None: obj.state not in ['done', 'cancel'],
'hr_recruitment.mt_applicant_new': lambda self, cr, uid, obj, ctx=None: obj.stage_id and obj.stage_id.sequence == 1,
'hr_recruitment.mt_applicant_stage_changed': lambda self, cr, uid, obj, ctx=None: obj.stage_id and obj.stage_id.sequence != 1,
},
}
@ -109,7 +94,7 @@ class hr_applicant(base_stage, osv.Model):
def _get_default_stage_id(self, cr, uid, context=None):
""" Gives default stage_id """
department_id = self._get_default_department_id(cr, uid, context=context)
return self.stage_find(cr, uid, [], department_id, [('state', '=', 'draft')], context=context)
return self.stage_find(cr, uid, [], department_id, [('sequence', '=', '1')], context=context)
def _resolve_department_id_from_context(self, cr, uid, context=None):
""" Returns ID of department based on the value of 'default_department_id'
@ -197,20 +182,12 @@ class hr_applicant(base_stage, osv.Model):
'write_date': fields.datetime('Update Date', readonly=True),
'stage_id': fields.many2one ('hr.recruitment.stage', 'Stage', track_visibility='onchange',
domain="['|', ('department_id', '=', department_id), ('department_id', '=', False)]"),
'state': fields.related('stage_id', 'state', type="selection", store=True,
selection=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\'.'),
'categ_ids': fields.many2many('hr.applicant_category', string='Tags'),
'company_id': fields.many2one('res.company', 'Company'),
'user_id': fields.many2one('res.users', 'Responsible', track_visibility='onchange'),
# Applicant Columns
'date_closed': fields.datetime('Closed', readonly=True, select=True),
'date_open': fields.datetime('Opened', readonly=True, select=True),
'date': fields.datetime('Date'),
'date_open': fields.datetime('Assigned', readonly=True, select=True),
'date_last_stage_update': fields.datetime('Last Stage Update', select=True),
'date_action': fields.date('Next Action Date'),
'title_action': fields.char('Next Action', size=64),
'priority': fields.selection(AVAILABLE_PRIORITIES, 'Appreciation'),
@ -234,37 +211,35 @@ class hr_applicant(base_stage, osv.Model):
'day_close': fields.function(_compute_day, string='Days to Close', \
multi='day_close', type="float", store=True),
'color': fields.integer('Color Index'),
'emp_id': fields.many2one('hr.employee', 'employee'),
'emp_id': fields.many2one('hr.employee', string='Employee',
help='Employee linked to the applicant.'),
'user_email': fields.related('user_id', 'email', type='char', string='User Email', readonly=True),
}
_defaults = {
'active': lambda *a: 1,
'user_id': lambda s, cr, uid, c: uid,
'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),
'department_id': lambda s, cr, uid, c: s._get_default_department_id(cr, uid, c),
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'hr.applicant', context=c),
'color': 0,
'date_last_stage_update': fields.datetime.now(),
}
_group_by_full = {
'stage_id': _read_group_stage_ids
}
def onchange_job(self, cr, uid, ids, job, context=None):
result = {}
def onchange_job(self, cr, uid, ids, job_id=False, context=None):
if job_id:
job_record = self.pool.get('hr.job').browse(cr, uid, job_id, context=context)
if job_record and job_record.department_id:
return {'value': {'department_id': job_record.department_id.id}}
return {}
if job:
job_obj = self.pool.get('hr.job')
result['department_id'] = job_obj.browse(cr, uid, job, context=context).department_id.id
return {'value': result}
return {'value': {'department_id': False}}
def onchange_department_id(self, cr, uid, ids, department_id=False, context=None):
obj_recru_stage = self.pool.get('hr.recruitment.stage')
stage_ids = obj_recru_stage.search(cr, uid, ['|',('department_id','=',department_id),('department_id','=',False)], context=context)
stage_id = stage_ids and stage_ids[0] or False
def onchange_department_id(self, cr, uid, ids, department_id=False, stage_id=False, context=None):
if not stage_id:
stage_id = self.stage_find(cr, uid, [], department_id, [('sequence', '=', '1')], context=context)
return {'value': {'stage_id': stage_id}}
def onchange_partner_id(self, cr, uid, ids, partner_id, context=None):
@ -403,27 +378,31 @@ class hr_applicant(base_stage, osv.Model):
return super(hr_applicant, self).message_update(cr, uid, ids, msg, update_vals=update_vals, context=context)
def create(self, cr, uid, vals, context=None):
if context is None:
context = {}
if vals.get('department_id') and not context.get('default_department_id'):
context['default_department_id'] = vals.get('department_id')
obj_id = super(hr_applicant, self).create(cr, uid, vals, context=context)
applicant = self.browse(cr, uid, obj_id, context=context)
if applicant.job_id:
self.pool.get('hr.job').message_post(cr, uid, [applicant.job_id.id], body=_('Applicant <b>created</b>'), subtype="hr_recruitment.mt_job_new_applicant", context=context)
return obj_id
def case_open(self, cr, uid, ids, context=None):
"""
open Request of the applicant for the hr_recruitment
"""
res = super(hr_applicant, self).case_open(cr, uid, ids, context)
date = self.read(cr, uid, ids, ['date_open'])[0]
if not date['date_open']:
self.write(cr, uid, ids, {'date_open': time.strftime('%Y-%m-%d %H:%M:%S'),})
return res
def write(self, cr, uid, ids, vals, context=None):
if isinstance(ids, (int, long)):
ids = [ids]
# stage change: update date_last_stage_update
if 'stage_id' in vals:
vals['date_last_stage_update'] = fields.datetime.now()
# user_id change: update date_start
if vals.get('user_id'):
vals['date_start'] = fields.datetime.now()
def case_close(self, cr, uid, ids, context=None):
res = super(hr_applicant, self).case_close(cr, uid, ids, context)
return res
return super(hr_applicant, self).write(cr, uid, ids, vals, context=context)
def case_close_with_emp(self, cr, uid, ids, context=None):
def create_employee_from_applicant(self, cr, uid, ids, context=None):
""" Create an hr.employee from the hr.applicants """
if context is None:
context = {}
hr_employee = self.pool.get('hr.employee')
@ -433,17 +412,16 @@ class hr_applicant(base_stage, osv.Model):
for applicant in self.browse(cr, uid, ids, context=context):
address_id = contact_name = False
if applicant.partner_id:
address_id = self.pool.get('res.partner').address_get(cr,uid,[applicant.partner_id.id],['contact'])['contact']
contact_name = self.pool.get('res.partner').name_get(cr,uid,[applicant.partner_id.id])[0][1]
address_id = self.pool.get('res.partner').address_get(cr, uid, [applicant.partner_id.id], ['contact'])['contact']
contact_name = self.pool.get('res.partner').name_get(cr, uid, [applicant.partner_id.id])[0][1]
if applicant.job_id and (applicant.partner_name or contact_name):
applicant.job_id.write({'no_of_recruitment': applicant.job_id.no_of_recruitment - 1})
emp_id = hr_employee.create(cr,uid,{'name': applicant.partner_name or contact_name,
emp_id = hr_employee.create(cr, uid, {'name': applicant.partner_name or contact_name,
'job_id': applicant.job_id.id,
'address_home_id': address_id,
'department_id': applicant.department_id.id
})
self.write(cr, uid, [applicant.id], {'emp_id': emp_id}, context=context)
self.case_close(cr, uid, [applicant.id], context)
else:
raise osv.except_osv(_('Warning!'), _('You must define an Applied Job and a Contact Name for this applicant.'))
@ -454,26 +432,6 @@ class hr_applicant(base_stage, osv.Model):
dict_act_window['view_mode'] = 'form,tree'
return dict_act_window
def case_cancel(self, cr, uid, ids, context=None):
"""Overrides cancel for crm_case for setting probability
"""
res = super(hr_applicant, self).case_cancel(cr, uid, ids, context)
self.write(cr, uid, ids, {'probability': 0.0})
return res
def case_pending(self, cr, uid, ids, context=None):
"""Marks case as pending"""
res = super(hr_applicant, self).case_pending(cr, uid, ids, context)
self.write(cr, uid, ids, {'probability': 0.0})
return res
def case_reset(self, cr, uid, ids, context=None):
"""Resets case as draft
"""
res = super(hr_applicant, self).case_reset(cr, uid, ids, context)
self.write(cr, uid, ids, {'date_open': False, 'date_closed': False})
return res
def set_priority(self, cr, uid, ids, priority, *args):
"""Set applicant priority
"""

View File

@ -51,34 +51,29 @@
<field name="name">Doctoral Degree</field>
<field name="sequence">4</field>
</record>
<record model="hr.recruitment.stage" id="stage_job1">
<field name="name">Initial Qualification</field>
<field name="state">draft</field>
<field name="sequence">1</field>
</record>
<record model="hr.recruitment.stage" id="stage_job2">
<field name="name">First Interview</field>
<field name="state">open</field>
<field name="sequence">2</field>
</record>
<record model="hr.recruitment.stage" id="stage_job3">
<field name="name">Second Interview</field>
<field name="state">open</field>
<field name="sequence">3</field>
</record>
<record model="hr.recruitment.stage" id="stage_job4">
<field name="name">Contract Proposed</field>
<field name="state">pending</field>
<field name="sequence">4</field>
</record>
<record model="hr.recruitment.stage" id="stage_job5">
<field name="name">Contract Signed</field>
<field name="state">done</field>
<field name="sequence">5</field>
</record>
<record model="hr.recruitment.stage" id="stage_job6">
<field name="name">Refused</field>
<field name="state">cancel</field>
<field name="sequence">6</field>
<field name="fold" eval="True"/>
</record>
@ -467,24 +462,24 @@
<field name="res_model">hr.job</field>
</record>
<!-- Applicant-related subtypes for messaging / Chatter -->
<record id="mt_stage_changed" model="mail.message.subtype">
<record id="mt_applicant_new" model="mail.message.subtype">
<field name="name">New Applicant</field>
<field name="res_model">hr.applicant</field>
<field name="default" eval="False"/>
<field name="description">Applicant created</field>
</record>
<record id="mt_applicant_stage_changed" model="mail.message.subtype">
<field name="name">Stage Changed</field>
<field name="res_model">hr.applicant</field>
<field name="default" eval="False"/>
<field name="description">Stage changed</field>
</record>
<record id="mt_applicant_hired" model="mail.message.subtype">
<record id="mt_applicant_employee" model="mail.message.subtype">
<field name="name">Applicant Hired</field>
<field name="res_model">hr.applicant</field>
<field name="default" eval="False"/>
<field name="description">Applicant hired</field>
</record>
<record id="mt_applicant_refused" model="mail.message.subtype">
<field name="name">Applicant Refused</field>
<field name="res_model">hr.applicant</field>
<field name="default" eval="False"/>
<field name="description">Applicant refused</field>
</record>
<!-- Applicant Categories(Tag) -->
<record id="tag_applicant_reserve" model="hr.applicant_category">
<field name="name">Reserve</field>

View File

@ -39,9 +39,10 @@
<field name="name">Applicants</field>
<field name="model">hr.applicant</field>
<field name="arch" type="xml">
<tree string="Applicants" fonts="bold:message_unread==True" colors="grey:state in ('cancel','done');blue:state=='pending'">
<tree string="Applicants" fonts="bold:message_unread==True">
<field name="message_unread" invisible="1"/>
<field name="create_date"/>
<field name="date_last_stage_update" invisible="1"/>
<field name="name" string="Subject"/>
<field name="partner_name"/>
<field name="email_from"/>
@ -58,7 +59,6 @@
<field name="availability" invisible="1"/>
<field name="department_id" invisible="context.get('invisible_department', True)"/>
<field name="user_id"/>
<field name="state" invisible="1"/>
</tree>
</field>
</record>
@ -69,13 +69,7 @@
<field name="arch" type="xml">
<form string="Jobs - Recruitment Form" version="7.0">
<header>
<button name="case_close_with_emp" string="Hire &amp; Create Employee" type="object"
class="oe_highlight"
attrs="{'invisible':['|', ('emp_id','!=',False), ('state','=','cancel')]}"/>
<button name="case_cancel" string="Refuse" type="object"
states="draft,open,pending" class="oe_highlight"/>
<field name="stage_id" widget="statusbar" clickable="True"/>
<field name="emp_id" invisible="1"/>
</header>
<sheet>
<div class="oe_right oe_button_box">
@ -93,9 +87,12 @@
<label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1>
<label for="partner_name" class="oe_edit_only"/>
<h2>
<h2 style="display: inline-block;">
<field name="partner_name" class="oe_inline"/>
</h2>
<button string="Create Employee" name="create_employee_from_applicant" type="object"
class="oe_link oe_inline" style="margin-left: 8px;"
attrs="{'invisible': [('emp_id', '!=', False)]}"/>
</div>
<group>
<group>
@ -115,7 +112,6 @@
<field name="title_action" class="oe_inline" placeholder="e.g. Call for interview"/>
</div>
<field name="priority"/>
<field name="state" invisible="1"/>
<field name="source_id"/>
<field name="reference"/>
</group>
@ -123,7 +119,7 @@
<field name="survey" invisible="1"/>
<field name="response" invisible="1"/>
<field name="job_id" on_change="onchange_job(job_id)"/>
<field name="department_id" on_change="onchange_department_id(department_id)"/>
<field name="department_id" on_change="onchange_department_id(department_id, stage_id)"/>
<label for="availability"/>
<div>
<field name="availability" class="oe_inline"/> <label string="Day(s)" class="oe_inline"/>
@ -142,6 +138,7 @@
<span class="oe_inline" attrs="{'invisible':[('salary_proposed_extra','=',False)]}"> + </span>
<field name="salary_proposed_extra" class="oe_inline" placeholder="Extra advantages..."/>
</div>
<field name="emp_id" readonly="1"/>
</group>
</group>
<group>
@ -165,7 +162,7 @@
<graph string="Cases By Stage and Estimates" type="bar" orientation="vertical">
<field name="job_id"/>
<field name="salary_expected" operator="+"/>
<field name="state" group="True"/>
<field name="stage_id" group="True"/>
</graph>
</field>
</record>
@ -174,22 +171,22 @@
<field name="name">Jobs - Recruitment Search</field>
<field name="model">hr.applicant</field>
<field name="arch" type="xml">
<search string="Search Jobs">
<search string="Search Applicants">
<field name="partner_name" filter_domain="['|','|',('name','ilike',self),('partner_name','ilike',self),('email_from','ilike',self)]" string="Subject / Applicant"/>
<filter string="Unassigned" domain="[('user_id', '=', False)]"/>
<filter string="My" domain="[('user_id', '=', uid)]"/>
<separator/>
<filter string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/>
<separator/>
<filter string="New" domain="[('state','=','draft')]" help="All Initial Jobs"/>
<filter string="In Progress" domain="[('state','=','open')]" help="Open Jobs"/>
<filter string="Pending" domain="[('state','=','pending')]" help="Pending Jobs"/>
<separator/>
<filter string="Unassigned Recruitments" domain="[('user_id','=',False)]" help="Unassigned Recruitments"/>
<separator/>
<filter string="Next Actions" context="{'invisible_next_action':False, 'invisible_next_date':False}"
domain="[('date_action','&lt;&gt;',False)]" help="Filter and view on next actions and date"/>
<field name="job_id"/>
<field name="department_id"/>
<field name="user_id"/>
<field name="stage_id" domain="[]"/>
<separator/>
<field name="categ_ids"/>
<separator/>
<group expand="0" string="Group By...">
<filter string="Responsible" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Department" domain="[]" context="{'group_by':'department_id'}"/>
@ -200,6 +197,7 @@
<filter string="Stage" domain="[]" context="{'group_by':'stage_id'}"/>
<filter string="Source" domain="[]" context="{'group_by':'source_id'}"/>
<filter string="Creation Date" domain="[]" context="{'group_by':'create_date'}"/>
<filter string="Last Stage Update" context="{'group_by':'date_last_stage_update'}"/>
</group>
</search>
</field>
@ -342,7 +340,6 @@
<field name="sequence" invisible="1"/>
<field name="name"/>
<field name="department_id"/>
<field name="state"/>
</tree>
</field>
</record>
@ -360,7 +357,6 @@
<field name="department_id"/>
</group>
<group>
<field name="state"/>
<field name="sequence"/>
<field name="fold"/>
</group>

View File

@ -18,30 +18,24 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import tools
from openerp.osv import fields,osv
from openerp.osv import fields, osv
from .. import hr_recruitment
from openerp.addons.decimal_precision import decimal_precision as dp
AVAILABLE_STATES = [
('draft','New'),
('open','Open'),
('cancel', 'Refused'),
('done', 'Hired'),
('pending','Pending')
]
class hr_recruitment_report(osv.osv):
class hr_recruitment_report(osv.Model):
_name = "hr.recruitment.report"
_description = "Recruitments Statistics"
_auto = False
_rec_name = 'date'
_rec_name = 'date_create'
_order = 'date_create desc'
_columns = {
'user_id': fields.many2one('res.users', 'User', readonly=True),
'nbr': fields.integer('# of Applications', readonly=True),
'state': fields.selection(AVAILABLE_STATES, 'Status', size=16, readonly=True),
# TDE TODO: use MONTHS
'month':fields.selection([('01', 'January'), ('02', 'February'), \
('03', 'March'), ('04', 'April'),\
('05', 'May'), ('06', 'June'), \
@ -51,7 +45,8 @@ class hr_recruitment_report(osv.osv):
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'year': fields.char('Year', size=4, readonly=True),
'date': fields.date('Date', readonly=True),
'date_create': fields.date('Create Date', readonly=True),
'date_last_stage_update': fields.datetime('Last Stage Update', readonly=True),
'date_closed': fields.date('Closed', readonly=True),
'job_id': fields.many2one('hr.job', 'Applied Job',readonly=True),
'stage_id': fields.many2one ('hr.recruitment.stage', 'Stage'),
@ -67,19 +62,19 @@ class hr_recruitment_report(osv.osv):
'delay_close': fields.float('Avg. Delay to Close', digits=(16,2), readonly=True, group_operator="avg",
help="Number of Days to close the project issue"),
}
_order = 'date desc'
def init(self, cr):
tools.drop_view_if_exists(cr, 'hr_recruitment_report')
cr.execute("""
create or replace view hr_recruitment_report as (
select
min(s.id) as id,
date_trunc('day',s.create_date) as date,
date_trunc('day',s.create_date) as date_create,
date_trunc('day',s.date_closed) as date_closed,
date_trunc('day',s.date_last_stage_update) as date_last_stage_update,
to_char(s.create_date, 'YYYY') as year,
to_char(s.create_date, 'MM') as month,
to_char(s.create_date, 'YYYY-MM-DD') as day,
s.state,
s.partner_id,
s.company_id,
s.user_id,
@ -93,7 +88,7 @@ class hr_recruitment_report(osv.osv):
(sum(salary_proposed)/count(*)) as salary_prop_avg,
sum(salary_expected) as salary_exp,
(sum(salary_expected)/count(*)) as salary_exp_avg,
extract('epoch' from (s.date_closed-s.create_date))/(3600*24) as delay_close,
extract('epoch' from (s.date_closed-s.create_date))/(3600*24) as delay_close,
count(*) as nbr
from hr_applicant s
group by
@ -105,7 +100,7 @@ class hr_recruitment_report(osv.osv):
s.date_open,
s.create_date,
s.date_closed,
s.state,
s.date_last_stage_update,
s.partner_id,
s.company_id,
s.user_id,

View File

@ -6,7 +6,7 @@
<field name="model">hr.recruitment.report</field>
<field name="arch" type="xml">
<tree string="Recruitment Analysis" create="false">
<field name="date" invisible="1"/>
<field name="date_create" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="job_id"/>
<field name="stage_id" invisible="1" />
@ -14,10 +14,10 @@
<field name="type_id" invisible="1"/>
<field name="partner_id" invisible="1"/>
<field name="company_id" groups="base.group_multi_company" invisible="1"/>
<field name="state" invisible="1"/>
<field name="year" invisible="1"/>
<field name="day" invisible="1"/>
<field name="month" invisible="1"/>
<field name="date_last_stage_update" invisible="1"/>
<field name="nbr" sum="# of Applications"/>
<field name="available" sum="Available"/>
<field name="salary_exp" sum="Expected Salary"/>
@ -46,34 +46,33 @@
<field name="model">hr.recruitment.report</field>
<field name="arch" type="xml">
<search string="Recruitment Analysis">
<filter string="New" icon="terp-document-new" domain="[('state','=','draft')]" help = "Draft recruitment"/>
<filter string="In progress" icon="terp-camera_test" domain="[('state', '=' ,'open')]" help = "In progress recruitment"/>
<filter string="Pending" icon="terp-gtk-media-pause" domain="[('state','=','pending')]" help = "Pending recruitment"/>
<filter string="Hired" icon="terp-camera_test" domain="[('state','=','done')]" help = "Hired employees"/>
<separator/>
<filter icon="terp-personal" string="My Recruitment" help="My Recruitment" domain="[('user_id','=',uid)]"/>
<field name="job_id"/>
<field name="department_id"/>
<field name="user_id" string="Responsible"/>
<field name="user_id"/>
<filter string="New" domain="[('sequence', '=', 1)]"/>
<separator/>
<filter string="Unassigned" domain="[('user_id', '=', False)]"/>
<filter string="My" domain="[('user_id', '=', uid)]"/>
<separator/>
<group expand="0" string="Extended Filters...">
<!--field name="job_id"/-->
<field name="priority"/>
<field name="stage_id"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="date" string="Creation Date"/>
<field name="date_create"/>
<field name="date_closed"/>
</group>
<group expand="1" string="Group By ...">
<filter string="Responsible" name='User' icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Company" icon="terp-go-home" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}" />
<filter string="Jobs" name="job" icon="terp-gtk-select-all" domain="[]" context="{'group_by':'job_id'}"/>
<filter string="Department" name="department" icon="terp-personal+" domain="[]" context="{'group_by':'department_id'}"/>
<filter string="Degree" name="degree" icon="terp-gtk-select-all" domain="[]" context="{'group_by':'type_id'}"/>
<filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}" />
<filter string="Day" name = "day" icon="terp-go-today" domain="[]" context="{'group_by':'day'}" help="Creation Date"/>
<filter string="Month" icon="terp-go-month" domain="[]" context="{'group_by':'month'}" help="Creation Date"/>
<filter string="Year" icon="terp-go-year" domain="[]" context="{'group_by':'year'}" help="Creation Date"/>
<filter string="Responsible" name='User' context="{'group_by':'user_id'}"/>
<filter string="Company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<filter string="Partner" context="{'group_by':'partner_id'}" />
<filter string="Jobs" name="job" context="{'group_by':'job_id'}"/>
<filter string="Department" name="department" context="{'group_by':'department_id'}"/>
<filter string="Degree" name="degree" context="{'group_by':'type_id'}"/>
<filter string="Stage" context="{'group_by':'stage_id'}" />
<filter string="Last Stage Update" context="{'group_by':'date_last_stage_update'}" />
<filter string="Day" name="day" context="{'group_by':'day'}" help="Creation Date"/>
<filter string="Month" context="{'group_by':'month'}" help="Creation Date"/>
<filter string="Year" context="{'group_by':'year'}" help="Creation Date"/>
</group>
</search>
</field>

View File

@ -17,33 +17,8 @@
resume_ids = self.pool.get('ir.attachment').search(cr, uid, [('datas_fname','=','resume.pdf'),('res_model','=',self._name),('res_id','=',applicant.id)])
assert applicant.name == "Application for the post of Jr.application Programmer.", "Applicant name does not match."
assert applicant.stage_id.id == ref('hr_recruitment.stage_job1'), "Stage should be 'Initial qualification' and is '%s'." % (applicant.stage_id.name)
assert applicant.state == "draft", "Applicant state should be 'draft'."
assert applicant.stage_id.sequence == 1, "Applicant stage sequence should be 1."
assert len(resume_ids), "Resume is not attached."
-
I refuse the applicant (hr_case_programmer)
-
!python {model: hr.applicant}: |
self.case_cancel(cr, uid, [ref("hr_case_programmer")])
-
I check the details of the refused applicant.
-
!python {model: hr.applicant}: |
applicant = self.browse(cr, uid, ref("hr_case_programmer"), context=context)
assert applicant.stage_id.id == ref('hr_recruitment.stage_job6'), "Stage should be 'Refused' and is %s." % (applicant.stage_id.name)
assert applicant.state == 'cancel', "Applicant is not in 'cancel' state."
-
I reset and re-open the previously refused applicant.
-
!python {model: hr.applicant}: |
self.case_reset(cr, uid, [ref("hr_case_programmer")])
self.case_open(cr, uid, [ref("hr_case_programmer")])
-
I check the details of the re-opened applicant.
-
!python {model: hr.applicant}: |
applicant = self.browse(cr, uid, ref("hr_case_programmer"), context=context)
assert applicant.stage_id.id == ref('hr_recruitment.stage_job2'), "Stage should be 'First interview' and is '%s'." % (applicant.stage_id.name)
assert applicant.state == "open", "Applicant state should be 'open'."
-
I assign the Job position to the applicant
-
@ -54,21 +29,6 @@
-
!python {model: hr.applicant}: |
self.action_makeMeeting(cr, uid, [ref('hr_case_programmer')])
-
I check Initial Qualification of applicant.
-
!python {model: hr.applicant}: |
self.stage_next(cr, uid, [ref('hr_case_programmer')])
-
I schedule First Interview of applicant.
-
!python {model: hr.applicant}: |
self.stage_next(cr, uid, [ref('hr_case_programmer')])
-
On a successful First Interview of applicant, I schedule Second Interview.
-
!python {model: hr.applicant}: |
self.stage_next(cr, uid, [ref('hr_case_programmer')])
-
Applicant fillup the answer of the interview quetion.
-
@ -83,40 +43,8 @@
I print Applicant fill up the interview quetion
-
!python {model: hr.applicant}: |
self.action_print_survey(cr, uid, [ref('hr_case_programmer')])
-
On a successful Second Interview of applicant Contract is Proposed to applicant.
-
!python {model: hr.applicant}: |
self.stage_next(cr, uid, [ref('hr_case_programmer')])
self.stage_previous(cr, uid, [ref('hr_case_programmer')])
-
I Hired Applicant.
-
!python {model: hr.applicant}: |
self.case_close_with_emp(cr, uid, [ref('hr_case_programmer')])
-
I check that applicant is "Hired".
-
!assert {model: hr.applicant, id: hr_case_programmer, string: Applicant state is done}:
- state == 'done'
-
I do not give employment to the hired the applicant.
-
!python {model: hired.employee}: |
context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")})
emp_id = self.create(cr, uid, {}, context=context)
self.case_close(cr, uid, [emp_id], context=context)
-
Now I give employment to hired applicant .
-
!python {model: hr.applicant}: |
hired_emp_obj = self.pool.get('hired.employee')
self.case_reset(cr, uid, [ref("hr_case_programmer")])
self.case_open(cr, uid, [ref("hr_case_programmer")])
context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")})
emp_hr_id = hired_emp_obj.create(cr, uid, {}, context=context)
hired_emp_obj.case_close_with_emp(cr, uid, [emp_hr_id], context=context)
self.action_print_survey(cr, uid, [ref('hr_case_programmer')])
-
Now hired employee want to be a partner of company.
-

View File

@ -2,7 +2,7 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2004-Today OpenERP (<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
@ -19,9 +19,7 @@
#
##############################################################################
import hr_recruitment_create_partner_job
import hr_recruitment_employee_hired
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,54 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# 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 hired_employee(osv.osv_memory):
_name = 'hired.employee'
_description = 'Create Employee'
def case_close(self, cr, uid, ids, context=None):
"""
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of case's Ids
@param *args: Give Tuple Value
"""
if context is None:
context = {}
self.pool.get('hr.applicant').case_close(cr, uid,context.get('active_ids',[]))
return {}
def case_close_with_emp(self, cr, uid, ids, context=None):
"""
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of case's Ids
"""
if context is None:
context = {}
return self.pool.get('hr.applicant').case_close_with_emp(cr, uid,context.get('active_ids', []))
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_hr_recruitment_hired_employee" model="ir.ui.view">
<field name="name">hr.recruitment.hired2employee.form</field>
<field name="model">hired.employee</field>
<field name="arch" type="xml">
<form string="Create New Employee" version="7.0">
<header>
<button name="case_close_with_emp" string="Yes" type="object" class="oe_highlight" />
<button name="case_close" string="No" type="object"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</header>
<label string="Would you like to create an employee ?"/>
</form>
</field>
</record>
<record id="action_hr_recruitment_hired_employee" model="ir.actions.act_window">
<field name="name">Create Employee</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hired.employee</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
</data>
</openerp>

View File

@ -173,7 +173,10 @@ class account_analytic_line(osv.osv):
data = {}
journal_types = {}
price = 0.0
for line in self.pool.get('account.analytic.line').browse(cr, uid, ids, context=context):
price += line.amount*-1
line_name = line.name
if line.journal_id.type not in journal_types:
journal_types[line.journal_id.type] = set()
journal_types[line.journal_id.type].add(line.account_id.id)
@ -204,7 +207,6 @@ class account_analytic_line(osv.osv):
'date_due': date_due,
'fiscal_position': account.partner_id.property_account_position.id
}
context2 = context.copy()
context2['lang'] = partner.lang
# set company_id in context, so the correct default journal will be selected
@ -225,36 +227,42 @@ class account_analytic_line(osv.osv):
if data.get('product'):
product_id = data['product'][0]
product = product_obj.browse(cr, uid, product_id, context=context2)
if not product:
raise osv.except_osv(_('Error!'), _('There is no product defined. Please select one or force the product through the wizard.'))
factor = invoice_factor_obj.browse(cr, uid, factor_id, context=context2)
factor_name = product_obj.name_get(cr, uid, [product_id], context=context2)[0][1]
if factor.customer_name:
factor_name += ' - ' + factor.customer_name
ctx = context.copy()
ctx.update({'uom':uom})
price = self._get_invoice_price(cr, uid, account, product_id, user_id, qty, ctx)
general_account = product.property_account_income or product.categ_id.property_account_income_categ
if not general_account:
raise osv.except_osv(_("Configuration Error!"), _("Please define income account for product '%s'.") % product.name)
taxes = product.taxes_id or general_account.tax_ids
tax = fiscal_pos_obj.map_tax(cr, uid, account.partner_id.property_account_position, taxes)
factor_name = factor.customer_name and line_name + ' - ' + factor.customer_name or line_name
curr_line = {
'price_unit': price,
'quantity': qty,
'discount':factor.factor,
'invoice_line_tax_id': [(6,0,tax )],
'discount': factor.factor,
'invoice_id': last_invoice,
'name': factor_name,
'product_id': product_id,
'invoice_line_tax_id': [(6,0,tax)],
'uos_id': uom,
'account_id': general_account.id,
'account_analytic_id': account.id,
}
if product:
factor_name = product_obj.name_get(cr, uid, [product_id], context=context2)[0][1]
if factor.customer_name:
factor_name += ' - ' + factor.customer_name
ctx = context.copy()
ctx.update({'uom': uom})
# check force product
if data.get('product'):
price = self._get_invoice_price(cr, uid, account, product_id, user_id, qty, ctx)
general_account = product.property_account_income or product.categ_id.property_account_income_categ
if not general_account:
raise osv.except_osv(_("Configuration Error!"), _("Please define income account for product '%s'.") % product.name)
taxes = product.taxes_id or general_account.tax_ids
tax = fiscal_pos_obj.map_tax(cr, uid, account.partner_id.property_account_position, taxes)
curr_line.update({
'price_unit': price,
'invoice_line_tax_id': [(6,0,tax )],
'name': factor_name,
'product_id': product_id,
'invoice_line_tax_id': [(6,0,tax)],
'account_id': general_account.id,
})
#
# Compute for lines

View File

@ -93,7 +93,6 @@
help="Accepted Ideas" />
<group expand="0" string="Group By...">
<filter string="Creator" help="By Responsible" context="{'group_by': 'user_id'}"/>
<filter string="Category" help="By Category" context="{'group_by': 'category_ids'}"/>
<filter string="Status" help="By State" context="{'group_by': 'state'}"/>
</group>
</search>

View File

@ -101,17 +101,19 @@ class LongPollingController(http.Controller):
raise Exception("Not usable in a server not running gevent")
from openerp.addons.im.watcher import ImWatcher
if db is not None:
request.session.authenticate(db=db, uid=uid, password=password)
openerp.service.security.check(db, uid, password)
else:
request.session.authenticate(db=request.session._db, uid=request.session._uid, password=request.session._password)
uid = request.session.uid
db = request.session.db
with request.registry.cursor() as cr:
request.registry.get('im.user').im_connect(cr, request.uid, uuid=uuid, context=request.context)
my_id = request.registry.get('im.user').get_by_user_id(cr, request.uid, uuid or request.session._uid, request.context)["id"]
registry = openerp.modules.registry.RegistryManager.get(db)
with registry.cursor() as cr:
registry.get('im.user').im_connect(cr, uid, uuid=uuid, context=request.context)
my_id = registry.get('im.user').get_by_user_id(cr, uid, uuid or uid, request.context)["id"]
num = 0
while True:
with request.registry.cursor() as cr:
res = request.registry.get('im.message').get_messages(cr, request.uid, last, users_watch, uuid=uuid, context=request.context)
with registry.cursor() as cr:
res = registry.get('im.message').get_messages(cr, uid, last, users_watch, uuid=uuid, context=request.context)
if num >= 1 or len(res["res"]) > 0:
return res
last = res["last"]

View File

@ -37,36 +37,45 @@ env.filters["json"] = json.dumps
class LiveChatController(http.Controller):
@http.route('/im_livechat/loader')
def _auth(self, db):
reg = openerp.modules.registry.RegistryManager.get(db)
uid = openerp.netsvc.dispatch_rpc('common', 'authenticate', [db, "anonymous", "anonymous", None])
return reg, uid
@http.route('/im_livechat/loader', auth="none")
def loader(self, **kwargs):
p = json.loads(kwargs["p"])
db = p["db"]
channel = p["channel"]
user_name = p.get("user_name", None)
request.session.authenticate(db=db, login="anonymous", password="anonymous")
info = request.session.model('im_livechat.channel').get_info_for_chat_src(channel)
info["db"] = db
info["channel"] = channel
info["userName"] = user_name
return request.make_response(env.get_template("loader.js").render(info),
headers=[('Content-Type', "text/javascript")])
@http.route('/im_livechat/web_page')
reg, uid = self._auth(db)
with reg.cursor() as cr:
info = reg.get('im_livechat.channel').get_info_for_chat_src(cr, uid, channel)
info["db"] = db
info["channel"] = channel
info["userName"] = user_name
return request.make_response(env.get_template("loader.js").render(info),
headers=[('Content-Type', "text/javascript")])
@http.route('/im_livechat/web_page', auth="none")
def web_page(self, **kwargs):
p = json.loads(kwargs["p"])
db = p["db"]
channel = p["channel"]
request.session.authenticate(db=db, login="anonymous", password="anonymous")
script = request.session.model('im_livechat.channel').read(channel, ["script"])["script"]
info = request.session.model('im_livechat.channel').get_info_for_chat_src(channel)
info["script"] = script
return request.make_response(env.get_template("web_page.html").render(info),
headers=[('Content-Type', "text/html")])
reg, uid = self._auth(db)
with reg.cursor() as cr:
script = reg.get('im_livechat.channel').read(cr, uid, channel, ["script"])["script"]
info = reg.get('im_livechat.channel').get_info_for_chat_src(cr, uid, channel)
info["script"] = script
return request.make_response(env.get_template("web_page.html").render(info),
headers=[('Content-Type', "text/html")])
@http.route('/im_livechat/available', type='json')
@http.route('/im_livechat/available', type='json', auth="none")
def available(self, db, channel):
request.session.authenticate(db=db, login="anonymous", password="anonymous")
return request.session.model('im_livechat.channel').get_available_user(channel) > 0
reg, uid = self._auth(db)
with reg.cursor() as cr:
return reg.get('im_livechat.channel').get_available_user(cr, uid, channel) > 0
class im_livechat_channel(osv.osv):
_name = 'im_livechat.channel'

View File

@ -117,6 +117,8 @@ class account_coda_import(osv.osv_memory):
# and so a 'like' operator would return the first account number in the database which matches.
cr.execute("select id from res_partner_bank where replace(replace(acc_number,' ',''),'-','') = %s", (statement['acc_number'],))
bank_ids = [id[0] for id in cr.fetchall()]
# Filter bank accounts which are not allowed
bank_ids = self.pool.get('res.partner.bank').search(cr, uid, [('id', 'in', bank_ids)])
if bank_ids and len(bank_ids) > 0:
bank_accs = self.pool.get('res.partner.bank').browse(cr, uid, bank_ids)
for bank_acc in bank_accs:
@ -248,7 +250,7 @@ class account_coda_import(osv.osv_memory):
elif line[0] == '9':
statement['balanceMin'] = float(rmspaces(line[22:37])) / 1000
statement['balancePlus'] = float(rmspaces(line[37:52])) / 1000
if not statement['balance_end_real']:
if not statement.get('balance_end_real'):
statement['balance_end_real'] = statement['balance_start'] + statement['balancePlus'] - statement['balanceMin']
for i, statement in enumerate(statements):
statement['coda_note'] = ''
@ -266,6 +268,8 @@ class account_coda_import(osv.osv_memory):
raise osv.except_osv(_('Error'), _("Configuration Error in journal %s!\nPlease verify the Default Debit and Credit Account settings.") % statement['journal_id'].name)
if balance_start_check != statement['balance_start']:
statement['coda_note'] = _("The CODA Statement %s Starting Balance (%.2f) does not correspond with the previous Closing Balance (%.2f) in journal %s!") % (statement['description'] + ' #' + statement['paperSeqNumber'], statement['balance_start'], balance_start_check, statement['journal_id'].name)
if not(statement.get('period_id')):
raise osv.except_osv(_('Error') + ' R3006', _(' No transactions or no period in coda file !'))
data = {
'name': statement['paperSeqNumber'],
'date': statement['date'],

View File

@ -153,25 +153,33 @@ class account_invoice(osv.osv):
return {'value': {'reference': reference}}
def create(self, cr, uid, vals, context=None):
if vals.has_key('reference_type'):
reference_type = vals['reference_type']
reference = vals.get('reference', False)
reference_type = vals.get('reference_type', False)
if vals.get('type') == 'out_invoice' and not reference_type:
# fallback on default communication type for partner
reference_type = self.pool.get('res.partner').browse(cr, uid, vals['partner_id']).out_inv_comm_type
if reference_type == 'bba':
if vals.has_key('reference'):
bbacomm = vals['reference']
else:
reference = self.generate_bbacomm(cr, uid, [], vals['type'], reference_type, vals['partner_id'], '', context={})['value']['reference']
vals.update({
'reference_type': reference_type or 'none',
'reference': reference,
})
if reference_type == 'bba':
if not reference:
raise osv.except_osv(_('Warning!'),
_('Empty BBA Structured Communication!' \
'\nPlease fill in a unique BBA Structured Communication.'))
if self.check_bbacomm(reference):
reference = re.sub('\D', '', reference)
vals['reference'] = '+++' + reference[0:3] + '/' + reference[3:7] + '/' + reference[7:] + '+++'
same_ids = self.search(cr, uid,
[('type', '=', 'out_invoice'), ('reference_type', '=', 'bba'),
('reference', '=', vals['reference'])])
if same_ids:
raise osv.except_osv(_('Warning!'),
_('Empty BBA Structured Communication!' \
'\nPlease fill in a unique BBA Structured Communication.'))
if self.check_bbacomm(bbacomm):
reference = re.sub('\D', '', bbacomm)
vals['reference'] = '+++' + reference[0:3] + '/' + reference[3:7] + '/' + reference[7:] + '+++'
same_ids = self.search(cr, uid,
[('type', '=', 'out_invoice'), ('reference_type', '=', 'bba'),
('reference', '=', vals['reference'])])
if same_ids:
raise osv.except_osv(_('Warning!'),
_('The BBA Structured Communication has already been used!' \
'\nPlease create manually a unique BBA Structured Communication.'))
_('The BBA Structured Communication has already been used!' \
'\nPlease create manually a unique BBA Structured Communication.'))
return super(account_invoice, self).create(cr, uid, vals, context=context)
def write(self, cr, uid, ids, vals, context=None):

View File

@ -101,8 +101,8 @@
<record id="gsttvq_sale_en" model="account.tax.template">
<field name="chart_template_id" ref="ca_en_chart_template_en"/>
<field name="name">GST + TVQ for sales</field>
<field name="description">GSTTVQ_SALE</field>
<field name="name">GST + QST for sales</field>
<field name="description">GSTQST_SALE</field>
<field name="type_tax_use">sale</field>
<field name="amount">1</field>
<field name="type">percent</field>
@ -127,8 +127,8 @@
<record id="tvq_sale_en" model="account.tax.template">
<field name="chart_template_id" ref="ca_en_chart_template_en"/>
<field name="name">TVQ for sales - 9.975%</field>
<field name="description">TVQ</field>
<field name="name">QST for sales - 9.975%</field>
<field name="description">QST</field>
<field name="type_tax_use">sale</field>
<field name="amount">0.099750</field>
<field name="type">percent</field>
@ -192,8 +192,8 @@
<record id="hst12_sale_en" model="account.tax.template">
<field name="chart_template_id" ref="ca_en_chart_template_en"/>
<field name="name">TVH for sales - 12%</field>
<field name="description">TVH12_SALE</field>
<field name="name">HST for sales - 12%</field>
<field name="description">HST12_SALE</field>
<field name="type_tax_use">sale</field>
<field name="amount">0.120000</field>
<field name="type">percent</field>
@ -207,8 +207,8 @@
<record id="hst13_sale_en" model="account.tax.template">
<field name="chart_template_id" ref="ca_en_chart_template_en"/>
<field name="name">TVH for sales - 13%</field>
<field name="description">TVH13_SALE</field>
<field name="name">HST for sales - 13%</field>
<field name="description">HST13_SALE</field>
<field name="type_tax_use">sale</field>
<field name="amount">0.130000</field>
<field name="type">percent</field>
@ -222,8 +222,8 @@
<record id="hst135_sale_en" model="account.tax.template">
<field name="chart_template_id" ref="ca_en_chart_template_en"/>
<field name="name">TVH for sales - 13.5%</field>
<field name="description">TVH135_SALE</field>
<field name="name">HST for sales - 13.5%</field>
<field name="description">HST135_SALE</field>
<field name="type_tax_use">sale</field>
<field name="amount">0.135000</field>
<field name="type">percent</field>
@ -237,8 +237,8 @@
<record id="hst15_sale_en" model="account.tax.template">
<field name="chart_template_id" ref="ca_en_chart_template_en"/>
<field name="name">TVH for sales - 15%</field>
<field name="description">TVH15_SALE</field>
<field name="name">HST for sales - 15%</field>
<field name="description">HST15_SALE</field>
<field name="type_tax_use">sale</field>
<field name="amount">0.150000</field>
<field name="type">percent</field>
@ -367,8 +367,8 @@
<record id="gsttvq_purc_en" model="account.tax.template">
<field name="chart_template_id" ref="ca_en_chart_template_en"/>
<field name="name">GST + TVQ for purchases</field>
<field name="description">GSTTVQ_PURC</field>
<field name="name">GST + QST for purchases</field>
<field name="description">GSTQST_PURC</field>
<field name="type_tax_use">purchase</field>
<field name="amount">1</field>
<field name="type">percent</field>
@ -393,8 +393,8 @@
<record id="tvq_purc_en" model="account.tax.template">
<field name="chart_template_id" ref="ca_en_chart_template_en"/>
<field name="name">TVQ for purchases - 9.975%</field>
<field name="description">TVQ</field>
<field name="name">QST for purchases - 9.975%</field>
<field name="description">QST</field>
<field name="type_tax_use">purchase</field>
<field name="amount">0.099750</field>
<field name="type">percent</field>
@ -458,8 +458,8 @@
<record id="hst12_purc_en" model="account.tax.template">
<field name="chart_template_id" ref="ca_en_chart_template_en"/>
<field name="name">TVH for purchases - 12%</field>
<field name="description">TVH12_PURC</field>
<field name="name">HST for purchases - 12%</field>
<field name="description">HST12_PURC</field>
<field name="type_tax_use">purchase</field>
<field name="amount">0.120000</field>
<field name="type">percent</field>
@ -473,8 +473,8 @@
<record id="hst13_purc_en" model="account.tax.template">
<field name="chart_template_id" ref="ca_en_chart_template_en"/>
<field name="name">TVH for purchases - 13%</field>
<field name="description">TVH13_PURC</field>
<field name="name">HST for purchases - 13%</field>
<field name="description">HST13_PURC</field>
<field name="type_tax_use">purchase</field>
<field name="amount">0.130000</field>
<field name="type">percent</field>
@ -488,8 +488,8 @@
<record id="hst135_purc_en" model="account.tax.template">
<field name="chart_template_id" ref="ca_en_chart_template_en"/>
<field name="name">TVH for purchases - 13.5%</field>
<field name="description">TVH135_PURC</field>
<field name="name">HST for purchases - 13.5%</field>
<field name="description">HST135_PURC</field>
<field name="type_tax_use">purchase</field>
<field name="amount">0.135000</field>
<field name="type">percent</field>
@ -503,8 +503,8 @@
<record id="hst15_purc_en" model="account.tax.template">
<field name="chart_template_id" ref="ca_en_chart_template_en"/>
<field name="name">TVH for purchases - 15%</field>
<field name="description">TVH15_PURC</field>
<field name="name">HST for purchases - 15%</field>
<field name="description">HST15_PURC</field>
<field name="type_tax_use">purchase</field>
<field name="amount">0.150000</field>
<field name="type">percent</field>

View File

@ -24,8 +24,8 @@
{'name': 'Switzerland - Accounting',
'description': """
Swiss localization :
====================
Swiss localization
==================
**Multilang swiss STERCHI account chart and taxes**
**Author:** Camptocamp SA

View File

@ -135,11 +135,47 @@
<record model="account.account.template" id="a189">
<field name="name">Tax Receivable</field>
<field name="code">189</field>
<field name="type">other</field>
<field name="type">view</field>
<field name="user_type" ref="account.data_account_type_asset"/>
<field name="reconcile" eval="False"/>
<field name="parent_id" ref="a10"/>
</record>
<record model="account.account.template" id="a189100">
<field name="name">Purchase Tax Receivable</field>
<field name="code">189100</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="reconcile" eval="True"/>
<field name="parent_id" ref="a189"/>
</record>
<record model="account.account.template" id="a189200">
<field name="name">VAT Receivable</field>
<field name="code">189200</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="reconcile" eval="True"/>
<field name="parent_id" ref="a189"/>
</record>
<record model="account.account.template" id="a189300">
<field name="name">Service Tax Receivable</field>
<field name="code">189300</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="reconcile" eval="True"/>
<field name="parent_id" ref="a189"/>
</record>
<record model="account.account.template" id="a189400">
<field name="name">Exice Duty Receivable</field>
<field name="code">189400</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="reconcile" eval="True"/>
<field name="parent_id" ref="a189"/>
</record>
<!-- Liabilities -->
<record model="account.account.template" id="a20">

View File

@ -2,269 +2,403 @@
<openerp>
<data noupdate="1">
<!-- Taxes Sale Tax -->
<record id="sales_private" model="account.tax.template">
<field name="name">Sale Tax-15%</field>
<field name="price_include" eval="0"/>
<field name="name">Sales Tax 15%</field>
<field name="description">Sales Tax 15%</field>
<field name="amount">0.15</field>
<field name="type">percent</field>
<field name="type_tax_use">sale</field>
<field name="account_collected_id" ref="a2161"/>
<field name="account_paid_id" ref="a2161"/>
<field name="base_code_id" ref="vat_code_base_tax_sale"/>
<field name="tax_code_id" ref="vat_code_tax_rec"/>
<field name="ref_base_code_id" ref="vat_code_base_tax_sale"/>
<field name="ref_tax_code_id" ref="vat_code_tax_rec"/>
<field name="child_depend" eval="0"/>
<field name="account_paid_id" ref="a2161"/>
<field name="base_code_id" ref="vat_code_base_tax_sale15"/>
<field name="tax_code_id" ref="vat_code_rec_sale15"/>
<field name="ref_base_code_id" ref="vat_code_base_tax_sale15"/>
<field name="ref_base_sign" eval="-1"/>
<field name="ref_tax_code_id" ref="vat_code_rec_sale15"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<record id="sales_private_main" model="account.tax.template">
<field name="name">Sale Tax-12%</field>
<field name="price_include" eval="0"/>
<field name="name">Sales Tax 12%</field>
<field name="description">Sales Tax 12%</field>
<field name="amount">0.12</field>
<field name="type">percent</field>
<field name="type_tax_use">sale</field>
<field name="account_collected_id" ref="a2161"/>
<field name="account_paid_id" ref="a2161"/>
<field name="base_code_id" ref="vat_code_base_tax_sale"/>
<field name="tax_code_id" ref="vat_code_tax_rec"/>
<field name="ref_base_code_id" ref="vat_code_base_tax_sale"/>
<field name="ref_tax_code_id" ref="vat_code_tax_rec"/>
<field name="child_depend" eval="0"/>
<field name="account_paid_id" ref="a2161"/>
<field name="base_code_id" ref="vat_code_base_tax_sale12"/>
<field name="tax_code_id" ref="vat_code_rec_sale12"/>
<field name="ref_base_code_id" ref="vat_code_base_tax_sale12"/>
<field name="ref_base_sign" eval="-1"/>
<field name="ref_tax_code_id" ref="vat_code_rec_sale12"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<record id="sales_private_main_4" model="account.tax.template">
<field name="name">Sale Tax-4%</field>
<field name="price_include" eval="0"/>
<field name="name">Sales Tax 4%</field>
<field name="description">Sales Tax 4%</field>
<field name="amount">0.04</field>
<field name="type">percent</field>
<field name="type_tax_use">sale</field>
<field name="account_collected_id" ref="a2161"/>
<field name="account_paid_id" ref="a2161"/>
<field name="base_code_id" ref="vat_code_base_tax_sale"/>
<field name="tax_code_id" ref="vat_code_tax_rec"/>
<field name="ref_base_code_id" ref="vat_code_base_tax_sale"/>
<field name="ref_tax_code_id" ref="vat_code_tax_rec"/>
<field name="child_depend" eval="0"/>
<field name="base_code_id" ref="vat_code_base_tax_sale4"/>
<field name="tax_code_id" ref="vat_code_rec_sale4"/>
<field name="ref_base_code_id" ref="vat_code_base_tax_sale4"/>
<field name="ref_base_sign" eval="-1"/>
<field name="ref_tax_code_id" ref="vat_code_rec_sale4"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<!-- Purchase tax -->
<record id="purchase_tax_private" model="account.tax.template">
<field name="name">Purchase Tax-15%</field>
<field name="name">Purchase Tax 15%</field>
<field name="description">Purchase Tax 15%</field>
<field name="account_collected_id" ref="a189"/>
<field name="account_paid_id" ref="a189"/>
<field name="price_include" eval="0"/>
<field name="account_paid_id" ref="a189"/>
<field name="amount">0.15</field>
<field name="type">percent</field>
<field name="type_tax_use">purchase</field>
<field name="base_code_id" ref="vat_code_base_tax_purchase"/>
<field name="tax_code_id" ref="vat_code_payable"/>
<field name="ref_base_code_id" ref="vat_code_base_tax_purchase"/>
<field name="ref_tax_code_id" ref="vat_code_payable"/>
<field name="base_code_id" ref="vat_code_base_tax_pur15"/>
<field name="tax_code_id" ref="vat_code_pay_pur4"/>
<field name="ref_base_code_id" ref="vat_code_base_tax_pur15"/>
<field name="ref_base_sign" eval="-1"/>
<field name="ref_tax_code_id" ref="vat_code_pay_pur4"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<!-- vat -->
<record id="vat_private_main" model="account.tax.template">
<field name="name">VAT-5%(4% VAT+1% Add. Tax.)</field>
<field name="price_include" eval="0"/>
<record id="vat_private_out_vat5" model="account.tax.template">
<field name="name">Output VAT 5% (VAT 4% + Add. VAT 1%)</field>
<field name="description">Output VAT 5%</field>
<field name="type_tax_use">sale</field>
<field name="type">percent</field>
<field name="amount">0.04</field>
<field name="account_collected_id" ref="a2162"/>
<field name="account_paid_id" ref="a2162"/>
<field name="base_code_id" ref="vat_code_tax_sal_vat5"/>
<field name="tax_code_id" ref="vat_code_tax_rec_vat5"/>
<field name="ref_base_code_id" ref="vat_code_tax_sal_vat5"/>
<field name="ref_base_sign" eval="-1"/>
<field name="ref_tax_code_id" ref="vat_code_tax_rec_vat5"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<record id="vat_private_in_vat5" model="account.tax.template">
<field name="name">Input VAT 5% (VAT 4% + Add. VAT 1%)</field>
<field name="description">Input VAT 5%</field>
<field name="amount">0.05</field>
<field name="type">percent</field>
<field name="type_tax_use">all</field>
<field name="account_collected_id" ref="a2162"/>
<field name="account_paid_id" ref="a2162"/>
<field name="base_code_id" ref="vat_code_base_tax_sale"/>
<field name="base_sign">1</field>
<field name="tax_code_id" ref="vat_code_tax_rec"/>
<field name="tax_sign">1</field>
<field name="ref_base_code_id" ref="vat_code_base_tax_sale"/>
<field name="ref_base_sign">1</field>
<field name="ref_tax_code_id" ref="vat_code_tax_rec"/>
<field name="ref_tax_sign">1</field>
<field name="child_depend" eval="0"/>
<field name="type_tax_use">purchase</field>
<field name="account_collected_id" ref="a189200"/>
<field name="account_paid_id" ref="a189200"/>
<field name="base_code_id" ref="vat_code_tax_pur_vat5"/>
<field name="tax_code_id" ref="vat_code_tax_pay_vat5"/>
<field name="ref_base_code_id" ref="vat_code_tax_pur_vat5"/>
<field name="ref_base_sign" eval="-1"/>
<field name="ref_tax_code_id" ref="vat_code_tax_pay_vat5"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<record id="vat_private_main_tax" model="account.tax.template">
<field name="name">VAT-15%(12.5% VAT+2.5% Add. Tax.)</field>
<field name="price_include" eval="0"/>
<record id="vat_private_in_vat15" model="account.tax.template">
<field name="name">Input VAT 15% (VAT 12.5% + Add. VAT 2.5%)</field>
<field name="description">Input VAT 15%</field>
<field name="amount">0.15</field>
<field name="type">percent</field>
<field name="type_tax_use">all</field>
<field name="account_collected_id" ref="a2162"/>
<field name="account_paid_id" ref="a2162"/>
<field name="base_code_id" ref="vat_code_base_tax_sale"/>
<field name="base_sign">1</field>
<field name="tax_code_id" ref="vat_code_tax_rec"/>
<field name="tax_sign">1</field>
<field name="ref_base_code_id" ref="vat_code_base_tax_sale"/>
<field name="ref_base_sign">1</field>
<field name="ref_tax_code_id" ref="vat_code_tax_rec"/>
<field name="ref_tax_sign">1</field>
<field name="child_depend" eval="0"/>
<field name="type_tax_use">purchase</field>
<field name="account_collected_id" ref="a189200"/>
<field name="account_paid_id" ref="a189200"/>
<field name="base_code_id" ref="vat_code_tax_pur_vat15"/>
<field name="tax_code_id" ref="vat_code_tax_pay_vat15"/>
<field name="ref_base_code_id" ref="vat_code_tax_pur_vat15"/>
<field name="ref_base_sign" eval="-1"/>
<field name="ref_tax_code_id" ref="vat_code_tax_pay_vat15"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<record id="vat_private_tax" model="account.tax.template">
<field name="name">VAT-8%</field>
<field name="price_include" eval="0"/>
<record id="vat_private_out_vat15" model="account.tax.template">
<field name="name">Output VAT 15% (VAT 12.5% + Add. VAT 2.5%)</field>
<field name="description">Output VAT 15%</field>
<field name="amount">0.15</field>
<field name="type">percent</field>
<field name="type_tax_use">sale</field>
<field name="account_collected_id" ref="a2162"/>
<field name="account_paid_id" ref="a2162"/>
<field name="base_code_id" ref="vat_code_tax_sal_vat15"/>
<field name="tax_code_id" ref="vat_code_tax_rec_vat15"/>
<field name="ref_base_code_id" ref="vat_code_tax_sal_vat15"/>
<field name="ref_base_sign" eval="-1"/>
<field name="ref_tax_code_id" ref="vat_code_tax_rec_vat15"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<record id="vat_private_in_vat8" model="account.tax.template">
<field name="name">Input VAT 8%</field>
<field name="description">Input VAT 8%</field>
<field name="amount">0.08</field>
<field name="type">percent</field>
<field name="type_tax_use">all</field>
<field name="account_collected_id" ref="a2162"/>
<field name="account_paid_id" ref="a2162"/>
<field name="base_code_id" ref="vat_code_base_tax_sale"/>
<field name="tax_code_id" ref="vat_code_tax_rec"/>
<field name="ref_base_code_id" ref="vat_code_base_tax_sale"/>
<field name="ref_tax_code_id" ref="vat_code_tax_rec"/>
<field name="child_depend" eval="0"/>
<field name="type_tax_use">purchase</field>
<field name="account_collected_id" ref="a189200"/>
<field name="account_paid_id" ref="a189200"/>
<field name="base_code_id" ref="vat_code_tax_pur_vat8"/>
<field name="tax_code_id" ref="vat_code_tax_pay_vat8"/>
<field name="ref_base_code_id" ref="vat_code_tax_pur_vat8"/>
<field name="ref_base_sign" eval="-1"/>
<field name="ref_tax_code_id" ref="vat_code_tax_pay_vat8"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<record id="vat_private_tax_10" model="account.tax.template">
<field name="name">VAT-10%</field>
<field name="price_include" eval="0"/>
<record id="vat_private_out_vat8" model="account.tax.template">
<field name="name">Output VAT 8%</field>
<field name="description">Output VAT 8%</field>
<field name="amount">0.08</field>
<field name="type">percent</field>
<field name="type_tax_use">sale</field>
<field name="account_collected_id" ref="a2162"/>
<field name="account_paid_id" ref="a2162"/>
<field name="base_code_id" ref="vat_code_tax_sal_vat8"/>
<field name="tax_code_id" ref="vat_code_tax_rec_vat8"/>
<field name="ref_base_code_id" ref="vat_code_tax_sal_vat8"/>
<field name="ref_base_sign" eval="-1"/>
<field name="ref_tax_code_id" ref="vat_code_tax_rec_vat8"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<record id="vat_private_in_vat10" model="account.tax.template">
<field name="name">Input VAT 10%</field>
<field name="description">Input VAT 10%</field>
<field name="amount">0.10</field>
<field name="type">percent</field>
<field name="type_tax_use">all</field>
<field name="account_collected_id" ref="a2162"/>
<field name="account_paid_id" ref="a2162"/>
<field name="base_code_id" ref="vat_code_base_tax_sale"/>
<field name="tax_code_id" ref="vat_code_tax_rec"/>
<field name="ref_base_code_id" ref="vat_code_base_tax_sale"/>
<field name="ref_tax_code_id" ref="vat_code_tax_rec"/>
<field name="child_depend" eval="0"/>
<field name="type_tax_use">purchase</field>
<field name="account_collected_id" ref="a189200"/>
<field name="account_paid_id" ref="a189200"/>
<field name="base_code_id" ref="vat_code_tax_pur_vat10"/>
<field name="tax_code_id" ref="vat_code_tax_pay_vat10"/>
<field name="ref_base_code_id" ref="vat_code_tax_pur_vat10"/>
<field name="ref_base_sign" eval="-1"/>
<field name="ref_tax_code_id" ref="vat_code_tax_pay_vat10"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<record id="vat_private_tax_12" model="account.tax.template">
<field name="name">VAT-12.5%</field>
<field name="price_include" eval="0"/>
<field name="amount">12.5</field>
<field name="type">percent</field>
<field name="type_tax_use">all</field>
<field name="account_collected_id" ref="a2162"/>
<field name="account_paid_id" ref="a2162"/>
<field name="base_code_id" ref="vat_code_base_tax_sale"/>
<field name="tax_code_id" ref="vat_code_tax_rec"/>
<field name="ref_base_code_id" ref="vat_code_base_tax_sale"/>
<field name="ref_tax_code_id" ref="vat_code_tax_rec"/>
<field name="child_depend" eval="0"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<!-- Exice Duty -->
<record id="exice_duty_private_main" model="account.tax.template">
<field name="name">Excise Duty-10.30%</field>
<field name="include_base_amount" eval="True"/>
<record id="vat_private_out_vat10" model="account.tax.template">
<field name="name">Output VAT 10%</field>
<field name="description">Output VAT 10%</field>
<field name="amount">0.10</field>
<field name="type">percent</field>
<field name="type_tax_use">sale</field>
<field name="account_collected_id" ref="a2164"/>
<field name="account_paid_id" ref="a2164"/>
<field name="base_code_id" ref="vat_code_base_tax_sale"/>
<field name="base_sign">1</field>
<field name="tax_code_id" ref="vat_code_tax_rec"/>
<field name="tax_sign">1</field>
<field name="ref_base_code_id" ref="vat_code_base_tax_sale"/>
<field name="ref_base_sign">1</field>
<field name="ref_tax_code_id" ref="vat_code_tax_rec"/>
<field name="ref_tax_sign">1</field>
<field name="child_depend" eval="0"/>
<field name="account_collected_id" ref="a2162"/>
<field name="account_paid_id" ref="a2162"/>
<field name="base_code_id" ref="vat_code_tax_sal_vat10"/>
<field name="tax_code_id" ref="vat_code_tax_rec_vat10"/>
<field name="ref_base_code_id" ref="vat_code_tax_sal_vat10"/>
<field name="ref_base_sign" eval="-1"/>
<field name="ref_tax_code_id" ref="vat_code_tax_rec_vat10"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<record id="exice_private_duty_parent" model="account.tax.template">
<field name="name">Excise Duty-2%</field>
<field name="amount">0.02</field>
<record id="vat_private_in_vat12" model="account.tax.template">
<field name="name">Input VAT 12.5%</field>
<field name="description">Input VAT 12.5%</field>
<field name="amount">0.125</field>
<field name="type">percent</field>
<field name="type_tax_use">purchase</field>
<field name="account_collected_id" ref="a189200"/>
<field name="account_paid_id" ref="a189200"/>
<field name="base_code_id" ref="vat_code_tax_pur_vat12"/>
<field name="tax_code_id" ref="vat_code_tax_pay_vat12"/>
<field name="ref_base_code_id" ref="vat_code_tax_pur_vat12"/>
<field name="ref_base_sign" eval="-1"/>
<field name="ref_tax_code_id" ref="vat_code_tax_pay_vat12"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<record id="vat_private_out_vat12" model="account.tax.template">
<field name="name">Output VAT 12.5%</field>
<field name="description">Output VAT 12.5%</field>
<field name="amount">0.125</field>
<field name="type">percent</field>
<field name="type_tax_use">sale</field>
<field name="parent_id" ref="exice_duty_private_main"/>
<field name="account_collected_id" ref="a2164"/>
<field name="account_paid_id" ref="a2164"/>
<field name="base_code_id" ref="vat_code_base_tax_sale"/>
<field name="base_sign">1</field>
<field name="tax_code_id" ref="vat_code_tax_rec"/>
<field name="tax_sign">1</field>
<field name="ref_base_code_id" ref="vat_code_base_tax_sale"/>
<field name="ref_base_sign">1</field>
<field name="ref_tax_code_id" ref="vat_code_tax_rec"/>
<field name="ref_tax_sign">1</field>
<field name="account_collected_id" ref="a2162"/>
<field name="account_paid_id" ref="a2162"/>
<field name="base_code_id" ref="vat_code_tax_sal_vat12"/>
<field name="tax_code_id" ref="vat_code_tax_rec_vat12"/>
<field name="ref_base_code_id" ref="vat_code_tax_sal_vat12"/>
<field name="ref_base_sign" eval="-1"/>
<field name="ref_tax_code_id" ref="vat_code_tax_rec_vat12"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<record id="exice_private_duty" model="account.tax.template">
<field name="name">Excise Duty-1%</field>
<field name="amount">0.01</field>
<field name="type">percent</field>
<!-- Exice Duty -->
<record id="exice_duty_private_sale12" model="account.tax.template">
<field name="name">Excise Duty 12% - Sales</field>
<field name="description">Excise Duty 12% - Sales</field>
<field name="type_tax_use">sale</field>
<field name="type">percent</field>
<field name="amount">0.1200</field>
<field name="account_collected_id" ref="a2164"/>
<field name="account_paid_id" ref="a2164"/>
<field name="base_code_id" ref="vat_code_base_tax_sale"/>
<field name="base_sign">1</field>
<field name="tax_code_id" ref="vat_code_tax_rec"/>
<field name="tax_sign">1</field>
<field name="ref_base_code_id" ref="vat_code_base_tax_sale"/>
<field name="ref_base_sign">1</field>
<field name="ref_tax_code_id" ref="vat_code_tax_rec"/>
<field name="ref_tax_sign">1</field>
<field name="parent_id" ref="exice_duty_private_main"/>
<field name="account_paid_id" ref="a2164"/>
<field name="base_code_id" ref="vat_code_tax_sales_excise"/>
<field name="tax_code_id" ref="vat_code_tax_rec_exice12"/>
<field name="ref_base_code_id" ref="vat_code_tax_sales_excise"/>
<field name="ref_base_sign" eval="-1"/>
<field name="ref_tax_code_id" ref="vat_code_tax_rec_exice12"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<record id="exice_duty_private_sale2" model="account.tax.template">
<field name="name">Excise Duty 2% - Sales</field>
<field name="description">Excise Duty 2% - Sales</field>
<field name="type_tax_use">sale</field>
<field name="type">percent</field>
<field name="amount">0.020</field>
<field name="account_collected_id" ref="a2164"/>
<field name="account_paid_id" ref="a2164"/>
<field name="base_code_id" ref="vat_code_tax_sales_excise"/>
<field name="tax_code_id" ref="vat_code_tax_rec_exice2"/>
<field name="ref_base_code_id" ref="vat_code_tax_sales_excise"/>
<field name="ref_base_sign" eval="-1"/>
<field name="ref_tax_code_id" ref="vat_code_tax_rec_exice2"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<record id="exice_duty_private_sale1" model="account.tax.template">
<field name="name">Output Excise Duty 1%</field>
<field name="description">Output Excise Duty 1%</field>
<field name="type_tax_use">sale</field>
<field name="type">percent</field>
<field name="amount">0.0100</field>
<field name="account_collected_id" ref="a2164"/>
<field name="account_paid_id" ref="a2164"/>
<field name="base_code_id" ref="vat_code_tax_sales_excise"/>
<field name="tax_code_id" ref="vat_code_tax_rec_exice1"/>
<field name="ref_base_code_id" ref="vat_code_tax_sales_excise"/>
<field name="ref_base_sign" eval="-1"/>
<field name="ref_tax_code_id" ref="vat_code_tax_rec_exice1"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<!-- Service Tax -->
<record id="service_private_main" model="account.tax.template">
<field name="type_tax_use">all</field>
<field name="name">Service Tax-12.30%</field>
<field name="include_base_amount" eval="True"/>
<record id="service_private_ser12_sale" model="account.tax.template">
<field name="name">Output Service Tax 12%</field>
<field name="description">Output Service Tax 12%</field>
<field name="type_tax_use">sale</field>
<field name="type">percent</field>
<field name="amount">0.12</field>
<field name="type">percent</field>
<field name="sequence">1</field>
<field name="account_collected_id" ref="a2163"/>
<field name="account_paid_id" ref="a2163"/>
<field name="base_code_id" ref="vat_code_base_tax_sale"/>
<field name="tax_code_id" ref="vat_code_tax_rec"/>
<field name="ref_base_code_id" ref="vat_code_base_tax_sale"/>
<field name="ref_tax_code_id" ref="vat_code_tax_rec"/>
<field name="child_depend" eval="0"/>
<field name="account_paid_id" ref="a2163"/>
<field name="base_code_id" ref="vat_code_tax_sale_ser12"/>
<field name="tax_code_id" ref="vat_code_tax_rec_st12"/>
<field name="ref_base_code_id" ref="vat_code_tax_sale_ser12"/>
<field name="ref_base_sign" eval="-1"/>
<field name="ref_tax_code_id" ref="vat_code_tax_rec_st12"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<record id="service_private_tax_parent" model="account.tax.template">
<field name="name">Service Tax-%2</field>
<record id="service_private_ser2_sale" model="account.tax.template">
<field name="name">Output Sales Service Tax 2%</field>
<field name="description">Output Sales Service Tax 2%</field>
<field name="type_tax_use">sale</field>
<field name="type">percent</field>
<field name="amount">0.02</field>
<field name="type">percent</field>
<field name="type_tax_use">all</field>
<field name="sequence">3</field>
<field name="account_collected_id" ref="a2163"/>
<field name="account_paid_id" ref="a2163"/>
<field name="base_code_id" ref="vat_code_base_tax_sale"/>
<field name="tax_code_id" ref="vat_code_tax_rec"/>
<field name="ref_base_code_id" ref="vat_code_base_tax_sale"/>
<field name="ref_tax_code_id" ref="vat_code_tax_rec"/>
<field name="parent_id" ref="service_private_main"/>
<field name="account_paid_id" ref="a2163"/>
<field name="tax_code_id" ref="vat_code_tax_rec_st2"/>
<field name="ref_tax_code_id" ref="vat_code_tax_rec_st2"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="parent_id" ref="service_private_ser12_sale"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<record id="service_private_tax" model="account.tax.template">
<field name="name">Service Tax-%1</field>
<record id="service_private_ser1_sale" model="account.tax.template">
<field name="name">Output Service Tax 1%</field>
<field name="description">Output Service Tax 1%</field>
<field name="type_tax_use">sale</field>
<field name="type">percent</field>
<field name="amount">0.01</field>
<field name="type">percent</field>
<field name="type_tax_use">all</field>
<field name="sequence">5</field>
<field name="account_collected_id" ref="a2163"/>
<field name="account_paid_id" ref="a2163"/>
<field name="base_code_id" ref="vat_code_base_tax_sale"/>
<field name="tax_code_id" ref="vat_code_tax_rec"/>
<field name="ref_base_code_id" ref="vat_code_base_tax_sale"/>
<field name="ref_tax_code_id" ref="vat_code_tax_rec"/>
<field name="parent_id" ref="service_private_main"/>
<field name="account_paid_id" ref="a2163"/>
<field name="tax_code_id" ref="vat_code_tax_rec_st1"/>
<field name="ref_tax_code_id" ref="vat_code_tax_rec_st1"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="parent_id" ref="service_private_ser12_sale"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<record id="service_private_ser12_purchase" model="account.tax.template">
<field name="name">Input Service Tax 12%</field>
<field name="description">Input Service Tax 12%</field>
<field name="type_tax_use">purchase</field>
<field name="type">percent</field>
<field name="amount">0.1200</field>
<field name="sequence">1</field>
<field name="account_collected_id" ref="a189300"/>
<field name="account_paid_id" ref="a189300"/>
<field name="base_code_id" ref="vat_code_tax_pur_ser12"/>
<field name="tax_code_id" ref="vat_code_tax_pay_ic_st"/>
<field name="ref_base_code_id" ref="vat_code_tax_pur_ser12"/>
<field name="ref_base_sign" eval="-1"/>
<field name="ref_tax_code_id" ref="vat_code_tax_pay_ic_st"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<record id="service_private_ser2_purchase" model="account.tax.template">
<field name="name">Input Service Tax Edu. Cess. 2%</field>
<field name="description">Input Service Tax Edu. Cess. 2%</field>
<field name="type_tax_use">purchase</field>
<field name="type">percent</field>
<field name="amount">0.0200</field>
<field name="sequence">3</field>
<field name="account_collected_id" ref="a189300"/>
<field name="account_paid_id" ref="a189300"/>
<field name="tax_code_id" ref="vat_code_tax_pay_ic_edu_cess"/>
<field name="ref_tax_code_id" ref="vat_code_tax_pur_PCST5"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="parent_id" ref="service_private_ser12_purchase"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
<record id="service_private_ser1_purchase" model="account.tax.template">
<field name="name">Input Service Tax Seco. &amp; HEC 1%</field>
<field name="description">Input Service Tax Seco. &amp; HEC 1%</field>
<field name="type_tax_use">purchase</field>
<field name="type">percent</field>
<field name="amount">0.0100</field>
<field name="sequence">5</field>
<field name="account_collected_id" ref="a189300"/>
<field name="account_paid_id" ref="a189300"/>
<field name="tax_code_id" ref="vat_code_tax_pay_ic_seco_hec"/>
<field name="ref_tax_code_id" ref="vat_code_tax_pay_ic_seco_hec"/>
<field name="ref_tax_sign" eval="-1"/>
<field name="parent_id" ref="service_private_ser12_purchase"/>
<field name="chart_template_id" ref="indian_chart_template_private"/>
</record>
</data>
</openerp>

View File

@ -116,7 +116,7 @@
<record model="account.account.template" id="p15400">
<field name="name">Tax Receivable</field>
<field name="code">15400</field>
<field name="type">other</field>
<field name="type">view</field>
<field name="user_type" ref="account.data_account_type_asset"/>
<field name="reconcile" eval="False"/>
<field name="parent_id" ref="p10000"/>
@ -658,7 +658,327 @@
<field name="reconcile" eval="False"/>
<field name="parent_id" ref="p96000"/>
</record>
<record model="account.account.template" id="p154001">
<field name="name">Input CST 5%</field>
<field name="code">154001</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_expense"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154002">
<field name="name">Input Service Tax Seco. &amp; HEC 1%</field>
<field name="code">154002</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154003">
<field name="name">Input Credit - URD</field>
<field name="code">154003</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154004">
<field name="name">TDS on Audit Fees - 94J</field>
<field name="code">154004</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154005">
<field name="name">TDS on Commission Or Brokerage - 94H</field>
<field name="code">154005</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154006">
<field name="name">Input Credit - Import Duty</field>
<field name="code">154006</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154007">
<field name="name">Additional Duty (Imports) 4%</field>
<field name="code">154007</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154008">
<field name="name">Input Service Tax 12%</field>
<field name="code">154008</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154009">
<field name="name">Input Service Tax Edu. Cess. 2%</field>
<field name="code">154009</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154010">
<field name="name">TDS on Salary - 92B</field>
<field name="code">154010</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154011">
<field name="name">Input Excise Duty 6%</field>
<field name="code">154011</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154012">
<field name="name">Input Excise Duty 5%</field>
<field name="code">154012</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154013">
<field name="name">Input Excise Duty 12%</field>
<field name="code">154013</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154014">
<field name="name">Education Cess 2% - Purchase</field>
<field name="code">154014</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154015">
<field name="name">Seco. &amp; Higher Edu. Cess 1% - Purchase</field>
<field name="code">154015</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p247001">
<field name="name">Excise Duty 12% - Sales</field>
<field name="code">247001</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p24700"/>
</record>
<record model="account.account.template" id="p247010">
<field name="name">Education Cess 2% - Sales</field>
<field name="code">247010</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p24700"/>
</record>
<record model="account.account.template" id="p247002">
<field name="name">Seco. &amp; Higher Edu. Cess 1% - Sales</field>
<field name="code">247002</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p24700"/>
</record>
<record model="account.account.template" id="p154016">
<field name="name">Input Sec. &amp; HEC - Capital Goods</field>
<field name="code">154016</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154017">
<field name="name">TDS on Contractor - 94C</field>
<field name="code">154017</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154018">
<field name="name">TDS on Director's Interest</field>
<field name="code">154018</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154019">
<field name="name">TDS on Director's Remuneration - 92B</field>
<field name="code">154019</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154020">
<field name="name">TDS on Interest</field>
<field name="code">154020</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154021">
<field name="name">TDS on Professional Fees - 94J</field>
<field name="code">154021</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154022">
<field name="name">TDS on Rent - 94I</field>
<field name="code">154022</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154023">
<field name="name">Input Edu. Cess - Capital Goods</field>
<field name="code">154023</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154024">
<field name="name">Input Excise Duty 12% - Capital Goods</field>
<field name="code">154024</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154025">
<field name="name">Input VAT 4%</field>
<field name="code">154025</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154026">
<field name="name">Input Additional VAT 1%</field>
<field name="code">154026</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154027">
<field name="name">Input VAT 15%</field>
<field name="code">154027</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p247003">
<field name="name">Output VAT 4%</field>
<field name="code">247003</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p24700"/>
</record>
<record model="account.account.template" id="p247004">
<field name="name">Output Adi. VAT 1%</field>
<field name="code">247004</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p24700"/>
</record>
<record model="account.account.template" id="p247005">
<field name="name">CST 2% on Sales - Against Form - C</field>
<field name="code">247005</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p24700"/>
</record>
<record model="account.account.template" id="p247006">
<field name="name">CST 5% on Sales</field>
<field name="code">247006</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p24700"/>
</record>
<record model="account.account.template" id="p154028">
<field name="name">Input VAT 12.5%</field>
<field name="code">154028</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154029">
<field name="name">Input Additional VAT 2.5%</field>
<field name="code">154029</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p154030">
<field name="name">Input CST 2%</field>
<field name="code">154030</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_expense"/>
<field name="parent_id" ref="p15400"/>
</record>
<record model="account.account.template" id="p247007">
<field name="name">CST 2% on Sales - CT3 Against Form C</field>
<field name="code">247007</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p24700"/>
</record>
<record model="account.account.template" id="p247008">
<field name="name">Output VAT 4% on Sales - CT3</field>
<field name="code">247008</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p24700"/>
</record>
<record model="account.account.template" id="p247009">
<field name="name">Output Adi. VAT 1% Sales CT3</field>
<field name="code">247009</field>
<field name="type">other</field>
<field name="user_type" ref="account.data_account_type_liability"/>
<field name="parent_id" ref="p24700"/>
</record>
<record id="indian_chart_template_public" model="account.chart.template">
<field name="name">India - Chart of Accounts for Public Ltd</field>
<field name="account_root_id" ref="p0"/>

File diff suppressed because it is too large Load Diff

View File

@ -19,6 +19,7 @@
<record model="account.tax.code.template" id="vat_code_payable">
<field name="name">Tax Paid</field>
<field name="sign">-1</field>
<field name="parent_id" ref="vat_code_balance_net"/>
</record>
@ -27,16 +28,540 @@
<field name="parent_id" ref="vat_code_tax"/>
</record>
<record model="account.tax.code.template" id="vat_code_base_tax_sale">
<field name="name">Base of Taxed Sales</field>
<field name="name">Taxable Sale Bases</field>
<field name="parent_id" ref="vat_code_base_net"/>
</record>
<record model="account.tax.code.template" id="vat_code_base_tax_purchase">
<field name="name">Base of Taxed Purchases</field>
<field name="name">Taxable Purchase Bases</field>
<field name="parent_id" ref="vat_code_base_net"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pur_CSTP5">
<field name="name">Input CST 5%</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pur_PCST5">
<field name="name">Purchase CST 5%</field>
<field name="parent_id" ref="vat_code_base_tax_purchase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pur_ser12">
<field name="name">Purchase Service Tax 12%</field>
<field name="parent_id" ref="vat_code_base_tax_purchase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_sale_ser12">
<field name="name">Sales Service Tax 12%</field>
<field name="parent_id" ref="vat_code_base_tax_sale"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_exice_salebase">
<field name="name">Excise Duty 12.36% - Sales</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_exice12">
<field name="name">Excise Duty 12% - Sales</field>
<field name="parent_id" ref="vat_code_tax_rec_exice_salebase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_exice2">
<field name="name">Excise Duty 2% - Sales</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_exice1">
<field name="name">Excise Duty 1% - Sales</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_ic_st_purbase">
<field name="name">Excise Duty 12.36% - Purchase</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_exice12">
<field name="name">Excise Duty 12% - Purchase</field>
<field name="parent_id" ref="vat_code_tax_pay_ic_st_purbase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_cess2">
<field name="name">Education Cess 2% - Sales</field>
<field name="parent_id" ref="vat_code_tax_rec_exice_salebase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_cess2">
<field name="name">Education Cess 2% - Purchase</field>
<field name="parent_id" ref="vat_code_tax_pay_ic_st_purbase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_import_duty">
<field name="name">Input Credit - Import Duty</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_edu_cess">
<field name="name">Input Credit On Capital Goods - Edu. Cess</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_cap_goods">
<field name="name">Input Excise Duty 12% - Capital Goods</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_seco_hec">
<field name="name">Input Credit on Capital Goods - Seco. &amp; HEC</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_ic_st_base">
<field name="name">Input Service Tax 12.36%</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_ic_st">
<field name="name">Input Service Tax 12%</field>
<field name="parent_id" ref="vat_code_tax_pay_ic_st_base"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_ic_edu_cess">
<field name="name">Input Service Tax Edu. Cess. 2%</field>
<field name="parent_id" ref="vat_code_tax_pay_ic_st_base"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_ic_seco_hec">
<field name="name">Input Service Tax Seco. &amp; HEC 1%</field>
<field name="parent_id" ref="vat_code_tax_pay_ic_st_base"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_sec_hig_edu">
<field name="name">Seco. &amp; Higher Edu. Cess 1% - Purchase</field>
<field name="parent_id" ref="vat_code_tax_pay_ic_st_purbase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_sec_hig_cess">
<field name="name">Seco. &amp; Higher Edu. Cess 1% - Sales</field>
<field name="parent_id" ref="vat_code_tax_rec_exice_salebase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_cst2">
<field name="name">CST 2% on Sales</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_cst5">
<field name="name">CST 5% on Sales</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_add_vat1">
<field name="name">Input Additional VAT 1%</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_add_vat2">
<field name="name">Input Additional Vat 2.5%</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_vat12">
<field name="name">Input VAT 12.5%</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_vat15">
<field name="name">Input VAT 15%</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_vat10">
<field name="name">Input VAT 10%</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_vat8">
<field name="name">Input VAT 8%</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_vat5">
<field name="name">Input VAT 5%</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_vat4">
<field name="name">Input VAT 4%</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_vat15">
<field name="name">Output VAT 15%</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_vat12">
<field name="name">Output VAT 12.5%</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_vat10">
<field name="name">Output VAT 10%</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_vat8">
<field name="name">Output VAT 8%</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_vat5">
<field name="name">Output VAT 5%</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_vat4">
<field name="name">Output VAT 4%</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_add_vat1">
<field name="name">Output Adi. VAT 1%</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_cst2">
<field name="name">CST 2% on Purchase</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_exice5">
<field name="name">Input Excise Duty 5%</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_exice6">
<field name="name">Input Excise Duty 6%</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_urd">
<field name="name">Input Credit - URD</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_tds_audit_fee">
<field name="name">TDS on Audit Fees - 94J</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_tds_brokerage">
<field name="name">TDS on Commission Or Brokerage- 94H</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_tds_contractor">
<field name="name">TDS on Contractor-94C</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_tds_dir_intrest">
<field name="name">TDS on Director's Interest</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_tds_dir_ren">
<field name="name">TDS on Director's Remuneration - 92B</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_tds_intrest">
<field name="name">TDS on Interest</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_tds_prof_fee">
<field name="name">TDS on Professional Fees - 94J</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_tds_rent">
<field name="name">TDS on Rent - 94I</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_tds_sal">
<field name="name">TDS on Salary - 92B</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_tds_pur_import">
<field name="name">Import Purchase</field>
<field name="parent_id" ref="vat_code_base_tax_purchase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pur_vat">
<field name="name">Purchase VAT 4% / VAT 12.5% / VAT 15% / CST 2% / CST 5%</field>
<field name="parent_id" ref="vat_code_base_tax_purchase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pur_plant_machinery">
<field name="name">Plant &amp; Machinery</field>
<field name="parent_id" ref="vat_code_base_tax_purchase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pur_exp_act">
<field name="name">Expense Accounts</field>
<field name="parent_id" ref="vat_code_base_tax_purchase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_sales_excise">
<field name="name">Sales Excise</field>
<field name="parent_id" ref="vat_code_base_tax_sale"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_sale_cst2">
<field name="name">Sales CST 2%</field>
<field name="parent_id" ref="vat_code_base_tax_sale"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_sale_cst15">
<field name="name">Sales CST 5%</field>
<field name="parent_id" ref="vat_code_base_tax_sale"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pur_vat15">
<field name="name">Purchase VAT 15%</field>
<field name="parent_id" ref="vat_code_base_tax_purchase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pur_vat12">
<field name="name">Purchase VAT 12.5%</field>
<field name="parent_id" ref="vat_code_base_tax_purchase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pur_vat10">
<field name="name">Purchase VAT 10%</field>
<field name="parent_id" ref="vat_code_base_tax_purchase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pur_vat8">
<field name="name">Purchase VAT 8%</field>
<field name="parent_id" ref="vat_code_base_tax_purchase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pur_vat5">
<field name="name">Purchase VAT 5%</field>
<field name="parent_id" ref="vat_code_base_tax_purchase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pur_vat4">
<field name="name">Purchase VAT 4%</field>
<field name="parent_id" ref="vat_code_base_tax_purchase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pur_vat25">
<field name="name">Purchase VAT 2.5%</field>
<field name="parent_id" ref="vat_code_base_tax_purchase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_sal_vat15">
<field name="name">Sales VAT 15%</field>
<field name="parent_id" ref="vat_code_base_tax_sale"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_sal_vat12">
<field name="name">Sales VAT 12.5%</field>
<field name="parent_id" ref="vat_code_base_tax_sale"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_sal_vat10">
<field name="name">Sales VAT 10%</field>
<field name="parent_id" ref="vat_code_base_tax_sale"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_sal_vat8">
<field name="name">Sales VAT 8%</field>
<field name="parent_id" ref="vat_code_base_tax_sale"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_sal_vat5">
<field name="name">Sales VAT 5%</field>
<field name="parent_id" ref="vat_code_base_tax_sale"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_sal_vat4">
<field name="name">Sales VAT 4%</field>
<field name="parent_id" ref="vat_code_base_tax_sale"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pur_cst2">
<field name="name">Input CST 2%</field>
<field name="parent_id" ref="vat_code_base_tax_purchase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pur_urd">
<field name="name">Purchase URD</field>
<field name="parent_id" ref="vat_code_base_tax_purchase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pur_base_tds">
<field name="name">Base Expenses for TDS</field>
<field name="parent_id" ref="vat_code_base_tax_purchase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_pay_add_imp_duty">
<field name="name">Additional Duty (Imports) 4%</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_sal_formh_tax">
<field name="name">Sales Export - Form H - With Tax</field>
<field name="parent_id" ref="vat_code_base_tax_sale"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_cst2_on_sal_cst3">
<field name="name">CST 2% on Sales CT3</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_sal_cst3">
<field name="name">Sales CT3 VAT</field>
<field name="parent_id" ref="vat_code_base_tax_sale"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_out4_sal_cst3">
<field name="name">Output VAT 4% on Sales CT3</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_out_add1_sale_cst3">
<field name="name">Output Adi. VAT 1% on Sales CT3</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_sal_ct3_cst">
<field name="name">Sales CT3 CST</field>
<field name="parent_id" ref="vat_code_base_tax_sale"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_sal_exp_ct1">
<field name="name">Sales Export - Form H - With CT1</field>
<field name="parent_id" ref="vat_code_base_tax_sale"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_sal_sez_out_guj">
<field name="name">Sales Export - SEZ - Out of Gujarat</field>
<field name="parent_id" ref="vat_code_base_tax_sale"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_sal_sez_in_guj">
<field name="name">Sales Export - SEZ - In Gujarat</field>
<field name="parent_id" ref="vat_code_base_tax_sale"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_no_saz_ogs">
<field name="name">No Tax SEZ OGS</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_no_sez_guj">
<field name="name">No Tax SEZ Gujarat</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_sal_out_country">
<field name="name">Sales Export - Out of Country</field>
<field name="parent_id" ref="vat_code_base_tax_sale"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_sal_proj">
<field name="name">Sales Others (Projects)</field>
<field name="parent_id" ref="vat_code_base_tax_sale"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_formh_bed">
<field name="name">No Tax Form H with BED</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_fomh">
<field name="name">No Tax Form H</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_no_out_country">
<field name="name">No Tax Export Out of Country</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_no_proj">
<field name="name">No Tax Projects</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_st_salebase">
<field name="name">Service Tax 12.36% - Sales</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_st12">
<field name="name">Service Tax 12% - Sales</field>
<field name="parent_id" ref="vat_code_tax_rec_st_salebase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_st2">
<field name="name">Service Tax 2% - Sales</field>
<field name="parent_id" ref="vat_code_tax_rec_st_salebase"/>
</record>
<record model="account.tax.code.template" id="vat_code_tax_rec_st1">
<field name="name">Service Tax 1% - Sales</field>
<field name="parent_id" ref="vat_code_tax_rec_st_salebase"/>
</record>
<record model="account.tax.code.template" id="vat_code_base_tax_sale15">
<field name="name">Sales Tax 15%</field>
<field name="parent_id" ref="vat_code_base_tax_sale"/>
</record>
<record model="account.tax.code.template" id="vat_code_rec_sale15">
<field name="name">Sales Tax - 15%</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_base_tax_sale12">
<field name="name">Sales Tax 12%</field>
<field name="parent_id" ref="vat_code_base_tax_sale"/>
</record>
<record model="account.tax.code.template" id="vat_code_rec_sale12">
<field name="name">Sales Tax - 12%</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_base_tax_sale4">
<field name="name">Sales Tax 4%</field>
<field name="parent_id" ref="vat_code_base_tax_sale"/>
</record>
<record model="account.tax.code.template" id="vat_code_rec_sale4">
<field name="name">Sales Tax - 4%</field>
<field name="parent_id" ref="vat_code_tax_rec"/>
</record>
<record model="account.tax.code.template" id="vat_code_base_tax_pur15">
<field name="name">Purchase Tax 15%</field>
<field name="parent_id" ref="vat_code_base_tax_purchase"/>
</record>
<record model="account.tax.code.template" id="vat_code_pay_pur4">
<field name="name">Purchase Tax - 15%</field>
<field name="parent_id" ref="vat_code_payable"/>
</record>
</data>
</openerp>

View File

@ -176,7 +176,7 @@ class mail_mail(osv.Model):
if context is None:
context = {}
if not ids:
filters = ['&', ('state', '=', 'outgoing'), ('type', '=', 'email')]
filters = [('state', '=', 'outgoing')]
if 'filters' in context:
filters.extend(context['filters'])
ids = self.search(cr, uid, filters, context=context)

View File

@ -312,7 +312,12 @@ class mail_thread(osv.AbstractModel):
# subscribe uid unless asked not to
if not context.get('mail_create_nosubscribe'):
self.message_subscribe_users(cr, uid, [thread_id], [uid], context=context)
self.message_auto_subscribe(cr, uid, [thread_id], values.keys(), context=context)
# auto_subscribe: take values and defaults into account
create_values = set(values.keys())
for key, val in context.iteritems():
if key.startswith('default_'):
create_values.add(key[8:])
self.message_auto_subscribe(cr, uid, [thread_id], list(create_values), context=context)
# track values
tracked_fields = self._get_tracked_fields(cr, uid, values.keys(), context=context)
@ -1436,7 +1441,7 @@ class mail_thread(osv.AbstractModel):
], context=context)
mail_followers_obj.write(cr, SUPERUSER_ID, fol_ids, {'subtype_ids': [(6, 0, subtype_ids)]}, context=context)
# subtype_ids not specified: do not update already subscribed partner, fetch default subtypes for new partners
else:
elif subtype_ids is None:
subtype_ids = subtype_obj.search(cr, uid, [
('default', '=', True),
'|',

View File

@ -21,7 +21,7 @@ email overload.
</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=mail" class="oe_button oe_big oe_tacky">Start your <span class="oe_emph">free</span> trial</a>
</div>
</div>
</div>

View File

@ -967,6 +967,24 @@ openerp.mail = function (session) {
this.$('.oe_reply').on('click', this.on_message_reply);
this.$('.oe_star').on('click', this.on_star);
this.$('.oe_msg_vote').on('click', this.on_vote);
this.$('.oe_mail_action_model').on('click', this.on_record_clicked);
},
on_record_clicked: function (event) {
event.stopPropagation();
var state = {
'model': this.model,
'id': this.res_id,
'title': this.record_name
};
session.webclient.action_manager.do_push_state(state);
this.do_action({
res_model: state.model,
res_id: state.id,
type: 'ir.actions.act_window',
views: [[false, 'form']]
});
return false;
},
/* Call the on_compose_message on the thread of this message. */

View File

@ -20,7 +20,7 @@ planning with the smart kanban and gantt views. Use the advanced analytics
features to detect bottleneck in resources capacities and inventory locations.
</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=mrp" class="oe_button oe_big oe_tacky">Start your <span class="oe_emph">free</span> trial</a>
</div>
</div>
</div>

View File

@ -15,7 +15,7 @@
Organize yourself with efficient todo lists and notes. From personnal tasks to collaborative meeting minutes, increase your user's productivity by giving them the tools to prioritize their work, share their ideas and collaborate on documents.
</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=note" class="oe_button oe_big oe_tacky">Start your <span class="oe_emph">free</span> trial</a>
</div>
</div>
</div>

View File

@ -6,7 +6,7 @@
<field name="inherit_id" ref="project.view_task_form2"/>
<field name="arch" type="xml">
<field name="description" position="replace">
<field name="description_pad" attrs="{'readonly':[('state','=','done')]}" widget="pad"/>
<field name="description_pad" widget="pad"/>
</field>
</field>
</record>

View File

@ -4,29 +4,31 @@ import simplejson
import os
import openerp
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.addons.web.controllers.main import manifest_list, module_boot, html_template
class PointOfSaleController(openerp.addons.web.http.Controller):
_cp_path = '/pos'
class PointOfSaleController(http.Controller):
@openerp.addons.web.http.httprequest
def app(self, req, s_action=None, **kw):
js = "\n ".join('<script type="text/javascript" src="%s"></script>' % i for i in manifest_list(req, None, 'js'))
css = "\n ".join('<link rel="stylesheet" href="%s">' % i for i in manifest_list(req, None, 'css'))
@http.route('/pos/app', type='http', auth='admin')
def app(self):
js = "\n ".join('<script type="text/javascript" src="%s"></script>' % i for i in manifest_list('js',db=request.db))
css = "\n ".join('<link rel="stylesheet" href="%s">' % i for i in manifest_list('css',db=request.db))
cookie = req.httprequest.cookies.get("instance0|session_id")
cookie = request.httprequest.cookies.get("instance0|session_id")
session_id = cookie.replace("%22","")
template = html_template.replace('<html','<html manifest="/pos/manifest?session_id=%s"'%session_id)
template = html_template.replace('<html','<html manifest="/pos/manifest?session_id=%s"' % request.session_id)
r = template % {
'js': js,
'css': css,
'modules': simplejson.dumps(module_boot(req)),
'modules': simplejson.dumps(module_boot(request)),
'init': 'var wc = new s.web.WebClient();wc.appendTo($(document.body));'
}
return r
@openerp.addons.web.http.httprequest
def manifest(self, req, **kwargs):
@http.route('/pos/manifest',type='http', auth='admin')
def manifest(self):
""" This generates a HTML5 cache manifest files that preloads the categories and products thumbnails
and other ressources necessary for the point of sale to work offline """
@ -45,16 +47,16 @@ class PointOfSaleController(openerp.addons.web.http.Controller):
imgdir = openerp.modules.get_module_resource('point_of_sale','static/src/img');
load_css_img(imgdir,'/point_of_sale/static/src/img')
products = req.session.model('product.product')
for p in products.search_read([('pos_categ_id','!=',False)], ['name']):
products = request.registry.get('product.product')
for p in products.search_read(request.cr, request.uid, [('pos_categ_id','!=',False)], ['name']):
product_id = p['id']
url = "/web/binary/image?session_id=%s&model=product.product&field=image&id=%s" % (req.session_id, product_id)
url = "/web/binary/image?session_id=%s&model=product.product&field=image&id=%s" % (request.session_id, product_id)
ml.append(url)
categories = req.session.model('pos.category')
for c in categories.search_read([],['name']):
categories = request.registry.get('pos.category')
for c in categories.search_read(request.cr, request.uid, [], ['name']):
category_id = c['id']
url = "/web/binary/image?session_id=%s&model=pos.category&field=image&id=%s" % (req.session_id, category_id)
url = "/web/binary/image?session_id=%s&model=pos.category&field=image&id=%s" % (request.session_id, category_id)
ml.append(url)
ml += ["NETWORK:","*"]
@ -62,108 +64,103 @@ class PointOfSaleController(openerp.addons.web.http.Controller):
return m
@openerp.addons.web.http.jsonrequest
def dispatch(self, request, iface, **kwargs):
method = 'iface_%s' % iface
return getattr(self, method)(request, **kwargs)
@openerp.addons.web.http.jsonrequest
def scan_item_success(self, request, ean):
@http.route('/pos/scan_item_success', type='json', auth='admin')
def scan_item_success(self, ean):
"""
A product has been scanned with success
"""
print 'scan_item_success: ' + str(ean)
return
@openerp.addons.web.http.jsonrequest
def scan_item_error_unrecognized(self, request, ean):
@http.route('/pos/scan_item_error_unrecognized')
def scan_item_error_unrecognized(self, ean):
"""
A product has been scanned without success
"""
print 'scan_item_error_unrecognized: ' + str(ean)
return
@openerp.addons.web.http.jsonrequest
def help_needed(self, request):
@http.route('/pos/help_needed', type='json', auth='admin')
def help_needed(self):
"""
The user wants an help (ex: light is on)
"""
print "help_needed"
return
@openerp.addons.web.http.jsonrequest
def help_canceled(self, request):
@http.route('/pos/help_canceled', type='json', auth='admin')
def help_canceled(self):
"""
The user stops the help request
"""
print "help_canceled"
return
@openerp.addons.web.http.jsonrequest
def weighting_start(self, request):
@http.route('/pos/weighting_start', type='json', auth='admin')
def weighting_start(self):
print "weighting_start"
return
@openerp.addons.web.http.jsonrequest
def weighting_read_kg(self, request):
@http.route('/pos/weighting_read_kg', type='json', auth='admin')
def weighting_read_kg(self):
print "weighting_read_kg"
return 0.0
return 3.14
@openerp.addons.web.http.jsonrequest
def weighting_end(self, request):
@http.route('/pos/weighting_end', type='json', auth='admin')
def weighting_end(self):
print "weighting_end"
return
@openerp.addons.web.http.jsonrequest
def payment_request(self, request, price):
@http.route('/pos/payment_request', type='json', auth='admin')
def payment_request(self, price):
"""
The PoS will activate the method payment
"""
print "payment_request: price:"+str(price)
return 'ok'
@openerp.addons.web.http.jsonrequest
def payment_status(self, request):
@http.route('/pos/payment_status', type='json', auth='admin')
def payment_status(self):
print "payment_status"
return { 'status':'waiting' }
@openerp.addons.web.http.jsonrequest
def payment_cancel(self, request):
@http.route('/pos/payment_cancel', type='json', auth='admin')
def payment_cancel(self):
print "payment_cancel"
return
@openerp.addons.web.http.jsonrequest
def transaction_start(self, request):
@http.route('/pos/transaction_start', type='json', auth='admin')
def transaction_start(self):
print 'transaction_start'
return
@openerp.addons.web.http.jsonrequest
def transaction_end(self, request):
@http.route('/pos/transaction_end', type='json', auth='admin')
def transaction_end(self):
print 'transaction_end'
return
@openerp.addons.web.http.jsonrequest
def cashier_mode_activated(self, request):
@http.route('/pos/cashier_mode_activated', type='json', auth='admin')
def cashier_mode_activated(self):
print 'cashier_mode_activated'
return
@openerp.addons.web.http.jsonrequest
def cashier_mode_deactivated(self, request):
@http.route('/pos/cashier_mode_deactivated', type='json', auth='admin')
def cashier_mode_deactivated(self):
print 'cashier_mode_deactivated'
return
@openerp.addons.web.http.jsonrequest
def open_cashbox(self, request):
@http.route('/pos/open_cashbox', type='json', auth='admin')
def open_cashbox(self):
print 'open_cashbox'
return
@openerp.addons.web.http.jsonrequest
def print_receipt(self, request, receipt):
@http.route('/pos/print_receipt', type='json', auth='admin')
def print_receipt(self, receipt):
print 'print_receipt' + str(receipt)
return
@openerp.addons.web.http.jsonrequest
def print_pdf_invoice(self, request, pdfinvoice):
@http.route('/pos/print_pdf_invoice', type='json', auth='admin')
def print_pdf_invoice(self, pdfinvoice):
print 'print_pdf_invoice' + str(pdfinvoice)
return

View File

@ -63,6 +63,7 @@ class pos_config(osv.osv):
'iface_electronic_scale' : fields.boolean('Electronic Scale Interface'),
'iface_vkeyboard' : fields.boolean('Virtual KeyBoard Interface'),
'iface_print_via_proxy' : fields.boolean('Print via Proxy'),
'iface_invoicing': fields.boolean('Invoicing',help='Enables invoice generation from the Point of Sale'),
'state' : fields.selection(POS_CONFIG_STATE, 'Status', required=True, readonly=True),
'sequence_id' : fields.many2one('ir.sequence', 'Order IDs Sequence', readonly=True,
@ -127,7 +128,8 @@ class pos_config(osv.osv):
'warehouse_id': _default_warehouse,
'journal_id': _default_sale_journal,
'group_by' : True,
'pricelist_id': _default_pricelist
'pricelist_id': _default_pricelist,
'iface_invoicing': True,
}
def set_active(self, cr, uid, ids, context=None):
@ -492,13 +494,17 @@ class pos_order(osv.osv):
#_logger.info("orders: %r", orders)
order_ids = []
for tmp_order in orders:
to_invoice = tmp_order['to_invoice']
order = tmp_order['data']
order_id = self.create(cr, uid, {
'name': order['name'],
'user_id': order['user_id'] or False,
'session_id': order['pos_session_id'],
'lines': order['lines'],
'pos_reference':order['name']
'pos_reference':order['name'],
'partner_id': order['partner_id'] or False
}, context)
for payments in order['statement_ids']:
@ -529,6 +535,12 @@ class pos_order(osv.osv):
}, context=context)
order_ids.append(order_id)
self.signal_paid(cr, uid, [order_id])
if to_invoice:
self.action_invoice(cr, uid, [order_id], context)
order_obj = self.browse(cr, uid, order_id, context)
self.pool['account.invoice'].signal_invoice_open(cr, uid, [order_obj.invoice_id.id])
return order_ids
def write(self, cr, uid, ids, vals, context=None):
@ -881,6 +893,7 @@ class pos_order(osv.osv):
inv_line_ref.create(cr, uid, inv_line, context=context)
inv_ref.button_reset_taxes(cr, uid, [inv_id], context=context)
self.signal_invoice(cr, uid, [order.id])
inv_ref.signal_validate(cr, uid, [inv_id])
if not inv_ids: return {}
@ -975,11 +988,11 @@ class pos_order(osv.osv):
})
if data_type == 'product':
key = ('product', values['partner_id'], values['product_id'])
key = ('product', values['partner_id'], values['product_id'], values['debit'] > 0)
elif data_type == 'tax':
key = ('tax', values['partner_id'], values['tax_code_id'],)
key = ('tax', values['partner_id'], values['tax_code_id'], values['debit'] > 0)
elif data_type == 'counter_part':
key = ('counter_part', values['partner_id'], values['account_id'])
key = ('counter_part', values['partner_id'], values['account_id'], values['debit'] > 0)
else:
return

View File

@ -794,6 +794,7 @@
<field name="iface_self_checkout" />
<field name="iface_cashdrawer" />
<field name="iface_payment_terminal" />
<field name="iface_invoicing" />
</group>
<group>
<field name="iface_electronic_scale" />

View File

@ -22,7 +22,7 @@
consolidations amongst all shops without the hassle of integrating several applications.
</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=point_of_sale" class="oe_button oe_big oe_tacky">Start your <span class="oe_emph">free</span> trial</a>
</div>
</div>
</div>

View File

@ -291,10 +291,15 @@
display: inline-block;
text-align: center;
vertical-align: top;
width: 205px;
max-height: 232px;
overflow-y: auto;
overflow-x: hidden;
}
.point-of-sale #paypad button {
height: 50px;
width: 208px;
display: block;
width: 100%;
margin: 0px -6px 4px -2px;
font-weight: bold;
vertical-align: middle;
@ -302,6 +307,17 @@
border-top: 1px solid #efefef;
font-size: 14px;
}
.point-of-sale #paypad button, .point-of-sale #numpad button, .point-of-sale .popup button{
position: relative;
top: 0;
-webkit-transition: top 150ms linear;
-moz-transition: top 150ms linear;
-ms-transition: top 150ms linear;
transition: top 150ms linear;
}
.point-of-sale #paypad button:active, .point-of-sale #numpad button:active, .point-of-sale .popup button:active{
top:3px;
}
.point-of-sale #paypad button:hover, .point-of-sale #numpad button:hover, .point-of-sale #numpad .selected-mode, .point-of-sale .popup button:hover {
border: none;
color: white;

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -267,11 +267,21 @@ function openerp_pos_db(instance, module){
return results;
},
add_order: function(order){
var last_id = this.load('last_order_id',0);
var order_id = order.uid;
var orders = this.load('orders',[]);
orders.push({id: last_id + 1, data: order});
this.save('last_order_id',last_id+1);
// if the order was already stored, we overwrite its data
for(var i = 0, len = orders.length; i < len; i++){
if(orders[i].id === order_id){
orders[i].data = order;
this.save('orders',orders);
return order_id;
}
}
orders.push({id: order_id, data: order});
this.save('orders',orders);
return order_id;
},
remove_order: function(order_id){
var orders = this.load('orders',[]);
@ -283,5 +293,14 @@ function openerp_pos_db(instance, module){
get_orders: function(){
return this.load('orders',[]);
},
get_order: function(order_id){
var orders = this.get_orders();
for(var i = 0, len = orders.length; i < len; i++){
if(orders[i].id === order_id){
return orders[i];
}
}
return undefined;
},
});
}

View File

@ -104,7 +104,6 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
return self.fetch('res.currency',['symbol','position','rounding','accuracy'],[['id','=',self.get('company').currency_id[0]]]);
}).then(function(currencies){
console.log('Currency:',currencies[0]);
self.set('currency',currencies[0]);
return self.fetch('product.uom', null, null);
@ -145,7 +144,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
['name','journal_ids','warehouse_id','journal_id','pricelist_id',
'iface_self_checkout', 'iface_led', 'iface_cashdrawer',
'iface_payment_terminal', 'iface_electronic_scale', 'iface_barscan', 'iface_vkeyboard',
'iface_print_via_proxy','iface_cashdrawer','state','sequence_id','session_ids'],
'iface_print_via_proxy','iface_cashdrawer','iface_invoicing','state','sequence_id','session_ids'],
[['id','=', self.get('pos_session').config_id[0]]]
);
}).then(function(configs){
@ -156,6 +155,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
self.iface_vkeyboard = !!pos_config.iface_vkeyboard;
self.iface_self_checkout = !!pos_config.iface_self_checkout;
self.iface_cashdrawer = !!pos_config.iface_cashdrawer;
self.iface_invoicing = !!pos_config.iface_invoicing;
return self.fetch('stock.warehouse',[],[['id','=',pos_config.warehouse_id[0]]]);
}).then(function(shops){
@ -240,12 +240,6 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
}
},
// saves the order locally and try to send it to the backend. 'record' is a bizzarely defined JSON version of the Order
push_order: function(record) {
this.db.add_order(record);
this.flush();
},
//creates a new empty order and sets it as the current order
add_new_order: function(){
var order = new module.Order({pos:this});
@ -253,45 +247,161 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
this.set('selectedOrder', order);
},
// saves the order locally and try to send it to the backend.
// it returns a deferred that succeeds after having tried to send the order and all the other pending orders.
push_order: function(order) {
var self = this;
var order_id = this.db.add_order(order.export_as_JSON());
var pushed = new $.Deferred();
this.set('nbr_pending_operations',self.db.get_orders().length);
this.flush_mutex.exec(function(){
var flushed = self._flush_all_orders();
flushed.always(function(){
pushed.resolve();
});
return flushed;
});
return pushed;
},
// saves the order locally and try to send it to the backend and make an invoice
// returns a deferred that succeeds when the order has been posted and successfully generated
// an invoice. This method can fail in various ways:
// error-no-client: the order must have an associated partner_id. You can retry to make an invoice once
// this error is solved
// error-transfer: there was a connection error during the transfer. You can retry to make the invoice once
// the network connection is up
push_and_invoice_order: function(order){
var self = this;
var invoiced = new $.Deferred();
if(!order.get_client()){
invoiced.reject('error-no-client');
return invoiced;
}
var order_id = this.db.add_order(order.export_as_JSON());
this.set('nbr_pending_operations',self.db.get_orders().length);
this.flush_mutex.exec(function(){
var done = new $.Deferred(); // holds the mutex
// send the order to the server
// we have a 30 seconds timeout on this push.
// FIXME: if the server takes more than 30 seconds to accept the order,
// the client will believe it wasn't successfully sent, and very bad
// things will happen as a duplicate will be sent next time
// so we must make sure the server detects and ignores duplicated orders
var transfer = self._flush_order(order_id, {timeout:30000, to_invoice:true});
transfer.fail(function(){
invoiced.reject('error-transfer');
done.reject();
});
// on success, get the order id generated by the server
transfer.pipe(function(order_server_id){
// generate the pdf and download it
self.pos_widget.do_action('point_of_sale.pos_invoice_report',{additional_context:{
active_ids:order_server_id,
}});
invoiced.resolve();
done.resolve();
});
return done;
});
return invoiced;
},
// attemps to send all pending orders ( stored in the pos_db ) to the server,
// and remove the successfully sent ones from the db once
// it has been confirmed that they have been sent correctly.
flush: function() {
//TODO make the mutex work
//this makes sure only one _int_flush is called at the same time
/*
return this.flush_mutex.exec(_.bind(function() {
return this._flush(0);
}, this));
*/
this._flush(0);
var self = this;
var flushed = new $.Deferred();
this.flush_mutex.exec(function(){
var done = new $.Deferred();
self._flush_all_orders()
.done( function(){ flushed.resolve();})
.fail( function(){ flushed.reject(); })
.always(function(){ done.resolve(); });
return done;
});
return flushed;
},
// attempts to send an order of index 'index' in the list of order to send. The index
// is used to skip orders that failed. do not call this method outside the mutex provided
// by flush()
_flush: function(index){
// attempts to send the locally stored order of id 'order_id'
// the sending is asynchronous and can take some time to decide if it is successful or not
// it is therefore important to only call this method from inside a mutex
// this method returns a deferred indicating wether the sending was successful or not
// there is a timeout parameter which is set to 2 seconds by default.
_flush_order: function(order_id, options){
var self = this;
options = options || {};
timeout = typeof options.timeout === 'number' ? options.timeout : 5000;
var order = this.db.get_order(order_id);
order.to_invoice = options.to_invoice || false;
if(!order){
// flushing a non existing order always fails
return (new $.Deferred()).reject();
}
// we try to send the order. shadow prevents a spinner if it takes too long. (unless we are sending an invoice,
// then we want to notify the user that we are waiting on something )
var rpc = (new instance.web.Model('pos.order')).call('create_from_ui',[[order]],undefined,{shadow: !options.to_invoice, timeout:timeout});
rpc.fail(function(unused,event){
// prevent an error popup creation by the rpc failure
// we want the failure to be silent as we send the orders in the background
event.preventDefault();
console.error('Failed to send order:',order);
});
rpc.done(function(){
self.db.remove_order(order_id);
self.set('nbr_pending_operations',self.db.get_orders().length);
});
return rpc;
},
// attempts to send all the locally stored orders. As with _flush_order, it should only be
// called from within a mutex.
// this method returns a deferred that always succeeds when all orders have been tried to be sent,
// even if none of them could actually be sent.
_flush_all_orders: function(){
var self = this;
var orders = this.db.get_orders();
self.set('nbr_pending_operations',orders.length);
var tried_all = new $.Deferred();
var order = orders[index];
if(!order){
return;
function rec_flush(index){
if(index < orders.length){
self._flush_order(orders[index].id).always(function(){
rec_flush(index+1);
})
}else{
tried_all.resolve();
}
}
//try to push an order to the server
// shadow : true is to prevent a spinner to appear in case of timeout
(new instance.web.Model('pos.order')).call('create_from_ui',[[order]],undefined,{ shadow:true })
.fail(function(unused, event){
//don't show error popup if it fails
event.preventDefault();
console.error('Failed to send order:',order);
self._flush(index+1);
})
.done(function(){
//remove from db if success
self.db.remove_order(order.id);
self._flush(index);
});
rec_flush(0);
return tried_all;
},
scan_product: function(parsed_ean){
@ -590,11 +700,12 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
module.Order = Backbone.Model.extend({
initialize: function(attributes){
Backbone.Model.prototype.initialize.apply(this, arguments);
this.uid = this.generateUniqueId();
this.set({
creationDate: new Date(),
orderLines: new module.OrderlineCollection(),
paymentLines: new module.PaymentlineCollection(),
name: "Order " + this.generateUniqueId(),
name: "Order " + this.uid,
client: null,
});
this.pos = attributes.pos;
@ -770,7 +881,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
currency: this.pos.get('currency'),
};
},
exportAsJSON: function() {
export_as_JSON: function() {
var orderLines, paymentLines;
orderLines = [];
(this.get('orderLines')).each(_.bind( function(item) {
@ -789,8 +900,9 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
lines: orderLines,
statement_ids: paymentLines,
pos_session_id: this.pos.get('pos_session').id,
partner_id: this.pos.get('client') ? this.pos.get('client').id : undefined,
partner_id: this.get_client() ? this.get_client().id : false,
user_id: this.pos.get('cashier') ? this.pos.get('cashier').id : this.pos.get('user').id,
uid: this.uid,
};
},
getSelectedLine: function(){

View File

@ -434,6 +434,14 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
template:'ErrorNegativePricePopupWidget',
});
module.ErrorNoClientPopupWidget = module.ErrorPopupWidget.extend({
template: 'ErrorNoClientPopupWidget',
});
module.ErrorInvoiceTransferPopupWidget = module.ErrorPopupWidget.extend({
template: 'ErrorInvoiceTransferPopupWidget',
});
module.ScaleInviteScreenWidget = module.ScreenWidget.extend({
template:'ScaleInviteScreenWidget',
@ -452,7 +460,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
clearInterval(this.intervalID);
self.pos_widget.screen_selector.set_current_screen(self.next_screen);
}
},500);
},100);
this.add_action_button({
label: _t('Back'),
@ -507,7 +515,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
self.weight = weight;
self.renderElement();
}
},200);
},100);
},
renderElement: function(){
var self = this;
@ -640,7 +648,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
var cashregister = selfCheckoutRegisters[0] || self.pos.get('cashRegisters').models[0];
currentOrder.addPaymentLine(cashregister);
self.pos.push_order(currentOrder.exportAsJSON())
self.pos.push_order(currentOrder)
currentOrder.destroy();
self.pos.proxy.transaction_end();
self.pos_widget.screen_selector.set_current_screen(self.next_screen);
@ -808,19 +816,42 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
this._super();
var self = this;
this.add_action_button({
var print_button = this.add_action_button({
label: _t('Print'),
icon: '/point_of_sale/static/src/img/icons/png48/printer.png',
click: function(){ self.print(); },
});
this.add_action_button({
var finish_button = this.add_action_button({
label: _t('Next Order'),
icon: '/point_of_sale/static/src/img/icons/png48/go-next.png',
click: function() { self.finishOrder(); },
});
window.print();
// THIS IS THE HACK OF THE CENTURY
//
// The problem is that in chrome the print() is asynchronous and doesn't
// execute until all rpc are finished. So it conflicts with the rpc used
// to send the orders to the backend, and the user is able to go to the next
// screen before the printing dialog is opened. The problem is that what's
// printed is whatever is in the page when the dialog is opened and not when it's called,
// and so you end up printing the product list instead of the receipt...
//
// Fixing this would need a re-architecturing
// of the code to postpone sending of orders after printing.
//
// But since the print dialog also blocks the other asynchronous calls, the
// button enabling in the setTimeout() is blocked until the printing dialog is
// closed. But the timeout has to be big enough or else it doesn't work
// 2 seconds is the same as the default timeout for sending orders and so the dialog
// should have appeared before the timeout... so yeah that's not ultra reliable.
finish_button.set_disabled(true);
setTimeout(function(){
finish_button.set_disabled(false);
}, 2000);
},
print: function() {
window.print();
@ -870,15 +901,15 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
this.set_numpad_state(this.pos_widget.numpad.state);
this.back_button = this.add_action_button({
this.add_action_button({
label: _t('Back'),
icon: '/point_of_sale/static/src/img/icons/png48/go-previous.png',
click: function(){
self.pos_widget.screen_selector.set_current_screen(self.back_screen);
},
});
this.validate_button = this.add_action_button({
this.add_action_button({
label: _t('Validate'),
name: 'validation',
icon: '/point_of_sale/static/src/img/icons/png48/validate.png',
@ -886,6 +917,17 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
self.validateCurrentOrder();
},
});
if(this.pos.iface_invoicing){
this.add_action_button({
label: 'Invoice',
name: 'invoice',
icon: '/point_of_sale/static/src/img/icons/png48/invoice.png',
click: function(){
self.validateCurrentOrder({invoice: true});
},
});
}
this.updatePaymentSummary();
this.line_refocus();
@ -898,15 +940,44 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
back: function() {
this.pos_widget.screen_selector.set_current_screen(self.back_screen);
},
validateCurrentOrder: function() {
validateCurrentOrder: function(options) {
var self = this;
options = options || {};
var currentOrder = this.pos.get('selectedOrder');
this.pos.push_order(currentOrder.exportAsJSON())
if(this.pos.iface_print_via_proxy){
this.pos.proxy.print_receipt(currentOrder.export_for_printing());
this.pos.get('selectedOrder').destroy(); //finish order and go back to scan screen
if(options.invoice){
// deactivate the validation button while we try to send the order
this.pos_widget.action_bar.set_button_disabled('validation',true);
this.pos_widget.action_bar.set_button_disabled('invoice',true);
var invoiced = this.pos.push_and_invoice_order(currentOrder);
invoiced.fail(function(error){
if(error === 'error-no-client'){
self.pos_widget.screen_selector.show_popup('error-no-client');
}else{
self.pos_widget.screen_selector.show_popup('error-invoice-transfer');
}
self.pos_widget.action_bar.set_button_disabled('validation',false);
self.pos_widget.action_bar.set_button_disabled('invoice',false);
});
invoiced.done(function(){
self.pos_widget.action_bar.set_button_disabled('validation',false);
self.pos_widget.action_bar.set_button_disabled('invoice',false);
self.pos.get('selectedOrder').destroy();
});
}else{
this.pos_widget.screen_selector.set_current_screen(this.next_screen);
this.pos.push_order(currentOrder)
if(this.pos.iface_print_via_proxy){
this.pos.proxy.print_receipt(currentOrder.export_for_printing());
this.pos.get('selectedOrder').destroy(); //finish order and go back to scan screen
}else{
this.pos_widget.screen_selector.set_current_screen(this.next_screen);
}
}
},
bindPaymentLineEvents: function() {
@ -985,6 +1056,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
if(this.pos_widget.action_bar){
this.pos_widget.action_bar.set_button_disabled('validation', remaining > 0.000001);
this.pos_widget.action_bar.set_button_disabled('invoice', remaining > 0.000001);
}
},
set_numpad_state: function(numpadState) {

View File

@ -838,6 +838,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
instance.web.blockUI();
this.pos = new module.PosModel(this.session);
this.pos.pos_widget = this;
this.pos_widget = this; //So that pos_widget's childs have pos_widget set automatically
this.numpad_visible = true;
@ -952,6 +953,12 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
this.error_negative_price_popup = new module.ErrorNegativePricePopupWidget(this, {});
this.error_negative_price_popup.appendTo($('.point-of-sale'));
this.error_no_client_popup = new module.ErrorNoClientPopupWidget(this, {});
this.error_no_client_popup.appendTo($('.point-of-sale'));
this.error_invoice_transfer_popup = new module.ErrorInvoiceTransferPopupWidget(this, {});
this.error_invoice_transfer_popup.appendTo($('.point-of-sale'));
// -------- Misc ---------
this.notification = new module.SynchNotificationWidget(this,{});
@ -1013,6 +1020,8 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
'error-session': this.error_session_popup,
'error-negative-price': this.error_negative_price_popup,
'choose-receipt': this.choose_receipt_popup,
'error-no-client': this.error_no_client_popup,
'error-invoice-transfer': this.error_invoice_transfer_popup,
},
default_client_screen: 'welcome',
default_cashier_screen: 'products',

View File

@ -336,11 +336,11 @@
<div class="modal-dialog">
<div class="popup popup-help">
<p class="message">The scanned product was not recognized<br /> Please wait, a cashier is on the way</p>
</div>
</div>
<div class="footer">
<div class="button">
Ok
<div class="footer">
<div class="button">
Ok
</div>
</div>
</div>
</div>
</t>
@ -361,6 +361,33 @@
</div>
</t>
<t t-name="ErrorNoClientPopupWidget">
<div class="modal-dialog">
<div class="popup popup-help">
<p class="message">An anonymous order cannot be invoiced</p>
<div class="footer">
<div class="button">
Ok
</div>
</div>
</div>
</div>
</t>
<t t-name="ErrorInvoiceTransferPopupWidget">
<div class="modal-dialog">
<div class="popup popup-help">
<p class="message">The Order could not be sent to the server for invoicing. Invoices cannot be generated
in offline mode. Please check your internet connection and try again.</p>
<div class="footer">
<div class="button">
Ok
</div>
</div>
</div>
</div>
</t>
<t t-name="ErrorPopupWidget">
<div class="modal-dialog">
<div class="popup popup-help">
@ -538,7 +565,6 @@
<button class="paypad-button" t-att-cash-register-id="widget.cashRegister.get('id')">
<t t-esc="widget.cashRegister.get('journal').name"/>
</button>
<br />
</t>
<t t-name="OrderButtonWidget">

View File

@ -85,6 +85,7 @@ class pos_session_opening(osv.osv_memory):
session_ids = proxy.search(cr, uid, [
('state', '!=', 'closed'),
('config_id', '=', config_id),
('user_id', '=', uid),
], context=context)
if session_ids:
session = proxy.browse(cr, uid, session_ids[0], context=context)

View File

@ -0,0 +1,25 @@
# Chinese (Simplified) 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-03 15:17+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\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-07-04 05:12+0000\n"
"X-Generator: Launchpad (build 16692)\n"
#. module: portal_anonymous
#. openerp-web
#: code:addons/portal_anonymous/static/src/xml/portal_anonymous.xml:8
#, python-format
msgid "Login"
msgstr "用户名"

View File

@ -19,35 +19,17 @@
#
##############################################################################
from openerp.addons.project.tests.test_project_base import TestProjectBase
from openerp.osv.orm import except_orm
from openerp.tests import common
from openerp.tools import mute_logger
class TestPortalProject(common.TransactionCase):
class TestPortalProjectBase(TestProjectBase):
def setUp(self):
super(TestPortalProject, self).setUp()
super(TestPortalProjectBase, self).setUp()
cr, uid = self.cr, self.uid
# Useful models
self.project_project = self.registry('project.project')
self.project_task = self.registry('project.task')
self.res_users = self.registry('res.users')
self.res_partner = self.registry('res.partner')
# Find Employee group
group_employee_ref = self.registry('ir.model.data').get_object_reference(cr, uid, 'base', 'group_user')
self.group_employee_id = group_employee_ref and group_employee_ref[1] or False
# Find Project User group
group_project_user_ref = self.registry('ir.model.data').get_object_reference(cr, uid, 'project', 'group_project_user')
self.group_project_user_id = group_project_user_ref and group_project_user_ref[1] or False
# Find Project Manager group
group_project_manager_ref = self.registry('ir.model.data').get_object_reference(cr, uid, 'project', 'group_project_manager')
self.group_project_manager_id = group_project_manager_ref and group_project_manager_ref[1] or False
# Find Portal group
group_portal_ref = self.registry('ir.model.data').get_object_reference(cr, uid, 'portal', 'group_portal')
self.group_portal_id = group_portal_ref and group_portal_ref[1] or False
@ -56,62 +38,39 @@ class TestPortalProject(common.TransactionCase):
group_anonymous_ref = self.registry('ir.model.data').get_object_reference(cr, uid, 'portal', 'group_anonymous')
self.group_anonymous_id = group_anonymous_ref and group_anonymous_ref[1] or False
# Test users to use through the various tests
self.user_alfred_id = self.res_users.create(cr, uid, {
'name': 'Alfred EmployeeUser',
'login': 'alfred',
'alias_name': 'alfred',
'groups_id': [(6, 0, [self.group_employee_id, self.group_project_user_id])]
})
self.user_bert_id = self.res_users.create(cr, uid, {
'name': 'Bert Nobody',
'login': 'bert',
'alias_name': 'bert',
'groups_id': [(6, 0, [])]
})
self.user_chell_id = self.res_users.create(cr, uid, {
'name': 'Chell Portal',
'login': 'chell',
'alias_name': 'chell',
'groups_id': [(6, 0, [self.group_portal_id])]
})
self.user_donovan_id = self.res_users.create(cr, uid, {
'name': 'Donovan Anonymous',
'login': 'donovan',
'alias_name': 'donovan',
'groups_id': [(6, 0, [self.group_anonymous_id])]
})
self.user_ernest_id = self.res_users.create(cr, uid, {
'name': 'Ernest Manager',
'login': 'ernest',
'alias_name': 'ernest',
'groups_id': [(6, 0, [self.group_project_manager_id])]
})
# # Test users to use through the various tests
self.user_portal_id = self.res_users.create(cr, uid, {
'name': 'Chell Portal',
'login': 'chell',
'alias_name': 'chell',
'groups_id': [(6, 0, [self.group_portal_id])]
})
self.user_anonymous_id = self.res_users.create(cr, uid, {
'name': 'Donovan Anonymous',
'login': 'donovan',
'alias_name': 'donovan',
'groups_id': [(6, 0, [self.group_anonymous_id])]
})
# Test 'Pigs' project
self.project_pigs_id = self.project_project.create(cr, uid,
{'name': 'Pigs', 'privacy_visibility': 'public'},
{'mail_create_nolog': True})
self.project_pigs_id = self.project_project.create(cr, uid, {
'name': 'Pigs', 'privacy_visibility': 'public'}, {'mail_create_nolog': True})
# Various test tasks
self.task_1_id = self.project_task.create(cr, uid,
{'name': 'Test1', 'user_id': False, 'project_id': self.project_pigs_id},
{'mail_create_nolog': True})
self.task_2_id = self.project_task.create(cr, uid,
{'name': 'Test2', 'user_id': False, 'project_id': self.project_pigs_id},
{'mail_create_nolog': True})
self.task_3_id = self.project_task.create(cr, uid,
{'name': 'Test3', 'user_id': False, 'project_id': self.project_pigs_id},
{'mail_create_nolog': True})
self.task_4_id = self.project_task.create(cr, uid,
{'name': 'Test4', 'user_id': self.user_alfred_id, 'project_id': self.project_pigs_id},
{'mail_create_nolog': True})
self.task_5_id = self.project_task.create(cr, uid,
{'name': 'Test5', 'user_id': self.user_chell_id, 'project_id': self.project_pigs_id},
{'mail_create_nolog': True})
self.task_6_id = self.project_task.create(cr, uid,
{'name': 'Test6', 'user_id': self.user_donovan_id, 'project_id': self.project_pigs_id},
{'mail_create_nolog': True})
self.task_1_id = self.project_task.create(cr, uid, {
'name': 'Test1', 'user_id': False, 'project_id': self.project_pigs_id}, {'mail_create_nolog': True})
self.task_2_id = self.project_task.create(cr, uid, {
'name': 'Test2', 'user_id': False, 'project_id': self.project_pigs_id}, {'mail_create_nolog': True})
self.task_3_id = self.project_task.create(cr, uid, {
'name': 'Test3', 'user_id': False, 'project_id': self.project_pigs_id}, {'mail_create_nolog': True})
self.task_4_id = self.project_task.create(cr, uid, {
'name': 'Test4', 'user_id': self.user_projectuser_id, 'project_id': self.project_pigs_id}, {'mail_create_nolog': True})
self.task_5_id = self.project_task.create(cr, uid, {
'name': 'Test5', 'user_id': self.user_portal_id, 'project_id': self.project_pigs_id}, {'mail_create_nolog': True})
self.task_6_id = self.project_task.create(cr, uid, {
'name': 'Test6', 'user_id': self.user_anonymous_id, 'project_id': self.project_pigs_id}, {'mail_create_nolog': True})
class TestPortalProject(TestPortalProjectBase):
@mute_logger('openerp.addons.base.ir.ir_model', 'openerp.osv.orm')
def test_00_project_access_rights(self):
""" Test basic project access rights, for project and portal_project """
@ -122,53 +81,47 @@ class TestPortalProject(common.TransactionCase):
# ----------------------------------------
# Do: Alfred reads project -> ok (employee ok public)
self.project_project.read(cr, self.user_alfred_id, pigs_id, ['name'])
self.project_project.read(cr, self.user_projectuser_id, pigs_id, ['name'])
# Test: all project tasks visible
task_ids = self.project_task.search(cr, self.user_alfred_id, [('project_id', '=', pigs_id)])
task_ids = self.project_task.search(cr, self.user_projectuser_id, [('project_id', '=', pigs_id)])
test_task_ids = set([self.task_1_id, self.task_2_id, self.task_3_id, self.task_4_id, self.task_5_id, self.task_6_id])
self.assertEqual(set(task_ids), test_task_ids,
'access rights: project user cannot see all tasks of a public project')
'access rights: project user cannot see all tasks of a public project')
# Test: all project tasks readable
self.project_task.read(cr, self.user_alfred_id, task_ids, ['name'])
self.project_task.read(cr, self.user_projectuser_id, task_ids, ['name'])
# Test: all project tasks writable
self.project_task.write(cr, self.user_alfred_id, task_ids, {'description': 'TestDescription'})
self.project_task.write(cr, self.user_projectuser_id, task_ids, {'description': 'TestDescription'})
# Do: Bert reads project -> crash, no group
self.assertRaises(except_orm, self.project_project.read,
cr, self.user_bert_id, pigs_id, ['name'])
self.assertRaises(except_orm, self.project_project.read, cr, self.user_none_id, pigs_id, ['name'])
# Test: no project task visible
self.assertRaises(except_orm, self.project_task.search,
cr, self.user_bert_id, [('project_id', '=', pigs_id)])
self.assertRaises(except_orm, self.project_task.search, cr, self.user_none_id, [('project_id', '=', pigs_id)])
# Test: no project task readable
self.assertRaises(except_orm, self.project_task.read,
cr, self.user_bert_id, task_ids, ['name'])
self.assertRaises(except_orm, self.project_task.read, cr, self.user_none_id, task_ids, ['name'])
# Test: no project task writable
self.assertRaises(except_orm, self.project_task.write,
cr, self.user_bert_id, task_ids, {'description': 'TestDescription'})
self.assertRaises(except_orm, self.project_task.write, cr, self.user_none_id, task_ids, {'description': 'TestDescription'})
# Do: Chell reads project -> ok (portal ok public)
self.project_project.read(cr, self.user_chell_id, pigs_id, ['name'])
self.project_project.read(cr, self.user_portal_id, pigs_id, ['name'])
# Test: all project tasks visible
task_ids = self.project_task.search(cr, self.user_chell_id, [('project_id', '=', pigs_id)])
task_ids = self.project_task.search(cr, self.user_portal_id, [('project_id', '=', pigs_id)])
self.assertEqual(set(task_ids), test_task_ids,
'access rights: project user cannot see all tasks of a public project')
'access rights: project user cannot see all tasks of a public project')
# Test: all project tasks readable
self.project_task.read(cr, self.user_chell_id, task_ids, ['name'])
self.project_task.read(cr, self.user_portal_id, task_ids, ['name'])
# Test: no project task writable
self.assertRaises(except_orm, self.project_task.write,
cr, self.user_chell_id, task_ids, {'description': 'TestDescription'})
self.assertRaises(except_orm, self.project_task.write, cr, self.user_portal_id, task_ids, {'description': 'TestDescription'})
# Do: Donovan reads project -> ok (anonymous ok public)
self.project_project.read(cr, self.user_donovan_id, pigs_id, ['name'])
self.project_project.read(cr, self.user_anonymous_id, pigs_id, ['name'])
# Test: all project tasks visible
task_ids = self.project_task.search(cr, self.user_donovan_id, [('project_id', '=', pigs_id)])
task_ids = self.project_task.search(cr, self.user_anonymous_id, [('project_id', '=', pigs_id)])
self.assertEqual(set(task_ids), test_task_ids,
'access rights: anonymous user cannot see all tasks of a public project')
'access rights: anonymous user cannot see all tasks of a public project')
# Test: all project tasks readable
self.project_task.read(cr, self.user_donovan_id, task_ids, ['name'])
self.project_task.read(cr, self.user_anonymous_id, task_ids, ['name'])
# Test: no project task writable
self.assertRaises(except_orm, self.project_task.write,
cr, self.user_donovan_id, task_ids, {'description': 'TestDescription'})
self.assertRaises(except_orm, self.project_task.write, cr, self.user_anonymous_id, task_ids, {'description': 'TestDescription'})
# ----------------------------------------
# CASE2: portal project
@ -176,39 +129,36 @@ class TestPortalProject(common.TransactionCase):
self.project_project.write(cr, uid, [pigs_id], {'privacy_visibility': 'portal'})
# Do: Alfred reads project -> ok (employee ok public)
self.project_project.read(cr, self.user_alfred_id, pigs_id, ['name'])
self.project_project.read(cr, self.user_projectuser_id, pigs_id, ['name'])
# Test: all project tasks visible
task_ids = self.project_task.search(cr, self.user_alfred_id, [('project_id', '=', pigs_id)])
task_ids = self.project_task.search(cr, self.user_projectuser_id, [('project_id', '=', pigs_id)])
self.assertEqual(set(task_ids), test_task_ids,
'access rights: project user cannot see all tasks of a portal project')
'access rights: project user cannot see all tasks of a portal project')
# Do: Bert reads project -> crash, no group
self.assertRaises(except_orm, self.project_project.read,
cr, self.user_bert_id, pigs_id, ['name'])
self.assertRaises(except_orm, self.project_project.read, cr, self.user_none_id, pigs_id, ['name'])
# Test: no project task searchable
self.assertRaises(except_orm, self.project_task.search,
cr, self.user_bert_id, [('project_id', '=', pigs_id)])
self.assertRaises(except_orm, self.project_task.search, cr, self.user_none_id, [('project_id', '=', pigs_id)])
# Data: task follower
self.project_task.message_subscribe_users(cr, self.user_alfred_id, [self.task_1_id, self.task_3_id], [self.user_chell_id])
self.project_task.message_subscribe_users(cr, self.user_projectuser_id, [self.task_1_id, self.task_3_id], [self.user_portal_id])
# Do: Chell reads project -> ok (portal ok public)
self.project_project.read(cr, self.user_chell_id, pigs_id, ['name'])
self.project_project.read(cr, self.user_portal_id, pigs_id, ['name'])
# Test: only followed project tasks visible + assigned
task_ids = self.project_task.search(cr, self.user_chell_id, [('project_id', '=', pigs_id)])
task_ids = self.project_task.search(cr, self.user_portal_id, [('project_id', '=', pigs_id)])
test_task_ids = set([self.task_1_id, self.task_3_id, self.task_5_id])
self.assertEqual(set(task_ids), test_task_ids,
'access rights: portal user should see the followed tasks of a portal project')
'access rights: portal user should see the followed tasks of a portal project')
# Do: Donovan reads project -> ko (anonymous ko portal)
self.assertRaises(except_orm, self.project_project.read,
cr, self.user_donovan_id, pigs_id, ['name'])
self.assertRaises(except_orm, self.project_project.read, cr, self.user_anonymous_id, pigs_id, ['name'])
# Test: no project task visible
task_ids = self.project_task.search(cr, self.user_donovan_id, [('project_id', '=', pigs_id)])
task_ids = self.project_task.search(cr, self.user_anonymous_id, [('project_id', '=', pigs_id)])
self.assertFalse(task_ids, 'access rights: anonymous user should not see tasks of a portal project')
# Data: task follower cleaning
self.project_task.message_unsubscribe_users(cr, self.user_alfred_id, [self.task_1_id, self.task_3_id], [self.user_chell_id])
self.project_task.message_unsubscribe_users(cr, self.user_projectuser_id, [self.task_1_id, self.task_3_id], [self.user_portal_id])
# ----------------------------------------
# CASE3: employee project
@ -216,29 +166,26 @@ class TestPortalProject(common.TransactionCase):
self.project_project.write(cr, uid, [pigs_id], {'privacy_visibility': 'employees'})
# Do: Alfred reads project -> ok (employee ok employee)
self.project_project.read(cr, self.user_alfred_id, pigs_id, ['name'])
self.project_project.read(cr, self.user_projectuser_id, pigs_id, ['name'])
# Test: all project tasks visible
task_ids = self.project_task.search(cr, self.user_alfred_id, [('project_id', '=', pigs_id)])
task_ids = self.project_task.search(cr, self.user_projectuser_id, [('project_id', '=', pigs_id)])
test_task_ids = set([self.task_1_id, self.task_2_id, self.task_3_id, self.task_4_id, self.task_5_id, self.task_6_id])
self.assertEqual(set(task_ids), test_task_ids,
'access rights: project user cannot see all tasks of an employees project')
'access rights: project user cannot see all tasks of an employees project')
# Do: Bert reads project -> crash, no group
self.assertRaises(except_orm, self.project_project.read,
cr, self.user_bert_id, pigs_id, ['name'])
self.assertRaises(except_orm, self.project_project.read, cr, self.user_none_id, pigs_id, ['name'])
# Do: Chell reads project -> ko (portal ko employee)
self.assertRaises(except_orm, self.project_project.read,
cr, self.user_chell_id, pigs_id, ['name'])
self.assertRaises(except_orm, self.project_project.read, cr, self.user_portal_id, pigs_id, ['name'])
# Test: no project task visible + assigned
task_ids = self.project_task.search(cr, self.user_chell_id, [('project_id', '=', pigs_id)])
task_ids = self.project_task.search(cr, self.user_portal_id, [('project_id', '=', pigs_id)])
self.assertFalse(task_ids, 'access rights: portal user should not see tasks of an employees project, even if assigned')
# Do: Donovan reads project -> ko (anonymous ko employee)
self.assertRaises(except_orm, self.project_project.read,
cr, self.user_donovan_id, pigs_id, ['name'])
self.assertRaises(except_orm, self.project_project.read, cr, self.user_anonymous_id, pigs_id, ['name'])
# Test: no project task visible
task_ids = self.project_task.search(cr, self.user_donovan_id, [('project_id', '=', pigs_id)])
task_ids = self.project_task.search(cr, self.user_anonymous_id, [('project_id', '=', pigs_id)])
self.assertFalse(task_ids, 'access rights: anonymous user should not see tasks of an employees project')
# ----------------------------------------
@ -247,54 +194,49 @@ class TestPortalProject(common.TransactionCase):
self.project_project.write(cr, uid, [pigs_id], {'privacy_visibility': 'followers'})
# Do: Alfred reads project -> ko (employee ko followers)
self.assertRaises(except_orm, self.project_project.read,
cr, self.user_alfred_id, pigs_id, ['name'])
self.assertRaises(except_orm, self.project_project.read, cr, self.user_projectuser_id, pigs_id, ['name'])
# Test: no project task visible
task_ids = self.project_task.search(cr, self.user_alfred_id, [('project_id', '=', pigs_id)])
task_ids = self.project_task.search(cr, self.user_projectuser_id, [('project_id', '=', pigs_id)])
test_task_ids = set([self.task_4_id])
self.assertEqual(set(task_ids), test_task_ids,
'access rights: employee user should not see tasks of a not-followed followers project, only assigned')
'access rights: employee user should not see tasks of a not-followed followers project, only assigned')
# Do: Bert reads project -> crash, no group
self.assertRaises(except_orm, self.project_project.read,
cr, self.user_bert_id, pigs_id, ['name'])
self.assertRaises(except_orm, self.project_project.read, cr, self.user_none_id, pigs_id, ['name'])
# Do: Chell reads project -> ko (portal ko employee)
self.assertRaises(except_orm, self.project_project.read,
cr, self.user_chell_id, pigs_id, ['name'])
self.assertRaises(except_orm, self.project_project.read, cr, self.user_portal_id, pigs_id, ['name'])
# Test: no project task visible
task_ids = self.project_task.search(cr, self.user_chell_id, [('project_id', '=', pigs_id)])
task_ids = self.project_task.search(cr, self.user_portal_id, [('project_id', '=', pigs_id)])
test_task_ids = set([self.task_5_id])
self.assertEqual(set(task_ids), test_task_ids,
'access rights: portal user should not see tasks of a not-followed followers project, only assigned')
'access rights: portal user should not see tasks of a not-followed followers project, only assigned')
# Do: Donovan reads project -> ko (anonymous ko employee)
self.assertRaises(except_orm, self.project_project.read,
cr, self.user_donovan_id, pigs_id, ['name'])
self.assertRaises(except_orm, self.project_project.read, cr, self.user_anonymous_id, pigs_id, ['name'])
# Test: no project task visible
task_ids = self.project_task.search(cr, self.user_donovan_id, [('project_id', '=', pigs_id)])
task_ids = self.project_task.search(cr, self.user_anonymous_id, [('project_id', '=', pigs_id)])
self.assertFalse(task_ids, 'access rights: anonymous user should not see tasks of a followers project')
# Data: subscribe Alfred, Chell and Donovan as follower
self.project_project.message_subscribe_users(cr, uid, [pigs_id], [self.user_alfred_id, self.user_chell_id, self.user_donovan_id])
self.project_task.message_subscribe_users(cr, self.user_alfred_id, [self.task_1_id, self.task_3_id], [self.user_chell_id, self.user_alfred_id])
self.project_project.message_subscribe_users(cr, uid, [pigs_id], [self.user_projectuser_id, self.user_portal_id, self.user_anonymous_id])
self.project_task.message_subscribe_users(cr, self.user_projectuser_id, [self.task_1_id, self.task_3_id], [self.user_portal_id, self.user_projectuser_id])
# Do: Alfred reads project -> ok (follower ok followers)
self.project_project.read(cr, self.user_alfred_id, pigs_id, ['name'])
self.project_project.read(cr, self.user_projectuser_id, pigs_id, ['name'])
# Test: followed + assigned tasks visible
task_ids = self.project_task.search(cr, self.user_alfred_id, [('project_id', '=', pigs_id)])
task_ids = self.project_task.search(cr, self.user_projectuser_id, [('project_id', '=', pigs_id)])
test_task_ids = set([self.task_1_id, self.task_3_id, self.task_4_id])
self.assertEqual(set(task_ids), test_task_ids,
'access rights: employee user should not see followed + assigned tasks of a follower project')
'access rights: employee user should not see followed + assigned tasks of a follower project')
# Do: Chell reads project -> ok (follower ok follower)
self.project_project.read(cr, self.user_chell_id, pigs_id, ['name'])
self.project_project.read(cr, self.user_portal_id, pigs_id, ['name'])
# Test: followed + assigned tasks visible
task_ids = self.project_task.search(cr, self.user_chell_id, [('project_id', '=', pigs_id)])
task_ids = self.project_task.search(cr, self.user_portal_id, [('project_id', '=', pigs_id)])
test_task_ids = set([self.task_1_id, self.task_3_id, self.task_5_id])
self.assertEqual(set(task_ids), test_task_ids,
'access rights: employee user should not see followed + assigned tasks of a follower project')
'access rights: employee user should not see followed + assigned tasks of a follower project')
# Do: Donovan reads project -> ko (anonymous ko follower even if follower)
self.assertRaises(except_orm, self.project_project.read,
cr, self.user_donovan_id, pigs_id, ['name'])
self.assertRaises(except_orm, self.project_project.read, cr, self.user_anonymous_id, pigs_id, ['name'])

View File

@ -26,7 +26,7 @@
</div>
<div><field name="categ_ids" widget="many2many_tags" class="oe_left"/></div>
<div class="oe_text_right">
<h1><field name="state" readonly="1"/></h1>
<h1><field name="stage_id" readonly="1"/></h1>
</div>
</div>
<div>

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