[MERGE]merge with latest trunk

bzr revid: csn@openerp.com-20121109134313-6g2o6z6xhleavssi
This commit is contained in:
Cedric Snauwaert 2012-11-09 14:43:13 +01:00
commit 42e0ce3374
374 changed files with 7447 additions and 62054 deletions

View File

@ -541,10 +541,18 @@ class account_account(osv.osv):
return False
return True
def _check_company_account(self, cr, uid, ids, context=None):
for account in self.browse(cr, uid, ids, context=context):
if account.parent_id:
if account.company_id != account.parent_id.company_id:
return False
return True
_constraints = [
(_check_recursion, 'Error!\nYou cannot create recursive accounts.', ['parent_id']),
(_check_type, 'Configuration Error!\nYou cannot define children to an account with internal type different of "View".', ['type']),
(_check_account_type, 'Configuration Error!\nYou cannot select an account type with a deferral method different of "Unreconciled" for accounts with internal type "Payable/Receivable".', ['user_type','type']),
(_check_company_account, 'Error!\nYou cannot create an account which has parent account of different company.', ['parent_id']),
]
_sql_constraints = [
('code_company_uniq', 'unique (code,company_id)', 'The code of the account must be unique per company !')

View File

@ -61,7 +61,7 @@ class account_bank_statement(osv.osv):
return res
def _get_period(self, cr, uid, context=None):
periods = self.pool.get('account.period').find(cr, uid)
periods = self.pool.get('account.period').find(cr, uid,context=context)
if periods:
return periods[0]
return False

View File

@ -78,7 +78,7 @@ class account_cash_statement(osv.osv):
"""
res = {}
for statement in self.browse(cr, uid, ids, context=context):
if statement.journal_id.type not in ('cash',):
if (statement.journal_id.type not in ('cash',)) or (not statement.journal_id.cash_control):
continue
start = end = 0
for line in statement.details_ids:
@ -289,13 +289,13 @@ class account_cash_statement(osv.osv):
super(account_cash_statement, self).button_confirm_bank(cr, uid, ids, context=context)
absl_proxy = self.pool.get('account.bank.statement.line')
TABLES = (('Profit', 'profit_account_id'), ('Loss', 'loss_account_id'),)
TABLES = ((_('Profit'), 'profit_account_id'), (_('Loss'), 'loss_account_id'),)
for obj in self.browse(cr, uid, ids, context=context):
if obj.difference == 0.0:
continue
for item_label, item_account in TALBES:
for item_label, item_account in TABLES:
if getattr(obj.journal_id, item_account):
raise osv.except_osv(_('Error!'),
_('There is no %s Account on the journal %s.') % (item_label, obj.journal_id.name,))

View File

@ -168,10 +168,8 @@
context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}"
domain="[('supplier', '=', True)]"/>
<field name="fiscal_position" widget="selection"/>
<group>
<field name="origin"/>
<field name="supplier_invoice_number"/>
</group>
<field name="origin"/>
<field name="supplier_invoice_number"/>
<label for="reference_type"/>
<div>
<field name="reference_type" class="oe_inline oe_edit_only"/>

View File

@ -975,7 +975,7 @@ class account_move_line(osv.osv):
if context is None:
context = {}
result = super(account_move_line, self).fields_view_get(cr, uid, view_id, view_type, context=context, toolbar=toolbar, submenu=submenu)
if view_type != 'tree':
if (view_type != 'tree') or view_id:
#Remove the toolbar from the form view
if view_type == 'form':
if result.get('toolbar', False):

View File

@ -509,8 +509,8 @@
<page string="Cash Registers">
<group>
<group string="Accounts">
<field name="profit_account_id"/>
<field name="loss_account_id"/>
<field name="profit_account_id" domain="[('type','!=','view')]"/>
<field name="loss_account_id" domain="[('type','!=','view')]"/>
<field name="internal_account_id"/>
</group>
<group string="Miscellaneous">
@ -1230,8 +1230,8 @@
<field name="move_id" string="Number (Move)"/>
<field name="account_id"/>
<field name="partner_id"/>
<field name="journal_id" context="{'journal_id':self}"/>
<field name="period_id" context="{'period_id':self}"/>
<field name="journal_id" context="{'journal_id':self}" widget="selection"/> <!-- it's important to keep widget='selection' in this filter viewbecause without that the value passed in the context is not the ID but the textual value (name) of the selected journal -->
<field name="period_id" context="{'period_id':self}" widget="selection"/> <!-- it's important to keep the widget='selection' in this field, for the same reason as explained above -->
<group expand="0" string="Group By...">
<filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
@ -1791,7 +1791,7 @@
<field name="name"/>
<field name="active"/>
</group>
<field name="note" placeholder="Note fo the invoice..."/>
<field name="note" placeholder="Note for the invoice..."/>
<separator string="Computation"/>
<field name="line_ids"/>
</form>

View File

@ -127,7 +127,6 @@
<field name="view_id" ref="account_journal_bank_view"/>
<field name="name">Status</field>
<field name="field">state</field>
<field eval="True" name="invisible"/>
<field eval="19" name="sequence"/>
</record>
<record id="bank_col20" model="account.journal.column">
@ -215,7 +214,6 @@
<field name="view_id" ref="account_journal_bank_view_multi"/>
<field name="name">Status</field>
<field name="field">state</field>
<field eval="True" name="invisible"/>
<field eval="19" name="sequence"/>
</record>
<record id="bank_col20_multi" model="account.journal.column">
@ -291,7 +289,6 @@
<field name="view_id" ref="account_journal_view"/>
<field name="name">Status</field>
<field name="field">state</field>
<field eval="True" name="invisible"/>
<field eval="19" name="sequence"/>
</record>
@ -373,7 +370,6 @@
<field name="view_id" ref="account_sp_journal_view"/>
<field name="name">Status</field>
<field name="field">state</field>
<field eval="True" name="invisible"/>
<field eval="19" name="sequence"/>
</record>
<record id="sp_journal_col20" model="account.journal.column">
@ -460,7 +456,6 @@
<field name="view_id" ref="account_sp_refund_journal_view"/>
<field name="name">Status</field>
<field name="field">state</field>
<field eval="True" name="invisible"/>
<field eval="19" name="sequence"/>
</record>
<record id="sp_refund_journal_col20" model="account.journal.column">

View File

@ -7,14 +7,15 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-02-08 00:35+0000\n"
"PO-Revision-Date: 2012-06-20 16:18+0000\n"
"Last-Translator: Raphael Collet (OpenERP) <Unknown>\n"
"PO-Revision-Date: 2012-10-30 15:48+0000\n"
"Last-Translator: Frederic Clementi - Camptocamp.com "
"<frederic.clementi@camptocamp.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: 2012-10-30 05:01+0000\n"
"X-Generator: Launchpad (build 16206)\n"
"X-Launchpad-Export-Date: 2012-11-03 05:03+0000\n"
"X-Generator: Launchpad (build 16218)\n"
#. module: account
#: code:addons/account/account_move_line.py:1215
@ -151,7 +152,7 @@ msgstr "Définition des enfants"
#: code:addons/account/account_bank_statement.py:302
#, python-format
msgid "Journal item \"%s\" is not valid."
msgstr "Écriture \"%s\" n'est pas équilibrée"
msgstr ""
#. module: account
#: model:ir.model,name:account.model_report_aged_receivable
@ -1608,10 +1609,9 @@ msgid ""
"entry per accounting document: invoice, refund, supplier payment, bank "
"statements, etc."
msgstr ""
"Une pièce comptable est composée de plusieurs écritures comptables, chacune "
"étant soit un débit soit un crédit. OpenERP crée automatiquement une pièce "
"comptable par document comptable : facture, avoir, paiement de fournisseur, "
"relevés bancaires, etc."
"Un écriture est composée de plusieurs lignes, chacune étant soit un débit "
"soit un crédit. OpenERP crée automatiquement une écriture par document "
"comptable : facture, avoir, paiement de fournisseur, relevés bancaires, etc."
#. module: account
#: view:account.entries.report:0
@ -1703,7 +1703,7 @@ msgstr "Recherche d'un relevé bancaire"
#. module: account
#: view:account.move.line:0
msgid "Unposted Journal Items"
msgstr "Pièces non comptabiliisées"
msgstr "Ecritures brouillon"
#. module: account
#: view:account.chart.template:0
@ -2478,8 +2478,6 @@ msgid ""
"In order to delete a bank statement, you must first cancel it to delete "
"related journal items."
msgstr ""
"Pour supprimer un relevé bancaire vous devez préalablement supprimer les "
"lignes rapprochées."
#. module: account
#: field:account.invoice,payment_term:0
@ -3629,7 +3627,7 @@ msgstr "État des ventes par type de compte"
#. module: account
#: view:account.move.line:0
msgid "Unreconciled Journal Items"
msgstr "Ecritures non lettrées"
msgstr "Ecritures non léttrées"
#. module: account
#: sql_constraint:res.currency:0
@ -3900,7 +3898,7 @@ msgstr ""
#. module: account
#: model:ir.actions.report.xml,name:account.account_account_balance_landscape
msgid "Account balance"
msgstr "Balance des comptes"
msgstr "Balance générale"
#. module: account
#: report:account.invoice:0
@ -3972,7 +3970,7 @@ msgstr "Nom"
#. module: account
#: model:ir.model,name:account.model_account_aged_trial_balance
msgid "Account Aged Trial balance Report"
msgstr "Rapport du solde de la balance agée"
msgstr "Balance agée"
#. module: account
#: code:addons/account/account_move_line.py:582
@ -4181,7 +4179,7 @@ msgstr ""
#. module: account
#: view:account.move.line:0
msgid "Posted Journal Items"
msgstr "Ecritures saisies"
msgstr "Ecritures validées"
#. module: account
#: view:account.tax.template:0
@ -4244,7 +4242,7 @@ msgstr "Titulaire du compte bancaire"
#: model:ir.actions.report.xml,name:account.account_account_balance
#: model:ir.ui.menu,name:account.menu_general_Balance_report
msgid "Trial Balance"
msgstr "Balance des comptes"
msgstr "Balance générale"
#. module: account
#: model:ir.model,name:account.model_account_invoice_cancel
@ -4659,7 +4657,7 @@ msgstr "Sert de compte par défaut pour le crédit"
#: view:validate.account.move:0
#: view:validate.account.move.lines:0
msgid "Post Journal Entries"
msgstr "Comptabiliser les pièces comptables dans le journal"
msgstr "Valider les écritures"
#. module: account
#: selection:account.invoice,state:0
@ -4927,7 +4925,7 @@ msgstr ""
#: code:addons/account/account.py:923
#, python-format
msgid "Opening Period"
msgstr "Période ouverte"
msgstr "Période d'ouverture"
#. module: account
#: view:account.move:0
@ -5611,7 +5609,7 @@ msgstr "Quantité de produits"
#: selection:account.move,state:0
#: view:account.move.line:0
msgid "Unposted"
msgstr "Non comptabilisé"
msgstr "Non validée"
#. module: account
#: view:account.change.currency:0
@ -5823,7 +5821,7 @@ msgstr "Journal d'écriture"
#: model:ir.actions.act_window,name:account.action_account_fiscalyear_close
#: model:ir.ui.menu,name:account.menu_wizard_fy_close
msgid "Generate Opening Entries"
msgstr "Générer les écritures d'ouverture"
msgstr "Générer l'écriture d'ouverture"
#. module: account
#: code:addons/account/account_move_line.py:775
@ -7117,7 +7115,7 @@ msgstr "Sélection du journal"
#: code:addons/account/account.py:432
#, python-format
msgid "Opening Balance"
msgstr "Solde initial"
msgstr ""
#. module: account
#: model:ir.model,name:account.model_account_move_reconcile
@ -7727,8 +7725,7 @@ msgstr "Signes sur les Rapports"
#: code:addons/account/wizard/account_fiscalyear_close.py:88
#, python-format
msgid "The periods to generate opening entries were not found"
msgstr ""
"Les périodes pour générer les écritures d'ouverture n'ont pas été trouvées."
msgstr "Aucune période d'ouverture trouvée"
#. module: account
#: model:account.account.type,name:account.data_account_type_view
@ -7822,7 +7819,7 @@ msgstr "Journal des ventes"
#: code:addons/account/wizard/account_move_journal.py:104
#, python-format
msgid "Open Journal Items !"
msgstr "Écritures ouvertes !"
msgstr ""
#. module: account
#: model:ir.model,name:account.model_account_invoice_tax
@ -7859,7 +7856,7 @@ msgstr ""
#. module: account
#: view:account.move:0
msgid "Unposted Journal Entries"
msgstr "Pièces non comptabilisées"
msgstr "Ecritures non validées"
#. module: account
#: view:product.product:0
@ -7976,7 +7973,7 @@ msgstr "Code de la case"
#. module: account
#: view:validate.account.move:0
msgid "Post Journal Entries of a Journal"
msgstr "Comptabiliser les pièces comptables d'un journal"
msgstr "Valider les écritures"
#. module: account
#: view:product.product:0
@ -8161,7 +8158,7 @@ msgstr "Ligne de caisse"
#: model:ir.actions.report.xml,name:account.account_3rdparty_ledger_other
#: model:ir.ui.menu,name:account.menu_account_partner_ledger
msgid "Partner Ledger"
msgstr "Grand Livre"
msgstr "Livre des tiers"
#. module: account
#: selection:account.tax.template,type:0
@ -8359,7 +8356,7 @@ msgstr ""
#: help:account.account,reconcile:0
msgid ""
"Check this box if this account allows reconciliation of journal items."
msgstr "Cochez si le compte autorise le lettrage des pièces."
msgstr "Cochez si le compte autorise le lettrage des écritures."
#. module: account
#: help:account.period,state:0
@ -9220,7 +9217,7 @@ msgstr "inconnu"
#: code:addons/account/account.py:3130
#, python-format
msgid "Opening Entries Journal"
msgstr "Journal des écritures d'ouverture"
msgstr "Journal d'ouverture"
#. module: account
#: model:process.transition,note:account.process_transition_customerinvoice0
@ -10006,7 +10003,7 @@ msgstr "Ce compte de tiers remplacera le compte par défaut."
#. module: account
#: field:account.period,special:0
msgid "Opening/Closing Period"
msgstr "Ouverture/clôture d'exercice"
msgstr "Période d'ouverture/clôture"
#. module: account
#: field:account.account,currency_id:0
@ -10336,7 +10333,7 @@ msgstr "Date de fin"
#: model:ir.actions.act_window,name:account.action_account_open_closed_fiscalyear
#: model:ir.ui.menu,name:account.menu_wizard_account_open_closed_fiscalyear
msgid "Cancel Opening Entries"
msgstr "Annuler les écritures d'ouvertures"
msgstr "Annuler l'écriture d'ouverture"
#. module: account
#: field:account.payment.term.line,days2:0
@ -10505,7 +10502,7 @@ msgstr "Signer pour le parent"
#. module: account
#: model:ir.model,name:account.model_account_balance_report
msgid "Trial Balance Report"
msgstr "Rapport sur la balance des comptes"
msgstr "Balance générale"
#. module: account
#: model:ir.actions.act_window,name:account.action_bank_statement_draft_tree
@ -10688,7 +10685,7 @@ msgstr "Intervalle"
#. module: account
#: view:account.analytic.line:0
msgid "Analytic Journal Items related to a purchase journal."
msgstr "Imputations analytiques relatives au journal des achats."
msgstr "Ecritures analytiques relatives au journal des achats."
#. module: account
#: help:account.account,type:0
@ -11213,7 +11210,7 @@ msgstr "Future"
#. module: account
#: view:account.move.line:0
msgid "Search Journal Items"
msgstr "Rechercher des écritures comptables"
msgstr "Recherche par ligne d'écritures"
#. module: account
#: help:account.tax,base_sign:0

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-02-08 00:35+0000\n"
"PO-Revision-Date: 2012-10-26 09:03+0000\n"
"PO-Revision-Date: 2012-10-31 10:41+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: 2012-10-30 05:04+0000\n"
"X-Generator: Launchpad (build 16206)\n"
"X-Launchpad-Export-Date: 2012-11-03 05:03+0000\n"
"X-Generator: Launchpad (build 16218)\n"
#. module: account
#: view:account.invoice.report:0
@ -7939,7 +7939,7 @@ msgstr "Строка кассы"
#: model:ir.actions.report.xml,name:account.account_3rdparty_ledger_other
#: model:ir.ui.menu,name:account.menu_account_partner_ledger
msgid "Partner Ledger"
msgstr "Книгапартнера"
msgstr "Книга партнера"
#. module: account
#: selection:account.tax.template,type:0

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-02-08 00:35+0000\n"
"PO-Revision-Date: 2012-06-20 16:03+0000\n"
"Last-Translator: Raphael Collet (OpenERP) <Unknown>\n"
"PO-Revision-Date: 2012-11-01 18:30+0000\n"
"Last-Translator: Dusan Laznik <laznik@mentis.si>\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: 2012-10-30 05:04+0000\n"
"X-Generator: Launchpad (build 16206)\n"
"X-Launchpad-Export-Date: 2012-11-03 05:04+0000\n"
"X-Generator: Launchpad (build 16218)\n"
#. module: account
#: view:account.invoice.report:0
@ -1587,7 +1587,7 @@ msgstr "Neobdavčeno"
#. module: account
#: view:account.partner.reconcile.process:0
msgid "Go to Next Partner"
msgstr ""
msgstr "Naslednji parner"
#. module: account
#: view:account.bank.statement:0
@ -3150,7 +3150,7 @@ msgstr "Predloge kontnih načrtov"
#. module: account
#: model:ir.actions.act_window,name:account.action_wizard_multi_chart
msgid "Set Your Accounting Options"
msgstr ""
msgstr "Nastavitve"
#. module: account
#: view:report.account.sales:0
@ -4358,7 +4358,7 @@ msgstr "res_config_contents"
#. module: account
#: view:account.unreconcile:0
msgid "Unreconciliate Transactions"
msgstr ""
msgstr "Neusklajene postavke"
#. module: account
#: help:account.chart.template,visible:0
@ -4558,7 +4558,7 @@ msgstr "Datum dogodka"
#. module: account
#: view:account.unreconcile.reconcile:0
msgid "Unreconciliation Transactions"
msgstr ""
msgstr "Naknadno odprte postavke"
#. module: account
#: field:account.tax,ref_tax_code_id:0
@ -6046,7 +6046,7 @@ msgstr "Davek(%)"
#. module: account
#: view:account.addtmpl.wizard:0
msgid "Create an Account Based on this Template"
msgstr ""
msgstr "Ustvarite konto na osnovi te predloge"
#. module: account
#: view:account.account.type:0
@ -8827,7 +8827,7 @@ msgstr "Prodaja po vrstah"
#. module: account
#: view:account.analytic.cost.ledger.journal.report:0
msgid "Cost Ledger for Period"
msgstr ""
msgstr "Stroški za obdobje"
#. module: account
#: help:account.tax,child_depend:0
@ -10307,7 +10307,7 @@ msgstr "Urejanje vrst dnevnikov."
#. module: account
#: view:account.payment.term:0
msgid "Description on Invoices"
msgstr ""
msgstr "Opis na računih"
#. module: account
#: model:ir.model,name:account.model_account_analytic_chart

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-02-08 00:35+0000\n"
"PO-Revision-Date: 2012-10-25 16:26+0000\n"
"Last-Translator: AllanWong <18895563@qq.com>\n"
"PO-Revision-Date: 2012-11-01 08:44+0000\n"
"Last-Translator: ccdos <ccdos@163.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: 2012-10-30 05:07+0000\n"
"X-Generator: Launchpad (build 16206)\n"
"X-Launchpad-Export-Date: 2012-11-03 05:04+0000\n"
"X-Generator: Launchpad (build 16218)\n"
#. module: account
#: view:account.invoice.report:0
@ -2330,7 +2330,7 @@ msgstr "筛选"
#: selection:report.invoice.created,state:0
#, python-format
msgid "Open"
msgstr "打开"
msgstr "待支付"
#. module: account
#: model:process.node,note:account.process_node_draftinvoices0
@ -4668,7 +4668,7 @@ msgstr "税适用"
#: model:ir.ui.menu,name:account.menu_eaction_account_moves_sale
#, python-format
msgid "Journal Items"
msgstr "会计凭证"
msgstr "会计凭证明细"
#. module: account
#: code:addons/account/account.py:1095
@ -9642,7 +9642,7 @@ msgstr "本报表让您打印或产生一个由所有账簿生成的总账"
#: selection:account.account.template,type:0
#: selection:account.entries.report,type:0
msgid "Regular"
msgstr "定期"
msgstr "常规科目"
#. module: account
#: view:account.account:0
@ -10557,7 +10557,7 @@ msgstr "前景"
#. module: account
#: view:account.move.line:0
msgid "Search Journal Items"
msgstr "搜索分录"
msgstr "搜索会计凭证明细"
#. module: account
#: help:account.tax,base_sign:0

View File

@ -209,7 +209,7 @@ class res_partner(osv.osv):
relation='account.fiscal.position',
string="Fiscal Position",
view_load=True,
help="The fiscal position will determine taxes and the accounts used for the partner.",
help="The fiscal position will determine taxes and accounts used for the partner.",
),
'property_payment_term': fields.property(
'account.payment.term',

View File

@ -30,14 +30,14 @@ class product_category(osv.osv):
relation='account.account',
string="Income Account",
view_load=True,
help="This account will be used for invoices to value sales for the current product category"),
help="This account will be used for invoices to value sales."),
'property_account_expense_categ': fields.property(
'account.account',
'account.account',
type='many2one',
relation='account.account',
string="Expense Account",
view_load=True,
help="This account will be used for invoices to value expenses for the current product category"),
help="This account will be used for invoices to value expenses."),
}
product_category()
@ -60,14 +60,14 @@ class product_template(osv.osv):
relation='account.account',
string="Income Account",
view_load=True,
help="This account will be used for invoices instead of the default one to value sales for the current product"),
help="This account will be used for invoices instead of the default one to value sales for the current product."),
'property_account_expense': fields.property(
'account.account',
type='many2one',
relation='account.account',
string="Expense Account",
view_load=True,
help="This account will be used for invoices instead of the default one to value expenses for the current product"),
help="This account will be used for invoices instead of the default one to value expenses for the current product."),
}
product_template()

View File

@ -49,9 +49,11 @@
<field name="inherit_id" ref="product.product_category_form_view"/>
<field name="arch" type="xml">
<data>
<xpath expr="/form/sheet//group[@name='account_property']" position="inside">
<field name="property_account_income_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<field name="property_account_expense_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<xpath expr="//group[@name='parent']" position="inside">
<group name="account_property" string="Account Properties" colspan="2">
<field name="property_account_income_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<field name="property_account_expense_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
</group>
</xpath>
</data>
</field>

View File

@ -94,8 +94,8 @@
<field name="state">open</field>
<field name="partner_id" ref="base.res_partner_19"/>
</record>
<record id="analytic_magasin_bml_1" model="account.analytic.account">
<field name="name">Magasin BML 1</field>
<record id="analytic_millennium_industries" model="account.analytic.account">
<field name="name">Millennium Industries</field>
<field name="parent_id" ref="analytic_integration"/>
<field name="type">normal</field>
<field name="partner_id" ref="base.res_partner_15"/>
@ -121,8 +121,8 @@
<field name="parent_id" ref="analytic_customers"/>
<field name="partner_id" ref="base.res_partner_1"/>
</record>
<record id="analytic_distripc" model="account.analytic.account">
<field name="name">DistriPC</field>
<record id="analytic_deltapc" model="account.analytic.account">
<field name="name">Delta PC</field>
<field name="parent_id" ref="analytic_customers"/>
<field name="type">normal</field>
<field name="partner_id" ref="base.res_partner_4"/>
@ -145,8 +145,8 @@
<field name="partner_id" ref="base.res_partner_17"/>
<field name="state">open</field>
</record>
<record id="analytic_leclerc" model="account.analytic.account">
<field name="name">Leclerc</field>
<record id="analytic_luminous_technologies" model="account.analytic.account">
<field name="name">Luminous Technologies</field>
<field eval="time.strftime('%Y-04-24')" name="date_start"/>
<field eval="str(time.localtime()[0] + 1) + '-04-24'" name="date"/>
<field name="type">normal</field>
@ -161,8 +161,8 @@
<field name="parent_id" ref="analytic_partners"/>
<field name="partner_id" ref="base.res_partner_12"/>
</record>
<record id="analytic_tiny_at_work" model="account.analytic.account">
<field name="name">OpenERP SA AT Work</field>
<record id="analytic_think_big_systems" model="account.analytic.account">
<field name="name">Think Big Systems</field>
<field name="type">normal</field>
<field name="parent_id" ref="analytic_partners"/>
<field name="partner_id" ref="base.res_partner_18"/>

View File

@ -35,7 +35,6 @@
<field name="partner_id"/>
<field name="user_id"/>
<group expand="0" string="Group By...">
<filter string="Manager" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Associated Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Parent Account" icon="terp-folder-green" domain="[]" context="{'group_by':'parent_id'}"/>
<filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}" groups="base.group_no_one"/>
@ -144,8 +143,8 @@
<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id, journal_id)"/>
<label for="unit_amount"/>
<div>
<field name="unit_amount" class="oe_inline"/>
<field name="product_uom_id" class="oe_inline"/>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" class="oe_inline"/>
<field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, company_id, product_uom_id)" class="oe_inline"/>
</div>
</group>
<group string="General Accounting">

View File

@ -42,7 +42,7 @@
<field name="arch" type="xml">
<graph string="Invoices Analysis" type="bar">
<field name="product_id"/>
<field name="user_currency_price_total"/>
<field name="price_total"/>
</graph>
</field>
</record>

View File

@ -277,7 +277,7 @@
<font color="white"> </font>
</para>
<section>
<para style="terp_default_Bold_9">[[ getLines(o) and removeParentNode('section')]]There is nothing due with this customer</para>
<para style="terp_default_Bold_9">[[ getLines(o) and removeParentNode('section')]]There is nothing due with this customer.</para>
</section>
<para style="terp_default_9">
<font color="white"> </font>

View File

@ -262,6 +262,7 @@ class account_config_settings(osv.osv_memory):
'sale_tax_rate': config.sale_tax_rate,
'purchase_tax_rate': config.purchase_tax_rate,
'complete_tax_set': config.complete_tax_set,
'currency_id': config.currency_id.id,
}, context)
wizard.execute(cr, uid, [wizard_id], context)

View File

@ -268,7 +268,7 @@
<field name="target">inline</field>
</record>
<menuitem id="menu_account_config" name="Accounting" parent="base.menu_config"
<menuitem id="menu_account_config" name="Invoicing" parent="base.menu_config"
sequence="14" action="action_account_config"/>
</data>

View File

@ -48,7 +48,7 @@ openerp.account = function (instance) {
this.last_group_by = group_by;
this.old_search = _.bind(this._super, this);
var mod = new instance.web.Model("account.move.line", context, domain);
return mod.call("list_partners_to_reconcile", []).pipe(function(result) {
return mod.call("list_partners_to_reconcile", []).then(function(result) {
var current = self.current_partner !== null ? self.partners[self.current_partner][0] : null;
self.partners = result;
var index = _.find(_.range(self.partners.length), function(el) {
@ -74,7 +74,7 @@ openerp.account = function (instance) {
return fct();
} else {
return new instance.web.Model("res.partner").call("read",
[self.partners[self.current_partner][0], ["last_reconciliation_date"]]).pipe(function(res) {
[self.partners[self.current_partner][0], ["last_reconciliation_date"]]).then(function(res) {
self.last_reconciliation_date =
instance.web.format_value(res.last_reconciliation_date, {"type": "datetime"}, _t("Never"));
return fct();
@ -92,7 +92,7 @@ openerp.account = function (instance) {
return false;
}
new instance.web.Model("ir.model.data").call("get_object_reference", ["account", "action_view_account_move_line_reconcile"]).pipe(function(result) {
new instance.web.Model("ir.model.data").call("get_object_reference", ["account", "action_view_account_move_line_reconcile"]).then(function(result) {
var additional_context = _.extend({
active_id: ids[0],
active_ids: ids,
@ -101,7 +101,7 @@ openerp.account = function (instance) {
return self.rpc("/web/action/load", {
action_id: result[1],
context: additional_context
}).then(function (result) {
}).done(function (result) {
result.context = _.extend(result.context || {}, additional_context);
result.flags = result.flags || {};
result.flags.new_window = true;
@ -116,7 +116,7 @@ openerp.account = function (instance) {
mark_as_reconciled: function() {
var self = this;
var id = self.partners[self.current_partner][0];
new instance.web.Model("res.partner").call("mark_as_reconciled", [[id]]).pipe(function() {
new instance.web.Model("res.partner").call("mark_as_reconciled", [[id]]).then(function() {
self.do_search(self.last_domain, self.last_context, self.last_group_by);
});
},

View File

@ -5,6 +5,7 @@
<!-- Top menu item -->
<menuitem name="Accounting"
id="account.menu_finance"/>
<menuitem id="account.menu_account_config" name="Accounting" parent="base.menu_config"/>
</data>

View File

@ -3,13 +3,21 @@
<menuitem id="base.menu_invoiced" name="Invoicing" parent="base.menu_base_partner" sequence="5"/>
<record id="action_hr_tree_invoiced_all" model="ir.actions.act_window">
<field name="name">Time &amp; Costs to Invoice</field>
<field name="name">Time &amp; Materials to Invoice</field>
<field name="res_model">account.analytic.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('invoice_id','=',False)]</field>
<field name="context">{'search_default_to_invoice': 1}</field>
<field name="search_view_id" ref="account.view_account_analytic_line_filter"/>
<field name="help" type="html">
<p>
You will find here timesheets and purchases you did for
contracts that can be reinvoiced to the customer. If you want
to record new activities to invoice, you should use the timesheet
menu instead.
</p>
</field>
</record>
<menuitem action="action_hr_tree_invoiced_all" id="menu_action_hr_tree_invoiced_all" parent="base.menu_invoiced" sequence="5"/>

View File

@ -38,7 +38,7 @@ Allows to automatically select analytic accounts based on criterions:
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'images': ['images/analytic_defaults.jpeg'],
'depends': ['sale'],
'depends': ['sale_stock'],
'data': [
'security/ir.model.access.csv',
'security/account_analytic_default_security.xml',

View File

@ -38,14 +38,14 @@ class product_category(osv.osv):
relation='account.account',
string="Income Account",
view_load=True,
help="This account will be used to value outgoing stock for the current product category using sale price"),
help="This account will be used to value outgoing stock using sale price."),
'property_account_expense_categ': fields.property(
'account.account',
type='many2one',
relation='account.account',
string="Expense Account",
view_load=True,
help="This account will be used to value outgoing stock for the current product category using cost price"),
help="This account will be used to value outgoing stock using cost price."),
}
product_category()
@ -68,14 +68,14 @@ class product_template(osv.osv):
relation='account.account',
string="Income Account",
view_load=True,
help="This account will be used to value outgoing stock for the current product category using sale price"),
help="This account will be used to value outgoing stock using sale price."),
'property_account_expense': fields.property(
'account.account',
type='many2one',
relation='account.account',
string="Expense Account",
view_load=True,
help="This account will be used to value outgoing stock for the current product category using cost price"),
help="This account will be used to value outgoing stock using cost price."),
}
product_template()

View File

@ -29,10 +29,10 @@
<record id="view_category_property_form" model="ir.ui.view">
<field name="name">product.category.property.form.inherit.stock</field>
<field name="model">product.category</field>
<field name="inherit_id" ref="product.product_category_form_view"/>
<field name="inherit_id" ref="account.view_category_property_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="/form/sheet//group[@name='account_property']" position="inside">
<xpath expr="//field[@name='property_account_income_categ']" position="before">
<field name="property_account_creditor_price_difference_categ" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
</xpath>
</data>

View File

@ -134,10 +134,11 @@ class account_asset_asset(osv.osv):
def compute_depreciation_board(self, cr, uid, ids, context=None):
depreciation_lin_obj = self.pool.get('account.asset.depreciation.line')
currency_obj = self.pool.get('res.currency')
for asset in self.browse(cr, uid, ids, context=context):
if asset.value_residual == 0.0:
continue
posted_depreciation_line_ids = depreciation_lin_obj.search(cr, uid, [('asset_id', '=', asset.id), ('move_check', '=', True)])
posted_depreciation_line_ids = depreciation_lin_obj.search(cr, uid, [('asset_id', '=', asset.id), ('move_check', '=', True)],order='depreciation_date desc')
old_depreciation_line_ids = depreciation_lin_obj.search(cr, uid, [('asset_id', '=', asset.id), ('move_id', '=', False)])
if old_depreciation_line_ids:
depreciation_lin_obj.unlink(cr, uid, old_depreciation_line_ids, context=context)
@ -148,7 +149,12 @@ class account_asset_asset(osv.osv):
else:
# depreciation_date = 1st January of purchase year
purchase_date = datetime.strptime(asset.purchase_date, '%Y-%m-%d')
depreciation_date = datetime(purchase_date.year, 1, 1)
#if we already have some previous validated entries, starting date isn't 1st January but last entry + method period
if (len(posted_depreciation_line_ids)>0):
last_depreciation_date = datetime.strptime(depreciation_lin_obj.browse(cr,uid,posted_depreciation_line_ids[0],context=context).depreciation_date, '%Y-%m-%d')
depreciation_date = (last_depreciation_date+relativedelta(months=+asset.method_period))
else:
depreciation_date = datetime(purchase_date.year, 1, 1)
day = depreciation_date.day
month = depreciation_date.month
year = depreciation_date.year
@ -158,6 +164,10 @@ class account_asset_asset(osv.osv):
for x in range(len(posted_depreciation_line_ids), undone_dotation_number):
i = x + 1
amount = self._compute_board_amount(cr, uid, asset, i, residual_amount, amount_to_depr, undone_dotation_number, posted_depreciation_line_ids, total_days, depreciation_date, context=context)
company_currency = asset.company_id.currency_id.id
current_currency = asset.currency_id.id
# compute amount into company currency
amount = currency_obj.compute(cr, uid, current_currency, company_currency, amount, context=context)
residual_amount -= amount
vals = {
'amount': amount,
@ -191,7 +201,7 @@ class account_asset_asset(osv.osv):
def _amount_residual(self, cr, uid, ids, name, args, context=None):
cr.execute("""SELECT
l.asset_id as id, round(SUM(abs(l.debit-l.credit))) AS amount
l.asset_id as id, SUM(abs(l.debit-l.credit)) AS amount
FROM
account_move_line l
WHERE
@ -349,8 +359,8 @@ class account_asset_depreciation_line(osv.osv):
'sequence': fields.integer('Sequence', required=True),
'asset_id': fields.many2one('account.asset.asset', 'Asset', required=True),
'parent_state': fields.related('asset_id', 'state', type='char', string='State of Asset'),
'amount': fields.float('Depreciation Amount', required=True),
'remaining_value': fields.float('Amount to Depreciate', required=True),
'amount': fields.float('Depreciation Amount', digits_compute=dp.get_precision('Account'), required=True),
'remaining_value': fields.float('Amount to Depreciate', digits_compute=dp.get_precision('Account'),required=True),
'depreciated_value': fields.float('Amount Already Depreciated', required=True),
'depreciation_date': fields.date('Depreciation Date', select=1),
'move_id': fields.many2one('account.move', 'Depreciation Entry'),

View File

@ -105,8 +105,7 @@ account_bank_statement_line_global()
class account_bank_statement_line(osv.osv):
_inherit = 'account.bank.statement.line'
_columns = {
'date': fields.date('Entry Date', required=True, states={'confirm': [('readonly', True)]}),
'val_date': fields.date('Valuta Date', states={'confirm': [('readonly', True)]}),
'val_date': fields.date('Value Date', states={'confirm': [('readonly', True)]}),
'globalisation_id': fields.many2one('account.bank.statement.line.global', 'Globalisation ID',
states={'confirm': [('readonly', True)]},
help="Code to identify transactions belonging to the same globalisation level within a batch payment"),

View File

@ -148,7 +148,7 @@
<field name="name">Bank Statement Lines</field>
<field name="res_model">account.bank.statement.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph,form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'block_statement_line_delete' : 1}</field>
<field name="search_view_id" ref="view_bank_statement_line_filter"/>
<field name="view_id" ref="view_bank_statement_line_list"/>

View File

@ -284,13 +284,13 @@
<record model="ir.ui.view" id="view_account_analytic_account_form_inherit_budget">
<field name="name">account.analytic.account.form.inherot.budget</field>
<field name="name">account.analytic.account.form.inherit.budget</field>
<field name="model">account.analytic.account</field>
<field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
<field name="arch" type="xml">
<notebook position="inside">
<page string="Budget Lines" groups="account.group_account_user">
<field name="crossovered_budget_line" widget="one2many_list" colspan="4" nolabel="1" mode="tree,graph">
<field name="crossovered_budget_line" widget="one2many_list" colspan="4" nolabel="1" mode="tree">
<tree string="Budget Lines" editable="top">
<field name="crossovered_budget_id"/>
<field name="general_budget_id"/>
@ -310,11 +310,6 @@
<field name="paid_date"/>
<field name="planned_amount"/>
</form>
<graph type="bar" string="Lines">
<field name="general_budget_id" />
<field name="planned_amount" operator="+"/>
<field group="True" name="analytic_account_id"/>
</graph>
</field>
</page>
</notebook>

File diff suppressed because it is too large Load Diff

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-02-08 00:35+0000\n"
"PO-Revision-Date: 2012-02-10 15:03+0000\n"
"Last-Translator: Wei \"oldrev\" Li <oldrev@gmail.com>\n"
"PO-Revision-Date: 2012-10-30 15:45+0000\n"
"Last-Translator: ccdos <ccdos@163.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: 2012-10-30 05:13+0000\n"
"X-Generator: Launchpad (build 16206)\n"
"X-Launchpad-Export-Date: 2012-11-03 05:04+0000\n"
"X-Generator: Launchpad (build 16218)\n"
#. module: account_payment
#: field:payment.order,date_scheduled:0
@ -653,7 +653,7 @@ msgstr "公司币别"
#: view:payment.line:0
#: view:payment.order:0
msgid "Payment"
msgstr "付"
msgstr "付"
#. module: account_payment
#: report:payment.order:0

View File

@ -61,6 +61,7 @@ This module manages:
'account_voucher_data.xml',
],
'test' : [
'test/case5_suppl_usd_usd.yml',
'test/account_voucher.yml',
'test/sales_receipt.yml',
'test/sales_payment.yml',

View File

@ -712,14 +712,14 @@ class account_voucher(osv.osv):
'move_line_id':line.id,
'account_id':line.account_id.id,
'amount_original': amount_original,
'amount': (move_line_found == line.id) and min(price, amount_unreconciled) or 0.0,
'amount': (move_line_found == line.id) and min(abs(price), amount_unreconciled) or 0.0,
'date_original':line.date,
'date_due':line.date_maturity,
'amount_unreconciled': amount_unreconciled,
'currency_id': line_currency_id,
}
#split voucher amount by most old first, but only for lines in the same currency
#in case a corresponding move_line hasn't been found, we now try to assign the voucher amount
#on existing invoices: we split voucher amount by most old first, but only for lines in the same currency
if not move_line_found:
if currency_id == line_currency_id:
if line.credit:

