diff --git a/addons/account/i18n/es.po b/addons/account/i18n/es.po index 941a87b5fdc..4779ae32dd5 100644 --- a/addons/account/i18n/es.po +++ b/addons/account/i18n/es.po @@ -7,13 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-04-11 21:46+0000\n" -"Last-Translator: Juan Eduardo Riva \n" +"PO-Revision-Date: 2010-06-23 17:24+0000\n" +"Last-Translator: Jordi Esteve (www.zikzakmedia.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: 2010-06-22 04:06+0000\n" +"X-Launchpad-Export-Date: 2010-06-24 03:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account @@ -60,7 +61,7 @@ msgstr "Nombre de modelo inválido en la definición de acción." #. module: account #: help:account.journal,currency:0 msgid "The currency used to enter statement" -msgstr "La moneda utilizada para introducir asientos" +msgstr "La divisa utilizada para introducir asientos." #. module: account #: wizard_view:account_use_models,init_form:0 @@ -456,7 +457,7 @@ msgstr "Estado" #: model:ir.actions.act_window,name:account.action_invoice_tree13 #: model:ir.ui.menu,name:account.menu_action_invoice_tree13 msgid "Unpaid Supplier Refunds" -msgstr "Facturas de abono de proveedor sin pagar" +msgstr "Facturas rectificativas (abono) de proveedor sin pagar" #. module: account #: view:account.tax:0 @@ -1232,10 +1233,10 @@ msgid "" "software system you may have to use the rate at date. Incoming transactions " "always use the rate at date." msgstr "" -"Permite seleccionar la forma en que la tasa de la moneda actual de las " -"transacciones de salida se calcula. En la mayoría de los países el método " -"legal es \"Promedio\", pero sólo unos pocos sistemas de software son capaces " -"de gestionarlo. Por lo tanto, si la importación procede de otro sistema de " +"Permite seleccionar la forma en que se calcula la tasa de la divisa actual " +"en las transacciones de salida. En la mayoría de los países el método legal " +"es \"Promedio\", pero sólo unos pocos sistemas de software son capaces de " +"gestionarlo. Por lo tanto, si la importación procede de otro sistema de " "software, es posible que tenga que utilizar la tasa \"En fecha\". Las " "transacciones de entrada siempre utilizan la tasa \"En fecha\"." @@ -1887,7 +1888,7 @@ msgstr "Fecha inicial" #. module: account #: model:account.journal,name:account.refund_expenses_journal msgid "x Expenses Credit Notes Journal" -msgstr "x Diario facturas de abono de gastos" +msgstr "x Diario facturas rectificativas (abono) de gastos" #. module: account #: field:account.analytic.journal,type:0 @@ -1914,7 +1915,7 @@ msgstr "Base imponible" #: field:account.tax,account_collected_id:0 #: field:account.tax.template,account_collected_id:0 msgid "Invoice Tax Account" -msgstr "Cuenta impuestos de factura" +msgstr "Cuenta impuestos de facturas" #. module: account #: view:account.move.line:0 @@ -2026,7 +2027,7 @@ msgstr "Informe analítico de diario" #: model:ir.actions.act_window,name:account.action_invoice_tree3 #: model:ir.ui.menu,name:account.menu_action_invoice_tree3 msgid "Customer Refunds" -msgstr "Facturas de abono de cliente" +msgstr "Facturas rectificativas (abono) de cliente" #. module: account #: rml:account.vat.declaration:0 @@ -2047,7 +2048,7 @@ msgstr "Nombre diario-período" #: field:account.tax.code,name:0 #: field:account.tax.code.template,name:0 msgid "Tax Case Name" -msgstr "Nombre impuesto del caso" +msgstr "Nombre código de impuesto" #. module: account #: help:account.journal,entry_posted:0 @@ -2114,7 +2115,7 @@ msgstr "Comentario situacion fiscal" #. module: account #: wizard_field:account.fiscalyear.close,init,period_id:0 msgid "Opening Entries Period" -msgstr "Periodo asientos de apertura" +msgstr "Período asientos de apertura" #. module: account #: model:ir.actions.wizard,name:account.wizard_validate_account_moves @@ -2145,7 +2146,7 @@ msgstr "Anterior" #: field:account.model.line,currency_id:0 #: field:account.move.line,currency_id:0 msgid "Currency" -msgstr "Moneda" +msgstr "Divisa" #. module: account #: model:ir.actions.act_window,name:account.act_account_journal_2_account_invoice_opened @@ -2225,7 +2226,7 @@ msgstr "Facturas de proveedor en borrador" #. module: account #: wizard_field:account.invoice.refund,init,period:0 msgid "Force period" -msgstr "Forzar periodo" +msgstr "Forzar período" #. module: account #: selection:account.account.type,close_method:0 @@ -2306,7 +2307,7 @@ msgstr "Fecha factura" #: help:account.third_party_ledger.report,init,periods:0 #: help:account.vat.declaration,init,periods:0 msgid "All periods if empty" -msgstr "Todos los periodos si está vacío" +msgstr "Todos los períodos si está vacío." #. module: account #: model:account.account.type,name:account.account_type_liability @@ -2530,7 +2531,7 @@ msgstr "Asientos conciliados" #. module: account #: help:account.bank.statement.reconcile,total_second_amount:0 msgid "The amount in the currency of the journal" -msgstr "La cantidad en la moneda del diario" +msgstr "El importe en la divisa del diario." #. module: account #: wizard_field:account.general.ledger.report,checktype,landscape:0 @@ -2928,7 +2929,7 @@ msgstr "Estado abierto" #. module: account #: field:account.journal,entry_posted:0 msgid "Skip 'Draft' State for Created Entries" -msgstr "Omitir el estado 'Borrador ' para los asientos creados" +msgstr "Omitir estado 'Borrador ' al crear asientos" #. module: account #: field:account.invoice.tax,account_id:0 @@ -2964,7 +2965,7 @@ msgstr "1cm 27.7cm 20cm 27.7cm" #: model:ir.actions.act_window,name:account.action_invoice_tree12 #: model:ir.ui.menu,name:account.menu_action_invoice_tree12 msgid "Draft Supplier Refunds" -msgstr "Facturas de abono de proveedor en borrador" +msgstr "Facturas rectificativas (abono) de proveedor en borrador" #. module: account #: model:process.node,name:account.process_node_accountingstatemententries0 @@ -3051,7 +3052,7 @@ msgstr "Tasa de divisas de salida" #: model:ir.actions.act_window,name:account.action_invoice_tree10 #: model:ir.ui.menu,name:account.menu_action_invoice_tree10 msgid "Draft Customer Refunds" -msgstr "Facturas de abono de cliente en borrador" +msgstr "Facturas rectificativas (abono) de cliente en borrador" #. module: account #: field:account.journal.column,readonly:0 @@ -3084,7 +3085,7 @@ msgstr "Documento" #. module: account #: help:account.move.line,move_id:0 msgid "The move of this entry line." -msgstr "El movimiento de esta línea del asiento." +msgstr "El asiento de este apunte." #. module: account #: field:account.invoice.line,uos_id:0 @@ -3234,7 +3235,7 @@ msgstr "Diario de banco" #: selection:account.partner.balance.report,init,state:0 #: selection:account.third_party_ledger.report,init,state:0 msgid "By Date and Period" -msgstr "Por fecha y periodo" +msgstr "Por fecha y período" #. module: account #: view:account.account:0 @@ -3343,7 +3344,7 @@ msgstr "Nombre impuesto" #. module: account #: wizard_view:account.fiscalyear.close.state,init:0 msgid " Close states of Fiscal year and periods" -msgstr " Cerrar estados de ejercicio fiscal y periodos" +msgstr " Cerrar estados de ejercicio fiscal y períodos" #. module: account #: model:account.payment.term,name:account.account_payment_term @@ -3540,7 +3541,7 @@ msgstr "Titular de la cuenta bancaria" #: wizard_view:account.partner.balance.report,init:0 #: wizard_view:account.third_party_ledger.report,init:0 msgid "Filter on Periods" -msgstr "Filtrar por periodos" +msgstr "Filtrar por períodos" #. module: account #: field:res.partner,property_account_receivable:0 @@ -3608,7 +3609,7 @@ msgstr "Impreso" #: model:ir.actions.act_window,name:account.action_invoice_tree4_new #: model:ir.ui.menu,name:account.menu_action_invoice_tree4_new msgid "New Supplier Refund" -msgstr "Nueva factura de abono de proveedor" +msgstr "Nueva factura rectificativa (abono) de proveedor" #. module: account #: view:account.model:0 @@ -3618,7 +3619,7 @@ msgstr "Modelo de asiento" #. module: account #: wizard_field:account.general.ledger.report,checktype,amount_currency:0 msgid "With Currency" -msgstr "Con moneda" +msgstr "Con divisa" #. module: account #: view:account.account:0 @@ -3723,7 +3724,7 @@ msgstr "Codificación asiento" #: wizard_view:account.invoice.refund,init:0 #: model:ir.actions.wizard,name:account.wizard_invoice_refund msgid "Credit Note" -msgstr "Factura de abono" +msgstr "Factura rectificativa (abono)" #. module: account #: model:ir.actions.todo,note:account.config_fiscalyear @@ -3869,7 +3870,7 @@ msgstr "Secuencia del asiento" #: selection:account.account,type:0 #: selection:account.account.template,type:0 msgid "Closed" -msgstr "Cerrado" +msgstr "Cierre" #. module: account #: model:process.node,name:account.process_node_paymententries0 @@ -3925,7 +3926,7 @@ msgstr "Movimiento" #. module: account #: help:account.period,special:0 msgid "These periods can overlap." -msgstr "Estos periodos se pueden solapar." +msgstr "Estos períodos se pueden solapar." #. module: account #: help:product.template,property_account_expense:0 @@ -3953,7 +3954,7 @@ msgstr "Diarios financieros" #: selection:account.partner.balance.report,init,state:0 #: selection:account.third_party_ledger.report,init,state:0 msgid "By Period" -msgstr "Por periodo" +msgstr "Por período" #. module: account #: help:account.invoice,date_invoice:0 @@ -4051,7 +4052,7 @@ msgstr "Cuenta a pagar" #: field:account.account,currency_id:0 #: field:account.account.template,currency_id:0 msgid "Secondary Currency" -msgstr "Moneda secundaria" +msgstr "Divisa secundaria" #. module: account #: field:account.account,credit:0 @@ -4086,7 +4087,7 @@ msgstr "" #: field:account.tax,account_paid_id:0 #: field:account.tax.template,account_paid_id:0 msgid "Refund Tax Account" -msgstr "Cuenta impuestos de devoluciones" +msgstr "Cuenta impuestos de reintegros" #. module: account #: field:account.tax.code,child_ids:0 @@ -4166,7 +4167,7 @@ msgstr "Límite a pagar" #: wizard_field:account.partner.balance.report,init,state:0 #: wizard_field:account.third_party_ledger.report,init,state:0 msgid "Date/Period Filter" -msgstr "Filtrar fecha/periodo" +msgstr "Filtrar por fecha/período" #. module: account #: rml:account.analytic.account.journal:0 @@ -4189,7 +4190,7 @@ msgstr "Secuencias de diarios separadas" #. module: account #: help:account.bank.statement.reconcile,total_second_currency:0 msgid "The currency of the journal" -msgstr "La moneda del diario" +msgstr "La divisa del diario" #. module: account #: view:account.journal.column:0 @@ -4432,7 +4433,7 @@ msgstr "Fijado" #: view:account.tax:0 #: view:account.tax.template:0 msgid "Credit Notes" -msgstr "Facturas de abono" +msgstr "Facturas rectificativas (abono)" #. module: account #: field:account.config.wizard,date2:0 @@ -4502,7 +4503,7 @@ msgstr "Línea del modelo de asiento" #. module: account #: view:account.tax.template:0 msgid "Account Tax Template" -msgstr "Plantilla de impuesto" +msgstr "Plantilla de impuestos" #. module: account #: help:account.model,name:0 @@ -4624,7 +4625,7 @@ msgstr "Por fecha" #: model:ir.actions.act_window,name:account.action_invoice_tree4 #: model:ir.ui.menu,name:account.menu_action_invoice_tree4 msgid "Supplier Refunds" -msgstr "Facturas de abono de proveedor" +msgstr "Facturas rectificativas (abono) de proveedor" #. module: account #: help:account.model.line,date:0 @@ -5129,7 +5130,7 @@ msgstr "Cuenta de ingresos en plantilla producto" #: help:account.account.template,currency_id:0 msgid "Force all moves for this account to have this secondary currency." msgstr "" -"Fuerza a todos los movimientos de esta cuenta que tengan esta moneda " +"Fuerza a todos los movimientos de esta cuenta que tengan esta divisa " "secundaria." #. module: account @@ -5143,7 +5144,7 @@ msgstr "_Cancelar" #: wizard_view:account.partner.balance.report,init:0 #: wizard_view:account.third_party_ledger.report,init:0 msgid "Select Date-Period" -msgstr "Seleccionar fecha-periodo" +msgstr "Seleccionar fecha-período" #. module: account #: rml:account.analytic.account.inverted.balance:0 @@ -5172,7 +5173,7 @@ msgstr "Grupo de Impuestos" #: model:ir.actions.act_window,name:account.action_invoice_tree3_new #: model:ir.ui.menu,name:account.menu_action_invoice_tree3_new msgid "New Customer Refund" -msgstr "Nueva factura de abono de cliente" +msgstr "Nueva factura rectificativa (abono) de cliente" #. module: account #: help:wizard.multi.charts.accounts,seq_journal:0 @@ -5370,7 +5371,7 @@ msgstr "Pagado" #: model:ir.actions.act_window,name:account.action_invoice_tree11 #: model:ir.ui.menu,name:account.menu_action_invoice_tree11 msgid "Unpaid Customer Refunds" -msgstr "Facturas de abono de cliente sin pagar" +msgstr "Facturas rectificativas (abono) de cliente sin pagar" #. module: account #: help:account.invoice,residual:0 @@ -5558,7 +5559,7 @@ msgstr "Saldo pendiente" #. module: account #: rml:account.invoice:0 msgid "Refund" -msgstr "Factura de abono" +msgstr "Factura rectificativa (abono)" #. module: account #: model:ir.model,name:account.model_account_invoice_tax @@ -5795,7 +5796,7 @@ msgstr "" #: field:account.tax.code,code:0 #: field:account.tax.code.template,code:0 msgid "Case Code" -msgstr "Código caso" +msgstr "Código" #. module: account #: selection:account.automatic.reconcile,init,power:0 @@ -5811,7 +5812,7 @@ msgstr "Cuenta de ingresos" #. module: account #: field:account.period,special:0 msgid "Opening/Closing Period" -msgstr "Periodo de apertura/cierre" +msgstr "Período de apertura/cierre" #. module: account #: rml:account.analytic.account.balance:0 @@ -5919,7 +5920,7 @@ msgstr "Dejarlo vacío para todos los ejercicios fiscales abiertos" #: rml:account.invoice:0 #: selection:account.invoice,type:0 msgid "Supplier Refund" -msgstr "Factura de abono de proveedor" +msgstr "Factura rectificativa (abono) de proveedor" #. module: account #: model:process.transition,note:account.process_transition_entriesreconcile0 diff --git a/addons/account/i18n/zh_CN.po b/addons/account/i18n/zh_CN.po index 3ddd263d146..99660f05218 100644 --- a/addons/account/i18n/zh_CN.po +++ b/addons/account/i18n/zh_CN.po @@ -13,7 +13,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-06-23 03:52+0000\n" +"X-Launchpad-Export-Date: 2010-06-24 03:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account diff --git a/addons/account/partner_view.xml b/addons/account/partner_view.xml index 5d9bbb7e9b0..2d97f1581ca 100644 --- a/addons/account/partner_view.xml +++ b/addons/account/partner_view.xml @@ -70,8 +70,8 @@ 2 - - + + @@ -119,7 +119,7 @@ - + diff --git a/addons/account_budget/i18n/es.po b/addons/account_budget/i18n/es.po index 8226d60e975..22fe5f58d28 100644 --- a/addons/account_budget/i18n/es.po +++ b/addons/account_budget/i18n/es.po @@ -7,13 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2009-11-17 09:34+0000\n" -"Last-Translator: Ana Juaristi Olalde \n" +"PO-Revision-Date: 2010-06-23 17:05+0000\n" +"Last-Translator: Jordi Esteve (www.zikzakmedia.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: 2010-06-22 04:18+0000\n" +"X-Launchpad-Export-Date: 2010-06-24 03:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account_budget @@ -460,7 +461,7 @@ msgstr "Cuentas" #. module: account_budget #: model:ir.actions.report.xml,name:account_budget.account_budget msgid "Print Budget" -msgstr "Imprimir Presupuestos" +msgstr "Imprimir presupuestos" #. module: account_budget #: view:account.analytic.account:0 diff --git a/addons/account_payment/i18n/es.po b/addons/account_payment/i18n/es.po index 10dc951b3ae..96b1e86eeb9 100644 --- a/addons/account_payment/i18n/es.po +++ b/addons/account_payment/i18n/es.po @@ -7,13 +7,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2009-12-25 16:54+0000\n" -"Last-Translator: Paco Molinero \n" +"PO-Revision-Date: 2010-06-23 17:09+0000\n" +"Last-Translator: Jordi Esteve (www.zikzakmedia.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: 2010-06-22 04:10+0000\n" +"X-Launchpad-Export-Date: 2010-06-24 03:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account_payment @@ -351,7 +352,7 @@ msgstr "Total haber" #. module: account_payment #: model:ir.actions.wizard,name:account_payment.wizard_populate_payment msgid "Populate payment" -msgstr "Propagar el pago" +msgstr "Rellenar la orden" #. module: account_payment #: field:payment.order,user_id:0 diff --git a/addons/auction/i18n/el.po b/addons/auction/i18n/el.po index 654882aedc2..ee0853b10fc 100644 --- a/addons/auction/i18n/el.po +++ b/addons/auction/i18n/el.po @@ -8,29 +8,29 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2009-10-18 06:57+0000\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2010-06-24 02:48+0000\n" +"Last-Translator: Panayiotis Konstantinidis \n" "Language-Team: Greek \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-06-22 04:12+0000\n" +"X-Launchpad-Export-Date: 2010-06-24 03:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: auction #: field:report.deposit.border,total_marge:0 msgid "Total margin" -msgstr "" +msgstr "Συνολικό περιθώριο" #. module: auction #: wizard_view:auction.lots.sms_send,init:0 msgid "SMS - Gateway: clickatell" -msgstr "" +msgstr "Κέντρο μηνυμάτων SMS: clickatell" #. module: auction #: view:auction.lots:0 msgid "Set to draft" -msgstr "" +msgstr "Ρύθμιση ως πρόχειρο" #. module: auction #: field:auction.deposit,partner_id:0 @@ -40,55 +40,55 @@ msgstr "" #: field:report.seller.auction,seller:0 #: field:report.seller.auction2,seller:0 msgid "Seller" -msgstr "" +msgstr "Πωλητής" #. module: auction #: constraint:ir.actions.act_window:0 msgid "Invalid model name in the action definition." -msgstr "" +msgstr "Λανθασμένο όνομα μοντέλου στον ορισμό ενέργειας" #. module: auction #: selection:auction.lots.send.aie,date_ask,numerotation:0 #: selection:auction.lots.send.aie,init,numerotation:0 msgid "Provisoire" -msgstr "" +msgstr "Προσωρινός" #. module: auction #: selection:auction.lots.send.aie,date_ask,numerotation:0 #: selection:auction.lots.send.aie,init,numerotation:0 msgid "Definitive (ordre catalogue)" -msgstr "" +msgstr "Οριστικά (κατάλογος παραγγελίας)" #. module: auction #: model:ir.ui.menu,name:auction.menu_report_auction_object_date_tree1_my msgid "My Encoded Objects Per Day" -msgstr "" +msgstr "Τα κωδικοποιημένα αντικείμενά μου ανά ημέρα" #. module: auction #: model:ir.model,name:auction.model_auction_lot_history msgid "Lot history" -msgstr "" +msgstr "Ιστορικό Lot" #. module: auction #: field:report.seller.auction,avg_estimation:0 msgid "Avg estimation" -msgstr "" +msgstr "Υπολογισμός μέσου όρου" #. module: auction #: field:report.auction.object.date,obj_num:0 #: field:report.auction.view2,obj_number:0 msgid "# of Objects" -msgstr "" +msgstr "# αντικειμένων" #. module: auction #: model:ir.ui.menu,name:auction.menu_action_bids_form msgid "Bids line" -msgstr "" +msgstr "Γραμμή προσφορών" #. module: auction #: xsl:report.auction.deposit:0 msgid "Deposit Form" -msgstr "" +msgstr "Φόρμα κατάθεσης" #. module: auction #: rml:auction.bids:0 @@ -103,81 +103,81 @@ msgstr "" #: field:report.buyer.auction,buyer:0 #: field:report.buyer.auction2,buyer:0 msgid "Buyer" -msgstr "" +msgstr "Αγοραστής" #. module: auction #: field:report.auction.view,nobjects:0 #: field:report.buyer.auction,object:0 msgid "No of objects" -msgstr "" +msgstr "Αριθμόες αντικειμένων" #. module: auction #: model:ir.ui.menu,name:auction.menu_report_auction_adjudication_tree msgid "Adjudication by Auction" -msgstr "" +msgstr "Δικάζεται από Δημοπρασία" #. module: auction #: rml:auction.total.rml:0 msgid "# of paid items (based on invoices):" -msgstr "" +msgstr "# πληρωμένων αντικειμένων (βασισμένο στα τιμολόγια):" #. module: auction #: model:ir.actions.wizard,name:auction.wizard_numerotate_lot msgid "Numerotation (per lot)" -msgstr "" +msgstr "Αρίθμιση (ανα παρτίδα)" #. module: auction #: selection:auction.lot.category,aie_categ:0 msgid "Antique/Books, manuscripts, eso." -msgstr "" +msgstr "Αντίκες/Βιβλία, χειρόγραφα,κα." #. module: auction #: view:auction.deposit:0 #: model:ir.model,name:auction.model_auction_deposit msgid "Deposit Border" -msgstr "" +msgstr "Κατάθεση ορίων" #. module: auction #: wizard_field:auction.lots.make_invoice,init,amount:0 #: wizard_field:auction.lots.make_invoice_buyer,init,amount:0 msgid "Invoiced Amount" -msgstr "" +msgstr "Αξία Τιμολογίου" #. module: auction #: selection:auction.lot.category,aie_categ:0 msgid "Antique/Tin / Copper wares" -msgstr "" +msgstr "Αντίκες / τσίγκινα / χάλκινα σκεύη" #. module: auction #: field:auction.lots,paid_ach:0 msgid "Buyer invoice reconciled" -msgstr "" +msgstr "Διασταύρωση τιμολογίων αγορών" #. module: auction #: model:ir.actions.wizard,name:auction.auction_wizard_able_taken msgid "Mark as taken away" -msgstr "" +msgstr "Σημαδέψτε καθώς αφαιρείται" #. module: auction #: xsl:report.auction.seller.list:0 msgid "Inv." -msgstr "" +msgstr "Τιμ." #. module: auction #: field:auction.deposit.cost,amount:0 msgid "Amount" -msgstr "" +msgstr "Ποσό" #. module: auction #: model:ir.actions.act_window,name:auction.action_deposit_border #: model:ir.ui.menu,name:auction.menu_auction_deposit_border msgid "Deposit border" -msgstr "" +msgstr "Όριο κατάθεσης" #. module: auction #: xsl:report.auction.deposit:0 msgid "VAT" -msgstr "" +msgstr "ΦΠΑ" #. module: auction #: view:auction.lots:0 @@ -187,58 +187,58 @@ msgstr "" #. module: auction #: xsl:flagey.huissier:0 msgid "Adjudication" -msgstr "" +msgstr "Δικαστική απόφαση" #. module: auction #: field:auction.dates,account_analytic_id:0 msgid "Analytic Account" -msgstr "" +msgstr "Αναλυτικός Λογαριασμός" #. module: auction #: selection:auction.lot.category,aie_categ:0 msgid "Unclassifieds" -msgstr "" +msgstr "Αταξινόμητα" #. module: auction #: model:ir.ui.menu,name:auction.menu_auction_dates_next_by_auction msgid "Objects by Auction" -msgstr "" +msgstr "Αντικείμενα σε Δημοπρασία" #. module: auction #: field:auction.lots,lot_num:0 #: field:report.unclassified.objects,lot_num:0 msgid "List Number" -msgstr "" +msgstr "Αριθμός καταλόγου" #. module: auction #: field:auction.deposit.cost,name:0 msgid "Cost Name" -msgstr "" +msgstr "Όνομα κόστους" #. module: auction #: selection:auction.lot.category,aie_categ:0 msgid "Antiques" -msgstr "" +msgstr "Αντίκες" #. module: auction #: view:auction.dates:0 msgid "State" -msgstr "" +msgstr "Κατάσταση" #. module: auction #: field:report.auction.estimation.adj.category,lot_type:0 msgid "Object Type" -msgstr "" +msgstr "Τύπος αντικειμένου" #. module: auction #: wizard_field:auction.lots.sms_send,init,text:0 msgid "SMS Message" -msgstr "" +msgstr "Μήνυμα SMS" #. module: auction #: selection:auction.lot.category,aie_categ:0 msgid "Contemporary Art" -msgstr "" +msgstr "Σύγχρονη Τέχνη" #. module: auction #: view:auction.lots:0 diff --git a/addons/audittrail/audittrail.py b/addons/audittrail/audittrail.py index 80166298edb..3a56f15ed3d 100644 --- a/addons/audittrail/audittrail.py +++ b/addons/audittrail/audittrail.py @@ -25,6 +25,7 @@ from tools.translate import _ import ir import pooler import time +import tools class audittrail_rule(osv.osv): """ @@ -33,25 +34,28 @@ class audittrail_rule(osv.osv): _name = 'audittrail.rule' _description = "Audittrail Rule" _columns = { - "name": fields.char("Rule Name", size=32, required=True), - "object_id": fields.many2one('ir.model', 'Object', required=True), - "user_id": fields.many2many('res.users', 'audittail_rules_users', - 'user_id', 'rule_id', 'Users'), - "log_read": fields.boolean("Log reads"), - "log_write": fields.boolean("Log writes"), - "log_unlink": fields.boolean("Log deletes"), - "log_create": fields.boolean("Log creates"), - "state": fields.selection((("draft", "Draft"), - ("subscribed", "Subscribed")), - "State", required=True), - "action_id": fields.many2one('ir.actions.act_window', "Action ID"), + "name": fields.char("Rule Name", size=32, required=True), + "object_id": fields.many2one('ir.model', 'Object', required=True), + "user_id": fields.many2many('res.users', 'audittail_rules_users', + 'user_id', 'rule_id', 'Users', help="if User is not added then it will applicable for all users"), + "log_read": fields.boolean("Log Reads"), + "log_write": fields.boolean("Log Writes"), + "log_unlink": fields.boolean("Log Deletes"), + "log_create": fields.boolean("Log Creates"), + "log_action": fields.boolean("Log Action"), + "log_workflow": fields.boolean("Log Workflow"), + "state": fields.selection((("draft", "Draft"), + ("subscribed", "Subscribed")), + "State", required=True), + "action_id": fields.many2one('ir.actions.act_window', "Action ID"), + } _defaults = { - 'state': lambda *a: 'draft', - 'log_create': lambda *a: 1, - 'log_unlink': lambda *a: 1, - 'log_write': lambda *a: 1, + 'state': lambda *a: 'draft', + 'log_create': lambda *a: 1, + 'log_unlink': lambda *a: 1, + 'log_write': lambda *a: 1, } _sql_constraints = [ @@ -65,7 +69,7 @@ class audittrail_rule(osv.osv): @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of Auddittrail Rule’s IDs. - @return: True + @return: True """ obj_action = self.pool.get('ir.actions.act_window') obj_model = self.pool.get('ir.model.data') @@ -74,20 +78,20 @@ class audittrail_rule(osv.osv): obj = self.pool.get(thisrule.object_id.model) if not obj: raise osv.except_osv( - _('WARNING: audittrail is not part of the pool'), + _('WARNING: audittrail is not part of the pool'), _('Change audittrail depends -- Setting rule as DRAFT')) self.write(cr, uid, [thisrule.id], {"state": "draft"}) val = { - "name": 'View Log', - "res_model": 'audittrail.log', - "src_model": thisrule.object_id.model, + "name": 'View Log', + "res_model": 'audittrail.log', + "src_model": thisrule.object_id.model, "domain": "[('object_id','=', " + str(thisrule.object_id.id) + "), ('res_id', '=', active_id)]" } - id = obj_action.create(cr, uid, val) - self.write(cr, uid, [thisrule.id], {"state": "subscribed", "action_id": id}) + action_id = obj_action.create(cr, uid, val) + self.write(cr, uid, [thisrule.id], {"state": "subscribed", "action_id": action_id}) keyword = 'client_action_relate' - value = 'ir.actions.act_window,' + str(id) + value = 'ir.actions.act_window,' + str(action_id) res = obj_model.ir_set(cr, uid, 'action', keyword, 'View_log_' + thisrule.object_id.model, [thisrule.object_id.model], value, replace=True, isobject=True, xml_id=False) #End Loop return True @@ -98,7 +102,7 @@ class audittrail_rule(osv.osv): @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of Auddittrail Rule’s IDs. - @return: True + @return: True """ obj_action = self.pool.get('ir.actions.act_window') val_obj = self.pool.get('ir.values') @@ -127,17 +131,28 @@ class audittrail_log(osv.osv): _name = 'audittrail.log' _description = "Audittrail Log" + def _name_get_resname(self, cr, uid, ids, *args): + data = {} + for resname in self.browse(cr, uid, ids,[]): + model_object = resname.object_id + res_id = resname.res_id + if model_object and res_id: + model_pool = self.pool.get(model_object.model) + res = model_pool.read(cr, uid, res_id, ['name']) + data[resname.id] = res['name'] + else: + data[resname.id] = False + return data + _columns = { - "name": fields.char("Name", size=32), - "object_id": fields.many2one('ir.model', 'Object'), - "user_id": fields.many2one('res.users', 'User'), - "method": fields.selection((('read', 'Read'), - ('write', 'Write'), - ('unlink', 'Delete'), - ('create', 'Create')), "Method"), - "timestamp": fields.datetime("Date"), - "res_id": fields.integer('Resource Id'), - "line_ids": fields.one2many('audittrail.log.line', 'log_id', 'Log lines'), + "name": fields.char("Resource Name",size=64), + # "name": fields.function(_name_get_resname, type='char', string='Resource Name', method=True), + "object_id": fields.many2one('ir.model', 'Object'), + "user_id": fields.many2one('res.users', 'User'), + "method": fields.char("Method", size=64), + "timestamp": fields.datetime("Date"), + "res_id": fields.integer('Resource Id'), + "line_ids": fields.one2many('audittrail.log.line', 'log_id', 'Log lines'), } _defaults = { @@ -155,14 +170,14 @@ class audittrail_log_line(osv.osv): _name = 'audittrail.log.line' _description = "Log Line" _columns = { - 'field_id': fields.many2one('ir.model.fields', 'Fields', required=True), - 'log_id': fields.many2one('audittrail.log', 'Log'), - 'log': fields.integer("Log ID"), - 'old_value': fields.text("Old Value"), - 'new_value': fields.text("New Value"), - 'old_value_text': fields.text('Old value Text'), - 'new_value_text': fields.text('New value Text'), - 'field_description': fields.char('Field Description', size=64), + 'field_id': fields.many2one('ir.model.fields', 'Fields', required=True), + 'log_id': fields.many2one('audittrail.log', 'Log'), + 'log': fields.integer("Log ID"), + 'old_value': fields.text("Old Value"), + 'new_value': fields.text("New Value"), + 'old_value_text': fields.text('Old value Text'), + 'new_value_text': fields.text('New value Text'), + 'field_description': fields.char('Field Description', size=64), } audittrail_log_line() @@ -170,276 +185,366 @@ audittrail_log_line() class audittrail_objects_proxy(osv_pool): """ Uses Object proxy for auditing changes on object of subscribed Rules""" - - def get_value_text(self, cr, uid, field_name, values, object, context=None): + + def get_value_text(self, cr, uid, field_name, values, model, context=None): """ Gets textual values for the fields e.g.: For field of type many2one it gives its name value instead of id @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, - @param field_name: List of fields for text values - @param values: Values for field to be converted into textual values - @return: values: List of textual values for given fields + @param field_name: List of fields for text values + @param values: Values for field to be converted into textual values + @return: values: List of textual values for given fields """ if not context: context = {} pool = pooler.get_pool(cr.dbname) - f_id = pool.get('ir.model.fields').search(cr, uid, [('name', '=', field_name), ('model_id', '=', object.id)]) - if f_id: - field = pool.get('ir.model.fields').read(cr, uid, f_id)[0] - model = field['relation'] + field_pool = pool.get('ir.model.fields') + model_pool = pool.get('ir.model') + obj_pool = pool.get(model.model) + if obj_pool._inherits: + inherits_ids = model_pool.search(cr, uid, [('model', '=', obj_pool._inherits.keys()[0])]) + field_ids = field_pool.search(cr, uid, [('name', '=', field_name), ('model_id', 'in', (model.id, inherits_ids[0]))]) + else: + field_ids = field_pool.search(cr, uid, [('name', '=', field_name), ('model_id', '=', model.id)]) + field_id = field_ids and field_ids[0] or False + assert field_id, _("'%s' field is not exits in '%s' model" %(field_name, model.model)) - if field['ttype'] == 'many2one': - if values: - if type(values) == tuple: - values = values[0] - val = pool.get(model).read(cr, uid, [values], [pool.get(model)._rec_name]) - if val: - return val[0][pool.get(model)._rec_name] - elif field['ttype'] == 'many2many': - value = [] - if values: - for id in values: - val = pool.get(model).read(cr, uid, [id], [pool.get(model)._rec_name]) - if val: - value.append(val[0][pool.get(model)._rec_name]) - return value + field = field_pool.read(cr, uid, field_id) + relation_model = field['relation'] + relation_model_pool = relation_model and pool.get(relation_model) or False - elif field['ttype'] == 'one2many': - if values: - value = [] - for id in values: - val = pool.get(model).read(cr, uid, [id], [pool.get(model)._rec_name]) + if field['ttype'] == 'many2one': + res = False + relation_id = False + if values and type(values) == tuple: + relation_id = values[0] + if relation_id and relation_model_pool: + relation_model_object = relation_model_pool.read(cr, uid, relation_id, [relation_model_pool._rec_name]) + res = relation_model_object[relation_model_pool._rec_name] + return res - if val: - value.append(val[0][pool.get(model)._rec_name]) - return value - return values + elif field['ttype'] in ('many2many','one2many'): + res = [] + for relation_model_object in relation_model_pool.read(cr, uid, values, [relation_model_pool._rec_name]): + res.append(relation_model_object[relation_model_pool._rec_name]) + return res - def create_log_line(self, cr, uid, id, object, lines=[]): + return values + + def create_log_line(self, cr, uid, log_id, model, lines=[]): """ Creates lines for changed fields with its old and new values @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, - @param object: Object who's values are being changed + @param model: Object who's values are being changed @param lines: List of values for line is to be created """ - pool = pooler.get_pool(cr.dbname) - obj = pool.get(object.model) + obj_pool = pool.get(model.model) + model_pool = pool.get('ir.model') + field_pool = pool.get('ir.model.fields') + log_line_pool = pool.get('audittrail.log.line') #start Loop for line in lines: - if obj._inherits: - inherits_ids = pool.get('ir.model').search(cr, uid, [('model', '=', obj._inherits.keys()[0])]) - f_id = pool.get('ir.model.fields').search(cr, uid, [('name', '=', line['name']), ('model_id', 'in', (object.id, inherits_ids[0]))]) + if obj_pool._inherits: + inherits_ids = model_pool.search(cr, uid, [('model', '=', obj_pool._inherits.keys()[0])]) + field_ids = field_pool.search(cr, uid, [('name', '=', line['name']), ('model_id', 'in', (model.id, inherits_ids[0]))]) else: - f_id = pool.get('ir.model.fields').search(cr, uid, [('name', '=', line['name']), ('model_id', '=', object.id)]) - if f_id: - fields = pool.get('ir.model.fields').read(cr, uid, f_id) - old_value = 'old_value' in line and line['old_value'] or '' - new_value = 'new_value' in line and line['new_value'] or '' - old_value_text = 'old_value_text' in line and line['old_value_text'] or '' - new_value_text = 'new_value_text' in line and line['new_value_text'] or '' - - if old_value_text == new_value_text: - continue - if fields[0]['ttype'] == 'many2one': - if type(old_value) == tuple: - old_value = old_value[0] - if type(new_value) == tuple: - new_value = new_value[0] - vals = { - "log_id": id, - "field_id": f_id[0], - "old_value": old_value, - "new_value": new_value, - "old_value_text": old_value_text, - "new_value_text": new_value_text, - "field_description": fields[0]['field_description'] - } - line_id = pool.get('audittrail.log.line').create(cr, uid, vals) - cr.commit() - #End Loop + field_ids = field_pool.search(cr, uid, [('name', '=', line['name']), ('model_id', '=', model.id)]) + field_id = field_ids and field_ids[0] or False + assert field_id, _("'%s' field is not exits in '%s' model" %(line['name'], model.model)) + + field = field_pool.read(cr, uid, field_id) + old_value = 'old_value' in line and line['old_value'] or '' + new_value = 'new_value' in line and line['new_value'] or '' + old_value_text = 'old_value_text' in line and line['old_value_text'] or '' + new_value_text = 'new_value_text' in line and line['new_value_text'] or '' + + if old_value_text == new_value_text: + continue + if field['ttype'] == 'many2one': + if type(old_value) == tuple: + old_value = old_value[0] + if type(new_value) == tuple: + new_value = new_value[0] + vals = { + "log_id": log_id, + "field_id": field_id, + "old_value": old_value, + "new_value": new_value, + "old_value_text": old_value_text, + "new_value_text": new_value_text, + "field_description": field['field_description'] + } + line_id = log_line_pool.create(cr, uid, vals) + #End Loop return True - def log_fct(self, db, uid, object, method, fct_src, *args): + + def log_fct(self, db, uid, model, method, fct_src, *args): """ Logging function: This function is performs logging oprations according to method @param db: the current database @param uid: the current user’s ID for security checks, @param object: Object who's values are being changed - @param method: method to log: create, read, write, unlink + @param method: method to log: create, read, write, unlink @param fct_src: execute method of Object proxy - - @return: Returns result as per method of Object proxy + + @return: Returns result as per method of Object proxy """ - logged_uids = [] + res2 = args pool = pooler.get_pool(db) cr = pooler.get_db(db).cursor() - obj_ids = pool.get('ir.model').search(cr, uid, [('model', '=', object)]) - model_object = pool.get('ir.model').browse(cr, uid, obj_ids)[0] + resource_pool = pool.get(model) + log_pool = pool.get('audittrail.log') + model_pool = pool.get('ir.model') + + model_ids = model_pool.search(cr, uid, [('model', '=', model)]) + model_id = model_ids and model_ids[0] or False + assert model_id, _("'%s' Model is not exits..." %(model)) + model = model_pool.browse(cr, uid, model_id) + if method in ('create'): - res_id = fct_src(db, uid, object, method, *args) + res_id = fct_src(db, uid, model.model, method, *args) cr.commit() - new_value = pool.get(model_object.model).read(cr, uid, [res_id], args[0].keys())[0] - if 'id' in new_value: - del new_value['id'] - if not logged_uids or uid in logged_uids: - resource_name = pool.get(model_object.model).name_get(cr, uid, [res_id]) - resource_name = resource_name and resource_name[0][1] or '' - vals = { - "method": method, - "object_id": model_object.id, - "user_id": uid, "res_id": res_id, - "name": resource_name - } - id = pool.get('audittrail.log').create(cr, uid, vals) - lines = [] - for field in new_value: - if new_value[field]: - line = { - 'name': field, - 'new_value': new_value[field], - 'new_value_text': self.get_value_text(cr, uid, field, new_value[field], model_object) - } - lines.append(line) - self.create_log_line(cr, uid, id, model_object, lines) + resource = resource_pool.read(cr, uid, res_id, args[0].keys()) + vals = { + "method": method, + "object_id": model.id, + "user_id": uid, + "res_id": resource['id'], + } + if 'id' in resource: + del resource['id'] + log_id = log_pool.create(cr, uid, vals) + lines = [] + for field in resource: + line = { + 'name': field, + 'new_value': resource[field], + 'new_value_text': self.get_value_text(cr, uid, field, resource[field], model) + } + lines.append(line) + self.create_log_line(cr, uid, log_id, model, lines) + cr.commit() cr.close() return res_id - if method in ('write'): - res_ids = args[0] - for res_id in res_ids: - old_values = pool.get(model_object.model).read(cr, uid, res_id, args[1].keys()) - old_values_text = {} - for field in args[1].keys(): - old_values_text[field] = self.get_value_text(cr, uid, field, old_values[field], model_object) - res = fct_src(db, uid, object, method, *args) - cr.commit() - if res: - new_values = pool.get(model_object.model).read(cr, uid, res_ids, args[1].keys())[0] - if not logged_uids or uid in logged_uids: - resource_name = pool.get(model_object.model).name_get(cr, uid, [res_id]) - resource_name = resource_name and resource_name[0][1] or '' - id = pool.get('audittrail.log').create(cr, uid, {"method": method, "object_id": model_object.id, "user_id": uid, "res_id": res_id, "name": resource_name}) - lines = [] - for field in args[1].keys(): - if args[1].keys(): - line = { - 'name': field, - 'new_value': field in new_values and new_values[field] or '', - 'old_value': field in old_values and old_values[field] or '', - 'new_value_text': self.get_value_text(cr, uid, field, new_values[field], model_object), - 'old_value_text': old_values_text[field] - } - lines.append(line) - cr.commit() - self.create_log_line(cr, uid, id, model_object, lines) - cr.close() - return res - - if method in ('read'): + elif method in ('read'): res_ids = args[0] old_values = {} - res = fct_src(db, uid, object, method, *args) + res = fct_src(db, uid, model.model, method, *args) if type(res) == list: - for v in res: old_values[v['id']] = v else: old_values[res['id']] = res for res_id in old_values: - if not logged_uids or uid in logged_uids: - resource_name = pool.get(model_object.model).name_get(cr, uid, [res_id]) - resource_name = resource_name and resource_name[0][1] or '' - id = pool.get('audittrail.log').create(cr, uid, {"method": method, "object_id": model_object.id, "user_id": uid, "res_id": res_id, "name": resource_name}) - lines = [] - for field in old_values[res_id]: - if old_values[res_id][field]: - line = { - 'name': field, - 'old_value': old_values[res_id][field], - 'old_value_text': self.get_value_text(cr, uid, field, old_values[res_id][field], model_object) - } - lines.append(line) - cr.commit() - self.create_log_line(cr, uid, id, model_object, lines) + vals = { + "method": method, + "object_id": model.id, + "user_id": uid, + "res_id": res_id, + + } + log_id = log_pool.create(cr, uid, vals) + lines = [] + for field in old_values[res_id]: + line = { + 'name': field, + 'old_value': old_values[res_id][field], + 'old_value_text': self.get_value_text(cr, uid, field, old_values[res_id][field], model) + } + lines.append(line) + + self.create_log_line(cr, uid, log_id, model, lines) + cr.close() return res - if method in ('unlink'): + elif method in ('unlink'): res_ids = args[0] old_values = {} for res_id in res_ids: - old_values[res_id] = pool.get(model_object.model).read(cr, uid, res_id, []) + old_values[res_id] = resource_pool.read(cr, uid, res_id) for res_id in res_ids: - if not logged_uids or uid in logged_uids: - resource_name = pool.get(model_object.model).name_get(cr, uid, [res_id]) - resource_name = resource_name and resource_name[0][1] or '' - id = pool.get('audittrail.log').create(cr, uid, {"method": method, "object_id": model_object.id, "user_id": uid, "res_id": res_id, "name": resource_name}) - lines = [] - for field in old_values[res_id]: - if old_values[res_id][field]: - line = { - 'name': field, - 'old_value': old_values[res_id][field], - 'old_value_text': self.get_value_text(cr, uid, field, old_values[res_id][field], model_object) - } - lines.append(line) - cr.commit() - self.create_log_line(cr, uid, id, model_object, lines) - res = fct_src(db, uid, object, method, *args) + vals = { + "method": method, + "object_id": model.id, + "user_id": uid, + "res_id": res_id, + + } + log_id = log_pool.create(cr, uid, vals) + lines = [] + for field in old_values[res_id]: + if field in ('id'): + continue + line = { + 'name': field, + 'old_value': old_values[res_id][field], + 'old_value_text': self.get_value_text(cr, uid, field, old_values[res_id][field], model) + } + lines.append(line) + + self.create_log_line(cr, uid, log_id, model, lines) + res = fct_src(db, uid, model.model, method, *args) + cr.commit() cr.close() return res - cr.close() + else: + res_ids = args[0] + old_values = {} + fields = [] + if len(args)>1 and type(args[1]) == dict: + fields = args[1].keys() + if type(res_ids) in (long, int): + res_ids = [res_ids] + if res_ids: + for resource in resource_pool.read(cr, uid, res_ids): + resource_id = resource['id'] + if 'id' in resource: + del resource['id'] + old_values_text = {} + old_value = {} + for field in resource.keys(): + old_value[field] = resource[field] + old_values_text[field] = self.get_value_text(cr, uid, field, resource[field], model) + old_values[resource_id] = {'text':old_values_text, 'value': old_value} - def execute(self, db, uid, object, method, *args, **kw): + res = fct_src(db, uid, model.model, method, *args) + cr.commit() + + if res_ids: + for resource in resource_pool.read(cr, uid, res_ids): + resource_id = resource['id'] + if 'id' in resource: + del resource['id'] + vals = { + "method": method, + "object_id": model.id, + "user_id": uid, + "res_id": resource_id, + } + + + log_id = log_pool.create(cr, uid, vals) + lines = [] + for field in resource.keys(): + line = { + 'name': field, + 'new_value': resource[field], + 'old_value': old_values[resource_id]['value'][field], + 'new_value_text': self.get_value_text(cr, uid, field, resource[field], model), + 'old_value_text': old_values[resource_id]['text'][field] + } + lines.append(line) + + self.create_log_line(cr, uid, log_id, model, lines) + cr.commit() + cr.close() + return res + return True + + + + def execute(self, db, uid, model, method, *args, **kw): """ Overrides Object Proxy execute method @param db: the current database @param uid: the current user’s ID for security checks, @param object: Object who's values are being changed - @param method: method to log: create, read, write, unlink - - @return: Returns result as per method of Object proxy + @param method: get any method and create log + + @return: Returns result as per method of Object proxy """ pool = pooler.get_pool(db) + model_pool = pool.get('ir.model') + rule_pool = pool.get('audittrail.rule') cr = pooler.get_db(db).cursor() cr.autocommit(True) logged_uids = [] fct_src = super(audittrail_objects_proxy, self).execute - def my_fct(db, uid, object, method, *args): - field = method + def my_fct(db, uid, model, method, *args): rule = False - obj_ids = pool.get('ir.model').search(cr, uid, [('model', '=', object)]) - for obj_name in pool.obj_list(): - if obj_name == 'audittrail.rule': + model_ids = model_pool.search(cr, uid, [('model', '=', model)]) + model_id = model_ids and model_ids[0] or False + + for model_name in pool.obj_list(): + if model_name == 'audittrail.rule': rule = True if not rule: - return fct_src(db, uid, object, method, *args) - if not obj_ids: - return fct_src(db, uid, object, method, *args) - rule_ids = pool.get('audittrail.rule').search(cr, uid, [('object_id', '=', obj_ids[0]), ('state', '=', 'subscribed')]) - if not rule_ids: - return fct_src(db, uid, object, method, *args) + return fct_src(db, uid, model, method, *args) + if not model_id: + return fct_src(db, uid, model, method, *args) - for thisrule in pool.get('audittrail.rule').browse(cr, uid, rule_ids): + rule_ids = rule_pool.search(cr, uid, [('object_id', '=', model_id), ('state', '=', 'subscribed')]) + if not rule_ids: + return fct_src(db, uid, model, method, *args) + + for thisrule in rule_pool.browse(cr, uid, rule_ids): for user in thisrule.user_id: logged_uids.append(user.id) if not logged_uids or uid in logged_uids: - if field in ('read', 'write', 'create', 'unlink'): - if getattr(thisrule, 'log_' + field): - return self.log_fct(db, uid, object, method, fct_src, *args) - return fct_src(db, uid, object, method, *args) - res = my_fct(db, uid, object, method, *args) + if method in ('read', 'write', 'create', 'unlink'): + if getattr(thisrule, 'log_' + method): + return self.log_fct(db, uid, model, method, fct_src, *args) + + elif method not in ('default_get','read','fields_view_get','fields_get','search','search_count','name_search','name_get','get','request_get', 'get_sc', 'unlink', 'write', 'create'): + if thisrule.log_action: + return self.log_fct(db, uid, model, method, fct_src, *args) + + return fct_src(db, uid, model, method, *args) + res = my_fct(db, uid, model, method, *args) cr.close() return res + + def exec_workflow(self, db, uid, model, method, *args, **argv): + pool = pooler.get_pool(db) + cr = pooler.get_db(db).cursor() + cr.autocommit(True) + logged_uids = [] + fct_src = super(audittrail_objects_proxy, self).exec_workflow + field = method + rule = False + model_pool = pool.get('ir.model') + rule_pool = pool.get('audittrail.rule') + model_ids = model_pool.search(cr, uid, [('model', '=', model)]) + for obj_name in pool.obj_list(): + if obj_name == 'audittrail.rule': + rule = True + if not rule: + cr.close() + return super(audittrail_objects_proxy, self).exec_workflow(db, uid, model, method, *args, **argv) + if not model_ids: + cr.close() + return super(audittrail_objects_proxy, self).exec_workflow(db, uid, model, method, *args, **argv) + + rule_ids = rule_pool.search(cr, uid, [('object_id', 'in', model_ids), ('state', '=', 'subscribed')]) + if not rule_ids: + cr.close() + return super(audittrail_objects_proxy, self).exec_workflow(db, uid, model, method, *args, **argv) + + for thisrule in rule_pool.browse(cr, uid, rule_ids): + for user in thisrule.user_id: + logged_uids.append(user.id) + if not logged_uids or uid in logged_uids: + if thisrule.log_workflow: + cr.close() + return self.log_fct(db, uid, model, method, fct_src, *args) + cr.close() + return super(audittrail_objects_proxy, self).exec_workflow(db, uid, model, method, *args, **argv) + + cr.close() + return True + audittrail_objects_proxy() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/audittrail/audittrail_view.xml b/addons/audittrail/audittrail_view.xml index a79e6a0b6c0..17b2594d470 100644 --- a/addons/audittrail/audittrail_view.xml +++ b/addons/audittrail/audittrail_view.xml @@ -12,12 +12,15 @@
- - - - - - + + + + + + + + +