diff --git a/addons/account/account.py b/addons/account/account.py index 37bf0fc2023..f3be0d159ab 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -154,6 +154,13 @@ class account_account(osv.osv): args[pos] = ('id','in',ids1) pos+=1 + if context and context.has_key('consolidate_childs'): #add concolidated childs of accounts + ids = super(account_account,self).search(cr, uid, args, offset, limit, + order, context=context, count=count) + for consolidate_child in self.browse(cr, uid, context['account_id']).child_consol_ids: + ids.append(consolidate_child.id) + return ids + return super(account_account,self).search(cr, uid, args, offset, limit, order, context=context, count=count) diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 02325bada84..e2b06ce9b78 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -58,6 +58,7 @@ + diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index f1a1050cf81..46d18515df4 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -676,7 +676,83 @@ class account_move_line(osv.osv): if update_check: if ('account_id' in vals) or ('journal_id' in vals) or ('period_id' in vals) or ('move_id' in vals) or ('debit' in vals) or ('credit' in vals) or ('date' in vals): self._update_check(cr, uid, ids, context) + + obj_line=self.browse(cr, uid, ids[0]) + lines={} + + obj_analytic_line=self.pool.get('account.analytic.line') + analytic=True + journal_flag=False + del_line=False + + if ('journal_id' in vals): + journal=self.pool.get('account.journal').browse(cr,uid,vals['journal_id']) + journal_flag=True + if not journal.analytic_journal_id: + del_line=True + + if ('analytic_account_id' in vals) and (not vals['analytic_account_id']): + del_line=True + + if del_line: + for obj in obj_line.analytic_lines: + obj_analytic_line.unlink(cr,uid,obj.id) + analytic=False + + if obj_line.analytic_lines: + mode='write' + else: + mode='create' + + if obj_line.analytic_lines and analytic: + if ('analytic_account_id' in vals): + lines['account_id'] = vals['analytic_account_id'] + + if ('account_id' in vals): + lines['general_account_id'] = vals['account_id'] + + if ('name' in vals): + lines['name'] = vals['name'] + + if ('date' in vals): + lines['date'] = vals['date'] + + if ('ref' in vals and vals['ref']): + lines['ref'] = vals['ref'] + + if ('quantity' in vals and vals['quantity']): + lines['unit_amount'] = vals['quantity'] + + if ('credit' in vals and vals['credit']): + lines['amount'] = vals['credit'] + + if ('debit' in vals and vals['debit']): + lines['amount'] = vals['debit'] + + if journal_flag: + lines['journal_id']=journal.analytic_journal_id.id + + if lines: + if mode=='write': + obj_analytic_line.write(cr,uid,obj_line.analytic_lines[0].id,lines,context) + result = super(osv.osv, self).write(cr, uid, ids, vals, context) + + if mode=='create' and analytic and obj_line.analytic_account_id: + if obj_line.journal_id.analytic_journal_id: + vals_lines={ + 'name': obj_line.name, + 'date': obj_line.date, + 'account_id': obj_line.analytic_account_id.id, + 'unit_amount':obj_line.quantity, + 'amount': obj_line.debit or obj_line.credit, + 'general_account_id': obj_line.account_id.id, + 'journal_id': obj_line.journal_id.analytic_journal_id.id, + 'ref': obj_line.ref, + 'move_id':obj_line.id + } + obj_analytic_line.create(cr,uid,vals_lines) + if check: done = [] for line in self.browse(cr, uid, ids): @@ -786,20 +862,20 @@ class account_move_line(osv.osv): if not ok: raise osv.except_osv(_('Bad account !'), _('You can not use this general account in this journal !')) - result = super(osv.osv, self).create(cr, uid, vals, context) +# result = super(osv.osv, self).create(cr, uid, vals, context) if 'analytic_account_id' in vals and vals['analytic_account_id']: if journal.analytic_journal_id: vals['analytic_lines'] = [(0,0, { 'name': vals['name'], 'date': vals['date'], 'account_id': vals['analytic_account_id'], - 'unit_amount': vals['quantity'], + 'unit_amount':'quantity' in vals and vals['quantity'] or 1.0, 'amount': vals['debit'] or vals['credit'], 'general_account_id': vals['account_id'], 'journal_id': journal.analytic_journal_id.id, 'ref': vals['ref'], })] - + result = super(osv.osv, self).create(cr, uid, vals, context) # CREATE Taxes if 'account_tax_id' in vals and vals['account_tax_id']: tax_id=tax_obj.browse(cr,uid,vals['account_tax_id']) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 012f63a4392..f84f5181342 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -172,7 +172,6 @@ Chart of Accounts account.account tree - form [('parent_id','=',False)] @@ -717,10 +716,10 @@ - + diff --git a/addons/account/i18n/fr_FR.po b/addons/account/i18n/fr_FR.po index 401f31fbff5..7b4ee9110f5 100644 --- a/addons/account/i18n/fr_FR.po +++ b/addons/account/i18n/fr_FR.po @@ -9,7 +9,7 @@ msgstr "" "POT-Creation-Date: 2008-11-02 20:23:25+0000\n" "PO-Revision-Date: 2008-11-02 20:23:25+0000\n" "Last-Translator: <>\n" -"Language-Team: \n" +"Language-Team: OpenERP Language Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -853,7 +853,7 @@ msgstr "Propriétés des comptes" #. module: account #: model:ir.ui.menu,name:account.next_id_30 msgid "Bank Reconciliation" -msgstr "Reconciliation banquaire" +msgstr "Reconciliation bancaire" #. module: account #: model:ir.model,name:account.model_account_tax_template @@ -1097,7 +1097,7 @@ msgstr "Le champ sequence est utilisé pour classer les lignes de termes de paie #. module: account #: field:account.chart.template,property_account_income_categ:0 msgid "Income Category Account" -msgstr "" +msgstr "COmpte de type Revenu" #. module: account #: model:ir.actions.act_window,name:account.analytic_account_form @@ -1154,7 +1154,7 @@ msgstr "Journal" #. module: account #: view:res.partner:0 msgid "Bank account" -msgstr "Compte banquaire" +msgstr "Compte bancaire" #. module: account #: wizard_field:account.general.ledger.report,checktype,amount_currency:0 @@ -1322,7 +1322,7 @@ msgstr "Si vous déreconciliez des transactions, vous devez aussi vérifier tout #. module: account #: field:wizard.multi.charts.accounts,bank_accounts_id:0 msgid "Bank Accounts" -msgstr "Comptes Banquaires" +msgstr "Comptes Bancaires" #. module: account #: view:res.partner:0 @@ -2276,7 +2276,7 @@ msgstr "Certaines entrées sont déjà réconciliées !" #. module: account #: model:process.node,note:account.process_node_reconciliationofentries0 msgid "Reconcilation of the entries with invoice." -msgstr "" +msgstr "Réconciliation des entrées avec la facture." #. module: account #: view:account.tax:0 @@ -2310,7 +2310,7 @@ msgstr "Laissez vide pour utiliser la période de la date de validation" #, python-format #: code:addons/account/account.py:0 msgid "No period defined for this date !\nPlease create a fiscal year." -msgstr "" +msgstr "Pas de période définie pour cette date !\nVeuillez créer une année fiscale." #. module: account #: rml:account.central.journal:0 @@ -2344,7 +2344,7 @@ msgstr "Code" #. module: account #: model:process.process,name:account.process_process_invoiceworkflow0 msgid "Invoice Workflow" -msgstr "" +msgstr "Flux de la Facture" #. module: account #: view:account.bank.statement:0 @@ -2391,7 +2391,7 @@ msgstr "" #. module: account #: help:account.chart.template,tax_template_ids:0 msgid "List of all the taxes that have to be installed by the wizard" -msgstr "" +msgstr "Liste de toutes les taxes qui ont été installée par l'assistant" #. module: account #: rml:account.analytic.account.cost_ledger:0 @@ -2432,7 +2432,7 @@ msgstr "Mode Paysage" #. module: account #: model:process.transition,note:account.process_transition_analyticinvoice0 msgid "From analytic accounts, Create invoice." -msgstr "" +msgstr "Créer la facture à partir des comptes analytiques." #. module: account #: wizard_button:account.analytic.account.analytic.check.report,init,end:0 @@ -2484,6 +2484,8 @@ msgstr "Annuler" #: help:account.account.type,sign:0 msgid "Allows to change the displayed amount of the balance in the reports, in order to see positive results instead of negative ones in expenses accounts." msgstr "" +"Permettre de changer le montant affiché de la balance dans les rapports, dans " +"le but de voir les résultats positifs au lieu des négatifs dans les comptes de dépenses." #. module: account #: field:account.account.type,name:0 @@ -2592,12 +2594,12 @@ msgstr "Puissance" #, python-format #: code:addons/account/account_bank_statement.py:0 msgid "The account entries lines are not in valid state." -msgstr "" +msgstr "Les lignes d'entrées de compte ne sont pas dans un état valide." #. module: account #: view:res.partner:0 msgid "Bank account owner" -msgstr "Propriétaire du compte banquaire" +msgstr "Propriétaire du compte bancaire" #. module: account #: rml:account.invoice:0 @@ -2622,7 +2624,7 @@ msgstr "Plan de Comptes Analytiques" #: field:account.fiscal.position,account_ids:0 #: view:account.fiscal.position:0 msgid "Accounts Mapping" -msgstr "" +msgstr "Association des comptes" #. module: account #: field:account.invoice,number:0 @@ -2633,18 +2635,18 @@ msgstr "Numéro de facture" #: wizard_button:populate_statement_from_inv,customer,finish:0 #: wizard_button:populate_statement_from_inv,supplier,finish:0 msgid "O_k" -msgstr "" +msgstr "O_k" #. module: account #: model:process.node,note:account.process_node_reconciliation0 msgid "Reconciliation of entries from end of the payment " -msgstr "" +msgstr "Réconciliation des entrées de la fin du paiement " #. module: account #, python-format #: code:addons/account/wizard/wizard_fiscalyear_close.py:0 msgid "Closing of fiscal year canceled, please check the box !" -msgstr "" +msgstr "Cloture de l'année fiscale annulée, veuillez cocher la case !" #. module: account #: model:ir.actions.report.xml,name:account.account_analytic_account_inverted_balance @@ -2686,7 +2688,7 @@ msgstr "Transactions de reconciliation" #. module: account #: wizard_field:account.aged.trial.balance,init,direction_selection:0 msgid "Analysis Direction" -msgstr "" +msgstr "Direction de l'analyse" #. module: account #: field:res.partner,ref_companies:0 @@ -2744,23 +2746,29 @@ msgstr "État Ouvert" #. module: account #: rml:account.analytic.account.quantity_cost_ledger:0 msgid "Max.qty:" -msgstr "" +msgstr "Qté Max." #. module: account #: help:account.account,currency_mode:0 msgid "This will select how is computed the current currency rate for outgoing transactions. In most countries the legal method is \"average\" but only a few softwares are able to manage this. So if you import from another software, you may have to use the rate at date. Incoming transactions, always use the rate at date." msgstr "" +"Cela sélectionnera la façon dont sera calculé le taux de change pour les " +"transactions sortantes. Dans la plupart des pays, la méthode légale est la " +"méthode \"moyenne\" mais seuls, un certain nombre de logiciels sont capables " +"de la gérer. Ainsi, si vous importez à partir d'un autre logiciel, vous devrez " +"probablement utiliser le taux à la date. Pour les transactions entrantes, utilisez " +"toujours le taux à la date." #. module: account #: model:process.transition,note:account.process_transition_statemententries0 msgid "From statement, create entries" -msgstr "" +msgstr "Créer les entrées à partir des extraits" #. module: account #, python-format #: code:addons/account/account.py:0 msgid "You can not delete posted movement: \"%s\"!" -msgstr "" +msgstr "Vous ne pouvez pas effacer le pouvement posté : \"%s\"!" #. module: account #: rml:account.partner.balance:0 @@ -2779,7 +2787,7 @@ msgstr "" #: rml:account.vat.declaration:0 #: rml:account.analytic.account.journal:0 msgid "1cm 27.7cm 20cm 27.7cm" -msgstr "" +msgstr "1cm 27.7cm 20cm 27.7cm" #. module: account #: model:ir.actions.act_window,name:account.action_invoice_tree12 @@ -2790,12 +2798,12 @@ msgstr "Notes de Crédit Fournisseur Brouillon" #. module: account #: model:process.process,note:account.process_process_invoiceworkflow0 msgid "Invoice flow for services companies." -msgstr "" +msgstr "Flux des factures pour les sociétés de services." #. module: account #: model:process.node,name:account.process_node_accountingstatemententries0 msgid "Accounting Statement" -msgstr "" +msgstr "Extraits de compte" #. module: account #: rml:account.invoice:0 @@ -2807,7 +2815,7 @@ msgstr "Note de Crédit Fournisseur" #, python-format #: code:addons/account/account_bank_statement.py:0 msgid "Unable to reconcile entry \"%s\": %.2f" -msgstr "" +msgstr "Impossible de réconcilier l'entrée \"%s\": %.2f" #. module: account #: field:account.bank.statement,balance_end_real:0 @@ -2833,7 +2841,7 @@ msgstr "Lignes d'entrée" #. module: account #: field:account.account,check_history:0 msgid "Display History" -msgstr "" +msgstr "Afficher l'historique" #. module: account #: field:account.move.line,centralisation:0 @@ -2851,7 +2859,7 @@ msgstr "Code de taxe" #. module: account #: rml:account.analytic.account.journal:0 msgid "Analytic Journal -" -msgstr "" +msgstr "Journal Analytique -" #. module: account #, python-format @@ -2862,12 +2870,12 @@ msgstr "" #. module: account #: rml:account.analytic.account.analytic.check:0 msgid "Analytic Debit" -msgstr "" +msgstr "Débit Analytique" #. module: account #: field:account.account,currency_mode:0 msgid "Outgoing Currencies Rate" -msgstr "" +msgstr "Taux de Change Sortant" #. module: account #: model:ir.actions.act_window,name:account.action_invoice_tree10 @@ -2879,7 +2887,7 @@ msgstr "Note de Crédit Client Brouillon" #, python-format #: code:addons/account/account.py:0 msgid "Sales Journal" -msgstr "" +msgstr "Journal des Ventes" #. module: account #: field:account.journal.column,readonly:0 @@ -2911,7 +2919,7 @@ msgstr "Le mouvement de cette ligne d'entrée." #. module: account #: field:account.invoice.line,uos_id:0 msgid "Unit of Measure" -msgstr "" +msgstr "Unité de Mesure" #. module: account #: view:account.tax.template:0 @@ -2922,7 +2930,7 @@ msgstr "Laisser vide pour utiliser le compte de revenu" #. module: account #: rml:account.central.journal:0 msgid "Printing Date" -msgstr "" +msgstr "Date d'Impression" #. module: account #: constraint:account.analytic.account:0 @@ -2955,12 +2963,12 @@ msgstr "Ouvrir pour réconciliation" #. module: account #: rml:account.general.ledger:0 msgid "Entry Label" -msgstr "" +msgstr "Titre de l'Entrée" #. module: account #: model:process.transition,note:account.process_transition_paymentreconcile0 msgid "Reconcilate the entries from payment" -msgstr "" +msgstr "Réconcilier les entrées à partir du paiement" #. module: account #: rml:account.tax.code.entries:0 @@ -2971,7 +2979,7 @@ msgstr "(" #, python-format #: code:addons/account/account.py:0 msgid "You can not modify/delete a journal with entries for this period !" -msgstr "" +msgstr "Vous ne pouvez pas modifier/effacer un journal avec des entrées pour cette période !" #. module: account #: view:account.invoice:0 @@ -2983,13 +2991,13 @@ msgstr "Mettre en brouillon" #. module: account #: help:account.invoice,origin:0 msgid "Reference of the document that produced this invoice." -msgstr "" +msgstr "Référence du document qui a produit cette facture." #. module: account #: selection:account.account.template,type:0 #: selection:account.account,type:0 msgid "Payable" -msgstr "" +msgstr "Payable" #. module: account #: rml:account.invoice:0 @@ -3006,12 +3014,12 @@ msgstr "Intitulé des comptes" #: selection:account.account.template,type:0 #: selection:account.account,type:0 msgid "Others" -msgstr "" +msgstr "Autres" #. module: account #: field:account.chart.template,property_account_expense_categ:0 msgid "Expense Category Account" -msgstr "" +msgstr "Compte de type Dépense" #. module: account #: wizard_button:account.move.validate,init,validate:0 @@ -3029,7 +3037,7 @@ msgstr "Légende" #. module: account #: model:process.node,note:account.process_node_draftinvoices0 msgid "Proposed invoice to be checked, validated and printed" -msgstr "" +msgstr "Facture proposée pour être vérifiée, validée ou imprimée" #. module: account #: model:ir.actions.act_window,name:account.action_move_line_select @@ -3067,7 +3075,8 @@ msgstr "Notes" #. module: account #: help:account.invoice,reconciled:0 msgid "The account moves of the invoice have been reconciled with account moves of the payment(s)." -msgstr "" +msgstr "Les mouvements de compte de la facture ont été réconciliés avec les " +"mouvements de compte du(des) paiement(s)." #. module: account #: model:ir.actions.act_window,name:account.action_tax_form @@ -3093,12 +3102,12 @@ msgstr "" #. module: account #: selection:account.account,currency_mode:0 msgid "Average Rate" -msgstr "" +msgstr "Taux Moyen" #. module: account #: model:process.node,note:account.process_node_bankstatement0 msgid "Statement encoding produces payment entries" -msgstr "" +msgstr "L'encodage des extraits produits les entrées du paiement" #. module: account #: model:ir.model,name:account.model_account_bank_statement_reconcile_line @@ -3115,7 +3124,7 @@ msgstr "Modèles pour les Comptes" #: code:addons/account/account_move_line.py:0 #: code:addons/account/account_analytic_line.py:0 msgid "Entries: " -msgstr "" +msgstr "Entrées : " #. module: account #: model:ir.actions.wizard,name:account.wizard_reconcile @@ -3147,12 +3156,12 @@ msgstr "Nom de la taxe" #. module: account #: model:ir.actions.report.xml,name:account.account_overdue msgid "Overdue Payments" -msgstr "" +msgstr "Paiements en retard" #. module: account #: model:account.payment.term,name:account.account_payment_term msgid "30 Days End of Month" -msgstr "" +msgstr "30 Jours Fin de Mois" #. module: account #: view:account.account:0 @@ -3167,7 +3176,7 @@ msgstr "N° d'écriture" #. module: account #: field:account.fiscal.position.tax,tax_src_id:0 msgid "Tax Source" -msgstr "" +msgstr "Source de la Taxe" #. module: account #: model:ir.actions.report.xml,name:account.account_analytic_account_balance @@ -3184,23 +3193,23 @@ msgstr "Total débit" #, python-format #: code:addons/account/wizard/wizard_bank_reconcile.py:0 msgid "You have to define the bank account\nin the journal definition for reconciliation." -msgstr "" +msgstr "Vous devez définir le compte bancaire\ndans la définition du journal pour la réconciliation." #. module: account #: view:wizard.multi.charts.accounts:0 msgid "Bank Information" -msgstr "" +msgstr "Information Bancaire" #. module: account #, python-format #: code:addons/account/account_move_line.py:0 msgid "Entry \"%s\" is not valid !" -msgstr "" +msgstr "L'entrée \"%s\" n'est pas valide !" #. module: account #: rml:account.invoice:0 msgid "Fax :" -msgstr "" +msgstr "Fax :" #. module: account #: rml:account.partner.balance:0 @@ -3208,7 +3217,7 @@ msgstr "" #: model:ir.actions.wizard,name:account.wizard_partner_balance_report #: model:ir.ui.menu,name:account.menu_partner_balance msgid "Partner Balance" -msgstr "" +msgstr "Balance Partenaire" #. module: account #: rml:account.third_party_ledger:0 @@ -3249,7 +3258,7 @@ msgstr "Entrées réelles" #. module: account #: model:process.node,name:account.process_node_importinvoice0 msgid "Import invoice" -msgstr "" +msgstr "Importer la facture" #. module: account #: view:account.invoice:0 @@ -3307,7 +3316,7 @@ msgstr "Type de compte" #. module: account #: wizard_view:account.analytic.line,init:0 msgid "Account Analytic Lines Analysis" -msgstr "" +msgstr "Analyse des Lignes de Compte Analytique" #. module: account #: wizard_view:account.account.balance.report,checktype:0 @@ -3315,7 +3324,7 @@ msgstr "" #: wizard_view:account.partner.balance.report,init:0 #: wizard_view:account.third_party_ledger.report,init:0 msgid "Filter on Periods" -msgstr "" +msgstr "Filtrer sur les Périodes" #. module: account #: field:res.partner,property_account_receivable:0 @@ -3330,7 +3339,7 @@ msgstr "Payer et réconcilier" #. module: account #: model:ir.actions.report.xml,name:account.account_central_journal msgid "Central Journal" -msgstr "" +msgstr "Journal Central" #. module: account #, python-format @@ -3340,7 +3349,7 @@ msgstr "" #: code:addons/account/account_analytic_line.py:0 #: code:addons/account/wizard/wizard_pay_invoice.py:0 msgid "Error !" -msgstr "" +msgstr "Erreur !" #. module: account #: rml:account.third_party_ledger:0 @@ -3361,7 +3370,7 @@ msgstr "Enfants consolidés" #. module: account #: model:ir.actions.report.xml,name:account.account_vat_declaration msgid "Taxes Report" -msgstr "" +msgstr "Rapports de Taxes" #. module: account #: selection:account.journal.period,state:0 @@ -3398,7 +3407,7 @@ msgstr "Journal" #: selection:account.account.template,type:0 #: selection:account.account,type:0 msgid "Closed" -msgstr "" +msgstr "Fermé" #. module: account #: view:account.analytic.line:0 @@ -3429,7 +3438,7 @@ msgstr "Référence Client:" #. module: account #: field:wizard.multi.charts.accounts,code_digits:0 msgid "# of Digits" -msgstr "" +msgstr "# de décimales" #. module: account #: wizard_field:account.move.line.reconcile,addendum,period_id:0 @@ -3439,7 +3448,7 @@ msgstr "Période d'ajustement" #. module: account #: help:account.invoice,account_id:0 msgid "The partner account used for this invoice." -msgstr "" +msgstr "Le compte partenaire utilisé pour cette facture." #. module: account #: model:process.transition,note:account.process_transition_accountentryreconcile0 @@ -3456,12 +3465,12 @@ msgstr "Encoder entrée" #: wizard_button:account.invoice.refund,init,refund:0 #: model:ir.actions.wizard,name:account.wizard_invoice_refund msgid "Credit Note" -msgstr "" +msgstr "Note de Crédit" #. module: account #: selection:account.config.wizard,period:0 msgid "3 Months" -msgstr "" +msgstr "3 Mois" #. module: account #: wizard_view:account.move.journal,init:0 @@ -3471,12 +3480,13 @@ msgstr "Entrées standard" #. module: account #: help:account.account,check_history:0 msgid "Check this box if you want to print all entries when printing the General Ledger, otherwise it will only print its balance." -msgstr "" +msgstr "Cochez cette case si vous voulez imprimer les entrées lors de l'impression " +"du Grand Livre des Comptes Généraux, sinon, elle imprimera uniquement la balance." #. module: account #: model:process.node,note:account.process_node_draftstatement0 msgid "Set starting and ending balance if bank statement" -msgstr "" +msgstr "Définissez la balance de départ et de fin si extrait bancaire" #. module: account #: selection:account.config.wizard,period:0 @@ -3504,7 +3514,7 @@ msgstr "Écriture d'abonnement" #. module: account #: model:ir.actions.act_window,name:account.action_account_config_wizard_form msgid "Account Configure Wizard " -msgstr "" +msgstr "Assistant de Configuration des Comptes" #. module: account #: wizard_button:account.wizard_paid_open,init,yes:0 @@ -3514,7 +3524,7 @@ msgstr "Oui" #. module: account #: wizard_view:account.general.ledger.report,account_selection:0 msgid "Select Chart" -msgstr "" +msgstr "Sélectionnez le Graphique" #. module: account #: model:ir.actions.report.xml,name:account.account_move_line_list @@ -3530,14 +3540,14 @@ msgstr "Note de Crédit Fournisseur" #. module: account #: rml:account.invoice:0 msgid "Invoice Date" -msgstr "" +msgstr "Date d'Impression" #. module: account #, python-format #: code:addons/account/wizard/wizard_open_closed_fiscalyear.py:0 #: code:addons/account/wizard/wizard_fiscalyear_close.py:0 msgid "The journal must have centralised counterpart" -msgstr "" +msgstr "Le journal doit avoir une contre-partie centralisée" #. module: account #: selection:account.account.type,close_method:0 @@ -3553,7 +3563,7 @@ msgstr "Ouvrir pour déréconciliation" #, python-format #: code:addons/account/invoice.py:0 msgid "Bad total !" -msgstr "" +msgstr "Total incorrect !" #. module: account #: field:account.journal,sequence_id:0 @@ -3570,7 +3580,7 @@ msgstr "Traitement les différences de paiement" #. module: account #: model:process.node,name:account.process_node_paymententries0 msgid "Payment Entries" -msgstr "" +msgstr "Entrées du Paiement" #. module: account #: model:ir.model,name:account.model_account_payment_term_line @@ -3598,13 +3608,15 @@ msgstr "En suspend" #. module: account #: rml:account.general.journal:0 msgid "General Journal -" -msgstr "" +msgstr "Journal Général -" #. module: account #, python-format #: code:addons/account/account_move_line.py:0 msgid "You can not do this modification on a confirmed entry ! Please note that you can just change some non important fields !" msgstr "" +"Vous ne pouvez pas effetcuer cette modification sur une entrée confirmée ! Veuillez " +"noter que vous pouvez quand même changer certains champs non importants !" #. module: account #: rml:account.overdue:0 @@ -3619,7 +3631,7 @@ msgstr "" #. module: account #: rml:account.overdue:0 msgid "Customer account statement" -msgstr "" +msgstr "Extrait de Compte Client" #. module: account #: model:ir.actions.act_window,name:account.action_account_journal_form @@ -3655,7 +3667,7 @@ msgstr "Groupes" #. module: account #: rml:account.analytic.account.quantity_cost_ledger:0 msgid "Code/Date" -msgstr "" +msgstr "Code/Date" #. module: account #: field:account.account,active:0 @@ -3671,7 +3683,7 @@ msgstr "Actif" #. module: account #: model:process.node,note:account.process_node_electronicfile0 msgid "Import from your bank statements" -msgstr "" +msgstr "Importer de vos extraits bancaires" #. module: account #: field:account.invoice.line,discount:0 @@ -3681,7 +3693,7 @@ msgstr "Escompte (%)" #. module: account #: view:account.chart.template:0 msgid "Properties" -msgstr "" +msgstr "Propriétés" #. module: account #: view:account.account:0 @@ -3695,12 +3707,12 @@ msgstr "Informations générales" #. module: account #: rml:account.general.journal:0 msgid "Printing Date :" -msgstr "" +msgstr "Date d'Impression :" #. module: account #: model:process.process,name:account.process_process_statementworkflow0 msgid "Statement workflow" -msgstr "" +msgstr "Flux de l'Extrait" #. module: account #: rml:account.analytic.account.quantity_cost_ledger:0 @@ -3708,17 +3720,17 @@ msgstr "" #: rml:account.general.journal:0 #: rml:account.invoice:0 msgid "Total:" -msgstr "" +msgstr "Total :" #. module: account #: wizard_field:account.vat.declaration,init,based_on:0 msgid "Base on" -msgstr "" +msgstr "Basé sur" #. module: account #: field:account.chart.template,property_account_payable:0 msgid "Payable Account" -msgstr "" +msgstr "Compte Payable" #. module: account #: field:account.account,currency_id:0 @@ -3811,7 +3823,7 @@ msgstr "Limite de paiement" #, python-format #: code:addons/account/invoice.py:0 msgid "Global taxes defined, but not in invoice lines !" -msgstr "" +msgstr "Taxes globales définies, mais pas dans les lignes de facture !" #. module: account #: wizard_field:account.account.balance.report,checktype,state:0 @@ -3819,7 +3831,7 @@ msgstr "" #: wizard_field:account.partner.balance.report,init,state:0 #: wizard_field:account.third_party_ledger.report,init,state:0 msgid "Date/Period Filter" -msgstr "" +msgstr "Filtre par Date/Période" #. module: account #: rml:account.analytic.account.journal:0 @@ -3832,7 +3844,7 @@ msgstr "Général" #. module: account #: rml:account.general.journal:0 msgid "Credit Trans." -msgstr "" +msgstr "Trans. de Crédit" #. module: account #: help:account.bank.statement.reconcile,total_second_currency:0 @@ -3910,7 +3922,7 @@ msgstr "Le nom de l'objet doit commencer avec x_ et ne pas contenir de charactè #. module: account #: help:account.config.wizard,code:0 msgid "Name of the fiscal year as displayed in reports." -msgstr "" +msgstr "Nom de l'année fiscale comme affichée sur les rapports." #. module: account #: help:account.move.line,date_maturity:0 @@ -3935,7 +3947,7 @@ msgstr "Types de contrôle" #. module: account #: wizard_view:populate_statement_from_inv,init:0 msgid "Choose invoice type and payment date" -msgstr "" +msgstr "Choisissez le type de facture et la date de paiement" #. module: account #: rml:account.analytic.account.analytic.check:0 @@ -3950,7 +3962,7 @@ msgstr "Nom du compte" #: wizard_field:account.move.line.reconcile,init_partial,credit:0 #: wizard_field:account.move.line.reconcile,init_full,credit:0 msgid "Credit amount" -msgstr "" +msgstr "Montant du Crédit" #. module: account #: rml:account.invoice:0 @@ -3977,7 +3989,7 @@ msgstr "Produit" #. module: account #: rml:account.partner.balance:0 msgid "Partner name" -msgstr "" +msgstr "Nom du Partenaire" #. module: account #: rml:account.tax.code.entries:0 @@ -4018,13 +4030,13 @@ msgstr "Colonnes" #. module: account #: model:process.transition,note:account.process_transition_filestatement0 msgid "Import file from your bank statement" -msgstr "" +msgstr "Importer un fichier de vos extraits bancaire" #. module: account #: field:account.account.template,type:0 #: field:account.account,type:0 msgid "Internal Type" -msgstr "" +msgstr "Type Interne" #. module: account #: model:ir.actions.act_window,name:account.action_subscription_form_running @@ -4805,7 +4817,7 @@ msgstr "Cochez ce compte si l'utilisateur peut faire une réconciliation des ent #. module: account #: view:res.partner:0 msgid "Supplier Debit" -msgstr "" +msgstr "Débit du Fournisseur" #. module: account #: wizard_button:account.invoice.pay,init,writeoff_check:0 @@ -4815,7 +4827,7 @@ msgstr "Paiement total" #. module: account #: rml:account.analytic.account.analytic.check:0 msgid "Analytic Credit" -msgstr "" +msgstr "Crédit Analytique" #. module: account #: field:account.fiscal.position.tax,tax_dest_id:0 @@ -4831,7 +4843,7 @@ msgstr "" #, python-format #: code:addons/account/wizard/wizard_journal.py:0 msgid "This period is already closed !" -msgstr "" +msgstr "Cette période est déjà close !" #. module: account #: wizard_view:account_use_models,create:0 @@ -4865,7 +4877,7 @@ msgstr "Toutes les entrées de compte" #: wizard_view:account.partner.balance.report,init:0 #: wizard_view:account.third_party_ledger.report,init:0 msgid "Date Filter" -msgstr "" +msgstr "Filtre par Date" #. module: account #: model:ir.actions.wizard,name:account.wizard_reconcile_unreconcile @@ -4882,7 +4894,7 @@ msgstr "Notes de Crédit Client Non Payées" #. module: account #: help:account.invoice,residual:0 msgid "Remaining amount due." -msgstr "" +msgstr "Montant dû restant." #. module: account #: wizard_view:account.fiscalyear.close,init:0 @@ -4904,7 +4916,7 @@ msgstr "Lignes d'Entrée Partielle" #. module: account #: help:account.move.line,statement_id:0 msgid "The bank statement used for bank reconciliation" -msgstr "Le relevé banquaire utilisé pour la réconciliation banquaire" +msgstr "Le relevé bancaire utilisé pour la réconciliation bancaire" #. module: account #: view:account.fiscalyear:0 @@ -4914,13 +4926,13 @@ msgstr "Exercice" #. module: account #: wizard_button:account.analytic.line,init,open:0 msgid "Open Entries" -msgstr "" +msgstr "Entrées Ouvertes" #. module: account #, python-format #: code:addons/account/account_move_line.py:0 msgid "Bad account!" -msgstr "" +msgstr "Compte incorrect !" #. module: account #: selection:account.analytic.account,type:0 @@ -4951,7 +4963,7 @@ msgstr "Utilisateur" #, python-format #: code:addons/account/account_move_line.py:0 msgid "You can not use an inactive account!" -msgstr "" +msgstr "Vous ne pouvez pas utiliser un compte inactif !" #. module: account #: wizard_field:account.general.ledger.report,checktype,soldeinit:0 @@ -4962,7 +4974,7 @@ msgstr "" #. module: account #: model:ir.ui.menu,name:account.menu_generic_report msgid "Generic Reports" -msgstr "" +msgstr "Rapports Génériques" #. module: account #: rml:account.account.balance:0 @@ -4979,7 +4991,7 @@ msgstr "Montant réconcilié" #. module: account #: selection:account.account,currency_mode:0 msgid "At Date" -msgstr "" +msgstr "À la Date" #. module: account #: rml:account.central.journal:0 @@ -5002,7 +5014,7 @@ msgstr "Calculer" #. module: account #: help:account.invoice.line,account_id:0 msgid "The income or expense account related to the selected product." -msgstr "" +msgstr "Le compte de revenu ou de dépense relatif au produit sélectionné." #. module: account #: field:account.bank.statement.reconcile,total_entry:0 @@ -5018,7 +5030,7 @@ msgstr "Montant total" #. module: account #: field:account.invoice,amount_untaxed:0 msgid "Untaxed" -msgstr "" +msgstr "Non Taxé" #. module: account #: model:ir.model,name:account.model_report_hr_timesheet_invoice_journal @@ -5029,7 +5041,7 @@ msgstr "Compte analytique coûts et revenus" #, python-format #: code:addons/account/account_move_line.py:0 msgid "Bad account !" -msgstr "" +msgstr "Compte Incorrect !" #. module: account #, python-format @@ -5037,7 +5049,7 @@ msgstr "" #: code:addons/account/account_move_line.py:0 #: code:addons/account/wizard/wizard_open_closed_fiscalyear.py:0 msgid "Error" -msgstr "" +msgstr "Erreur" #. module: account #: wizard_field:account.analytic.account.analytic.check.report,init,date2:0 @@ -5065,18 +5077,18 @@ msgstr "" #: wizard_button:account.account.balance.report,account_selection,checktype:0 #: wizard_button:account.general.ledger.report,account_selection,checktype:0 msgid "Next" -msgstr "" +msgstr "Suivant" #. module: account #, python-format #: code:addons/account/invoice.py:0 msgid "Taxes missing !" -msgstr "" +msgstr "Taxes Manquantes !" #. module: account #: help:account.invoice,partner_bank:0 msgid "The bank account to pay to or to be paid from" -msgstr "Compte banquaire à débiter ou à créditer" +msgstr "Compte bancaire à débiter ou à créditer" #. module: account #: rml:account.invoice:0 @@ -5098,7 +5110,7 @@ msgstr "" #. module: account #: model:process.process,note:account.process_process_statementworkflow0 msgid "Statement flow for services companies." -msgstr "" +msgstr "Flux des factures pour les sociétés de services." #. module: account #: model:ir.actions.act_window,name:account.action_account_analytic_journal_form @@ -5136,13 +5148,13 @@ msgstr "Laisser vide pour utiliser le compte de dépense" #. module: account #: help:res.partner,debit:0 msgid "Total amount you have to pay to this supplier." -msgstr "" +msgstr "Montant total que vous devez payé pour ce fournisseur." #. module: account #, python-format #: code:addons/account/account.py:0 msgid "No sequence defined in the journal !" -msgstr "" +msgstr "Pas de séquence définie dans ce journal !" #. module: account #: selection:account.analytic.account,state:0 @@ -5169,7 +5181,7 @@ msgstr "Liste des Comptes" #: view:product.product:0 #: view:product.template:0 msgid "Sales Properties" -msgstr "" +msgstr "Propriétés des Ventes" #. module: account #: view:res.partner:0 @@ -5195,17 +5207,17 @@ msgstr "Montant total dû :" #. module: account #: wizard_field:account.analytic.line,init,to_date:0 msgid "To" -msgstr "" +msgstr "Au" #. module: account #: view:account.analytic.account:0 msgid "Analytic Account Statistics" -msgstr "" +msgstr "Statistiques des Comptes Analytiques" #. module: account #: model:ir.actions.act_window,name:account.action_account_analytic_journal_open_form msgid "Entries of Open Analytic Journals" -msgstr "" +msgstr "Entrées des Journaux Analytiques Ouverts" #. module: account #: view:account.invoice.tax:0 @@ -5239,13 +5251,13 @@ msgstr "Nom du modèle" #, python-format #: code:addons/account/invoice.py:0 msgid "Cannot delete invoice(s) which are already opened or paid !" -msgstr "" +msgstr "Impossible de supprimer une(des) facture(s) déjà ouverte(s) ou payée(s) !" #. module: account #, python-format #: code:addons/account/invoice.py:0 msgid "Can not create invoice move on centralized journal" -msgstr "" +msgstr "Impossible de créer une facture sur un journal centralisé" #. module: account #: help:res.partner,property_account_receivable:0 @@ -5255,7 +5267,7 @@ msgstr "Ce compte sera utilisé, au lieu de celui par defaut, en tant que compte #. module: account #: wizard_button:account.vat.declaration,init,report:0 msgid "Print VAT Decl." -msgstr "" +msgstr "Imprimer la Déclaration TVA" #. module: account #: rml:account.invoice:0 @@ -5301,12 +5313,12 @@ msgstr "Modèles de Plan de Comptes" #. module: account #: view:account.config.wizard:0 msgid "Account Configure" -msgstr "" +msgstr "Configurer le Compte" #. module: account #: model:process.transition,note:account.process_transition_validentries0 msgid "Valid entries from invoice" -msgstr "" +msgstr "Entrées valides de la facture" #. module: account #: selection:account.subscription,state:0 @@ -5352,11 +5364,14 @@ msgstr "Référence" #: code:addons/account/invoice.py:0 msgid "Can not create an automatic sequence for this piece !\n\nPut a sequence in the journal definition for automatic numbering or create a sequence manually for this piece." msgstr "" +"Impossible de créer une séquence automatique pour cette pièce !\n\nDéfinissez une " +"séquence dans la définition du journal pour une numérotation automatique ou " +"créez une séquence manuellement pour cette pièce." #. module: account #: rml:account.analytic.account.balance:0 msgid "Analytic Balance -" -msgstr "" +msgstr "Balance Analytique -" #. module: account #: wizard_field:account_use_models,init_form,model:0 @@ -5378,7 +5393,7 @@ msgstr "Client" #, python-format #: code:addons/account/wizard/wizard_pay_invoice.py:0 msgid "Can not pay draft invoice." -msgstr "" +msgstr "Impossible de payer une facture brouillon." #. module: account #: field:account.subscription,period_type:0 @@ -5393,7 +5408,7 @@ msgstr "Obligatoire" #. module: account #: wizard_field:account.print.journal.report,init,sort_selection:0 msgid "Entries Sorted By" -msgstr "" +msgstr "Entrées Triées Par" #. module: account #: help:account.tax,name:0 @@ -5403,7 +5418,7 @@ msgstr "Ce nom sera utilisé pour être affiché sur les rapports" #. module: account #: rml:account.journal.period.print:0 msgid "Print Journal -" -msgstr "" +msgstr "Imprimer le Journal -" #. module: account #: help:account.account,currency_id:0 @@ -5416,7 +5431,7 @@ msgstr "Force tout les mouvements pour ce compte à avoir cette devise secondair #: wizard_view:account.partner.balance.report,init:0 #: wizard_view:account.third_party_ledger.report,init:0 msgid "Select Date-Period" -msgstr "" +msgstr "Sélectionnez la Date-Période" #. module: account #: model:account.account.type,name:account.account_type_cash_moves @@ -5428,7 +5443,7 @@ msgstr "Liquidités" #. module: account #: field:account.fiscal.position.account,account_dest_id:0 msgid "Account Destination" -msgstr "" +msgstr "Destination du Compte" #. module: account #: rml:account.overdue:0 @@ -5446,7 +5461,7 @@ msgstr "Exercice comptable" #: field:account.invoice,payment_ids:0 #: view:account.invoice:0 msgid "Payments" -msgstr "" +msgstr "Paiements" #. module: account #: view:product.product:0 @@ -5458,7 +5473,7 @@ msgstr "Comptabilité" #. module: account #: model:process.transition,note:account.process_transition_entriesreconcile0 msgid "Reconcile Entries." -msgstr "" +msgstr "Réconcilier les Entrées." #. module: account #: field:account.subscription.line,move_id:0 @@ -5469,7 +5484,7 @@ msgstr "Entrée" #: model:process.node,note:account.process_node_paidinvoice0 #: model:process.transition,note:account.process_transition_reconcilepaid0 msgid "Paid invoice when reconciled." -msgstr "" +msgstr "Facture payée après réconciliation." #. module: account #: field:account.tax,python_compute_inv:0 @@ -5494,7 +5509,7 @@ msgstr "Code Python (TVA Incl)" #: rml:account.vat.declaration:0 #: rml:account.analytic.account.journal:0 msgid "Page" -msgstr "" +msgstr "Page" #. module: account #: model:ir.actions.act_window,name:account.action_payment_term_form @@ -5508,7 +5523,7 @@ msgstr "Conditions de Paiement" #: help:account.tax.template,ref_tax_sign:0 #: help:account.tax.template,tax_sign:0 msgid "Usually 1 or -1." -msgstr "" +msgstr "Souvent 1 ou -1." #. module: account #: model:ir.model,name:account.model_account_move @@ -5534,7 +5549,7 @@ msgstr "Lignes analytiques" #. module: account #: field:account.bank.accounts.wizard,acc_no:0 msgid "Account No." -msgstr "" +msgstr "Compte N°." #. module: account #: model:ir.actions.wizard,name:account.wizard_invoice_state_cancel @@ -5544,7 +5559,7 @@ msgstr "Annuler les factures sélectionnées" #. module: account #: help:account.config.wizard,name:0 msgid "Name of the fiscal year as displayed on screens." -msgstr "" +msgstr "Nom de l'année fiscale comme affiché sur les écrans." #. module: account #: model:ir.model,name:account.model_account_payment_term @@ -5566,7 +5581,7 @@ msgstr "Devise" #. module: account #: model:process.node,name:account.process_node_confirmedstatement0 msgid "Confirmed statement" -msgstr "" +msgstr "Extrait confirmé" #. module: account #: model:ir.model,name:account.model_account_bank_statement_reconcile @@ -5590,5 +5605,5 @@ msgstr "Nom de colonne" #: wizard_view:account.partner.balance.report,init:0 #: wizard_view:account.third_party_ledger.report,init:0 msgid "Filters" -msgstr "" +msgstr "Filtres" diff --git a/addons/account/invoice.py b/addons/account/invoice.py index d346a5824fe..747b5d4a629 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -861,6 +861,7 @@ class account_invoice_line(osv.osv): _description = "Invoice line" _columns = { 'name': fields.char('Description', size=256, required=True), + 'origin': fields.char('Origin', size=256, help="Reference of the document that produced this invoice."), 'invoice_id': fields.many2one('account.invoice', 'Invoice Ref', ondelete='cascade', select=True), 'uos_id': fields.many2one('product.uom', 'Unit of Measure', ondelete='set null'), 'product_id': fields.many2one('product.product', 'Product', ondelete='set null'), diff --git a/addons/account/report/general_ledger.py b/addons/account/report/general_ledger.py index a2b5f729e67..aef67140939 100755 --- a/addons/account/report/general_ledger.py +++ b/addons/account/report/general_ledger.py @@ -36,27 +36,27 @@ from osv import osv class general_ledger(rml_parse.rml_parse): _name = 'report.account.general.ledger' - - - + + + def preprocess(self, objects, data, ids): ## - - + + self.borne_date = self.get_min_date(data['form']) - - + + ## new_ids = [] if (data['model'] == 'account.account'): new_ids = ids else: new_ids.append(data['form']['Account_list']) - + objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids) - + super(general_ledger, self).preprocess(objects, data, new_ids) - + def __init__(self, cr, uid, name, context): super(general_ledger, self).__init__(cr, uid, name, context) self.date_borne = {} @@ -64,7 +64,7 @@ class general_ledger(rml_parse.rml_parse): self.child_ids = "" self.tot_currency = 0.0 self.period_sql = "" - self.sold_accounts = {} + self.sold_accounts = {} self.localcontext.update( { 'time': time, 'lines': self.lines, @@ -73,7 +73,7 @@ class general_ledger(rml_parse.rml_parse): 'sum_solde_account': self._sum_solde_account, 'sum_debit': self._sum_debit, 'sum_credit': self._sum_credit, - 'sum_solde': self._sum_solde, + 'sum_solde': self._sum_solde, 'get_children_accounts': self.get_children_accounts, 'sum_currency_amount_account': self._sum_currency_amount_account }) @@ -82,7 +82,7 @@ class general_ledger(rml_parse.rml_parse): result = {} #for id in ids: # result.setdefault(id, False) - + for account_line in self.pool.get('account.move.line').browse(cr, uid, ids, context): # For avoid long text in the field we will limit it to 5 lines # @@ -92,7 +92,7 @@ class general_ledger(rml_parse.rml_parse): num_id_move = str(account_line.move_id.id) num_id_line = str(account_line.id) account_id = str(account_line.account_id.id) - # search the basic account + # search the basic account # We have the account ID we will search all account move line from now until this time # We are in the case of we are on the top of the account move Line cr.execute('SELECT distinct(ac.code) as code_rest,ac.name as name_rest from account_account AS ac, account_move_line mv\ @@ -115,10 +115,8 @@ class general_ledger(rml_parse.rml_parse): return result def get_children_accounts(self, account, form): - self.child_ids = self.pool.get('account.account').search(self.cr, self.uid, [('parent_id', 'child_of', self.ids)]) - res = [] ctx = self.context.copy() ## We will make the test for period or date @@ -130,20 +128,21 @@ class general_ledger(rml_parse.rml_parse): else: ctx['date_from'] = form['date_from'] ctx['date_to'] = form['date_to'] -# - + # # self.query = self.pool.get('account.move.line')._query_get(self.cr, self.uid, context=ctx) - - for child_id in self.pool.get('account.account').search(self.cr, self.uid, - [('parent_id', 'child_of', [account.id])]): - + if account and account.child_consol_ids: # add ids of consolidated childs also of selected account + ctx['consolidate_childs'] = True + ctx['account_id'] = account.id + ids_acc = self.pool.get('account.account').search(self.cr, self.uid,[('parent_id', 'child_of', [account.id])],context=ctx) + + for child_id in ids_acc: child_account = self.pool.get('account.account').browse(self.cr, self.uid, child_id) - + sold_account = self._sum_solde_account(child_account,form) - + self.sold_accounts[child_account.id] = sold_account - + if form['display_account'] == 'bal_mouvement': if child_account.type != 'view' \ and len(self.pool.get('account.move.line').search(self.cr, self.uid, @@ -158,52 +157,51 @@ class general_ledger(rml_parse.rml_parse): context=ctx)) <> 0 : if ( sold_account <> 0.0): res.append(child_account) - else: + else: if child_account.type != 'view' \ and len(self.pool.get('account.move.line').search(self.cr, self.uid, [('account_id','>=',child_account.id)], context=ctx)) <> 0 : res.append(child_account) - + ## - - + + ## We will now compute solde initiaux - + if not len(res): return[account] else: for move in res: - + SOLDEINIT = "SELECT sum(l.debit) AS sum_debit, sum(l.credit) AS sum_credit FROM account_move_line l WHERE l.account_id = " + str(move.id) + " AND l.date <= '" + self.borne_date['max_date'] + "'" + " AND l.date >= '" + self.borne_date['min_date'] + "'" self.cr.execute(SOLDEINIT) - resultat = self.cr.dictfetchall() - + resultat = self.cr.dictfetchall() + if resultat[0] : - + if resultat[0]['sum_debit'] == None: sum_debit = 0 else: - + sum_debit = resultat[0]['sum_debit'] if resultat[0]['sum_credit'] == None: sum_credit = 0 else: sum_credit = resultat[0]['sum_credit'] - + move.init_credit = sum_credit move.init_debit = sum_debit - + else: move.init_credit = 0 move.init_debit = 0 - + ## - return res - + def get_min_date(self,form): - + ## Get max born from account_fiscal year # sql = """ select min(fy.date_start) as start_date,max(fy.date_stop) as stop_date from account_fiscalyear @@ -218,9 +216,9 @@ class general_ledger(rml_parse.rml_parse): periods = form['periods'][0][2] if not periods: sql = """ - Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """ + Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """ """ - else: + else: periods_id = ','.join(map(str, periods)) sql = """ Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """) @@ -236,9 +234,9 @@ class general_ledger(rml_parse.rml_parse): periods = form['periods'][0][2] if not periods: sql = """ - Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """ + Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.fiscalyear_id = """ + str(form['fiscalyear']) + """ """ - else: + else: periods_id = ','.join(map(str, periods)) sql = """ Select min(p.date_start) as start_date,max(p.date_stop) as stop_date from account_period as p where p.id in ( """ + periods_id + """) @@ -270,8 +268,8 @@ class general_ledger(rml_parse.rml_parse): } return self.date_borne - - + + def lines(self, account, form): inv_types = { 'out_invoice': 'CI: ', @@ -280,27 +278,27 @@ class general_ledger(rml_parse.rml_parse): 'in_refund': 'SR: ', } ### We will now compute solde initaux - + if form['sortbydate'] == 'sort_date': sorttag = 'l.date' else: sorttag = 'j.code' - + sql = """ - SELECT l.id, l.date, j.code,c.code AS currency_code,l.amount_currency,l.ref, l.name , l.debit, l.credit, l.period_id + SELECT l.id, l.date, j.code,c.code AS currency_code,l.amount_currency,l.ref, l.name , l.debit, l.credit, l.period_id FROM account_move_line as l - LEFT JOIN res_currency c on (l.currency_id=c.id) + LEFT JOIN res_currency c on (l.currency_id=c.id) JOIN account_journal j on (l.journal_id=j.id) AND account_id = %d - AND %s - WHERE l.date<='%s' - AND l.date>='%s' - ORDER by %s"""%(account.id,self.query,self.date_borne['max_date'],self.date_borne['min_date'],sorttag) - + AND %s + WHERE l.date<='%s' + AND l.date>='%s' + ORDER by %s"""%(account.id,self.query,self.date_borne['max_date'],self.date_borne['min_date'],sorttag) + self.cr.execute(sql) - - res = self.cr.dictfetchall() - + + res = self.cr.dictfetchall() + sum = 0.0 account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') for l in res: @@ -324,7 +322,7 @@ class general_ledger(rml_parse.rml_parse): if (l['credit'] > 0): if l['amount_currency'] != None: l['amount_currency'] = abs(l['amount_currency']) * -1 - + # if l['amount_currency'] != None: self.tot_currency = self.tot_currency + l['amount_currency'] @@ -356,7 +354,7 @@ class general_ledger(rml_parse.rml_parse): sum_credit += account.init_credit # ## - + return sum_credit def _sum_solde_account(self, account, form): @@ -366,7 +364,7 @@ class general_ledger(rml_parse.rml_parse): sum_solde = self.cr.fetchone()[0] or 0.0 if form['soldeinit']: sum_solde += account.init_debit - account.init_credit - + return sum_solde @@ -402,7 +400,7 @@ class general_ledger(rml_parse.rml_parse): # "WHERE l.account_id in ("+','.join(map(str, child_ids))+") AND "+query+period_sql) sum_solde = self.cr.fetchone()[0] or 0.0 return sum_solde - + def _set_get_account_currency_code(self, account_id): self.cr.execute("SELECT c.code as code "\ "FROM res_currency c,account_account as ac "\ @@ -412,20 +410,20 @@ class general_ledger(rml_parse.rml_parse): self.account_currency = result[0] else: self.account_currency = False - - + + def _sum_currency_amount_account(self, account, form): - + self._set_get_account_currency_code(account.id) self.cr.execute("SELECT sum(aml.amount_currency) FROM account_move_line as aml,res_currency as rc WHERE aml.currency_id = rc.id AND aml.account_id= %d "%account.id) total = self.cr.fetchone() - + if self.account_currency: return_field = str(total[0]) + self.account_currency return return_field else: currency_total = self.tot_currency = 0.0 return currency_total - + report_sxw.report_sxw('report.account.general.ledger', 'account.account', 'addons/account/report/general_ledger.rml', parser=general_ledger, header=False) diff --git a/addons/account/report/general_ledger_landscape.py b/addons/account/report/general_ledger_landscape.py index 93c7766073e..6fd2eafae76 100755 --- a/addons/account/report/general_ledger_landscape.py +++ b/addons/account/report/general_ledger_landscape.py @@ -199,8 +199,11 @@ class general_ledger_landscape(rml_parse.rml_parse): # self.query = self.pool.get('account.move.line')._query_get(self.cr, self.uid, context=ctx) - - for child_id in self.pool.get('account.account').search(self.cr, self.uid,[('parent_id', 'child_of', [account.id])]): + if account and account.child_consol_ids: # add ids of consolidated childs also of selected account + ctx['consolidate_childs'] = True + ctx['account_id'] = account.id + ids_acc = self.pool.get('account.account').search(self.cr, self.uid,[('parent_id', 'child_of', [account.id])], context=ctx) + for child_id in ids_acc: child_account = self.pool.get('account.account').browse(self.cr, self.uid, child_id) sold_account = self._sum_solde_account(child_account,form) self.sold_accounts[child_account.id] = sold_account @@ -294,9 +297,9 @@ class general_ledger_landscape(rml_parse.rml_parse): else : l['partner'] = '' - + sum = l['debit'] - l ['credit'] - + c = time.strptime(l['date'],"%Y-%m-%d") l['date'] = time.strftime("%d-%m-%Y",c) l['progress'] = sum diff --git a/addons/account/wizard/wizard_move_line_select.py b/addons/account/wizard/wizard_move_line_select.py index 645d9f90b84..64c80a8ec8d 100644 --- a/addons/account/wizard/wizard_move_line_select.py +++ b/addons/account/wizard/wizard_move_line_select.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved # $Id$ # @@ -27,6 +27,7 @@ class wizard_move_line_select(wizard.interface): def _open_window(self, cr, uid, data, context): mod_obj = pooler.get_pool(cr.dbname).get('ir.model.data') act_obj = pooler.get_pool(cr.dbname).get('ir.actions.act_window') + account_obj = pooler.get_pool(cr.dbname).get('account.account') fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear') if not context.get('fiscalyear', False): @@ -48,6 +49,10 @@ class wizard_move_line_select(wizard.interface): 'fiscalyear': context.get('fiscalyear', False), 'account_id': data['id'] } + if data['id']: + acc_data = account_obj.browse(cr, uid, data['id']).child_consol_ids + if acc_data: + result['context'].update({'consolidate_childs': True}) result['domain']=result['domain'][0:-1]+','+domain+result['domain'][-1] return result diff --git a/addons/account_analytic_analysis/i18n/fr_FR.po b/addons/account_analytic_analysis/i18n/fr_FR.po index da70d21a06f..a8248f20c93 100644 --- a/addons/account_analytic_analysis/i18n/fr_FR.po +++ b/addons/account_analytic_analysis/i18n/fr_FR.po @@ -1,4 +1,4 @@ -# Translation of OpenERP Server. +# Translation of OpenERP Server. # This file containt the translation of the following modules: # * account_analytic_analysis # @@ -9,7 +9,7 @@ msgstr "" "POT-Creation-Date: 2008-09-05 16:28+0000\n" "PO-Revision-Date: 2008-10-09 12:57+0000\n" "Last-Translator: Olivier Laurent \n" -"Language-Team: LANGUAGE \n" +"Language-Team: OpenERP Language Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -18,11 +18,9 @@ msgstr "" #. module: account_analytic_analysis #: constraint:ir.model:0 -msgid "" -"The Object name must start with x_ and not contain any special character !" +msgid "The Object name must start with x_ and not contain any special character !" msgstr "" -"Le nom de l'objet doit commencer avec x_ et ne pas contenir de charactères " -"spéciaux !" +"Le nom de l'objet doit commencer avec x_ et ne pas contenir de charactères spéciaux !" #. module: account_analytic_analysis #: field:account.analytic.account,remaining_ca:0 diff --git a/addons/account_analytic_default/i18n/fr_FR.po b/addons/account_analytic_default/i18n/fr_FR.po index a9fb37026f9..a677386f523 100644 --- a/addons/account_analytic_default/i18n/fr_FR.po +++ b/addons/account_analytic_default/i18n/fr_FR.po @@ -1,4 +1,4 @@ -# Translation of OpenERP Server. +# Translation of OpenERP Server. # This file containt the translation of the following modules: # * account_analytic_default # @@ -9,7 +9,7 @@ msgstr "" "POT-Creation-Date: 2008-09-05 16:25+0000\n" "PO-Revision-Date: 2008-10-09 13:01+0000\n" "Last-Translator: Olivier Laurent \n" -"Language-Team: LANGUAGE \n" +"Language-Team: OpenERP Language Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/addons/account_analytic_plans/__terp__.py b/addons/account_analytic_plans/__terp__.py index 6fa9334c35a..b859645cd0a 100644 --- a/addons/account_analytic_plans/__terp__.py +++ b/addons/account_analytic_plans/__terp__.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved # $Id$ # @@ -20,7 +20,7 @@ # ############################################################################## { - "name" : "Multiple-plans management in analytic accounting", + "name" : "Multiple-plans management in Analytic Accounting", "version" : "1.0", "depends" : ["account", "account_analytic_default"], "author" : "Tiny", diff --git a/addons/account_analytic_plans/account_analytic_plans.py b/addons/account_analytic_plans/account_analytic_plans.py index 4b6ab06e827..73b5f4bc815 100644 --- a/addons/account_analytic_plans/account_analytic_plans.py +++ b/addons/account_analytic_plans/account_analytic_plans.py @@ -135,12 +135,14 @@ class account_analytic_plan_instance(osv.osv): def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False): wiz_id = self.pool.get('ir.actions.wizard').search(cr, uid, [("wiz_name","=","create.model")]) res = super(account_analytic_plan_instance,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar) + if (res['type']=='form'): plan_id = False if context.get('journal_id',False): plan_id = self.pool.get('account.journal').browse(cr, uid, int(context['journal_id']), context).plan_id elif context.get('plan_id',False): - plan_id = self.pool.get('account.analytic.plan').browse(cr, uid, int(context['plan_id']), context).plan_id + plan_id = self.pool.get('account.analytic.plan').browse(cr, uid, int(context['plan_id']), context) + if plan_id: i=1 res['arch'] = """
@@ -325,8 +327,6 @@ class account_invoice(osv.osv): _name = "account.invoice" _inherit="account.invoice" - - def line_get_convert(self, cr, uid, x, part, date, context={}): res=super(account_invoice,self).line_get_convert(cr, uid, x, part, date, context) res['analytics_id']=x.get('analytics_id',False) diff --git a/addons/account_analytic_plans/account_analytic_plans_view.xml b/addons/account_analytic_plans/account_analytic_plans_view.xml index cdfa31b7a47..a211f633e9b 100644 --- a/addons/account_analytic_plans/account_analytic_plans_view.xml +++ b/addons/account_analytic_plans/account_analytic_plans_view.xml @@ -115,7 +115,7 @@ diff --git a/addons/account_analytic_plans/i18n/fr_FR.po b/addons/account_analytic_plans/i18n/fr_FR.po index 6ed5db7c154..6047e642300 100644 --- a/addons/account_analytic_plans/i18n/fr_FR.po +++ b/addons/account_analytic_plans/i18n/fr_FR.po @@ -1,4 +1,4 @@ -# Translation of OpenERP Server. +# Translation of OpenERP Server. # This file containt the translation of the following modules: # * account_analytic_plans # @@ -9,7 +9,7 @@ msgstr "" "POT-Creation-Date: 2008-09-05 16:29+0000\n" "PO-Revision-Date: 2008-10-09 13:24+0000\n" "Last-Translator: Olivier Laurent \n" -"Language-Team: LANGUAGE \n" +"Language-Team: OpenERP Language Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/addons/account_balance/i18n/fr_FR.po b/addons/account_balance/i18n/fr_FR.po index b6b4d943338..1ef97b75758 100644 --- a/addons/account_balance/i18n/fr_FR.po +++ b/addons/account_balance/i18n/fr_FR.po @@ -1,4 +1,4 @@ -# Translation of OpenERP Server. +# Translation of OpenERP Server. # This file containt the translation of the following modules: # * account_balance # @@ -9,7 +9,7 @@ msgstr "" "POT-Creation-Date: 2008-09-05 16:29+0000\n" "PO-Revision-Date: 2008-10-09 14:13+0000\n" "Last-Translator: Olivier Laurent \n" -"Language-Team: LANGUAGE \n" +"Language-Team: OpenERP Language Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/addons/account_budget/crossovered_budget_view.xml b/addons/account_budget/crossovered_budget_view.xml index 059a73175b6..6e30323c39d 100644 --- a/addons/account_budget/crossovered_budget_view.xml +++ b/addons/account_budget/crossovered_budget_view.xml @@ -12,7 +12,7 @@ - + account.budget.post.tree account.budget.post @@ -80,7 +80,7 @@ - + @@ -270,7 +270,7 @@ - + diff --git a/addons/account_budget/i18n/fr_FR.po b/addons/account_budget/i18n/fr_FR.po index f1c7b9cf177..21d025dc1f9 100644 --- a/addons/account_budget/i18n/fr_FR.po +++ b/addons/account_budget/i18n/fr_FR.po @@ -9,7 +9,7 @@ msgstr "" "POT-Creation-Date: 2008-09-05 16:26+0000\n" "PO-Revision-Date: 2008-10-14 10:30+0000\n" "Last-Translator: Olivier Laurent \n" -"Language-Team: LANGUAGE \n" +"Language-Team: OpenERP Language Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/addons/account_date_check/i18n/fr_FR.po b/addons/account_date_check/i18n/fr_FR.po index d55843623d4..ed2bfba3942 100644 --- a/addons/account_date_check/i18n/fr_FR.po +++ b/addons/account_date_check/i18n/fr_FR.po @@ -1,4 +1,4 @@ -# Translation of OpenERP Server. +# Translation of OpenERP Server. # This file containt the translation of the following modules: # * account_date_check # @@ -9,7 +9,7 @@ msgstr "" "POT-Creation-Date: 2008-09-05 16:23+0000\n" "PO-Revision-Date: 2008-10-10 06:24+0000\n" "Last-Translator: Olivier Laurent \n" -"Language-Team: LANGUAGE \n" +"Language-Team: OpenERP Language Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/addons/account_followup/i18n/fr_FR.po b/addons/account_followup/i18n/fr_FR.po index c049727c42f..a07d0248527 100644 --- a/addons/account_followup/i18n/fr_FR.po +++ b/addons/account_followup/i18n/fr_FR.po @@ -1,4 +1,4 @@ -# Translation of OpenERP Server. +# Translation of OpenERP Server. # This file containt the translation of the following modules: # * account_followup # @@ -9,7 +9,7 @@ msgstr "" "POT-Creation-Date: 2008-09-05 16:26+0000\n" "PO-Revision-Date: 2008-10-10 06:38+0000\n" "Last-Translator: Olivier Laurent \n" -"Language-Team: LANGUAGE \n" +"Language-Team: OpenERP Language Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/addons/account_invoice_layout/i18n/fr_FR.po b/addons/account_invoice_layout/i18n/fr_FR.po index a9ca18bb9d1..2be6ad23d50 100644 --- a/addons/account_invoice_layout/i18n/fr_FR.po +++ b/addons/account_invoice_layout/i18n/fr_FR.po @@ -1,4 +1,4 @@ -# Translation of OpenERP Server. +# Translation of OpenERP Server. # This file containt the translation of the following modules: # * account_invoice_layout # @@ -9,7 +9,7 @@ msgstr "" "POT-Creation-Date: 2008-09-05 16:12+0000\n" "PO-Revision-Date: 2008-10-10 06:56+0000\n" "Last-Translator: Olivier Laurent \n" -"Language-Team: LANGUAGE \n" +"Language-Team: OpenERP Language Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/addons/account_payment/i18n/fr_FR.po b/addons/account_payment/i18n/fr_FR.po index f027750f355..522d2090995 100644 --- a/addons/account_payment/i18n/fr_FR.po +++ b/addons/account_payment/i18n/fr_FR.po @@ -1,4 +1,4 @@ -# Translation of OpenERP Server. +# Translation of OpenERP Server. # This file containt the translation of the following modules: # * account_payment # @@ -9,7 +9,7 @@ msgstr "" "POT-Creation-Date: 2008-09-05 16:29+0000\n" "PO-Revision-Date: 2008-10-10 08:14+0000\n" "Last-Translator: Olivier Laurent \n" -"Language-Team: LANGUAGE \n" +"Language-Team: OpenERP Language Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/addons/account_report/account.py b/addons/account_report/account.py index 0682a1100be..20c933fae91 100644 --- a/addons/account_report/account.py +++ b/addons/account_report/account.py @@ -74,7 +74,7 @@ class account_report(osv.osv): del context['fiscalyear'] acc = self.pool.get('account.account') acc_id = acc.search(cr, uid, [('code','in',code)]) - return reduce(lambda y,x=0: x.credit+y, acc.browse(cr, uid, acc_id, context),0) + return reduce(lambda y,x=0: x.credit+y, acc.browse(cr, uid, acc_id, context),0.0) def _calc_debit(code,year=0): context['fiscalyear']=_calc_context(year,obj_fy) @@ -82,7 +82,7 @@ class account_report(osv.osv): del context['fiscalyear'] acc = self.pool.get('account.account') acc_id = acc.search(cr, uid, [('code','in',code)]) - return reduce(lambda y,x=0: x.debit+y, acc.browse(cr, uid, acc_id, context),0) + return reduce(lambda y,x=0: x.debit+y, acc.browse(cr, uid, acc_id, context),0.0) def _calc_balance(code,year=0): context['fiscalyear']=_calc_context(year,obj_fy) @@ -90,12 +90,12 @@ class account_report(osv.osv): del context['fiscalyear'] acc = self.pool.get('account.account') acc_id = acc.search(cr, uid, [('code','in',code)]) - return reduce(lambda y,x=0: x.balance+y, acc.browse(cr, uid, acc_id, context),0) + return reduce(lambda y,x=0: x.balance+y, acc.browse(cr, uid, acc_id, context),0.0) def _calc_report(*code): acc = self.pool.get('account.report.report') acc_id = acc.search(cr, uid, [('code','in',code)]) - return reduce(lambda y,x=0: x.amount+y, acc.browse(cr, uid, acc_id, context),0) + return reduce(lambda y,x=0: x.amount+y, acc.browse(cr, uid, acc_id, context),0.0) def _calc_tax_code(code,period=0): context['period_id']=_calc_context(period,obj_period) @@ -104,7 +104,7 @@ class account_report(osv.osv): context['period_id']=context['period_id'][0] acc = self.pool.get('account.tax.code') acc_id = acc.search(cr, uid, [('code','in',code)]) - return reduce(lambda y,x=0: x.sum_period+y, acc.browse(cr, uid, acc_id, context),0) + return reduce(lambda y,x=0: x.sum_period+y, acc.browse(cr, uid, acc_id, context),0.0) result = {} for rep in self.browse(cr, uid, ids, context): objdict = { diff --git a/addons/account_report/account_report.xml b/addons/account_report/account_report.xml index b105fae4cf4..94bd6f5fc11 100755 --- a/addons/account_report/account_report.xml +++ b/addons/account_report/account_report.xml @@ -5,5 +5,12 @@ + diff --git a/addons/account_report/account_wizard.xml b/addons/account_report/account_wizard.xml index 63d4303f0c5..84404f461ab 100644 --- a/addons/account_report/account_wizard.xml +++ b/addons/account_report/account_wizard.xml @@ -3,5 +3,8 @@ + + + \ No newline at end of file diff --git a/addons/account_report/i18n/fr_FR.po b/addons/account_report/i18n/fr_FR.po index a07a3fac826..d0533294cdc 100644 --- a/addons/account_report/i18n/fr_FR.po +++ b/addons/account_report/i18n/fr_FR.po @@ -1,4 +1,4 @@ -# Translation of OpenERP Server. +# Translation of OpenERP Server. # This file containt the translation of the following modules: # * account_report # @@ -9,7 +9,7 @@ msgstr "" "POT-Creation-Date: 2008-09-05 13:23+0000\n" "PO-Revision-Date: 2008-10-10 08:15+0000\n" "Last-Translator: Olivier Laurent \n" -"Language-Team: LANGUAGE \n" +"Language-Team: OpenERP Language Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/addons/account_report/report/print_indicator.py b/addons/account_report/report/print_indicator.py index 43960f1df6a..9d990d4a22d 100644 --- a/addons/account_report/report/print_indicator.py +++ b/addons/account_report/report/print_indicator.py @@ -96,6 +96,7 @@ class accounting_report_indicator(report_sxw.rml_parse): self.treecount=0 self.list=[] self.header_name=self.header_val=[] + self.main_dict={} def repeatIn(self, lst, name, nodes_parent=False,td=False,width=[],value=[],type=[]): self._node.data = '' @@ -202,39 +203,62 @@ class accounting_report_indicator(report_sxw.rml_parse): theme.default_font_size = 12 - tb = text_box.T(loc=(0,700),line_style=line_style.darkblue,text=str(obj_history.code)) - - base_x=100 - base_y=700 - - if obj_history.child_ids: - tb.add_arrow((100, 700)) - can.line(line_style.black,base_x-30,base_y,base_x-30,base_y-(50*(len(obj_history.child_ids)-1))) - tb.draw() self.child_dist=0 - def draw_tree(obj_his,base_x,base_y,level=0): - self.child_dist=0 - for i in range(len(obj_his.child_ids)): - can.line(line_style.black,base_x-30,base_y,base_x-30,base_y-(50*(i+len(obj_his.child_ids[i].child_ids)))) - if i<>0: - a = arrow.T(head_style = 1) - if self.child_dist: - diff=self.child_dist - else: - diff=self.child_dist+i - a.draw([(base_x-(30),base_y-(50*diff)), (base_x,base_y-(50*diff))]) - if obj_his.child_ids[i].child_ids: - tb12 = text_box.T(loc=(base_x,base_y-(50*(self.child_dist))), text=str(obj_his.child_ids[i].code)) - tb12.add_arrow((base_x+(100*(level+1)),base_y-(50*(self.child_dist)))) - tb12.draw() - draw_tree(obj_his.child_ids[i],base_x+(100*(level+1)),base_y-(50*(self.child_dist)),level+1) + level=0 + self.level=0 + self.child_dist=0 + + def draw_tree(obj_history,base_x,base_y,level=0,i=0): + self.line_y=base_y + if obj_history.child_ids: + if self.child_dist: + diff=i*self.child_dist + self.child_dist=0 else: - tb12 = text_box.T(loc=(base_x,base_y-(50*(i+self.child_dist))), text=str(obj_his.child_ids[i].code)) - tb12.draw() - self.child_dist=len(obj_his.child_ids[i].child_ids) -# - draw_tree(obj_history,base_x,base_y,0) + diff=i + if self.level>0 and (base_y-(50*diff)) >= self.level: + base_y=self.level-(50*i) + else: + base_y=base_y-(50*diff) + tb = text_box.T(loc=(base_x,base_y),line_style=line_style.darkblue,text="/hC"+str(obj_history.code)+":\n"+str(obj_history.amount)) + + tb.add_arrow((base_x+100,base_y)) + tb.draw() + + if level!=0: + a = arrow.T(head_style = 1) + a.draw([(base_x-30,base_y), (base_x,base_y)]) + level+=1 + + if i>0: + can.line(line_style.black,base_x-30,base_y,base_x-30,self.line_y) + + i=0 + for child in obj_history.child_ids: + draw_tree(child,base_x+(100),base_y,level,i) + i+=1 + + child_dist=len(obj_history.child_ids) + self.child_dist=max(self.child_dist,child_dist) + + else: + + if self.level>0 and (base_y-(50*i)) >= self.level: + base_y=self.level-(50) + else: + base_y=base_y-(50*(i)) + + tb12 = text_box.T(loc=(base_x,base_y), text="/hC"+str(obj_history.code)+":\n"+str(obj_history.amount)) + tb12.draw() + + if i>0: + can.line(line_style.black,base_x-30,base_y,base_x-30,self.line_y) + a = arrow.T(head_style = 1) + a.draw([(base_x-30,base_y), (base_x,base_y)]) + self.level=base_y + self.line_y=900 + draw_tree(obj_history,0,900,0) can.close() os.system('cp '+'tree_image'+str(self.treecount)+'.png ' +path+str(self.treecount)+'.png') diff --git a/addons/account_report/wizard/__init__.py b/addons/account_report/wizard/__init__.py index 5689089dae4..042065595e9 100644 --- a/addons/account_report/wizard/__init__.py +++ b/addons/account_report/wizard/__init__.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved # $Id$ # @@ -21,5 +21,6 @@ ############################################################################## import wizard_print_indicators +import wizard_print_indicators_with_pdf # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_report/wizard/wizard_print_indicators_with_pdf.py b/addons/account_report/wizard/wizard_print_indicators_with_pdf.py new file mode 100644 index 00000000000..2371f912b62 --- /dev/null +++ b/addons/account_report/wizard/wizard_print_indicators_with_pdf.py @@ -0,0 +1,109 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + +import wizard +import pooler +import time +import datetime +import sys +from mx.DateTime import * +import tools +from report.render import render +from report.interface import report_int +import os +import base64 +import StringIO + +form = ''' +
+
@@ -136,7 +137,7 @@ stock.picking - + diff --git a/addons/delivery/i18n/fr_FR.po b/addons/delivery/i18n/fr_FR.po index c8df3800918..bf9995cb3f2 100644 --- a/addons/delivery/i18n/fr_FR.po +++ b/addons/delivery/i18n/fr_FR.po @@ -9,7 +9,7 @@ msgstr "" "POT-Creation-Date: 2008-11-02 20:23:25+0000\n" "PO-Revision-Date: 2008-11-02 20:23:25+0000\n" "Last-Translator: <>\n" -"Language-Team: \n" +"Language-Team: OpenERP Language Team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" diff --git a/addons/delivery/sale.py b/addons/delivery/sale.py index a7889b494c2..76498dc8cbd 100644 --- a/addons/delivery/sale.py +++ b/addons/delivery/sale.py @@ -30,6 +30,7 @@ class sale_order(osv.osv): _description = "Sale Order" _columns = { + 'id': fields.integer('ID', readonly=True,invisible=True), 'carrier_id':fields.many2one("delivery.carrier","Delivery method", help="Complete this field if you plan to invoice the shipping based on packings made."), } diff --git a/addons/document/document.py b/addons/document/document.py index 31de70cc63f..1a710106bbd 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved # $Id$ # @@ -96,7 +96,6 @@ class node_class(object): where.append( ('res_id','=',False) ) if nodename: where.append( (fobj._rec_name,'=',nodename) ) - print where+[ ('parent_id','=',self.object and self.object.id or False) ] ids = fobj.search(self.cr, self.uid, where+[ ('parent_id','=',self.object and self.object.id or False) ], context=self.context) if self.object and self.root and (self.object.type=='ressource'): ids += fobj.search(self.cr, self.uid, where+[ ('parent_id','=',False) ], context=self.context) @@ -249,26 +248,6 @@ class document_directory(osv.osv): user=self.pool.get('res.users').browse(cr,uid,uid) return "ftp://%s:%s@localhost:8021/%s/%s"%(user.login,user.password,cr.dbname,'/'.join(path)) return False - def _check_duplication(self, cr, uid,vals): - if 'name' in vals: - where=" name='%s'"% (vals['name']) - if not 'parent_id' in vals or not vals['parent_id']: - where+=' and parent_id is null' - else: - where+=' and parent_id=%d'%(vals['parent_id']) - if not 'ressource_parent_type_id' in vals or not vals['ressource_parent_type_id']: - where+= ' and ressource_parent_type_id is null' - else: - where+=" and ressource_parent_type_id='%s'"%(vals['ressource_parent_type_id']) -# if not 'ressource_id' in vals or not vals['ressource_id']: -# where+= ' and ressource_id is null' -# else: -# where+=" and ressource_id=%d"%(vals['ressource_id']) - cr.execute("select id from document_directory where" + where) - res = cr.fetchall() - if len(res): - return False - return True def _check_recursion(self, cr, uid, ids): level = 100 while len(ids): @@ -350,7 +329,7 @@ class document_directory(osv.osv): # need to make constraints to checking duplicate #if not self._check_duplication(cr,uid,vals): # raise except_orm('ValidateError', 'Directory name must be unique!') - return super(document_directory,self).write(cr,uid,ids,vals,context=context) + return result def copy(self, cr, uid, id, default=None, context=None): if not default: @@ -359,6 +338,34 @@ class document_directory(osv.osv): default.update({'name': name+ " (copy)"}) return super(document_directory,self).copy(cr,uid,id,default,context) + def _check_duplication(self, cr, uid,vals,ids=[],op='create'): + name=vals.get('name',False) + parent_id=vals.get('parent_id',False) + ressource_parent_type_id=vals.get('ressource_parent_type_id',False) + ressource_id=vals.get('ressource_id',0) + if op=='write': + for directory in self.browse(cr,uid,ids): + if not name: + name=directory.name + if not parent_id: + parent_id=directory.parent_id and directory.parent_id.id or False + if not ressource_parent_type_id: + ressource_parent_type_id=directory.ressource_parent_type_id and directory.ressource_parent_type_id.id or False + if not ressource_id: + ressource_id=directory.ressource_id and directory.ressource_id.id or 0 + res=self.search(cr,uid,[('id','<>',directory.id),('name','=',name),('parent_id','=',parent_id),('ressource_parent_type_id','=',ressource_parent_type_id),('ressource_id','=',ressource_id)]) + if len(res): + return False + if op=='create': + res=self.search(cr,uid,[('name','=',name),('parent_id','=',parent_id),('ressource_parent_type_id','=',ressource_parent_type_id),('ressource_id','=',ressource_id)]) + if len(res): + return False + return True + def write(self, cr, uid, ids, vals, context=None): + if not self._check_duplication(cr,uid,vals,ids,op='write'): + raise except_orm('ValidateError', 'Directory name must be unique!') + return super(document_directory,self).write(cr,uid,ids,vals,context=context) + def create(self, cr, uid, vals, context=None): if not self._check_duplication(cr,uid,vals): raise except_orm('ValidateError', 'Directory name must be unique!') @@ -471,7 +478,7 @@ def random_name(): def create_directory(path): dir_name = random_name() path = os.path.join(path,dir_name) - os.mkdir(path) + os.makedirs(path) return dir_name class document_file(osv.osv): @@ -484,7 +491,7 @@ class document_file(osv.osv): result[id] = d elif m=='fs': try: - path = os.path.join(os.getcwd(),'filestore') + path = os.path.join(os.getcwd(), 'filestore', cr.dbname) value = file(os.path.join(path,r), 'rb').read() result[id] = base64.encodestring(value) except: @@ -500,9 +507,9 @@ class document_file(osv.osv): if not value: return True if (not context) or context.get('store_method','fs')=='fs': - path = os.path.join(os.getcwd(), "filestore") + path = os.path.join(os.getcwd(), "filestore", cr.dbname) if not os.path.isdir(path): - os.mkdir(path) + os.makedirs(path) flag = None # This can be improved for dirs in os.listdir(path): @@ -549,16 +556,37 @@ class document_file(osv.osv): _sql_constraints = [ ('filename_uniq', 'unique (name,parent_id,res_id,res_model)', 'The file name must be unique !') ] - - def _check_duplication(self, cr, uid,vals): - if 'name' in vals: - res=self.search(cr,uid,[('name','=',vals['name']),('parent_id','=','parent_id' in vals and vals['parent_id'] or False),('res_id','=','res_id' in vals and vals['res_id'] or False),('res_model','=','res_model' in vals and vals['res_model']) or False]) + def _check_duplication(self, cr, uid,vals,ids=[],op='create'): + name=vals.get('name',False) + parent_id=vals.get('parent_id',False) + res_model=vals.get('res_model',False) + res_id=vals.get('res_id',0) + if op=='write': + for file in self.browse(cr,uid,ids): + if not name: + name=file.name + if not parent_id: + parent_id=file.parent_id and file.parent_id.id or False + if not res_model: + res_model=file.res_model and file.res_model or False + if not res_id: + res_id=file.res_id and file.res_id or 0 + res=self.search(cr,uid,[('id','<>',file.id),('name','=',name),('parent_id','=',parent_id),('res_model','=',res_model),('res_id','=',res_id)]) + if len(res): + return False + if op=='create': + res=self.search(cr,uid,[('name','=',name),('parent_id','=',parent_id),('res_id','=',res_id),('res_model','=',res_model)]) if len(res): return False return True - + def copy(self, cr, uid, id, default=None, context=None): + if not default: + default ={} + name = self.read(cr, uid, [id])[0]['name'] + default.update({'name': name+ " (copy)"}) + return super(document_file,self).copy(cr,uid,id,default,context) def write(self, cr, uid, ids, vals, context=None): - if not self._check_duplication(cr,uid,vals): + if not self._check_duplication(cr,uid,vals,ids,'write'): raise except_orm('ValidateError', 'File name must be unique!') result = super(document_file,self).write(cr,uid,ids,vals,context=context) cr.commit() @@ -577,6 +605,10 @@ class document_file(osv.osv): def create(self, cr, uid, vals, context={}): vals['title']=vals['name'] + if not vals.get('res_id', False) and context.get('default_res_id',False): + vals['res_id']=context.get('default_res_id',False) + if not vals.get('res_model', False) and context.get('default_res_model',False): + vals['res_model']=context.get('default_res_model',False) if vals.get('res_id', False) and vals.get('res_model',False): obj_model=self.pool.get(vals['res_model']) result = obj_model.read(cr, uid, [vals['res_id']], context=context) @@ -585,18 +617,22 @@ class document_file(osv.osv): vals['title'] = (obj['name'] or '')[:60] if obj_model._name=='res.partner': vals['partner_id']=obj['id'] - elif 'address_id' in obj: - address=self.pool.get('res.partner.address').read(cr,uid,[obj['address_id']],context=context) + elif obj.get('address_id',False): + if isinstance(obj['address_id'],tuple) or isinstance(obj['address_id'],list): + address_id=obj['address_id'][0] + else: + address_id=obj['address_id'] + address=self.pool.get('res.partner.address').read(cr,uid,[address_id],context=context) if len(address): - vals['partner_id']=address[0]['partner_id'] or False - elif 'partner_id' in obj: + vals['partner_id']=address[0]['partner_id'][0] or False + elif obj.get('partner_id',False): if isinstance(obj['partner_id'],tuple) or isinstance(obj['partner_id'],list): vals['partner_id']=obj['partner_id'][0] else: vals['partner_id']=obj['partner_id'] datas=None - if 'datas' not in vals: + if vals.get('datas',False) and vals.get('link',False) : import urllib datas=base64.encodestring(urllib.urlopen(vals['link']).read()) else: @@ -620,7 +656,7 @@ class document_file(osv.osv): for f in self.browse(cr, uid, ids, context): if f.store_method=='fs': try: - path = os.path.join(os.getcwd(),'filestore',f.store_fname) + path = os.path.join(os.getcwd(), cr.dbname, 'filestore',f.store_fname) os.unlink(path) except: pass @@ -631,7 +667,12 @@ class document_configuration_wizard(osv.osv_memory): _name='document.configuration.wizard' _rec_name = 'Auto Directory configuration' _columns = { - } + 'host': fields.char('Server Address', size=64, help="Put here the server address or IP. " \ + "Keep localhost if you don't know what to write.", required=True) + } + _defaults = { + 'host': lambda *args: 'localhost' + } def action_cancel(self,cr,uid,ids,conect=None): return { 'view_type': 'form', @@ -642,6 +683,7 @@ class document_configuration_wizard(osv.osv_memory): } def action_config(self, cr, uid, ids, context=None): + conf = self.browse(cr, uid, ids[0], context) obj=self.pool.get('document.directory') objid=self.pool.get('ir.model.data') @@ -694,7 +736,7 @@ class document_configuration_wizard(osv.osv_memory): 'include_name': 1, 'directory_id': id, }) - + if self.pool.get('account.analytic.account'): id = objid._get_id(cr, uid, 'document', 'dir_project') id = objid.browse(cr, uid, id, context=context).res_id @@ -706,6 +748,10 @@ class document_configuration_wizard(osv.osv_memory): 'ressource_tree': 1 }) + aid = objid._get_id(cr, uid, 'document', 'action_document_browse') + aid = objid.browse(cr, uid, aid, context=context).res_id + self.pool.get('ir.actions.url').write(cr, uid, [aid], {'url': 'ftp://'+(conf.host or 'localhost')+':8021/'}) + return { 'view_type': 'form', "view_mode": 'form', diff --git a/addons/document/document_view.xml b/addons/document/document_view.xml index 4a722b5294f..c2ba8844e90 100644 --- a/addons/document/document_view.xml +++ b/addons/document/document_view.xml @@ -251,6 +251,7 @@