View File

@ -7,14 +7,15 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-02-08 01:37+0100\n"
"PO-Revision-Date: 2012-05-10 17:31+0000\n"
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
"PO-Revision-Date: 2012-11-07 13:27+0000\n"
"Last-Translator: Frederic Clementi - Camptocamp.com "
"<frederic.clementi@camptocamp.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: 2012-10-30 05:19+0000\n"
"X-Generator: Launchpad (build 16206)\n"
"X-Launchpad-Export-Date: 2012-11-08 04:47+0000\n"
"X-Generator: Launchpad (build 16232)\n"
#. module: account_voucher
#: view:sale.receipt.report:0
@ -469,7 +470,7 @@ msgstr "Délai moyen de règlement"
#. module: account_voucher
#: field:res.company,income_currency_exchange_account_id:0
msgid "Income Currency Rate"
msgstr "Taux de change d'achat"
msgstr "Compte de gain de change"
#. module: account_voucher
#: code:addons/account_voucher/account_voucher.py:1063
@ -625,9 +626,9 @@ msgid ""
"Unable to create accounting entry for currency rate difference. You have to "
"configure the field 'Income Currency Rate' on the company! "
msgstr ""
"Impossible de créer une entrée de la comptabilité à cause de la différence "
"de taux de change. Vous devez configurer le champ 'Taux de change de vente' "
"sur la société! "
"Impossible de créer une écriture comptable à cause de la différence de taux "
"de change. Vous devez configurer le champ 'Compte de gain de change' au "
"niveau du formulaire de la société! "
#. module: account_voucher
#: view:account.voucher:0 view:sale.receipt.report:0
@ -802,7 +803,7 @@ msgstr "Factures et transactions exceptionnelles"
#. module: account_voucher
#: field:res.company,expense_currency_exchange_account_id:0
msgid "Expense Currency Rate"
msgstr "Taux de change de la dépense"
msgstr "Compte de perte de change"
#. module: account_voucher
#: sql_constraint:account.invoice:0
@ -1089,9 +1090,9 @@ msgid ""
"Unable to create accounting entry for currency rate difference. You have to "
"configure the field 'Expense Currency Rate' on the company! "
msgstr ""
"Impossible de créer une entrée en comptabilité pour la différence de taux de "
"change. Vous devez configurer le champ \"Taux de change d'achat\" de la "
"société ! "
"Impossible de créer une écriture comptable à cause de la différence de taux "
"de change. Vous devez configurer le champ 'Compte de perte de change' au "
"niveau du formulaire de la société! "
#. module: account_voucher
#: field:account.voucher,type:0
@ -1156,7 +1157,7 @@ msgstr "Année"
#. module: account_voucher
#: field:account.voucher.line,amount_unreconciled:0
msgid "Open Balance"
msgstr "Solde initial"
msgstr "Restant dû"
#. module: account_voucher
#: view:account.voucher:0 field:account.voucher,amount:0

View File

@ -0,0 +1,185 @@
-
In order to check the Account_voucher module with multi-currency in OpenERP,
I create a supplier invoices in USD and make the payment in USD but with another exchange rate and with a write-off
-
I create a cash account with currency USD
-
!record {model: account.account, id: account_cash_usd_id}:
currency_id: base.USD
name: "cash account in usd"
code: "Xcash usd"
type: 'liquidity'
user_type: "account.data_account_type_cash"
-
I create currency USD in OpenERP for November of 1.8 Rate
-
!record {model: res.currency.rate, id: nov_usd}:
currency_id: base.USD
name: !eval "'%s-11-01' %(datetime.now().year)"
rate: 1.8
-
I create currency USD in OpenERP for December of 1.5 Rate
-
!record {model: res.currency.rate, id: dec_usd}:
currency_id: base.USD
name: !eval "'%s-12-01' %(datetime.now().year)"
rate: 1.5
-
I set the income and expense currency accounts on the main company
-
!python {model: res.company}: |
from datetime import datetime
vals = {
'income_currency_exchange_account_id': ref('account.o_expense'),
'expense_currency_exchange_account_id': ref('account.o_expense')}
self.write(cr, uid, ref('base.main_company'), vals)
-
I create a bank journal with EUR as currency
-
!record {model: account.journal, id: bank_journal_EUR}:
name: Bank Journal(EUR)
code: BEUR
type: bank
analytic_journal_id: account.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account.cash
default_credit_account_id: account.cash
company_id: base.main_company
view_id: account.account_journal_bank_view
-
I create a bank journal with USD as currency
-
!record {model: account.journal, id: bank_journal_USD}:
name: Bank Journal(USD)
code: BUSD
type: bank
analytic_journal_id: account.sit
sequence_id: account.sequence_bank_journal
default_debit_account_id: account_cash_usd_id
default_credit_account_id: account_cash_usd_id
currency: base.USD
company_id: base.main_company
view_id: account.account_journal_bank_view
-
I set the context as would do the action in supplier invoice menuitem
-
!context
'default_type': 'in_invoice'
-
I create the invoice on 1st november for 1000 USD
-
!record {model: account.invoice, id: account_supplier_invoice_november, view: account.invoice_supplier_form}:
account_id: account.a_pay
company_id: base.main_company
currency_id: base.USD
date_invoice: !eval "'%s-11-01' %(datetime.now().year)"
period_id: account.period_1
invoice_line:
- account_id: account.a_expense
name: '[PCSC234] PC Assemble SC234'
price_unit: 1000.0
quantity: 1.0
product_id: product.product_product_3
uos_id: product.product_uom_unit
journal_id: account.sales_journal
partner_id: base.res_partner_19
reference_type: none
check_total : 1000
-
I Validate invoice by clicking on Validate button
-
!workflow {model: account.invoice, action: invoice_open, ref: account_supplier_invoice_november}
-
I check that first invoice move is correct for creditor account(debit - credit == -555.56)
-
!python {model: account.invoice}: |
invoice_id = self.browse(cr, uid, ref("account_supplier_invoice_november"))
assert invoice_id.move_id, "Move not created for open invoice"
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('account_id', '=', invoice_id.account_id.id)])
move_line = move_line_obj.browse(cr, uid, move_lines[0])
assert (move_line.debit - move_line.credit == -555.56), "Invoice move is incorrect for creditor account"
assert (move_line.amount_currency == -1000), "Amount currency is incorrect for creditor account"
-
I set the context that will be used for the encoding of all the vouchers of this file
-
!context
'type': 'payment'
-
I create the voucher of payment with values $950, journal USD
-
!record {model: account.voucher, id: account_voucher_case_5_supplier_flow, view: view_vendor_payment_form}:
account_id: account.cash
amount: 950.0
company_id: base.main_company
journal_id: bank_journal_USD
name: 'Payment: Case Basic SUPPLIER USD/USD'
partner_id: base.res_partner_19
period_id: account.period_12
date: !eval time.strftime("%Y-12-01")
payment_option: 'with_writeoff'
writeoff_acc_id: account.a_expense
comment: 'Write Off'
type: 'payment'
-
I fill $1000 for the previously encoded invoice
-
!python {model: account.voucher}: |
import netsvc, time
vals = {}
voucher_id = self.browse(cr, uid, ref('account_voucher_case_5_supplier_flow'))
for item in voucher_id.line_dr_ids:
if item.amount_unreconciled == 1000.00:
self.pool.get('account.voucher.line').write(cr, uid, [item.id], {'amount': 1000})
assert (voucher_id.state=='draft'), "Voucher is not in draft state"
-
I check that writeoff amount computed is -50.0
-
!assert {model: account.voucher, id: account_voucher_case_5_supplier_flow}:
- writeoff_amount == -50.0
-
I confirm the voucher
-
!workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_case_5_supplier_flow}
-
I check that the move of my voucher is valid and that it is posted
-
!python {model: account.voucher}: |
voucher_id = self.browse(cr, uid, ref('account_voucher_case_5_supplier_flow'))
assert voucher_id.state == 'posted', "Voucher state is not posted"
for move_line in voucher_id.move_id.line_id:
assert move_line.state == 'valid', "Voucher move is not valid"
-
I check that my creditor account is correct
-
I check that the bank entry is -$950 and 633.33€ as amount_currency and credit, respectively.
-
I check that the creditor account has 1 new line with $1000 and 666.67€ as amount_currency and debit, respectively.
-
I check that my currency rate difference is correct (111.11€ in debit/credit with no amount_currency)
-
I check that my writeoff is correct. 33.34€ in credit with -$50 as amount currency
-
!python {model: account.voucher}: |
voucher_id = self.browse(cr, uid, ref('account_voucher_case_5_supplier_flow'))
for move_line in voucher_id.move_id.line_id:
if move_line.amount_currency == -950.00:
assert move_line.credit == 633.33, "Wrong bank entry."
elif move_line.credit == 111.11 or move_line.debit == 111.11:
assert move_line.amount_currency == 0.00, "Incorrect Currency Difference."
elif move_line.credit == 33.34:
assert move_line.amount_currency == -50.0, "Writeoff amount is wrong."
elif move_line.debit == 666.67:
assert move_line.amount_currency == 1000.0, "Wrong supplier entry."
else:
assert False, "Wrong entry. Unrecognized account move line"
-
I check the residual amount of invoice, it should be 0 in residual currency and 0 in amount_residual and paid
-
!python {model: account.invoice}: |
invoice_id = self.browse(cr, uid, ref("account_supplier_invoice_november"))
move_line_obj = self.pool.get('account.move.line')
move_lines = move_line_obj.search(cr, uid, [('move_id', '=', invoice_id.move_id.id), ('invoice', '=', invoice_id.id), ('account_id', '=', invoice_id.account_id.id)])
move_line = move_line_obj.browse(cr, uid, move_lines[0])
assert (move_line.amount_residual_currency == 0.0 and move_line.amount_residual == 0.0 and invoice_id.state == 'paid') , "Residual amount is not correct for supplier invoice"

View File

@ -290,7 +290,7 @@
<group>
<group>
<field name="state" invisible="1"/>
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer" context="{'search_default_customer': 1}"/>
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Supplier" context="{'search_default_supplier': 1}"/>
<field name="currency_id" invisible="1"/>
<field name="amount" class="oe_inline"
string="Paid Amount"

View File

@ -180,7 +180,7 @@ class account_analytic_account(osv.osv):
'partner_id': fields.many2one('res.partner', 'Customer'),
'user_id': fields.many2one('res.users', 'Project Manager'),
'manager_id': fields.many2one('res.users', 'Account Manager'),
'date_start': fields.date('Date Start'),
'date_start': fields.date('Start Date'),
'date': fields.date('Date End', select=True),
'company_id': fields.many2one('res.company', 'Company', required=False), #not required because we want to allow different companies to use the same chart of account, except for leaf accounts.
'state': fields.selection([('template', 'Template'),('draft','New'),('open','In Progress'), ('cancelled', 'Cancelled'),('pending','To Renew'),('close','Closed')], 'Status', required=True,),
@ -305,7 +305,10 @@ class account_analytic_account(osv.osv):
def create_send_note(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
self.message_post(cr, uid, [obj.id], body=_("Contract for <em>%s</em> has been <b>created</b>.") % (obj.partner_id.name),
message = _("Contract <b>created</b>.")
if obj.partner_id:
message = _("Contract for <em>%s</em> has been <b>created</b>.") % (obj.partner_id.name,)
self.message_post(cr, uid, [obj.id], body=message,
subtype="analytic.mt_account_status", context=context)
account_analytic_account()

View File

@ -23,11 +23,11 @@
<group>
<field name="partner_id" on_change="on_change_partner_id(partner_id, name)"/>
<field name="manager_id"/>
<field name="code"/>
<field name="currency_id" attrs="{'invisible': ['|',('type', '&lt;&gt;', 'view'), ('company_id', '&lt;&gt;', False)]}"/>
</group>
<group>
<field name="type"/>
<field name="code"/>
<field name="type" invisible="context.get('default_type', False)"/>
<field name="parent_id" on_change="on_change_parent(parent_id)" attrs="{'invisible': [('type','in',['contract','template'])]}"/>
<field name="template_id" on_change="on_change_template(template_id,context)" domain="[('type','=','template')]" attrs="{'invisible': [('type','in',['view', 'normal','template'])]}" context="{'default_type' : 'template'}"/>
<field name="company_id" on_change="on_change_company(company_id)" widget="selection" groups="base.group_multi_company" attrs="{'required': [('type','&lt;&gt;','view')]}"/>
@ -40,7 +40,7 @@
Once the end date of the contract is
passed or the maximum number of service
units (e.g. support contract) is
reached, the account manager is warned
reached, the account manager is notified
by email to renew the contract with the
customer.
</p>

View File

@ -3,7 +3,7 @@ openerp.auth_anonymous = function(instance) {
instance.web.Login.include({
start: function() {
var self = this;
return $.when(this._super()).pipe(function() {
return $.when(this._super()).then(function() {
var dblist = self._db_list || [];
if (!self.session.session_is_valid() && dblist.length === 1) {
self.remember_credentials = false;

View File

@ -12,7 +12,7 @@ openerp.auth_oauth = function(instance) {
} else if(this.params.oauth_error === 2) {
this.do_warn("Authentication error","");
}
return d.then(this.do_oauth_load).fail(function() {
return d.done(this.do_oauth_load).fail(function() {
self.do_oauth_load([]);
});
},
@ -23,7 +23,7 @@ openerp.auth_oauth = function(instance) {
do_oauth_load: function() {
var db = this.$("form [name=db]").val();
if (db) {
this.rpc("/auth_oauth/list_providers", { dbname: db }).then(this.on_oauth_loaded);
this.rpc("/auth_oauth/list_providers", { dbname: db }).done(this.on_oauth_loaded);
}
},
on_oauth_loaded: function(result) {

View File

@ -69,7 +69,7 @@ instance.web.Login = instance.web.Login.extend({
_check_error: function() {
var self = this;
if (this.params.loginerror !== undefined) {
this.rpc('/auth_openid/login/status', {}).then(function(result) {
this.rpc('/auth_openid/login/status', {}).done(function(result) {
if (_.contains(['success', 'failure'], result.status) && result.message) {
self.do_warn('Invalid OpenID Login', result.message);
}
@ -106,7 +106,7 @@ instance.web.Login = instance.web.Login.extend({
do_openid_login: function(db, openid_url) {
var self = this;
this.rpc('/auth_openid/login/verify', {'db': db, 'url': openid_url}).then(function(result) {
this.rpc('/auth_openid/login/verify', {'db': db, 'url': openid_url}).done(function(result) {
if (result.error) {
self.do_warn(result.title, result.error);
return;

View File

@ -20,11 +20,10 @@
##############################################################################
import logging
import werkzeug
import openerp
from openerp.modules.registry import RegistryManager
from openerp.addons.web.controllers.main import login_and_redirect
from ..res_users import SignupError
_logger = logging.getLogger(__name__)
@ -41,22 +40,18 @@ class Controller(openerp.addons.web.http.Controller):
user_info = res_partner.signup_retrieve_info(cr, openerp.SUPERUSER_ID, token)
return user_info
@openerp.addons.web.http.httprequest
def signup(self, req, dbname, token, name, login, password, state=''):
""" sign up a user (new or existing), and log it in """
url = '/'
@openerp.addons.web.http.jsonrequest
def signup(self, req, dbname, token, name, login, password):
""" sign up a user (new or existing)"""
registry = RegistryManager.get(dbname)
with registry.cursor() as cr:
res_users = registry.get('res.users')
values = {'name': name, 'login': login, 'password': password}
try:
res_users = registry.get('res.users')
values = {'name': name, 'login': login, 'password': password}
credentials = res_users.signup(cr, openerp.SUPERUSER_ID, values, token)
cr.commit()
return login_and_redirect(req, *credentials, redirect_url='/#%s'%state)
except Exception as e:
# signup error
_logger.exception('error when signup')
url = "/#action=login&error_message=%s" % werkzeug.urls.url_quote(e.message)
return werkzeug.utils.redirect(url)
res_users.signup(cr, openerp.SUPERUSER_ID, values, token)
except SignupError, e:
return {'error': openerp.tools.exception_to_unicode(e)}
cr.commit()
return {}
# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -29,6 +29,9 @@ from openerp import SUPERUSER_ID
from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
from openerp.tools.safe_eval import safe_eval
class SignupError(Exception):
pass
def random_token():
# the token has an entropy of about 120 bits (6 bits/char * 20 chars)
chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
@ -101,12 +104,12 @@ class res_partner(osv.Model):
partner_ids = self.search(cr, uid, [('signup_token', '=', token)], context=context)
if not partner_ids:
if raise_exception:
raise Exception("Signup token '%s' is not valid" % token)
raise SignupError("Signup token '%s' is not valid" % token)
return False
partner = self.browse(cr, uid, partner_ids[0], context)
if check_validity and not partner.signup_valid:
if raise_exception:
raise Exception("Signup token '%s' is no longer valid" % token)
raise SignupError("Signup token '%s' is no longer valid" % token)
return False
return partner
@ -194,7 +197,7 @@ class res_users(osv.Model):
# check that uninvited users may sign up
if 'partner_id' not in values:
if not safe_eval(ir_config_parameter.get_param(cr, uid, 'auth_signup.allow_uninvited', 'False')):
raise Exception('Signup is not allowed for uninvited users')
raise SignupError('Signup is not allowed for uninvited users')
# create a copy of the template user (attached to a specific partner_id if given)
values['active'] = True

View File

@ -8,12 +8,20 @@ openerp.auth_signup = function(instance) {
var d = this._super();
// to switch between the signup and regular login form
this.$('a.oe_signup_signup').click(function() {
this.$('a.oe_signup_signup').click(function(ev) {
if (ev) {
ev.preventDefault();
}
self.$el.addClass("oe_login_signup");
return false;
});
this.$('a.oe_signup_back').click(function() {
this.$('a.oe_signup_back').click(function(ev) {
if (ev) {
ev.preventDefault();
}
self.$el.removeClass("oe_login_signup");
delete self.params.token;
return false;
});
// if there is an error message in params, show it then forget it
@ -90,10 +98,19 @@ openerp.auth_signup = function(instance) {
name: name,
login: login,
password: password,
state: $.param(this.params)
//state: $.param(this.params)
};
var url = "/auth_signup/signup?" + $.param(params);
window.location = url;
var self = this,
super_ = this._super;
this.rpc('/auth_signup/signup', params)
.done(function(result) {
if (result.error) {
self.show_error(result.error);
} else {
super_.apply(self, [ev]);
}
});
} else {
// regular login
this._super(ev);

View File

@ -300,7 +300,7 @@ trigger date, like sending a reminder 15 minutes before a meeting."),
write['date_action_last'] = time.strftime('%Y-%m-%d %H:%M:%S')
if hasattr(obj, 'state') and action.act_state:
write['state'] = action.act_state
model_obj.write(cr, uid, [obj.id], write, context)
if hasattr(obj, 'state') and hasattr(obj, 'message_post') and action.act_state:
model_obj.message_post(cr, uid, [obj], _(action.act_state), context=context)

View File

@ -16,10 +16,10 @@
<group col="4">
<field name="name"/>
<field name="model_id"/>
<field name="model" invisible="1"/>
<field name="filter_id" domain="[('model_id','=',model)]" context="{'default_model_id': model}"/>
<field name="sequence"/>
<field name="active"/>
<field name="model" invisible="1"/>
</group>
<notebook>
<page string="Conditions">

View File

@ -336,7 +336,7 @@ class calendar_attendee(osv.osv):
('non-participant', 'For information Purpose')], 'Role', \
help='Participation role for the calendar user'),
'state': fields.selection([('needs-action', 'Needs Action'),
('tentative', 'Tentative'),
('tentative', 'Uncertain'),
('declined', 'Declined'),
('accepted', 'Accepted'),
('delegated', 'Delegated')], 'Status', readonly=True, \
@ -559,7 +559,8 @@ property or property parameter."),
for vals in self.browse(cr, uid, ids, context=context):
if vals.ref and vals.ref.user_id:
mod_obj = self.pool.get(vals.ref._name)
defaults = {'user_id': vals.user_id.id, 'organizer_id': vals.ref.user_id.id}
res=mod_obj.read(cr,uid,[vals.ref.id],['duration','class'],context)
defaults = {'user_id': vals.user_id.id, 'organizer_id': vals.ref.user_id.id,'duration':res[0]['duration'],'class':res[0]['class']}
mod_obj.copy(cr, uid, vals.ref.id, default=defaults, context=context)
self.write(cr, uid, vals.id, {'state': 'accepted'}, context)
@ -1012,7 +1013,7 @@ class calendar_event(osv.osv):
'Show Time as', states={'done': [('readonly', True)]}),
'base_calendar_url': fields.char('Caldav URL', size=264),
'state': fields.selection([
('tentative', 'Tentative'),
('tentative', 'Uncertain'),
('cancelled', 'Cancelled'),
('confirmed', 'Confirmed'),
], 'Status', readonly=True),

View File

@ -89,7 +89,8 @@
<page string="Meeting Details">
<group>
<group>
<field name="date" string="Starting at"/>
<field name="date" string="Starting at"
on_change="onchange_dates(date, duration, False, allday)"/>
<label for="duration"/>
<div>
<field name="duration" widget="float_time"
@ -100,7 +101,7 @@
<label for="allday" string="All Day?"/>)
</div>
<field name="date_deadline" groups="base.group_no_one"
attrs="{'invisible': [('allday','=',True)]}"
attrs="{'invisible': ['|', ('allday','=',True), ('duration','&lt;', 24)]}"
on_change="onchange_dates(date,False,date_deadline)"/>
</group>
<group>

View File

@ -1146,7 +1146,7 @@ msgstr ""
#: selection:calendar.attendee,state:0
#: selection:calendar.event,state:0
#: selection:calendar.todo,state:0
msgid "Tentative"
msgid "Uncertain"
msgstr ""
#. module: base_calendar

View File

@ -25,7 +25,8 @@
'description': """
Automated Translations through Gengo API
----------------------------------------
This module will install passive scheduler job for automated translations
This module will install passive scheduler job for automated translations
using the Gengo API. To activate it, you must
1) Configure your Gengo authentication parameters under `Settings > Companies > Gengo Parameters`
2) Launch the wizard under `Settings > Application Terms > Gengo: Manual Request of Translation` and follow the wizard.

View File

@ -26,7 +26,7 @@ Re-implement openerp's file import system:
'author': 'OpenERP SA',
'depends': ['base'],
'installable': True,
'auto_install': True,
'auto_install': False,
'css': [
'static/lib/select2/select2.css',
'static/src/css/import.css',

View File

@ -0,0 +1,15 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_base_import_tests_models_char,base.import.tests.models.char,model_base_import_tests_models_char,base.group_user,1,1,1,1
access_base_import_tests_models_char_required,base.import.tests.models.char.required,model_base_import_tests_models_char_required,base.group_user,1,1,1,1
access_base_import_tests_models_char_readonly,base.import.tests.models.char.readonly,model_base_import_tests_models_char_readonly,base.group_user,1,1,1,1
access_base_import_tests_models_char_states,base.import.tests.models.char.states,model_base_import_tests_models_char_states,base.group_user,1,1,1,1
access_base_import_tests_models_char_noreadonly,base.import.tests.models.char.noreadonly,model_base_import_tests_models_char_noreadonly,base.group_user,1,1,1,1
access_base_import_tests_models_char_stillreadonly,base.import.tests.models.char.stillreadonly,model_base_import_tests_models_char_stillreadonly,base.group_user,1,1,1,1
access_base_import_tests_models_m2o,base.import.tests.models.m2o,model_base_import_tests_models_m2o,base.group_user,1,1,1,1
access_base_import_tests_models_m2o_related,base.import.tests.models.m2o.related,model_base_import_tests_models_m2o_related,base.group_user,1,1,1,1
access_base_import_tests_models_m2o_required,base.import.tests.models.m2o.required,model_base_import_tests_models_m2o_required,base.group_user,1,1,1,1
access_base_import_tests_models_m2o_required_related,base.import.tests.models.m2o.required.related,model_base_import_tests_models_m2o_required_related,base.group_user,1,1,1,1
access_base_import_tests_models_o2m,base.import.tests.models.o2m,model_base_import_tests_models_o2m,base.group_user,1,1,1,1
access_base_import_tests_models_o2m_child,base.import.tests.models.o2m.child,model_base_import_tests_models_o2m_child,base.group_user,1,1,1,1
access_base_import_tests_models_preview,base.import.tests.models.preview,model_base_import_tests_models_preview,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_base_import_tests_models_char base.import.tests.models.char model_base_import_tests_models_char base.group_user 1 1 1 1
3 access_base_import_tests_models_char_required base.import.tests.models.char.required model_base_import_tests_models_char_required base.group_user 1 1 1 1
4 access_base_import_tests_models_char_readonly base.import.tests.models.char.readonly model_base_import_tests_models_char_readonly base.group_user 1 1 1 1
5 access_base_import_tests_models_char_states base.import.tests.models.char.states model_base_import_tests_models_char_states base.group_user 1 1 1 1
6 access_base_import_tests_models_char_noreadonly base.import.tests.models.char.noreadonly model_base_import_tests_models_char_noreadonly base.group_user 1 1 1 1
7 access_base_import_tests_models_char_stillreadonly base.import.tests.models.char.stillreadonly model_base_import_tests_models_char_stillreadonly base.group_user 1 1 1 1
8 access_base_import_tests_models_m2o base.import.tests.models.m2o model_base_import_tests_models_m2o base.group_user 1 1 1 1
9 access_base_import_tests_models_m2o_related base.import.tests.models.m2o.related model_base_import_tests_models_m2o_related base.group_user 1 1 1 1
10 access_base_import_tests_models_m2o_required base.import.tests.models.m2o.required model_base_import_tests_models_m2o_required base.group_user 1 1 1 1
11 access_base_import_tests_models_m2o_required_related base.import.tests.models.m2o.required.related model_base_import_tests_models_m2o_required_related base.group_user 1 1 1 1
12 access_base_import_tests_models_o2m base.import.tests.models.o2m model_base_import_tests_models_o2m base.group_user 1 1 1 1
13 access_base_import_tests_models_o2m_child base.import.tests.models.o2m.child model_base_import_tests_models_o2m_child base.group_user 1 1 1 1
14 access_base_import_tests_models_preview base.import.tests.models.preview model_base_import_tests_models_preview base.group_user 1 1 1 1

View File

@ -0,0 +1,6 @@
External ID,Name,Parent Category/External ID
a1,Expenses,product.product_category_all
a2,Other Products,product.product_category_all
a3,Sellable Products,product.product_category_all
a4,Tables,a1
a5,Seating furniture,a2
1 External ID Name Parent Category/External ID
2 a1 Expenses product.product_category_all
3 a2 Other Products product.product_category_all
4 a3 Sellable Products product.product_category_all
5 a4 Tables a1
6 a5 Seating furniture a2

View File

@ -0,0 +1,6 @@
External ID,Name,Internal Reference,Category/External ID,Can be Expensed,Can be Purchased,Can be Sold,Sale Price,Cost,Supply Method,Product Type,Procurement Method
a6,Aluminum Stool,ALS,a5,False,True,True,49.00,25.00,Buy,Stockable Product,Make to Stock
a7,Chair,CHR,a5,False,True,True,89.00,40.00,Buy,Stockable Product,Make to Stock
a8,Table,TBL,a4,False,True,True,169.00,100.00,Buy,Stockable Product,Make to Stock
a9,Software Book Tutorial,SBT,a2,False,True,False,19.00,8.00,Buy,Consumable,Make to Stock
a10,Fuel,FL,a1,True,False,False,0.30,0.25,Buy,Service,Make to Stock
1 External ID Name Internal Reference Category/External ID Can be Expensed Can be Purchased Can be Sold Sale Price Cost Supply Method Product Type Procurement Method
2 a6 Aluminum Stool ALS a5 False True True 49.00 25.00 Buy Stockable Product Make to Stock
3 a7 Chair CHR a5 False True True 89.00 40.00 Buy Stockable Product Make to Stock
4 a8 Table TBL a4 False True True 169.00 100.00 Buy Stockable Product Make to Stock
5 a9 Software Book Tutorial SBT a2 False True False 19.00 8.00 Buy Consumable Make to Stock
6 a10 Fuel FL a1 True False False 0.30 0.25 Buy Service Make to Stock

View File

@ -0,0 +1,6 @@
Name,Internal Reference,Can be Expensed,Can be Purchased,Can be Sold,Sale Price,Cost,Supply Method,Product Type,Procurement Method
Aluminum Stool,ALS,False,True,True,49.00,25.00,Buy,Stockable Product,Make to Stock
Chair,CHR,False,True,True,89.00,40.00,Buy,Stockable Product,Make to Stock
Table,TBL,False,True,True,169.00,100.00,Buy,Stockable Product,Make to Stock
Software Book Tutorial,SBT,False,True,False,19.00,8.00,Buy,Consumable,Make to Stock
Fuel,FL,True,False,False,0.30,0.25,Buy,Service,Make to Stock
1 Name Internal Reference Can be Expensed Can be Purchased Can be Sold Sale Price Cost Supply Method Product Type Procurement Method
2 Aluminum Stool ALS False True True 49.00 25.00 Buy Stockable Product Make to Stock
3 Chair CHR False True True 89.00 40.00 Buy Stockable Product Make to Stock
4 Table TBL False True True 169.00 100.00 Buy Stockable Product Make to Stock
5 Software Book Tutorial SBT False True False 19.00 8.00 Buy Consumable Make to Stock
6 Fuel FL True False False 0.30 0.25 Buy Service Make to Stock

View File

@ -0,0 +1,155 @@
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: companies; Type: TABLE; Schema: public; Owner: fp; Tablespace:
--
CREATE TABLE companies (
id integer NOT NULL,
company_name character varying
);
ALTER TABLE public.companies OWNER TO fp;
--
-- Name: companies_id_seq; Type: SEQUENCE; Schema: public; Owner: fp
--
CREATE SEQUENCE companies_id_seq
START WITH 1
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.companies_id_seq OWNER TO fp;
--
-- Name: companies_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: fp
--
ALTER SEQUENCE companies_id_seq OWNED BY companies.id;
--
-- Name: companies_id_seq; Type: SEQUENCE SET; Schema: public; Owner: fp
--
SELECT pg_catalog.setval('companies_id_seq', 3, true);
--
-- Name: persons; Type: TABLE; Schema: public; Owner: fp; Tablespace:
--
CREATE TABLE persons (
id integer NOT NULL,
company_id integer,
person_name character varying
);
ALTER TABLE public.persons OWNER TO fp;
--
-- Name: persons_id_seq; Type: SEQUENCE; Schema: public; Owner: fp
--
CREATE SEQUENCE persons_id_seq
START WITH 1
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.persons_id_seq OWNER TO fp;
--
-- Name: persons_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: fp
--
ALTER SEQUENCE persons_id_seq OWNED BY persons.id;
--
-- Name: persons_id_seq; Type: SEQUENCE SET; Schema: public; Owner: fp
--
SELECT pg_catalog.setval('persons_id_seq', 4, true);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: fp
--
ALTER TABLE ONLY companies ALTER COLUMN id SET DEFAULT nextval('companies_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: fp
--
ALTER TABLE ONLY persons ALTER COLUMN id SET DEFAULT nextval('persons_id_seq'::regclass);
--
-- Data for Name: companies; Type: TABLE DATA; Schema: public; Owner: fp
--
COPY companies (id, company_name) FROM stdin;
1 Bigees
2 Organi
3 Boum
\.
--
-- Data for Name: persons; Type: TABLE DATA; Schema: public; Owner: fp
--
COPY persons (id, company_id, person_name) FROM stdin;
1 1 Fabien
2 1 Laurence
3 2 Eric
4 3 Ramsy
\.
--
-- Name: companies_pkey; Type: CONSTRAINT; Schema: public; Owner: fp; Tablespace:
--
ALTER TABLE ONLY companies
ADD CONSTRAINT companies_pkey PRIMARY KEY (id);
--
-- Name: persons_company_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: fp
--
ALTER TABLE ONLY persons
ADD CONSTRAINT persons_company_id_fkey FOREIGN KEY (company_id) REFERENCES companies(id);
--
-- PostgreSQL database dump complete
--

View File

@ -0,0 +1,6 @@
Name,Reference,Tags,Customer,Street,City,Country
Credit & Leasing,3,Services,True,Central Avenue 814,Johannesburg,South Africa
Services & Finance,5,"Consultancy Services,IT Services",True,Grove Road 5,London,United Kingdom
Hydra Supplies,6,"Manufacturer,Retailer",True,Palm Street 9,Los Angeles,United States
Bolts & Screws,8,"Wholesaler,Components Buyer",True,Rua Américo 1000,Campinas,Brazil
National Parts & Supplies,18,"Manufacturer,Wholesaler",True,Guangdong Way 20,Shenzen,China
1 Name Reference Tags Customer Street City Country
2 Credit & Leasing 3 Services True Central Avenue 814 Johannesburg South Africa
3 Services & Finance 5 Consultancy Services,IT Services True Grove Road 5 London United Kingdom
4 Hydra Supplies 6 Manufacturer,Retailer True Palm Street 9 Los Angeles United States
5 Bolts & Screws 8 Wholesaler,Components Buyer True Rua Américo 1000 Campinas Brazil
6 National Parts & Supplies 18 Manufacturer,Wholesaler True Guangdong Way 20 Shenzen China

View File

@ -0,0 +1,10 @@
Order Date,Order Reference,Supplier,Destination,Pricelist,Order Lines / Product,Order Lines / Quantity
2012-12-15,PO00008,ASUSTeK,Stock,Default Purchase Pricelist,ADPT,20
,,,,,CARD,30
,,,,,C-Case,40
2012-12-15,PO00009,Axelor,Stock,Default Purchase Pricelist,CD,5
,,,,,CPUa8,15
2012-12-15,PO000010,China Export,Stock,Default Purchase Pricelist,HDD SH-1,10
,,,,,HDD SH-2,20
,,,,,LAP-CUS,35
,,,,,LAP-E5,40
1 Order Date Order Reference Supplier Destination Pricelist Order Lines / Product Order Lines / Quantity
2 2012-12-15 PO00008 ASUSTeK Stock Default Purchase Pricelist ADPT 20
3 CARD 30
4 C-Case 40
5 2012-12-15 PO00009 Axelor Stock Default Purchase Pricelist CD 5
6 CPUa8 15
7 2012-12-15 PO000010 China Export Stock Default Purchase Pricelist HDD SH-1 10
8 HDD SH-2 20
9 LAP-CUS 35
10 LAP-E5 40

View File

@ -0,0 +1,8 @@
Name,Address type,Street,City,Country,Tags,Supplier,Customer,Is a company,Companies that refers to partner / Parent company
Wood y Wood Pecker,,"Snow Street, 25",Kainuu,Finland,Supplier,1,0,1,
Roger Pecker,Default,"Snow Street, 27",Kainuu,Finland,Supplier,1,0,0,Wood y Wood Pecker
Sharon Pecker,Delivery,"Snow Street, 28",Kainuu,Finland,Supplier,1,0,0,Wood y Wood Pecker
Thomas Pecker,Contact,"Snow Street, 27",Kainuu,Finland,Supplier,1,0,0,Wood y Wood Pecker
Vicking Direct,,"Atonium Street, 45a",Brussels,Belgium,Supplier,1,0,1,
Yvan Holiday,Invoice,"Atonium Street, 45b",Brussels,Belgium,Supplier,1,0,0,Vicking Direct
Jack Unsworth,Contact,"Atonium Street, 45a",Brussels,Belgium,Supplier,1,0,0,Vicking Direct
1 Name Address type Street City Country Tags Supplier Customer Is a company Companies that refers to partner / Parent company
2 Wood y Wood Pecker Snow Street, 25 Kainuu Finland Supplier 1 0 1
3 Roger Pecker Default Snow Street, 27 Kainuu Finland Supplier 1 0 0 Wood y Wood Pecker
4 Sharon Pecker Delivery Snow Street, 28 Kainuu Finland Supplier 1 0 0 Wood y Wood Pecker
5 Thomas Pecker Contact Snow Street, 27 Kainuu Finland Supplier 1 0 0 Wood y Wood Pecker
6 Vicking Direct Atonium Street, 45a Brussels Belgium Supplier 1 0 1
7 Yvan Holiday Invoice Atonium Street, 45b Brussels Belgium Supplier 1 0 0 Vicking Direct
8 Jack Unsworth Contact Atonium Street, 45a Brussels Belgium Supplier 1 0 0 Vicking Direct

View File

@ -0,0 +1,6 @@
"Order Reference","Supplier","Destination","Pricelist","Order Lines / Product","Order Lines / Quantity"
"PO000020","ASUSTeK","Stock","Default Purchase Pricelist","ADPT",20
,,,,"CARD",30
,,,,"C-Case",40
"PO000021","Axelor","Stock","Default Purchase Pricelist","CD",5
,,,,"CPUa8",15
1 Order Reference Supplier Destination Pricelist Order Lines / Product Order Lines / Quantity
2 PO000020 ASUSTeK Stock Default Purchase Pricelist ADPT 20
3 CARD 30
4 C-Case 40
5 PO000021 Axelor Stock Default Purchase Pricelist CD 5
6 CPUa8 15

View File

@ -1,14 +1,17 @@
.oe_import{
display: inline-block;
width: 600px;
padding: 16px;
}
.oe_import > p {
margin-left: 8px;
margin-right: 8px;
text-align: justify
}
.oe_import h2 {
margin-top: 0;
margin-bottom: 5px;
}
.oe_padding {
padding: 13px;
}
/* ----------- IMPORT BOX ----------- */
.oe_import .oe_import_box{
@ -17,6 +20,7 @@
background: #F0EEEE;
border-radius: 3px;
border: solid 1px #dddddd;
width: 600px;
}
.oe_import .oe_import_toggle{
margin-top: 8px;

View File

@ -123,10 +123,10 @@ openerp.base_import = function (instance) {
this.exit();
}
},
init: function (parent, params) {
init: function (parent, action) {
var self = this;
this._super.apply(this, arguments);
this.res_model = params.model;
this.res_model = action.params.model;
// import object id
this.id = null;
this.Import = new instance.web.Model('base_import.import');
@ -139,7 +139,7 @@ openerp.base_import = function (instance) {
this._super(),
this.Import.call('create', [{
'res_model': this.res_model
}]).then(function (id) {
}]).done(function (id) {
self.id = id;
self.$('input[name=import_id]').val(id);
})
@ -179,7 +179,8 @@ openerp.base_import = function (instance) {
//- File & settings change section
onfile_loaded: function () {
this.$('.oe_import_button').prop('disabled', true);
this.$('.oe_import_button, .oe_import_file_reload')
.prop('disabled', true);
if (!this.$('input.oe_import_file').val()) { return; }
this.$el.removeClass('oe_import_preview oe_import_error');
@ -189,7 +190,8 @@ openerp.base_import = function (instance) {
},
onpreviewing: function () {
var self = this;
this.$('.oe_import_button').prop('disabled', true);
this.$('.oe_import_button, .oe_import_file_reload')
.prop('disabled', true);
this.$el.addClass('oe_import_with_file');
// TODO: test that write // succeeded?
this.$el.removeClass('oe_import_preview_error oe_import_error');
@ -198,13 +200,14 @@ openerp.base_import = function (instance) {
!this.$('input.oe_import_has_header').prop('checked'));
this.Import.call(
'parse_preview', [this.id, this.import_options()])
.then(function (result) {
.done(function (result) {
var signal = result.error ? 'preview_failed' : 'preview_succeeded';
self[signal](result);
});
},
onpreview_error: function (event, from, to, result) {
this.$('.oe_import_options').show();
this.$('.oe_import_file_reload').prop('disabled', false);
this.$el.addClass('oe_import_preview_error oe_import_error');
this.$('.oe_import_error_report').html(
QWeb.render('ImportView.preview.error', result));
@ -212,7 +215,8 @@ openerp.base_import = function (instance) {
onpreview_success: function (event, from, to, result) {
this.$('.oe_import_import').removeClass('oe_highlight');
this.$('.oe_import_validate').addClass('oe_highlight');
this.$('.oe_import_button').prop('disabled', false);
this.$('.oe_import_button, .oe_import_file_reload')
.prop('disabled', false);
this.$el.addClass('oe_import_preview');
this.$('table').html(QWeb.render('ImportView.preview', result));
@ -337,11 +341,11 @@ openerp.base_import = function (instance) {
},
onvalidate: function () {
return this.call_import({ dryrun: true })
.then(this.proxy('validated'));
.done(this.proxy('validated'));
},
onimport: function () {
var self = this;
return this.call_import({ dryrun: false }).then(function (message) {
return this.call_import({ dryrun: false }).done(function (message) {
if (!_.any(message, function (message) {
return message.type === 'error' })) {
self['import_succeeded']();

View File

@ -2,20 +2,25 @@
<t t-name="ImportView">
<t t-set="_id" t-value="_.uniqueId('export')"/>
<form action="" method="post" enctype="multipart/form-data" class="oe_import">
<header>
<button type="button" disabled="disabled"
class="oe_button oe_import_button oe_import_validate oe_highlight"
>Validate</button>
<button type="button" disabled="disabled"
class="oe_button oe_import_button oe_import_import"
>Import</button>
<span class="oe_fade">or</span>
<a class="oe_import_cancel" href="#">Cancel</a>
</header>
<input type="hidden" name="session_id"
t-att-value="widget.session.session_id"/>
<input type="hidden" name="import_id"/>
<h2>Upload your file</h2>
<div class="oe_view_manager oe_view_manager_current">
<div class="oe_view_manager_header oe_padding">
<h2>
Import a CSV File
</h2>
<input type="hidden" name="session_id"
t-att-value="widget.session.session_id"/>
<input type="hidden" name="import_id"/>
<button type="button" disabled="disabled"
class="oe_button oe_import_button oe_import_validate oe_highlight"
>Validate</button>
<button type="button" disabled="disabled"
class="oe_button oe_import_button oe_import_import"
>Import</button>
<span class="oe_fade">or</span>
<a class="oe_import_cancel" href="#">Cancel</a>
</div>
</div>
<p>Select the <a
href="http://en.wikipedia.org/wiki/Comma-separated_values"
class="oe_import_csv" target="_blank">.CSV</a>
@ -25,7 +30,9 @@
<label t-attf-for="file_#{_id}" autofocus="autofocus">CSV File:</label>
<input type="file" id-attf-id="file_#{_id}"
name="file" class="oe_import_file"/>
<button type="button" class="oe_import_file_reload">
<button type="button" class="oe_import_file_reload"
disabled="disabled"
title="Reload data to check changes.">
<img src="/web/static/src/img/icons/gtk-refresh.png"/>
</button>
<div class="oe_import_with_file">
@ -44,7 +51,7 @@
</div>
</div>
<div class="oe_import_with_file">
<div class="oe_import_with_file oe_padding">
<h2>Map your data to OpenERP</h2>
<input type="checkbox" class="oe_import_has_header"
id="oe_import_has_header" checked="checked"/>
@ -59,6 +66,7 @@
<table class="oe_import_grid" />
<h2>Frequently Asked Questions</h2>
<dl>
<dt><a href="#" class="oe_import_toggle">
Need to import data from an other application?</a></dt>
@ -78,9 +86,259 @@
whenever possible</p>
</dd>
</dl>
<dl>
<dt><a href="#" class="oe_import_toggle">
What can I do when the Import preview table isn't
displayed correctly?</a></dt>
<dd>
<p>By default the Import preview is set on commas as
field separators and quotation marks as text
delimiters. If your csv file does not have these
settings, you can modify the File Format Options
(displayed under the Browse CSV file bar after you
select your file).</p> <p>Note that if your CSV file
has a tabulation as separator, OpenERP will not
detect the separations. You will need to change the
file format options in your spreadsheet application.
See the following question.</p>
</dd>
</dl>
<dl>
<dt><a href="#" class="oe_import_toggle">
How can I change the CSV file format options when
saving in my spreadsheet application?</a></dt>
<dd>
<p>If you edit and save CSV files in speadsheet
applications, your computer's regional settings will
be applied for the separator and delimiter.
We suggest you use OpenOffice or LibreOffice Calc
as they will allow you to modify all three options
(in 'Save As' dialog box > Check the box 'Edit filter
settings' > Save).</p> <p>Microsoft Excel will allow
you to modify only the encoding when saving
(in 'Save As' dialog box > click 'Tools' dropdown
list > Encoding tab).</p>
</dd>
</dl>
<dl>
<dt><a href="#" class="oe_import_toggle">
What's the difference between Database ID and
External ID?</a></dt>
<dd>
<p>Some fields define a relationship with another
object. For example, the country of a contact is a
link to a record of the 'Country' object. When you
want to import such fields, OpenERP will have to
recreate links between the different records.
To help you import such fields, OpenERP provides 3
mechanisms. You must use one and only one mechanism
per field you want to import.</p> <p>For example, to
reference the country of a contact, OpenERP proposes
you 3 different fields to import: <ul>
<li>Country: the name or code of the country</li>
<li>Country/Database ID: the unique OpenERP ID for a
record, defined by the ID postgresql column</li>
<li>Country/External ID: the ID of this record
referenced in another application (or the .XML file
that imported it)</li> </ul></p> <p>For the country
Belgium, you can use one of these 3 ways to import:
<ul> <li>Country: Belgium</li> <li>Country/Database
ID: 21</li> <li>Country/External ID: base.be</li>
</ul></p> <p>According to your need, you should use
one of these 3 ways to reference records in relations.
Here is when you should use one or the other,
according to your need: <ul> <li>Use Country: This is
the easiest way when your data come from CSV files
that have been created manually.</li> <li>Use
Country/Database ID: You should rarely use this
notation. It's mostly used by developers as it's main
advantage is to never have conflicts (you may have
several records with the same name, but they always
have a unique Database ID)</li> <li>Use
Country/External ID: Use External ID when you import
data from a third party application.</li> </ul></p>
<p>When you use External IDs, you can import CSV files
with the "External ID" column to define the External
ID of each record you import. Then, you will be able
to make a reference to that record with columns like
"Field/External ID". The following two CSV files give
you an example for Products and their Categories.</p>
<a href="/base_import/static/csv/External_id_3rd_party_application_product_categories.csv">CSV file for categories</a><br/>
<a href="/base_import/static/csv/External_id_3rd_party_application_products.csv">CSV file for Products</a>
</dd>
</dl>
<dl>
<dt><a href="#" class="oe_import_toggle">
What can I do if I have multiple matches for a field?
</a></dt>
<dd>
<p>If for example you have two product categories
with the child name "Sellable" (ie. "Misc.
Products/Sellable" &amp; "Other Products/Sellable"),
your validation is halted but you may still import
your data. However, we recommend you do not import the
data because they will all be linked to the first
'Sellable' category found in the Product Category list
("Misc. Products/Sellable"). We recommend you modify
one of the duplicates' values or your product category
hierarchy.<br/>
However if you do not wish to change your
configuration of product categories, we recommend you
use make use of the external ID for this field
'Category'.</p>
</dd>
</dl>
<dl>
<dt><a href="#" class="oe_import_toggle">
How can I import a many2many relationship field
(e.g. a customer that has multiple tags)?</a></dt>
<dd>
<p>The tags should be separated by a comma without any
spacing. For example, if you want you customer to be
lined to both tags 'Manufacturer' and 'Retailer'
then you will encode it as follow "Manufacturer,
Retailer" in the same column of your CSV file.</p>
<a href="/base_import/static/csv/m2m_customers_tags.csv">
CSV file for Manufacturer, Retailer</a><br/>
</dd>
</dl>
<dl>
<dt><a href="#" class="oe_import_toggle">
How can I import a one2many relationship (e.g. several
Order Lines of a Sale Order)?</a></dt>
<dd>
<p>If you want to import sales order having several
order lines; for each order line, you need to reserve
a specific row in the CSV file. The first order line
will be imported on the same row as the information
relative to order. Any additional lines will need an
addtional row that does not have any information in
the fields relative to the order.</p>
<p>As an example, here is
purchase.order_functional_error_line_cant_adpat.CSV
file of some quotations you can import, based on demo
data.</p>
<a href="/base_import/static/csv/purchase.order_functional_error_line_cant_adpat.csv">File for some Quotations</a>
<p>The following CSV file shows how to import purchase
orders with their respective purchase order lines:</p>
<a href="/base_import/static/csv/o2m_purchase_order_lines.csv">Purchase orders with their respective purchase order lines</a>
<p>The following CSV file shows how to import
suppliers and their respective contacts</p>
<a href="/base_import/static/csv/o2m_suppliers_contacts.csv">Suppliers and their respective contacts</a>
</dd>
</dl>
<dl>
<dt><a href="#" class="oe_import_toggle">
Can I import several times the same record?</a></dt>
<dd>
<p>If you import a file that contains one of the
column "External ID" or "Database ID", records that
have already been imported will be modified instead of
being created. This is very usefull as it allows you
to import several times the same CSV file while having
made some changes in between two imports. OpenERP will
take care of creating or modifying each record
depending if it's new or not.</p> <p> This feature
allows you to use the Import/Export tool of OpenERP to
modify a batch of records in your favorite spreadsheet
application.</p>
</dd>
</dl>
<dl>
<dt><a href="#" class="oe_import_toggle">
What happens if I do not provide a value for a
specific field?</a></dt>
<dd>
<p>If you do not set all fields in your CSV file,
OpenERP will assign the default value for every non
defined fields. But if you
set fields with empty values in your CSV file, OpenERP
will set the EMPTY value in the field, instead of
assigning the default value.</p>
</dd>
</dl>
<dl>
<dt><a href="#" class="oe_import_toggle">
How to export/import different tables from an SQL
application to OpenERP?</a></dt>
<dd>
<p>If you need to import data from different tables,
you will have to recreate relations between records
belonging to different tables. (e.g. if you import
companies and persons, you will have to recreate the
link between each person and the company they work
for).</p> <p>To manage relations between tables,
you can use the "External ID" facilities of OpenERP.
The "External ID" of a record is the unique identifier
of this record in another application. This "External
ID" must be unique accoss all the records of all
objects, so it's a good practice to prefix this
"External ID" with the name of the application or
table. (like 'company_1', 'person_1' instead of '1')
</p> <p>As an example, suppose you have a SQL database
with two tables you want to import: companies and
persons. Each person belong to one company, so you
will have to recreate the link between a person and
the company he work for. (If you want to test this
example, here is a <a href="/base_import/static/csv/database_import_test.sql">
dump of such a PostgreSQL database</a>).</p>
<p>We will first export all companies and their
"External ID". In PSQL, write the following command:
</p> <p>&#160;&#160;&#160;&#160;copy
(select 'company_'||id as "External ID",company_name
as "Name",'True' as "Is a Company" from companies) TO
'/tmp/company.csv' with CSV HEADER;</p>
<p>This SQL command will create the following CSV file:
<br/>&#160;&#160;&#160;&#160;External ID,Name,Is a Company
<br/>&#160;&#160;&#160;&#160;company_1,Bigees,True
<br/>&#160;&#160;&#160;&#160;company_2,Organi,True
<br/>&#160;&#160;&#160;&#160;company_3,Boum,True</p>
<p>To create the CSV file for persons, linked to
companies, we will use the following SQL command in
PSQL:</p> <p>&#160;&#160;&#160;&#160;copy (select
'person_'||id as "External ID",person_name as
"Name",'False' as "Is a Company",'company_'||company_id
as "Related Company/External ID" from persons) TO
'/tmp/person.csv' with CSV</p>
<p>It will produce the following CSV file:
<br/>&#160;&#160;&#160;&#160;External ID,Name,Is a
Company,Related Company/External ID
<br/>&#160;&#160;&#160;&#160;person_1,Fabien,False,company_1
<br/>&#160;&#160;&#160;&#160;person_2,Laurence,False,company_1
<br/>&#160;&#160;&#160;&#160;person_3,Eric,False,company_2
<br/>&#160;&#160;&#160;&#160;person_4,Ramsy,False,company_3</p>
<p>As you can see in this file, Fabien and Laurence
are working for the Bigees company (company_1) and
Eric is working for the Organi company. The relation
between persons and companies is done using the
External ID of the companies. We had to prefix the
"External ID" by the name of the table to avoid a
conflict of ID between persons and companies (person_1
and company_1 who shared the same ID 1 in the orignial
database).</p>
<p>The two files produced are ready to be imported in
OpenERP without any modifications. After having
imported these two CSV files, you will have 4 contacts
and 3 companies. (the firsts two contacts are linked
to the first company). You must first import the
companies and then the persons.</p>
</dd>
</dl>
</div>
</form>
</t>
<t t-name="ImportView.preview">
<tr t-if="headers" class="oe_import_grid-header">
<td t-foreach="headers" t-as="header" class="oe_import_grid-cell"

View File

@ -60,14 +60,14 @@ class sale_config_settings(osv.osv_memory):
'module_web_linkedin': fields.boolean('Get contacts automatically from linkedIn',
help="""When you create a new contact (person or company), you will be able to load all the data from LinkedIn (photos, address, etc)."""),
'module_crm': fields.boolean('CRM'),
'module_plugin_thunderbird': fields.boolean('Enable Thunderbird plugin',
'module_plugin_thunderbird': fields.boolean('Enable Thunderbird plug-in',
help="""The plugin allows you archive email and its attachments to the selected
OpenERP objects. You can select a partner, or a lead and
attach the selected mail as a .eml file in
the attachment of a selected record. You can create documents for CRM Lead,
Partner from the selected emails.
This installs the module plugin_thunderbird."""),
'module_plugin_outlook': fields.boolean('Enable Outlook plugin',
'module_plugin_outlook': fields.boolean('Enable Outlook plug-in',
help="""The Outlook plugin allows you to select an object that you would like to add
to your email and its attachments from MS Outlook. You can select a partner,
or a lead object and archive a selected

View File

@ -9,7 +9,7 @@
<field name="arch" type="xml">
<field name="property_account_position" position="after" version="7.0">
<label for="vat"/>
<div>
<div name="vat_info">
<field name="vat" on_change="vat_change(vat)" placeholder="e.g. BE0477472701" class="oe_inline"/>
<button colspan="2" name="button_check_vat" string="Check Validity" type="object" icon="gtk-execute" class="oe_inline"/>
<field name="vat_subjected" class="oe_inline"/>

View File

@ -46,7 +46,7 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({
delete(action.attrs.colspan);
var action_id = _.str.toNumber(action.attrs.name);
if (!_.isNaN(action_id)) {
self.rpc('/web/action/load', {action_id: action_id}).then(function(result) {
self.rpc('/web/action/load', {action_id: action_id}).done(function(result) {
self.on_load_action(result, column_index + '_' + action_index, action.attrs);
});
}
@ -81,7 +81,7 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({
this.rpc('/web/view/undo_custom', {
view_id: this.view.fields_view.view_id,
reset: true
}).then(this.do_reload);
}).done(this.do_reload);
},
on_change_layout: function() {
var self = this;
@ -242,7 +242,7 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({
};
var list = am.inner_widget.views.list;
if (list) {
list.deferred.then(function() {
list.deferred.done(function() {
$(list.controller.groups).off('row_link').on('row_link', function(e, id) {
new_form_action(id);
});
@ -250,7 +250,7 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({
}
var kanban = am.inner_widget.views.kanban;
if (kanban) {
kanban.deferred.then(function() {
kanban.deferred.done(function() {
kanban.controller.open_record = function(id, editable) {
new_form_action(id, editable);
};
@ -335,7 +335,7 @@ instance.board.AddToDashboard = instance.web.search.Input.extend({
e.preventDefault();
self.add_dashboard();
});
return this.load_data().then(this.proxy("render_data"));
return this.load_data().done(this.proxy("render_data"));
},
load_data:function(){
var board = new instance.web.Model('board.board');
@ -347,7 +347,7 @@ instance.board.AddToDashboard = instance.web.search.Input.extend({
return new instance.web.Model('ir.model.data')
.query(['res_id'])
.filter([['name','=','menu_reporting_dashboard']])
.first().pipe(function (result) {
.first().then(function (result) {
var menu = _(dashboard_menu).chain()
.pluck('children')
.flatten(true)
@ -382,7 +382,7 @@ instance.board.AddToDashboard = instance.web.search.Input.extend({
domain: domain,
view_mode: view_parent.active_view,
name: this.$el.find("input").val()
}).then(function(r) {
}).done(function(r) {
if (r === false) {
self.do_warn("Could not add filter to dashboard");
} else {

View File

@ -188,7 +188,7 @@ class crm_lead(base_stage, format_address, osv.osv):
_columns = {
'partner_id': fields.many2one('res.partner', 'Partner', ondelete='set null',
select=True, help="Optional linked partner, usually after conversion of the lead"),
select=True, help="Linked partner (optional). Usually created when converting the lead."),
'id': fields.integer('ID', readonly=True),
'name': fields.char('Subject', size=64, required=True, select=1),
@ -236,7 +236,7 @@ class crm_lead(base_stage, format_address, osv.osv):
'ref': fields.reference('Reference', selection=crm._links_get, size=128),
'ref2': fields.reference('Reference 2', selection=crm._links_get, size=128),
'phone': fields.char("Phone", size=64),
'date_deadline': fields.date('Expected Closing'),
'date_deadline': fields.date('Expected Closing', help="Estimate of the date on which the opportunity will be won."),
'date_action': fields.date('Next Action Date', select=True),
'title_action': fields.char('Next Action', size=64),
'color': fields.integer('Color Index'),
@ -251,7 +251,7 @@ class crm_lead(base_stage, format_address, osv.osv):
'street2': fields.char('Street2', size=128),
'zip': fields.char('Zip', change_default=True, size=24),
'city': fields.char('City', size=128),
'state_id': fields.many2one("res.country.state", 'State', domain="[('country_id','=',country_id)]"),
'state_id': fields.many2one("res.country.state", 'State'),
'country_id': fields.many2one('res.country', 'Country'),
'phone': fields.char('Phone', size=64),
'fax': fields.char('Fax', size=64),
@ -610,9 +610,9 @@ class crm_lead(base_stage, format_address, osv.osv):
}
def convert_opportunity(self, cr, uid, ids, partner_id, user_ids=False, section_id=False, context=None):
partner = self.pool.get('res.partner')
customer = False
if partner_id:
partner = self.pool.get('res.partner')
customer = partner.browse(cr, uid, partner_id, context=context)
for lead in self.browse(cr, uid, ids, context=context):
if lead.state in ('done', 'cancel'):
@ -676,19 +676,17 @@ class crm_lead(base_stage, format_address, osv.osv):
def convert_partner(self, cr, uid, ids, action='create', partner_id=False, context=None):
"""
This function convert partner based on action.
Convert partner based on action.
if action is 'create', create new partner with contact and assign lead to new partner_id.
otherwise assign lead to specified partner_id
"""
if context is None:
context = {}
partner_ids = {}
force_partner_id = partner_id
for lead in self.browse(cr, uid, ids, context=context):
if action == 'create':
if not partner_id:
partner_id = self._create_lead_partner(cr, uid, lead, context)
partner_id = force_partner_id or self._create_lead_partner(cr, uid, lead, context=context)
self._lead_set_partner(cr, uid, lead, partner_id, context=context)
partner_ids[lead.id] = partner_id
return partner_ids
@ -896,6 +894,10 @@ class crm_lead(base_stage, format_address, osv.osv):
lead.message_post(body=message)
return True
crm_lead()
def onchange_state(self, cr, uid, ids, state_id, context=None):
if state_id:
country_id=self.pool.get('res.country.state').browse(cr, uid, state_id, context).country_id.id
return {'value':{'country_id':country_id}}
return {}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -160,7 +160,7 @@
<field name="street2"/>
<div class="address_format">
<field name="city" placeholder="City" style="width: 40%%"/>
<field name="state_id" options='{"no_open": True}' placeholder="State" style="width: 24%%"/>
<field name="state_id" on_change="onchange_state(state_id)" options='{"no_open": True}' placeholder="State" style="width: 24%%"/>
<field name="zip" placeholder="ZIP" style="width: 34%%"/>
</div>
<field name="country_id" placeholder="Country" options='{"no_open": True}'/>
@ -477,7 +477,7 @@
<field name="street2"/>
<div class="address_format">
<field name="city" placeholder="City" style="width: 40%%"/>
<field name="state_id" options='{"no_open": True}' placeholder="State" style="width: 24%%"/>
<field name="state_id" options='{"no_open": True}' on_change="onchange_state(state_id)" placeholder="State" style="width: 24%%"/>
<field name="zip" placeholder="ZIP" style="width: 34%%"/>
</div>
<field name="country_id" placeholder="Country" options='{"no_open": True}'/>

View File

@ -2,14 +2,6 @@
<openerp>
<data>
<act_window
id="crm_case_categ_phone_create_partner"
name="Schedule a Call"
res_model="crm.phonecall"
view_mode="tree,form,calendar"
context="{'search_default_partner_id': active_id, 'default_duration': 1.0, 'default_partner_id': active_id}"
groups="base.group_sale_salesman"
/>
<!-- TO CONFIRM: This is fine -->
<!-- act_window

View File

@ -56,6 +56,7 @@ added to partners that match the segmentation criterions after computation.'),
@param uid: the current users ID for security checks,
@param ids: List of Process continues IDs"""
partner_obj = self.pool.get('res.partner')
categs = self.read(cr, uid, ids, ['categ_id', 'exclusif', 'partner_id',\
'sales_purchase_active', 'profiling_active'])
for categ in categs:
@ -80,9 +81,11 @@ added to partners that match the segmentation criterions after computation.'),
for pid in to_remove_list:
partners.remove(pid)
for partner_id in partners:
cr.execute('insert into res_partner_res_partner_category_rel (category_id,partner_id) \
values (%s,%s)', (categ['categ_id'][0], partner_id))
for partner in partner_obj.browse(cr, uid, partners):
category_ids = [categ_id.id for categ_id in partner.category_id]
if categ['categ_id'][0] not in category_ids:
cr.execute('insert into res_partner_res_partner_category_rel (category_id,partner_id) \
values (%s,%s)', (categ['categ_id'][0], partner.id))
self.write(cr, uid, [id], {'state':'not running', 'partner_id':0})
return True

View File

@ -115,7 +115,7 @@
name="%(base_calendar.action_crm_meeting)d"
context="{'search_default_partner_ids': active_id, 'default_partner_ids' : [active_id]}"/>
<button type="action" string="Calls"
name="%(crm.crm_case_categ_phone_create_partner)d"
name="%(crm.crm_case_categ_phone_incoming0)d"
context="{'search_default_partner_id': active_id, 'default_duration': 1.0}" />
<button type="action" string="Opportunities" attrs="{'invisible': [('customer', '=', False)]}"
name="%(crm.crm_case_category_act_oppor11)d" context="{'search_default_partner_id': active_id}"/>

View File

@ -175,12 +175,19 @@ class crm_lead2opportunity_mass_convert(osv.osv_memory):
return res
def _convert_opportunity(self, cr, uid, ids, vals, context=None):
"""
When "massively" (more than one at a time) converting leads to
opportunities, check the salesteam_id and salesmen_ids and update
the values before calling super.
"""
if context is None:
context = {}
data = self.browse(cr, uid, ids, context=context)[0]
salesteam_id = data.section_id and data.section_id.id or False
salesman = []
salesmen_ids = []
if data.user_ids:
salesman = [x.id for x in data.user_ids]
vals.update({'user_ids': salesman, 'section_id': salesteam_id})
salesmen_ids = [x.id for x in data.user_ids]
vals.update({'user_ids': salesmen_ids, 'section_id': salesteam_id})
return super(crm_lead2opportunity_mass_convert, self)._convert_opportunity(cr, uid, ids, vals, context=context)
def mass_convert(self, cr, uid, ids, context=None):

View File

@ -35,7 +35,7 @@ class crm_lead2partner(osv.osv_memory):
}
def view_init(self, cr, uid, fields, context=None):
"""
This function checks for precondition before wizard executes
Check for precondition before wizard executes.
"""
if context is None:
context = {}
@ -69,22 +69,19 @@ class crm_lead2partner(osv.osv_memory):
return partner_id
def default_get(self, cr, uid, fields, context=None):
"""
This function gets default values
"""
res = super(crm_lead2partner, self).default_get(cr, uid, fields, context=context)
res = super(crm_lead2partner, self).default_get(cr, uid, fields, context=context)
partner_id = self._select_partner(cr, uid, context=context)
if 'partner_id' in fields:
res.update({'partner_id': partner_id})
if 'action' in fields:
res.update({'action': partner_id and 'exist' or 'create'})
return res
def open_create_partner(self, cr, uid, ids, context=None):
"""
This function Opens form of create partner.
Open form of create partner.
"""
view_obj = self.pool.get('ir.ui.view')
view_id = view_obj.search(cr, uid, [('model', '=', self._name), \
@ -101,21 +98,21 @@ class crm_lead2partner(osv.osv_memory):
def _create_partner(self, cr, uid, ids, context=None):
"""
This function Creates partner based on action.
Create partner based on action.
"""
if context is None:
context = {}
lead = self.pool.get('crm.lead')
lead_ids = context and context.get('active_ids') or []
lead_ids = context.get('active_ids', [])
data = self.browse(cr, uid, ids, context=context)[0]
partner_id = data.partner_id and data.partner_id.id or False
return lead.convert_partner(cr, uid, lead_ids, data.action, partner_id, context=context)
def make_partner(self, cr, uid, ids, context=None):
"""
This function Makes partner based on action.
Make a partner based on action.
Only called from form view, so only meant to convert one lead at a time.
"""
# Only called from Form view, so only meant to convert one Lead.
lead_id = context and context.get('active_id') or False
partner_ids_map = self._create_partner(cr, uid, ids, context=context)
return self.pool.get('res.partner').redirect_partner_form(cr, uid, partner_ids_map.get(lead_id, False), context=context)

View File

@ -96,13 +96,13 @@ class crm_claim(base_stage, osv.osv):
'user_id': fields.many2one('res.users', 'Responsible'),
'user_fault': fields.char('Trouble Responsible', size=64),
'section_id': fields.many2one('crm.case.section', 'Sales Team', \
select=True, help="Sales team to which Case belongs to."\
"Define Responsible user and Email account for"\
select=True, help="Responsible sales team."\
" Define Responsible user and Email account for"\
" mail gateway."),
'company_id': fields.many2one('res.company', 'Company'),
'partner_id': fields.many2one('res.partner', 'Partner'),
'email_cc': fields.text('Watchers Emails', size=252, help="These email addresses will be added to the CC field of all inbound and outbound emails for this record before being sent. Separate multiple email addresses with a comma"),
'email_from': fields.char('Email', size=128, help="These people will receive email."),
'email_from': fields.char('Email', size=128, help="Destination email for email gateway."),
'partner_phone': fields.char('Phone', size=32),
'stage_id': fields.many2one ('crm.claim.stage', 'Stage',
domain="['|', ('section_ids', '=', section_id), ('case_default', '=', True)]"),

View File

@ -106,12 +106,6 @@
states="draft,pending" groups="base.group_user"/>
<button name="case_close" string="Done" type="object" class="oe_highlight"
states="open,pending" groups="base.group_user"/>
<button name="case_refuse" string="Refuse" type="object" class="oe_highlight"
states="draft,open,pending" groups="base.group_user"/>
<button name="stage_previous" string="Previous Stage" type="object" groups="base.group_user"
states="open,pending" icon="gtk-go-back" attrs="{'invisible': [('stage_id','=', False)]}"/>
<button name="stage_next" string="Next Stage" type="object" groups="base.group_user"
states="open,pending" icon="gtk-go-forward" attrs="{'invisible': [('stage_id','=', False)]}"/>
<button name="case_reset" string="Reset to Draft" type="object" groups="base.group_user"
states="cancel,done"/>
<button name="case_cancel" string="Cancel" type="object" groups="base.group_user"
@ -124,13 +118,12 @@
<field name="name"/>
<field name="date"/>
</group>
<group colspan="4" col="6">
<group colspan="4" col="4">
<field name="user_id"/>
<field name="section_id" widget="selection"/>
<field name="state" groups="base.group_no_one"/>
<newline/>
<field name="priority" groups="base.group_user"/>
<field name="section_id"/>
<field name="date_deadline"/>
<field name="state" groups="base.group_no_one"/>
</group>
<group colspan="4" col="4">
<notebook>

View File

@ -53,13 +53,12 @@ class crm_helpdesk(base_state, base_stage, osv.osv):
'date_deadline': fields.date('Deadline'),
'user_id': fields.many2one('res.users', 'Responsible'),
'section_id': fields.many2one('crm.case.section', 'Sales Team', \
select=True, help='Sales team to which Case belongs to.\
Define Responsible user and Email account for mail gateway.'),
select=True, help='Responsible sales team. Define Responsible user and Email account for mail gateway.'),
'company_id': fields.many2one('res.company', 'Company'),
'date_closed': fields.datetime('Closed', readonly=True),
'partner_id': fields.many2one('res.partner', 'Partner'),
'email_cc': fields.text('Watchers Emails', size=252 , help="These email addresses will be added to the CC field of all inbound and outbound emails for this record before being sent. Separate multiple email addresses with a comma"),
'email_from': fields.char('Email', size=128, help="These people will receive email."),
'email_from': fields.char('Email', size=128, help="Destination email for email gateway"),
'date': fields.datetime('Date'),
'ref' : fields.reference('Reference', selection=crm._links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128),

View File

@ -244,6 +244,7 @@ class crm_segmentation(osv.osv):
@param uid: the current users ID for security checks,
@param ids: List of crm segmentations IDs """
partner_obj = self.pool.get('res.partner')
categs = self.read(cr,uid,ids,['categ_id','exclusif','partner_id', \
'sales_purchase_active', 'profiling_active'])
for categ in categs:
@ -280,8 +281,10 @@ class crm_segmentation(osv.osv):
for pid in to_remove_list:
partners.remove(pid)
for partner_id in partners:
cr.execute('insert into res_partner_res_partner_category_rel (category_id,partner_id) values (%s,%s)', (categ['categ_id'][0],partner_id))
for partner in partner_obj.browse(cr, uid, partners):
category_ids = [categ_id.id for categ_id in partner.category_id]
if categ['categ_id'][0] not in category_ids:
cr.execute('insert into res_partner_res_partner_category_rel (category_id,partner_id) values (%s,%s)', (categ['categ_id'][0],partner.id))
self.write(cr, uid, [id], {'state':'not running', 'partner_id':0})
return True

View File

@ -0,0 +1,96 @@
# Spanish translation for openobject-addons
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-08 00:36+0000\n"
"PO-Revision-Date: 2012-11-06 15:26+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Spanish <es@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-11-07 04:38+0000\n"
"X-Generator: Launchpad (build 16232)\n"
#. module: crm_todo
#: model:ir.model,name:crm_todo.model_project_task
msgid "Task"
msgstr "Tarea"
#. module: crm_todo
#: view:crm.lead:0
msgid "Timebox"
msgstr "Periodo de tiempo"
#. module: crm_todo
#: view:crm.lead:0
msgid "For cancelling the task"
msgstr "Para cancelar la tarea"
#. module: crm_todo
#: constraint:project.task:0
msgid "Error ! Task end-date must be greater then task start-date"
msgstr ""
"¡ Error ! La fecha final de la tarea debe ser mayor que la fecha de inicio"
#. module: crm_todo
#: model:ir.model,name:crm_todo.model_crm_lead
msgid "crm.lead"
msgstr "crm.iniciativa"
#. module: crm_todo
#: view:crm.lead:0
msgid "Next"
msgstr "Siguiente"
#. module: crm_todo
#: model:ir.actions.act_window,name:crm_todo.crm_todo_action
#: model:ir.ui.menu,name:crm_todo.menu_crm_todo
msgid "My Tasks"
msgstr "Mis tareas"
#. module: crm_todo
#: view:crm.lead:0
#: field:crm.lead,task_ids:0
msgid "Tasks"
msgstr "Tareas"
#. module: crm_todo
#: view:crm.lead:0
msgid "Done"
msgstr "Realizado"
#. module: crm_todo
#: constraint:project.task:0
msgid "Error ! You cannot create recursive tasks."
msgstr "¡Error! No se pueden crear tareas recursivas."
#. module: crm_todo
#: view:crm.lead:0
msgid "Cancel"
msgstr "Cancelar"
#. module: crm_todo
#: view:crm.lead:0
msgid "Extra Info"
msgstr "Información extra"
#. module: crm_todo
#: field:project.task,lead_id:0
msgid "Lead / Opportunity"
msgstr "Iniciativa / Oportunidad"
#. module: crm_todo
#: view:crm.lead:0
msgid "For changing to done state"
msgstr "Para cambiar a estado 'Realizada'"
#. module: crm_todo
#: view:crm.lead:0
msgid "Previous"
msgstr "Anterior"

View File

@ -322,7 +322,6 @@
<record id="view_picking_withcarrier_in_form" model="ir.ui.view">
<field name="name">delivery.stock.picking_withcarrier.in.form.view</field>
<field name="type">form</field>
<field name="model">stock.picking.in</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">

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-02-08 00:36+0000\n"
"PO-Revision-Date: 2012-02-17 03:56+0000\n"
"Last-Translator: Jeff Wang <wjfonhand@hotmail.com>\n"
"PO-Revision-Date: 2012-11-02 01:52+0000\n"
"Last-Translator: Joshua Jan(SHINEIT) <popkar77@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: 2012-10-30 04:51+0000\n"
"X-Generator: Launchpad (build 16206)\n"
"X-Launchpad-Export-Date: 2012-11-03 05:03+0000\n"
"X-Generator: Launchpad (build 16218)\n"
#. module: delivery
#: report:sale.shipping:0
@ -332,13 +332,13 @@ msgstr "重量"
msgid ""
"Check this box if you want to manage delivery prices that depends on the "
"destination, the weight, the total of the order, etc."
msgstr "如果要根据目的地、重量、订单总价来管理运费,请勾选这里。"
msgstr "如果要根据目的地、重量、订单总价来管理运费,请勾选这里。"
#. module: delivery
#: help:delivery.carrier,normal_price:0
msgid ""
"Keep empty if the pricing depends on the advanced pricing per destination"
msgstr "如果价格基于每个目的地的固定价格,这里留空。"
msgstr "默认的运费的价格,如果根据目的地定价,这里留空。"
#. module: delivery
#: constraint:stock.move:0
@ -576,7 +576,7 @@ msgstr "一次性交货"
#. module: delivery
#: field:delivery.carrier,use_detailed_pricelist:0
msgid "Advanced Pricing per Destination"
msgstr "每个目的地的固定价格"
msgstr "根据目的地定价"
#. module: delivery
#: view:delivery.carrier:0

View File

@ -5,6 +5,19 @@ openerp.document = function (instance) {
this._super.apply(this, arguments);
this.sections.splice(1, 0, { 'name' : 'files', 'label' : _t('Attachment(s)'), });
this.items['files'] = [];
}
},
on_attachments_loaded: function(attachments) {
//to display number in name if more then one attachment which has same name.
var self = this;
_.chain(attachments.reverse())
.groupBy(function(attachment) { return attachment.name})
.each(function(attachment){
if(attachment.length > 1)
_.map(attachment, function(attachment, i){
attachment.name = _.str.sprintf(_t("%s (%s)"), attachment.name, i+1)
})
})
self._super(attachments);
},
});
};
};

View File

@ -15,7 +15,7 @@ openerp.edi.EdiView = openerp.web.Widget.extend({
this._super();
var self = this;
var param = {"db": self.db, "token": self.token};
return self.rpc('/edi/get_edi_document', param).then(this.on_document_loaded, this.on_document_failed);
return self.rpc('/edi/get_edi_document', param).done(this.on_document_loaded).fail(this.on_document_failed);
},
on_document_loaded: function(docs){
this.doc = docs[0];
@ -108,7 +108,7 @@ openerp.edi.EdiView = openerp.web.Widget.extend({
});
openerp.edi.edi_view = function (db, token) {
openerp.session.session_bind().then(function () {
openerp.session.session_bind().done(function () {
new openerp.edi.EdiView(null,db,token).appendTo($("body").addClass('openerp'));
});
}
@ -149,11 +149,11 @@ openerp.edi.EdiImport = openerp.web.Widget.extend({
},
do_import: function() {
this.rpc('/edi/import_edi_url', {url: this.url}).then(this.on_imported, this.on_imported_error);
this.rpc('/edi/import_edi_url', {url: this.url}).done(this.on_imported).fail(this.on_imported_error);
},
on_imported: function(response) {
if ('action' in response) {
this.rpc("/web/session/save_session_action", {the_action: response.action}).then(function(key) {
this.rpc("/web/session/save_session_action", {the_action: response.action}).done(function(key) {
window.location = "/#sa="+encodeURIComponent(key);
});
}
@ -188,7 +188,7 @@ openerp.edi.EdiImport = openerp.web.Widget.extend({
});
openerp.edi.edi_import = function (url) {
openerp.session.session_bind().then(function () {
openerp.session.session_bind().done(function () {
new openerp.edi.EdiImport(null,url).appendTo($("body").addClass('openerp'));
});
}

View File

@ -338,7 +338,7 @@ class event_registration(osv.osv):
'date_closed': fields.datetime('Attended Date', readonly=True),
'date_open': fields.datetime('Registration Date', readonly=True),
'reply_to': fields.related('event_id','reply_to',string='Reply-to Email', type='char', size=128, readonly=True,),
'log_ids': fields.one2many('mail.message', 'res_id', 'Logs', domain=[('email_from', '=', False),('model','=',_name)]),
'log_ids': fields.one2many('mail.message', 'res_id', 'Logs', domain=[('model','=',_name)]),
'event_end_date': fields.related('event_id','date_end', type='datetime', string="Event End Date", readonly=True),
'event_begin_date': fields.related('event_id', 'date_begin', type='datetime', string="Event Start Date", readonly=True),
'user_id': fields.many2one('res.users', 'User', states={'done': [('readonly', True)]}),

View File

@ -101,7 +101,7 @@
<form string="Events" version="7.0">
<header>
<button string="Confirm Event" name="button_confirm" states="draft" type="object" class="oe_highlight" groups="base.group_user"/>
<button string="Event Ended" name="button_done" states="confirm" type="object" class="oe_highlight" groups="base.group_user"/>
<button string="Finish Event" name="button_done" states="confirm" type="object" class="oe_highlight" groups="base.group_user"/>
<button string="Set To Draft" name="button_draft" states="cancel,done" type="object" groups="base.group_user"/>
<button string="Cancel Event" name="button_cancel" states="draft,confirm" type="object" groups="base.group_user"/>
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,done"/>
@ -288,7 +288,7 @@
<t t-if="record.is_subscribed.raw_value">
<button type="object" name="unsubscribe_to_event" class="oe_unsubscribe_button ">
<span>Subscribed</span>
<span class="unsubscribe">Unsubscribe</span>
<span class="oe_unsubscribe">Unsubscribe</span>
</button>
</t>
</div>
@ -313,20 +313,6 @@
</field>
</record>
<!-- Event Graph view -->
<record model="ir.ui.view" id="view_event_graph">
<field name="name">Event Graph</field>
<field name="model">event.event</field>
<field name="arch" type="xml">
<graph string="Event by Registration" type="bar" orientation="horizontal">
<field name="name"/>
<field name="register_current" operator="+"/>
<field name="register_prospect" operator="+"/>
</graph>
</field>
</record>
<!-- Event Search View -->
<record model="ir.ui.view" id="view_event_search">
@ -362,7 +348,7 @@
<field name="type">ir.actions.act_window</field>
<field name="res_model">event.event</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,calendar,tree,form,graph</field>
<field name="view_mode">kanban,calendar,tree,form</field>
<field name="context">{"search_default_upcoming":1}</field>
<field name="search_view_id" ref="view_event_search"/>
<field name="help" type="html">
@ -524,7 +510,7 @@
<field name="model">event.registration</field>
<field name="arch" type="xml">
<search string="Event Registration">
<field name="name" string="Participant" filter_domain="['|','|','|',('name','ilike',self),('partner_id','ilike',self),('email','ilike',self),('origin','ilike',self)]"/>
<field name="name" string="Participant" filter_domain="['|','|',('name','ilike',self),('email','ilike',self),('origin','ilike',self)]"/>
<filter icon="terp-mail-message-new" string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/>
<separator/>
<filter icon="terp-check" string="New" name="draft" domain="[('state','=','draft')]" help="Registrations in unconfirmed state"/>
@ -533,6 +519,7 @@
<filter icon="terp-personal" string="My Registrations" help="My Registrations" domain="[('user_id','=',uid)]"/>
<field name="event_id"/>
<field name="user_id"/>
<field name="partner_id"/>
<group expand="0" string="Group By...">
<filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>

View File

@ -25,7 +25,7 @@ class res_partner(osv.osv):
_inherit = 'res.partner'
_columns = {
'speaker': fields.boolean('Speaker'),
'speaker': fields.boolean('Speaker', help="Check this box if this contact is a speaker."),
'event_ids': fields.one2many('event.event','main_speaker_id', readonly=True),
'event_registration_ids': fields.one2many('event.registration','partner_id', readonly=True),
}

View File

@ -23,7 +23,7 @@
<separator string="Connection with username and password" colspan="4"/>
<label string="Another approach is to create a user for OpenERP in Moodle. If you do so, make sure that this user has appropriate access rights." colspan="4"/>
<field name="moodle_username"/>
<field name="moodle_password"/>
<field name="moodle_password" password="True"/>
</group>
</form>
</field>

View File

@ -24,9 +24,9 @@
<field name="arch" type="xml">
<form string="Incoming Mail Server" version="7.0">
<header attrs="{'invisible' : [('type', '=', 'local')]}">
<button string="Test &amp; Confirm" type="object" name="button_confirm_login" states="draft" icon="gtk-apply"/>
<button string="Fetch Now" type="object" name="fetch_mail" states="done" icon="gtk-network"/>
<button string="Reset Confirmation" type="object" name="set_draft" icon="gtk-convert" states="done"/>
<button string="Test &amp; Confirm" type="object" name="button_confirm_login" states="draft"/>
<button string="Fetch Now" type="object" name="fetch_mail" states="done"/>
<button string="Reset Confirmation" type="object" name="set_draft" states="done"/>
<field name="state" widget="statusbar"/>
</header>
<sheet>

View File

@ -0,0 +1,124 @@
# Spanish translation for openobject-addons
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-08 00:36+0000\n"
"PO-Revision-Date: 2012-11-07 12:33+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Spanish <es@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-11-08 04:47+0000\n"
"X-Generator: Launchpad (build 16232)\n"
#. module: google_base_account
#: field:res.users,gmail_user:0
msgid "Username"
msgstr "Nombre de usuario"
#. module: google_base_account
#: model:ir.actions.act_window,name:google_base_account.act_google_login_form
msgid "Google Login"
msgstr "Acceso de Google"
#. module: google_base_account
#: code:addons/google_base_account/wizard/google_login.py:29
#, python-format
msgid "Google Contacts Import Error!"
msgstr "¡Error en la importacion de los contactos de Google!"
#. module: google_base_account
#: view:res.users:0
msgid " Synchronization "
msgstr " Sincronización "
#. module: google_base_account
#: sql_constraint:res.users:0
msgid "You can not have two users with the same login !"
msgstr "¡No puede tener dos usuarios con el mismo identificador!"
#. module: google_base_account
#: code:addons/google_base_account/wizard/google_login.py:75
#, python-format
msgid "Error"
msgstr "Error"
#. module: google_base_account
#: view:google.login:0
msgid "Google login"
msgstr "Acceso Google"
#. module: google_base_account
#: model:ir.model,name:google_base_account.model_res_users
msgid "res.users"
msgstr "Usuarios"
#. module: google_base_account
#: field:google.login,password:0
msgid "Google Password"
msgstr "Contraseña de Google"
#. module: google_base_account
#: view:google.login:0
msgid "_Cancel"
msgstr "_Cancelar"
#. module: google_base_account
#: view:res.users:0
msgid "Google Account"
msgstr "Cuenta de Google"
#. module: google_base_account
#: field:google.login,user:0
msgid "Google Username"
msgstr "Usuario de Google"
#. module: google_base_account
#: code:addons/google_base_account/wizard/google_login.py:29
#, python-format
msgid ""
"Please install gdata-python-client from http://code.google.com/p/gdata-"
"python-client/downloads/list"
msgstr ""
"Por favor, instale gdata-python-client de http://code.google.com/p/gdata-"
"python-client/downloads/list o desde el administrador de paquetes de su "
"distribución"
#. module: google_base_account
#: model:ir.model,name:google_base_account.model_google_login
msgid "Google Contact"
msgstr "Contacto Google"
#. module: google_base_account
#: view:google.login:0
msgid "_Login"
msgstr "Iniciar _sesión"
#. module: google_base_account
#: constraint:res.users:0
msgid "The chosen company is not in the allowed companies for this user"
msgstr ""
"La compañía seleccionada no está entre las companías permitidas para este "
"usuario"
#. module: google_base_account
#: field:res.users,gmail_password:0
msgid "Password"
msgstr "Contraseña"
#. module: google_base_account
#: code:addons/google_base_account/wizard/google_login.py:75
#, python-format
msgid "Authentication fail check the user and password !"
msgstr "Fallo en la autenticación. ¡Compruebe el usuario y la contraseña!"
#. module: google_base_account
#: view:google.login:0
msgid "ex: user@gmail.com"
msgstr "ejemplo: usuario@gmail.com"

View File

@ -0,0 +1,119 @@
# Mongolian translation for openobject-addons
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-08 00:36+0000\n"
"PO-Revision-Date: 2012-11-08 03:11+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Mongolian <mn@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: 2012-11-09 04:39+0000\n"
"X-Generator: Launchpad (build 16250)\n"
#. module: google_base_account
#: field:res.users,gmail_user:0
msgid "Username"
msgstr "Хэрэглэгчийн нэр"
#. module: google_base_account
#: model:ir.actions.act_window,name:google_base_account.act_google_login_form
msgid "Google Login"
msgstr ""
#. module: google_base_account
#: code:addons/google_base_account/wizard/google_login.py:29
#, python-format
msgid "Google Contacts Import Error!"
msgstr ""
#. module: google_base_account
#: view:res.users:0
msgid " Synchronization "
msgstr ""
#. module: google_base_account
#: sql_constraint:res.users:0
msgid "You can not have two users with the same login !"
msgstr "Ижил нэвтрэх нэртэй хоёр хэрэглэгч байж болохгүй!"
#. module: google_base_account
#: code:addons/google_base_account/wizard/google_login.py:75
#, python-format
msgid "Error"
msgstr "Алдаа"
#. module: google_base_account
#: view:google.login:0
msgid "Google login"
msgstr ""
#. module: google_base_account
#: model:ir.model,name:google_base_account.model_res_users
msgid "res.users"
msgstr "res.users"
#. module: google_base_account
#: field:google.login,password:0
msgid "Google Password"
msgstr ""
#. module: google_base_account
#: view:google.login:0
msgid "_Cancel"
msgstr "_Цуцлах"
#. module: google_base_account
#: view:res.users:0
msgid "Google Account"
msgstr ""
#. module: google_base_account
#: field:google.login,user:0
msgid "Google Username"
msgstr ""
#. module: google_base_account
#: code:addons/google_base_account/wizard/google_login.py:29
#, python-format
msgid ""
"Please install gdata-python-client from http://code.google.com/p/gdata-"
"python-client/downloads/list"
msgstr ""
#. module: google_base_account
#: model:ir.model,name:google_base_account.model_google_login
msgid "Google Contact"
msgstr ""
#. module: google_base_account
#: view:google.login:0
msgid "_Login"
msgstr ""
#. module: google_base_account
#: constraint:res.users:0
msgid "The chosen company is not in the allowed companies for this user"
msgstr ""
#. module: google_base_account
#: field:res.users,gmail_password:0
msgid "Password"
msgstr ""
#. module: google_base_account
#: code:addons/google_base_account/wizard/google_login.py:75
#, python-format
msgid "Authentication fail check the user and password !"
msgstr ""
#. module: google_base_account
#: view:google.login:0
msgid "ex: user@gmail.com"
msgstr ""

View File

@ -0,0 +1,121 @@
# Polish translation for openobject-addons
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-02-08 00:36+0000\n"
"PO-Revision-Date: 2012-11-02 14:30+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Polish <pl@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: 2012-11-03 05:04+0000\n"
"X-Generator: Launchpad (build 16218)\n"
#. module: google_base_account
#: field:res.users,gmail_user:0
msgid "Username"
msgstr ""
#. module: google_base_account
#: model:ir.actions.act_window,name:google_base_account.act_google_login_form
msgid "Google Login"
msgstr ""
#. module: google_base_account
#: code:addons/google_base_account/wizard/google_login.py:29
#, python-format
msgid "Google Contacts Import Error!"
msgstr ""
#. module: google_base_account
#: view:res.users:0
msgid " Synchronization "
msgstr ""
#. module: google_base_account
#: sql_constraint:res.users:0
msgid "You can not have two users with the same login !"
msgstr ""
#. module: google_base_account
#: code:addons/google_base_account/wizard/google_login.py:75
#, python-format
msgid "Error"
msgstr ""
#. module: google_base_account
#: view:google.login:0
msgid "Google login"
msgstr ""
#. module: google_base_account
#: model:ir.model,name:google_base_account.model_res_users
msgid "res.users"
msgstr "res.users"
#. module: google_base_account
#: field:google.login,password:0
msgid "Google Password"
msgstr ""
#. module: google_base_account
#: view:google.login:0
msgid "_Cancel"
msgstr ""
#. module: google_base_account
#: view:res.users:0
msgid "Google Account"
msgstr ""
#. module: google_base_account
#: field:google.login,user:0
msgid "Google Username"
msgstr ""
#. module: google_base_account
#: code:addons/google_base_account/wizard/google_login.py:29
#, python-format
msgid ""
"Please install gdata-python-client from http://code.google.com/p/gdata-"
"python-client/downloads/list"
msgstr ""
"Zainstaluj gdata-python-client z http://code.google.com/p/gdata-python-"
"client/downloads/list"
#. module: google_base_account
#: model:ir.model,name:google_base_account.model_google_login
msgid "Google Contact"
msgstr ""
#. module: google_base_account
#: view:google.login:0
msgid "_Login"
msgstr ""
#. module: google_base_account
#: constraint:res.users:0
msgid "The chosen company is not in the allowed companies for this user"
msgstr ""
#. module: google_base_account
#: field:res.users,gmail_password:0
msgid "Password"
msgstr ""
#. module: google_base_account
#: code:addons/google_base_account/wizard/google_login.py:75
#, python-format
msgid "Authentication fail check the user and password !"
msgstr ""
#. module: google_base_account
#: view:google.login:0
msgid "ex: user@gmail.com"
msgstr "np: user@gmail.com"

View File

@ -28,11 +28,12 @@
'installable': True,
'auto_install': False,
'js': ['static/src/js/gdocs.js'],
'qweb': ['static/src/xml/gdocs.xml'],
'data': [
'security/ir.model.access.csv',
'res_config_user_view.xml'
],
'depends': ['google_base_account'],
'depends': ['google_base_account','document'],
'description': """
Module to attach a google document to any model.
================================================

View File

@ -17,7 +17,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from datetime import datetime
from tools import DEFAULT_SERVER_DATETIME_FORMAT
from osv import osv, fields
from tools.translate import _
try:
@ -61,7 +62,8 @@ class google_docs_ir_attachment(osv.osv):
#login with the base account google module
client = self._auth(cr, uid, context=context)
# create the document in google docs
local_resource = gdata.docs.data.Resource(gdata.docs.data.DOCUMENT_LABEL)
title = "%s %s" % (context.get("name","Untitled Document."), datetime.today().strftime(DEFAULT_SERVER_DATETIME_FORMAT))
local_resource = gdata.docs.data.Resource(gdata.docs.data.DOCUMENT_LABEL,title=title)
#create a new doc in Google Docs
gdocs_resource = client.post(entry=local_resource, uri='https://docs.google.com/feeds/default/private/full/')
# create an ir.attachment into the db
@ -69,10 +71,12 @@ class google_docs_ir_attachment(osv.osv):
'res_model': res_model,
'res_id': res_id,
'type': 'url',
'name': _('Google Doc'),
'name': title,
'url': gdocs_resource.get_alternate_link().href,
}, context=context)
return gdocs_resource.resource_id.text
return {'resource_id': gdocs_resource.resource_id.text,
'title': title,
'url': gdocs_resource.get_alternate_link().href}
def copy_gdoc(self, cr, uid, res_model, res_id, name_gdocs, gdoc_template_id, context=None):
'''
@ -89,7 +93,7 @@ class google_docs_ir_attachment(osv.osv):
try:
original_resource = client.get_resource_by_id(gdoc_template_id)
#copy the document you choose in the configuration
copy_resource = client.copy_resource(original_resource, 'copy_%s' % original_resource.title.text)
copy_resource = client.copy_resource(original_resource, name_gdocs)
except:
raise osv.except_osv(_('Google Docs Error!'), _("Your resource id is not correct. You can find the id in the google docs URL."))
# create an ir.attachment
@ -114,7 +118,8 @@ class google_docs_ir_attachment(osv.osv):
a length of 1 element only (batch processing is not supported in the code, though nothing really prevent it)
:return: the google document object created
'''
assert len(ids) == 1, 'Creating google docs may only be done by one at a time'
if len(ids) != 1:
raise osv.except_osv(_('Google Docs Error!'), _("Creating google docs may only be done by one at a time."))
res_id = ids[0]
pool_ir_attachment = self.pool.get('ir.attachment')
pool_gdoc_config = self.pool.get('google.docs.config')
@ -125,7 +130,10 @@ class google_docs_ir_attachment(osv.osv):
google_docs_config = pool_gdoc_config.search(cr, uid, [('model_id', '=', res_model)], context=context)
if google_docs_config:
name_gdocs = pool_gdoc_config.browse(cr, uid, google_docs_config, context=context)[0].name_template
name_gdocs = name_gdocs % model_fields_dic
try:
name_gdocs = name_gdocs % model_fields_dic
except:
raise osv.except_osv(_('Key Error!'), _("Your Google Doc Name Pattern's key does not found in object."))
google_template_id = pool_gdoc_config.browse(cr, uid, google_docs_config[0], context=context).gdocs_resource_id
google_document = pool_ir_attachment.copy_gdoc(cr, uid, res_model, res_id, name_gdocs, google_template_id, context=context)
else:
@ -138,15 +146,15 @@ class config(osv.osv):
_columns = {
'model_id': fields.many2one('ir.model', 'Model', required=True),
'gdocs_resource_id': fields.char('Google Resource ID to Use as Template', size=64,help='''
'gdocs_resource_id': fields.char('Google Resource ID to Use as Template', size=64, help='''
This is the id of the template document, on google side. You can find it thanks to its URL:
*for a text document with url like `https://docs.google.com/a/openerp.com/document/d/123456789/edit`, the ID is `document:123456789`
*for a spreadsheet document with url like `https://docs.google.com/a/openerp.com/spreadsheet/ccc?key=123456789#gid=0`, the ID is `spreadsheet:123456789`
*for a presentation (slide show) document with url like `https://docs.google.com/a/openerp.com/presentation/d/123456789/edit#slide=id.p`, the ID is `presentation:123456789`
*for a drawing document with url like `https://docs.google.com/a/openerp.com/drawings/d/123456789/edit`, the ID is `drawings:123456789`
...
'''),
'name_template': fields.char('Google Doc Name Pattern', size=64, help='Choose how the new google docs will be named, on google side'),
''', required=True),
'name_template': fields.char('Google Doc Name Pattern', size=64, help='Choose how the new google docs will be named, on google side. Eg. gdoc_%(field_name)s', required=True),
}
_defaults = {

View File

@ -1,41 +1,40 @@
openerp.google_docs = function(instance, m) {
var _t = instance.web._t;
var _t = instance.web._t,
QWeb = instance.web.qweb;
instance.web.Sidebar = instance.web.Sidebar.extend({
on_attachments_loaded: function(attachments) {
instance.web.Sidebar.include({
redraw: function() {
var self = this;
self._super(attachments);
// if attachment contains a google doc url do nothing
// else display a button to create a google doc
var flag = false;
_.each(attachments, function(i) {
if (i.url && i.url.match('/docs.google.com/')) { flag = true; }
this._super.apply(this, arguments);
self.$el.find('.oe_sidebar_add_attachment').after(QWeb.render('AddGoogleDocumentItem', {widget: self}))
self.$el.find('.oe_sidebar_add_google_doc').on('click', function (e) {
self.on_google_doc();
});
if (! flag) {
this.add_items('files', [
{ label: _t('Add Google Doc...'), callback: self.on_google_doc },
]);
}
},
on_google_doc: function() {
var self = this;
var form = self.getParent();
form.sidebar_context().then(function (context) {
var ds = new instance.web.DataSet(this, 'ir.attachment', context);
ds.call('google_doc_get', [form.dataset.model, [form.datarecord.id], context]).then(function(r) {
if (r == 'False') {
var params = {
error: response,
message: _t("The user google credentials are not set yet. Contact your administrator for help.")
var view = self.getParent();
var ids = ( view.fields_view.type != "form" )? view.groups.get_selection().ids : [ view.datarecord.id ];
if( !_.isEmpty(ids) ){
view.sidebar_context().done(function (context) {
var ds = new instance.web.DataSet(this, 'ir.attachment', context);
ds.call('google_doc_get', [view.dataset.model, ids, context]).done(function(r) {
if (r == 'False') {
var params = {
error: response,
message: _t("The user google credentials are not set yet. Contact your administrator for help.")
}
$(openerp.web.qweb.render("DialogWarning", params)).dialog({
title: _t("User Google credentials are not yet set."),
modal: true,
});
}
$(openerp.web.qweb.render("DialogWarning", params)).dialog({
title: _t("User Google credentials are not yet set."),
modal: true,
});
}
form.reload();
}).done(function(r){
window.open(r.url,"_blank");
view.reload();
});
});
});
}
}
});
};

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- vim:fdl=1:
-->
<templates id="template" xml:space="preserve">
<t t-name="AddGoogleDocumentItem">
<li class="oe_sidebar_add_google_doc"><span><b>Add Google Doc...</b></span></li>
</t>
</templates>

View File

@ -24,12 +24,12 @@
'version': '1.1',
'author': 'OpenERP SA',
'category': 'Human Resources',
'sequence': 12,
'sequence': 21,
'website': 'http://www.openerp.com',
'summary': 'Jobs, Departments, Employees Details',
'description': """
Human Resources Management
=========================
==========================
This application enables you to manage important aspects of your company's staff and other details such as their skills, contacts, working time...

View File

@ -93,14 +93,14 @@ class hr_job(osv.osv):
_inherit = ['mail.thread']
_columns = {
'name': fields.char('Job Name', size=128, required=True, select=True),
'expected_employees': fields.function(_no_of_employee, string='Total Employees',
'expected_employees': fields.function(_no_of_employee, string='Total Forecasted Employees',
help='Expected number of employees for this job position after new recruitment.',
store = {
'hr.job': (lambda self,cr,uid,ids,c=None: ids, ['no_of_recruitment'], 10),
'hr.employee': (_get_job_position, ['job_id'], 10),
},
multi='no_of_employee'),
'no_of_employee': fields.function(_no_of_employee, string="Number of Employees",
'no_of_employee': fields.function(_no_of_employee, string="Current Number of Employees",
help='Number of employees currently occupying this job position.',
store = {
'hr.employee': (_get_job_position, ['job_id'], 10),

View File

@ -57,6 +57,7 @@ class report_custom(report_rml):
if emp_ids:
for emp in obj_emp.read(cr, uid, emp_ids, ['name']):
stop, days_xml = False, []
total_wh = 0.0
user_repr = '''
<user>
<name>%s</name>
@ -92,11 +93,15 @@ class report_custom(report_rml):
else:
ldt = dt
# Week xml representation
total_wh += wh
wh = hour2str(wh)
today_xml = '<day num="%s"><wh>%s</wh></day>' % ((today - month).days+1, (wh))
dy=(today - month).days+1
days_xml.append(today_xml)
today, tomor = tomor, tomor + one_day
total_wh = hour2str(total_wh)
today_xml = '<day num="Total"><wh>%s</wh></day>' % (total_wh)
days_xml.append(today_xml)
user_xml.append(user_repr % '\n'.join(days_xml))
rpt_obj = pooler.get_pool(cr.dbname).get('hr.employee')
@ -174,8 +179,9 @@ class report_custom(report_rml):
cell=cell+x
width_dict[j]=x
day_diff1=day_diff1-x
date_xml += ['<dayy name="Total" cell="Total"/>']
date_xml.append('</days>')
date_xml.append('<cols>3.5cm%s</cols>\n' % (',0.74cm' * (int(dy))))
date_xml.append('<cols>3.5cm%s,1.2cm</cols>\n' % (',0.74cm' * (int(dy))))
xml = '''<?xml version="1.0" encoding="UTF-8" ?>
<report>
%s
@ -183,7 +189,7 @@ class report_custom(report_rml):
%s
%s
</report>
''' % (header_xml,_('Attendances By Month'),'\n'.join(user_xml),date_xml)
''' % (header_xml,_('Attendances by Month'),'\n'.join(user_xml),date_xml)
return xml
report_custom('report.hr.attendance.bymonth', 'hr.employee', '', 'addons/hr_attendance/report/bymonth.xsl')

View File

@ -20,12 +20,15 @@
##############################################################################
import time
from datetime import datetime
from dateutil.relativedelta import relativedelta
import pooler
from report.interface import report_rml
from report.interface import toxml
from report import report_sxw
from tools.translate import _
import tools
one_week = relativedelta(days=7)
@ -38,7 +41,8 @@ class report_custom(report_rml):
def create_xml(self, cr, uid, ids, datas, context=None):
obj_emp = pooler.get_pool(cr.dbname).get('hr.employee')
ids = datas['active_ids']
emp_ids = datas['active_ids']
start_date = datetime.strptime(datas['form']['init_date'], '%Y-%m-%d')
end_date = datetime.strptime(datas['form']['end_date'], '%Y-%m-%d')
first_monday = start_date - relativedelta(days=start_date.date().weekday())
@ -47,9 +51,16 @@ class report_custom(report_rml):
if last_monday < first_monday:
first_monday, last_monday = last_monday, first_monday
rpt_obj = pooler.get_pool(cr.dbname).get('hr.employee')
rml_obj=report_sxw.rml_parse(cr, uid, rpt_obj._name,context)
header_xml = '''
<header>
<date>%s</date>
<company>%s</company>
</header>
''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,uid).company_id.name)
user_xml = []
for employee_id in ids:
for employee_id in emp_ids:
emp = obj_emp.read(cr, uid, [employee_id], ['id', 'name'])[0]
monday, n_monday = first_monday, first_monday + one_week
stop, week_xml = False, []
@ -88,7 +99,7 @@ class report_custom(report_rml):
ldt = dt
# Week xml representation
week_repr = ['<week>', '<weekstart>%s</weekstart>' % monday.strftime('%Y-%m-%d'), '<weekend>%s</weekend>' % n_monday.strftime('%Y-%m-%d')]
week_repr = ['<week>', '<weekstart>%s</weekstart>' % monday.strftime('%Y-%m-%d'), '<weekend>%s</weekend>' % (n_monday - relativedelta(days=1)).strftime('%Y-%m-%d')]
for idx in range(7):
week_repr.append('<%s>' % num2day[idx])
if idx in week_wh:
@ -98,17 +109,17 @@ class report_custom(report_rml):
week_repr.append('<worked>%sh%02d</worked>' % to_hour(reduce(lambda x,y:x+y, week_wh.values(), 0)))
week_repr.append('</total>')
week_repr.append('</week>')
if len(week_repr) > 21: # 21 = minimal length of week_repr
week_xml.append('\n'.join(week_repr))
week_xml.append('\n'.join(week_repr))
monday, n_monday = n_monday, n_monday + one_week
user_xml.append(user_repr % '\n'.join(week_xml))
xml = '''<?xml version="1.0" encoding="UTF-8" ?>
<report>
%s
<title>%s</title>
%s
</report>
''' % '\n'.join(user_xml)
''' % (header_xml,_('Attendances by Week'),'\n'.join(user_xml))
xml = tools.ustr(xml).encode('utf8')
return self.post_process_xml_data(cr, uid, xml, context)

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