diff --git a/addons/account/i18n/pl.po b/addons/account/i18n/pl.po index 38051a478f0..1ed4700b0e0 100644 --- a/addons/account/i18n/pl.po +++ b/addons/account/i18n/pl.po @@ -7,13 +7,13 @@ 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-05-29 19:19+0000\n" +"PO-Revision-Date: 2010-05-30 15:07+0000\n" "Last-Translator: Grzegorz Grzelak (Cirrus.pl) \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-05-30 03:44+0000\n" +"X-Launchpad-Export-Date: 2010-05-31 03:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account @@ -117,7 +117,7 @@ msgstr "Nadrzędne" #. module: account #: selection:account.move,type:0 msgid "Journal Voucher" -msgstr "" +msgstr "Dokument dziennika" #. module: account #: field:account.invoice,residual:0 @@ -156,7 +156,7 @@ msgstr "Zapisy" #. module: account #: selection:account.move.line,centralisation:0 msgid "Debit Centralisation" -msgstr "" +msgstr "Centralizacja Winien" #. module: account #: model:ir.actions.wizard,name:account.wizard_invoice_state_confirm @@ -867,7 +867,7 @@ msgstr "Konta analityczne" #: model:ir.actions.wizard,name:account.wizard_print_journal #: model:ir.ui.menu,name:account.menu_print_journal msgid "Print Journal" -msgstr "Drukuj dziennik" +msgstr "Drukuj zapisy dzienników" #. module: account #: model:ir.model,name:account.model_account_bank_accounts_wizard @@ -1339,7 +1339,7 @@ msgstr "Zamknij rok podatkowy" #. module: account #: field:account.journal,centralisation:0 msgid "Centralised counterpart" -msgstr "" +msgstr "Centralizacja przeciwnej strony" #. module: account #: view:wizard.company.setup:0 @@ -1546,7 +1546,7 @@ msgstr "Dodatnie" #: model:ir.actions.wizard,name:account.wizard_general_journal #: model:ir.ui.menu,name:account.menu_general_journal msgid "Print General Journal" -msgstr "" +msgstr "Drukuj stany dzienników" #. module: account #: model:ir.actions.act_window,name:account.action_account_chart_template_form @@ -1786,7 +1786,7 @@ msgstr "Uzgodnienie zapisów z faktur i płatności" #: model:ir.actions.wizard,name:account.wizard_central_journal #: model:ir.ui.menu,name:account.menu_central_journal msgid "Print Central Journal" -msgstr "" +msgstr "Drukuj konta dzienników" #. module: account #: wizard_field:account.aged.trial.balance,init,period_length:0 @@ -1877,7 +1877,7 @@ msgstr "Data początkowa" #. module: account #: model:account.journal,name:account.refund_expenses_journal msgid "x Expenses Credit Notes Journal" -msgstr "" +msgstr "x Dziennik korekt wydatków" #. module: account #: field:account.analytic.journal,type:0 @@ -2010,7 +2010,7 @@ msgstr " Data początkowa" #. module: account #: wizard_view:account.analytic.account.journal.report,init:0 msgid "Analytic Journal Report" -msgstr "" +msgstr "Raport dzenników analitycznych" #. module: account #: model:ir.actions.act_window,name:account.action_invoice_tree3 @@ -2119,7 +2119,7 @@ msgstr "dni" #. module: account #: selection:account.aged.trial.balance,init,direction_selection:0 msgid "Past" -msgstr "Poprzednio" +msgstr "Przeszłość" #. module: account #: field:account.analytic.account,company_currency_id:0 @@ -2847,7 +2847,7 @@ msgstr "Widok dziennika" #. module: account #: selection:account.move.line,centralisation:0 msgid "Credit Centralisation" -msgstr "" +msgstr "Centralizacja Ma" #. module: account #: rml:account.overdue:0 @@ -3005,7 +3005,7 @@ msgstr "Uzgodnienie" #. module: account #: field:account.move.line,centralisation:0 msgid "Centralisation" -msgstr "" +msgstr "Centralizacja" #. module: account #: field:account.invoice.tax,tax_code_id:0 @@ -3537,7 +3537,7 @@ msgstr "Zapłać i uzgodnij" #: rml:account.central.journal:0 #: model:ir.actions.report.xml,name:account.account_central_journal msgid "Central Journal" -msgstr "Dziennik główny" +msgstr "Konta dziennika" #. module: account #: rml:account.third_party_ledger:0 @@ -3923,7 +3923,7 @@ msgstr "Wprowadź ręcznie zestawienie" #: model:ir.actions.act_window,name:account.action_account_journal_form #: model:ir.ui.menu,name:account.menu_action_account_journal_form msgid "Financial Journals" -msgstr "Dzienniki finansowe" +msgstr "Dzienniki księgowe" #. module: account #: selection:account.account.balance.report,checktype,state:0 @@ -5505,7 +5505,7 @@ msgstr "Zapis na koncie" #: rml:account.general.journal:0 #: model:ir.actions.report.xml,name:account.account_general_journal msgid "General Journal" -msgstr "" +msgstr "Stany dzienników" #. module: account #: field:account.account,balance:0 @@ -5654,7 +5654,7 @@ msgstr "Do" #. module: account #: model:ir.actions.act_window,name:account.action_account_analytic_journal_open_form msgid "Entries of Open Analytic Journals" -msgstr "" +msgstr "Zapisy otwartych dzienników analitycznych" #. module: account #: view:account.invoice.tax:0 @@ -5687,7 +5687,7 @@ msgstr "Rok podatkowy do zamknięcia" #: wizard_field:account.analytic.account.quantity_cost_ledger.report,init,date1:0 #: wizard_field:account.automatic.reconcile,init,date1:0 msgid "Start of period" -msgstr "Pociątek okresu" +msgstr "Początek okresu" #. module: account #: model:ir.ui.menu,name:account.account_template_folder @@ -5876,7 +5876,7 @@ msgstr "Rok podatkowy" #. module: account #: selection:account.aged.trial.balance,init,direction_selection:0 msgid "Future" -msgstr "Przyszłe" +msgstr "Przyszłość" #. module: account #: help:account.account.balance.report,checktype,fiscalyear:0 diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index cd1477e79cf..523d77c84e3 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -36,10 +36,12 @@ class account_invoice_report(osv.osv): ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True), 'product_id':fields.many2one('product.product', 'Product', readonly=True), 'product_qty':fields.float('Qty', readonly=True), + 'uom_name': fields.char('Default UoM', size=128, readonly=True), 'payment_term': fields.many2one('account.payment.term', 'Payment Term',readonly=True), 'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')],readonly=True), 'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position',readonly=True), 'currency_id': fields.many2one('res.currency', 'Currency', readonly=True), + 'categ_id': fields.many2one('product.category','Category of Product', readonly=True), 'journal_id': fields.many2one('account.journal', 'Journal',readonly=True), 'partner_id':fields.many2one('res.partner', 'Partner', readonly=True), 'company_id':fields.many2one('res.company', 'Company', readonly=True), @@ -81,46 +83,64 @@ class account_invoice_report(osv.osv): to_char(s.date_invoice, 'MM') as month, to_char(s.date_invoice, 'YYYY-MM-DD') as day, l.product_id as product_id, - sum(l.quantity * u.factor) as product_qty, + sum(case when s.type in ('out_refund','in_invoice') then + l.quantity * u.factor * -1 + else + l.quantity * u.factor + end) as product_qty, s.partner_id as partner_id, s.payment_term as payment_term, s.period_id as period_id, + u.name as uom_name, s.currency_id as currency_id, s.journal_id as journal_id, s.fiscal_position as fiscal_position, s.user_id as user_id, s.company_id as company_id, - sum(l.quantity*l.price_unit) as price_total, - (sum(l.quantity*l.price_unit)/sum(l.quantity * u.factor))::decimal(16,2) as price_average, + sum(case when s.type in ('out_refund','in_invoice') then + l.quantity*l.price_unit * -1 + else + l.quantity*l.price_unit + end) as price_total, + sum(case when s.type in ('out_refund','in_invoice') then + l.quantity*l.price_unit * -1 + else + l.quantity*l.price_unit + end) / sum(l.quantity * u.factor)::decimal(16,2) as price_average, count(*) as nbr, s.type as type, s.state, + pt.categ_id, s.date_due as date_due, s.address_contact_id as address_contact_id, s.address_invoice_id as address_invoice_id, s.account_id as account_id, s.partner_bank as partner_bank, - s.residual as residual, + sum(case when s.type in ('out_refund','in_invoice') then + s.residual * -1 + else + s.residual + end) as residual, case when s.state != 'paid' then null else - extract(epoch from avg(am.date_created-l.create_date))/(24*60*60)::decimal(16,2) + extract(epoch from avg(am.date_created-l.create_date))/(24*60*60)::decimal(16,2) end as delay_to_pay - from - account_invoice_line l - left join - account_invoice s on (s.id=l.invoice_id) - left join product_uom u on (u.id=l.uos_id), + from account_invoice_line l + left join account_invoice s on (s.id=l.invoice_id) + left join product_template pt on (pt.id=l.product_id) + left join product_uom u on (u.id=l.uos_id), account_move_line am left join account_invoice i on (i.move_id=am.move_id) - where - am.account_id=i.account_id + where am.account_id=i.account_id group by s.type, s.date_invoice, s.partner_id, l.product_id, + u.name, l.uos_id, s.user_id, s.state, s.residual, + pt.categ_id, s.company_id, s.payment_term, s.period_id, diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml index 94f181cd587..965d5078ae9 100644 --- a/addons/account/report/account_invoice_report_view.xml +++ b/addons/account/report/account_invoice_report_view.xml @@ -16,8 +16,10 @@ - + + + @@ -97,16 +99,17 @@ - + + - + diff --git a/addons/crm/i18n/es.po b/addons/crm/i18n/es.po index d0b526f542e..79f079d2df0 100644 --- a/addons/crm/i18n/es.po +++ b/addons/crm/i18n/es.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2010-01-05 05:59+0000\n" -"PO-Revision-Date: 2010-05-17 23:03+0000\n" -"Last-Translator: Carlos Incaser \n" +"PO-Revision-Date: 2010-05-31 22:24+0000\n" +"Last-Translator: victor tejada yau \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-05-19 05:11+0000\n" +"X-Launchpad-Export-Date: 2010-06-01 03:44+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: crm @@ -951,6 +951,8 @@ msgid "" "Category related to the section.Subdivide the CRM cases independently or " "section-wise." msgstr "" +"Categoria relacionada a la seccion. subdividido independientemente los casos " +"CRM o modo-seccion" #. module: crm #: field:crm.case.rule,act_state:0 @@ -1340,7 +1342,7 @@ msgstr "Calcular la segmentación" #. module: crm #: view:crm.lead:0 msgid "Lead Email" -msgstr "" +msgstr "Dirigir correo electronico" #. module: crm #: model:ir.actions.act_window,name:crm.crm_segmentation-act @@ -1563,6 +1565,8 @@ msgid "" "Helps you to organise the jobs hiring process: evaluation, meetings, email " "integration..." msgstr "" +"Te ayuda a organizar los procesos para emplear trabajos: evaluacion, " +"reunion, integracion de correo electronico" #. module: crm #: view:crm.fundraising:0 @@ -1619,7 +1623,7 @@ msgstr "Convertido" #: view:crm.lead:0 #: view:crm.opportunity:0 msgid "Reply to Last Email" -msgstr "" +msgstr "Responder el ultimo correo electronico" #. module: crm #: view:crm.segmentation:0 @@ -1629,7 +1633,7 @@ msgstr "Descripción de segmentación" #. module: crm #: help:crm.meeting,location:0 msgid "Gives Location of Meeting" -msgstr "" +msgstr "Dando la ubicacion de la reunion" #. module: crm #: view:crm.case:0 @@ -1644,7 +1648,7 @@ msgstr "Historial" #. module: crm #: model:ir.model,name:crm.model_crm_job msgid "Job Cases" -msgstr "" +msgstr "casos de trabajos" #. module: crm #: view:crm.job:0 @@ -1654,7 +1658,7 @@ msgstr "Trabajos - selección de personal" #. module: crm #: field:crm.case.rule,regex_name:0 msgid "Regular Expression on Case Name" -msgstr "" +msgstr "Expresion regular en nombre de caso" #. module: crm #: field:crm.case,state:0 @@ -1719,7 +1723,7 @@ msgstr "¡No se ha encontrado Email en la dirección de su compañía!" #. module: crm #: view:crm.fundraising:0 msgid "Search Funds" -msgstr "" +msgstr "buscar fondos" #. module: crm #: view:crm.claim:0 @@ -1729,7 +1733,7 @@ msgstr "Tipo de reclamación" #. module: crm #: view:crm.case:0 msgid "Helpdesk Support Tree" -msgstr "" +msgstr "Arbol de soporte tecnico" #. module: crm #: view:res.partner.events:0 @@ -1760,12 +1764,14 @@ msgstr "Referencia" #. module: crm #: field:crm.meeting,exrule:0 msgid "Exception Rule" -msgstr "" +msgstr "Exception de regla" #. module: crm #: help:crm.case.rule,act_mail_to_partner:0 msgid "Check this if you want the rule to send an email to the partner." msgstr "" +"Verifica esto si tu quieres enviar la norma en un correo electronico a el " +"socio" #. module: crm #: model:crm.case.category2,name:crm.category_lead2 @@ -1810,7 +1816,7 @@ msgstr "Importe de venta" #: view:crm.lead:0 #: view:crm.opportunity:0 msgid "Add a CC" -msgstr "" +msgstr "Agregar un CC" #. module: crm #: selection:crm.segmentation.line,expr_operator:0 @@ -1838,7 +1844,7 @@ msgstr "Alarma" #. module: crm #: field:crm.case.rule,act_mail_to_watchers:0 msgid "Mail to watchers (CC)" -msgstr "" +msgstr "correo a los observadores (CC)" #. module: crm #: view:crm.fundraising:0 @@ -1903,7 +1909,7 @@ msgstr "" #. module: crm #: model:ir.actions.wizard,name:crm.wizard_crm_set_rrule msgid "Set RRULE" -msgstr "" +msgstr "Establecer RRULE" #. module: crm #: model:crm.case.stage,name:crm.stage_oppor4 @@ -1981,7 +1987,7 @@ msgstr "" #: code:addons/crm/crm.py:0 #, python-format msgid "Email Fail!" -msgstr "" +msgstr "Correo electronico fallo" #. module: crm #: model:crm.case.categ,name:crm.categ_phone1 diff --git a/addons/idea/i18n/id.po b/addons/idea/i18n/id.po index 190156f359b..da1e1c37693 100644 --- a/addons/idea/i18n/id.po +++ b/addons/idea/i18n/id.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2009-11-09 17:47+0000\n" -"Last-Translator: Fabien (Open ERP) \n" +"PO-Revision-Date: 2010-06-01 01:00+0000\n" +"Last-Translator: Pandu Pradana \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-04-17 04:09+0000\n" +"X-Launchpad-Export-Date: 2010-06-01 03:44+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: idea @@ -27,7 +27,7 @@ msgstr "" #: selection:idea.vote,score:0 #: selection:idea.vote.stat,score:0 msgid "Very Good" -msgstr "" +msgstr "Sangat Baik" #. module: idea #: view:idea.idea:0 @@ -39,7 +39,7 @@ msgstr "" #: model:ir.actions.act_window,name:idea.action_idea_idea_my_idea #: model:ir.ui.menu,name:idea.menu_idea_idea_my_idea msgid "My Ideas" -msgstr "" +msgstr "Ide Saya" #. module: idea #: constraint:ir.actions.act_window:0 @@ -51,13 +51,13 @@ msgstr "" #: selection:idea.vote,score:0 #: selection:idea.vote.stat,score:0 msgid "Not Voted" -msgstr "" +msgstr "Tidak Memberikan Suara" #. module: idea #: model:ir.actions.act_window,name:idea.action_idea_idea_open_my #: model:ir.ui.menu,name:idea.menu_idea_idea_open_my msgid "My Open Ideas" -msgstr "" +msgstr "Ide Terbuka Saya" #. module: idea #: model:ir.actions.act_window,name:idea.action_idea_idea @@ -69,18 +69,18 @@ msgstr "" #. module: idea #: field:idea.category,child_ids:0 msgid "Child Categories" -msgstr "" +msgstr "Kategori Anak" #. module: idea #: view:idea.idea:0 msgid "New Idea" -msgstr "" +msgstr "Ide Baru" #. module: idea #: model:ir.actions.act_window,name:idea.action_idea_category_tree #: model:ir.ui.menu,name:idea.menu_idea_category_tree msgid "Ideas by Categories" -msgstr "" +msgstr "Ide berdasar Kategori" #. module: idea #: field:idea.vote,score:0 @@ -101,7 +101,7 @@ msgstr "" #. module: idea #: model:ir.actions.act_window,name:idea.action_idea_vote_stat msgid "Statistics on Votes" -msgstr "" +msgstr "Statistik pada Voting" #. module: idea #: constraint:ir.model:0 @@ -112,17 +112,17 @@ msgstr "" #. module: idea #: model:ir.model,name:idea.model_idea_category msgid "Category for an idea" -msgstr "" +msgstr "Kategori untuk sebuah ide" #. module: idea #: model:ir.module.module,shortdesc:idea.module_meta_information msgid "Idea Manager" -msgstr "" +msgstr "Manager Ide" #. module: idea #: model:ir.ui.menu,name:idea.menu_idea_vote_stat msgid "Vote Statistics" -msgstr "" +msgstr "Statistik Voting" #. module: idea #: selection:idea.idea,state:0 @@ -161,12 +161,12 @@ msgstr "Pelaporan" #. module: idea #: model:ir.model,name:idea.model_idea_vote_stat msgid "Idea Votes Statistics" -msgstr "" +msgstr "Statistik Voting Ide" #. module: idea #: model:ir.model,name:idea.model_idea_vote msgid "idea.vote" -msgstr "" +msgstr "ide.voting" #. module: idea #: field:idea.comment,user_id:0 @@ -177,7 +177,7 @@ msgstr "" #. module: idea #: view:idea.idea:0 msgid "Your comment" -msgstr "" +msgstr "Komentar anda" #. module: idea #: model:ir.ui.menu,name:idea.menu_config @@ -193,12 +193,12 @@ msgstr "" #. module: idea #: view:idea.stat:0 msgid "stat" -msgstr "" +msgstr "stat" #. module: idea #: field:idea.idea,my_vote:0 msgid "My Vote" -msgstr "" +msgstr "Voting Saya" #. module: idea #: constraint:ir.ui.view:0 @@ -208,7 +208,7 @@ msgstr "" #. module: idea #: view:idea.vote:0 msgid "Votes" -msgstr "" +msgstr "Memilih" #. module: idea #: model:ir.module.module,description:idea.module_meta_information @@ -230,28 +230,28 @@ msgstr "" #. module: idea #: field:idea.idea,count_votes:0 msgid "Count of votes" -msgstr "" +msgstr "Jumlah voting" #. module: idea #: field:idea.vote.stat,nbr:0 msgid "Number of Votes" -msgstr "" +msgstr "Nomer Voting" #. module: idea #: model:ir.model,name:idea.model_idea_idea msgid "idea.idea" -msgstr "" +msgstr "ide.ide" #. module: idea #: model:ir.actions.act_window,name:idea.action_idea_idea_draft_my #: model:ir.ui.menu,name:idea.menu_idea_idea_draft_my msgid "My Draft Ideas" -msgstr "" +msgstr "Draf ide saya" #. module: idea #: field:idea.idea,vote_ids:0 msgid "Vote" -msgstr "" +msgstr "Pemilihan" #. module: idea #: selection:idea.idea,my_vote:0 @@ -264,7 +264,7 @@ msgstr "" #: view:idea.idea:0 #: model:ir.ui.menu,name:idea.menu_idea_idea msgid "All Ideas" -msgstr "" +msgstr "Semua Ide" #. module: idea #: view:idea.comment:0 @@ -277,17 +277,17 @@ msgstr "" #. module: idea #: field:idea.idea,count_comments:0 msgid "Count of comments" -msgstr "" +msgstr "Jumlah komentar" #. module: idea #: field:idea.idea,title:0 msgid "Idea Summary" -msgstr "" +msgstr "Ringkasan Ide" #. module: idea #: view:idea.category:0 msgid "Category of ideas" -msgstr "" +msgstr "Kategori berdasarkan ide" #. module: idea #: field:idea.category,summary:0 @@ -299,7 +299,7 @@ msgstr "" #: model:ir.actions.act_window,name:idea.action_idea_idea_open #: model:ir.ui.menu,name:idea.menu_idea_idea_open msgid "Open Ideas" -msgstr "" +msgstr "Ide Terbuka" #. module: idea #: view:idea.idea:0 @@ -317,7 +317,7 @@ msgstr "" #. module: idea #: field:idea.category,parent_id:0 msgid "Parent Categories" -msgstr "" +msgstr "Kategori Induk" #. module: idea #: field:idea.idea,user_id:0 @@ -335,14 +335,14 @@ msgstr "" #: field:idea.vote,idea_id:0 #: field:idea.vote.stat,idea_id:0 msgid "Idea" -msgstr "" +msgstr "Ide" #. module: idea #: selection:idea.idea,my_vote:0 #: selection:idea.vote,score:0 #: selection:idea.vote.stat,score:0 msgid "Very Bad" -msgstr "" +msgstr "Sangat Buruk" #. module: idea #: selection:idea.idea,state:0 @@ -352,7 +352,7 @@ msgstr "" #. module: idea #: model:ir.ui.menu,name:idea.menu_idea_vote msgid "All Votes" -msgstr "" +msgstr "Semua Pemilihan" #. module: idea #: view:idea.idea:0 @@ -367,7 +367,7 @@ msgstr "" #. module: idea #: field:idea.idea,vote_avg:0 msgid "Average Score" -msgstr "" +msgstr "Skor Rata-rata" #. module: idea #: view:idea.idea:0 @@ -377,4 +377,4 @@ msgstr "" #. module: idea #: help:idea.idea,description:0 msgid "Content of the idea" -msgstr "" +msgstr "Isi ide" diff --git a/addons/mail_gateway/__openerp__.py b/addons/mail_gateway/__openerp__.py index b5e56a03ee1..aaf12b926b3 100644 --- a/addons/mail_gateway/__openerp__.py +++ b/addons/mail_gateway/__openerp__.py @@ -27,8 +27,8 @@ * IMAP / IMAP with SSL * POP / POP with SSL * SMTP / SMTP with TLS - * ACL basd access polocy - * Queing and History for Emails + * ACL based access policy + * Queueing and History for Emails * Easy Integration with any Module""", 'author': 'Tiny', 'website': 'http://www.openerp.com', diff --git a/addons/mail_gateway/mail_gateway.py b/addons/mail_gateway/mail_gateway.py index 8534c32c510..05d27ce3ef2 100644 --- a/addons/mail_gateway/mail_gateway.py +++ b/addons/mail_gateway/mail_gateway.py @@ -30,7 +30,7 @@ class one2many_domain(fields.one2many): user=user, context=context) def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): - if not context: + if context is None: context = {} res = {} msg_obj = obj.pool.get('mailgate.message') @@ -65,7 +65,7 @@ class mailgate_thread(osv.osv): @param email: Email address if any @param details: Details of case history if any @param context: A standard dictionary for contextual values""" - if not context: + if context is None: context = {} # The mailgate sends the ids of the cases and not the object list if all(isinstance(case_id, (int, long)) for case_id in cases) and context.get('model'): diff --git a/addons/marketing_campaign_mailchimp/__init__.py b/addons/marketing_campaign_mailchimp/__init__.py new file mode 100644 index 00000000000..0f354314327 --- /dev/null +++ b/addons/marketing_campaign_mailchimp/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +import marketing_campaign_mailchimp + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/marketing_campaign_mailchimp/__openerp__.py b/addons/marketing_campaign_mailchimp/__openerp__.py new file mode 100644 index 00000000000..bd614607b97 --- /dev/null +++ b/addons/marketing_campaign_mailchimp/__openerp__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + + +{ + "name" : "", + "version" : "1.1", + "depends" : ['marketing_campaign'], + "author" : "Tiny", + "category": 'Generic Modules/Marketing', + "description": """ + """, + 'website': 'http://www.openerp.com', + 'init_xml': [], + 'update_xml': [ + 'marketing_campaign_mailchimp_view.xml', + ], + 'demo_xml': [], + 'installable': True, + 'active': False, +} + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/marketing_campaign_mailchimp/marketing_campaign_mailchimp.py b/addons/marketing_campaign_mailchimp/marketing_campaign_mailchimp.py new file mode 100644 index 00000000000..a1c3162cee2 --- /dev/null +++ b/addons/marketing_campaign_mailchimp/marketing_campaign_mailchimp.py @@ -0,0 +1,131 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import fields, osv + +import urllib2 +import simplejson as json + +mailchimp_url = 'http://%s.api.mailchimp.com/1.2' + +class marketing_campaign_mailchimp_account(osv.osv): #{{{ + _name = "marketing.campaign.mailchimp.account" + + _columns = { + 'name': fields.char('Account Name', size=64), + 'username': fields.char('Username', size=64, required=True), + 'password': fields.char('Password', size=64, required=True), + 'apikey': fields.char('API Key', size=128), + 'data_center': fields.selection([('us1', 'US1'), ('us2', 'US2'), + ('uk1', 'UK1')], 'Data Center'), + 'state': fields.selection([('draft', 'Draft'), ('approved', 'Approved'), + ('cancelled', 'Cancelled')], 'State', readonly=True) + } + + _defaults = { + 'state': lambda *a: 'draft' + } + + def get_response(self, cr, uid, mailchimp_id, method, params={}): + mailchimp_account = self.browse(cr, uid, mailchimp_id) + params['output'] = 'json' + if method == 'login': + params['username'] = mailchimp_account.username + params['password'] = mailchimp_account.password + else : + params['apikey'] = mailchimp_account.apikey + params = '&'.join(map(lambda x : '%s=%s' %(x, params[x]), params)) + url = mailchimp_url%mailchimp_account.data_center+ '/?method=%s'%method + req = urllib2.Request(url, params) + handle = urllib2.urlopen(req) + response = json.loads(handle.read()) + return response + + def button_approve(self, cr, uid, ids, context): + acc_obj = self.browse(cr, uid, ids)[0] + vals = {} + if not acc_obj.apikey: + method = 'login' + else: + method = 'ping' + response = self.get_response(cr, uid, acc_obj.id, method) + if 'error' not in response: + if method == 'login' : + vals['apikey'] = response + vals['state'] = 'approved' + self.write(cr, uid, ids, vals) + else : + raise osv.except_osv('Error!!!', + "Can't approved accoutnt : %s"%response['error']) + return True + + def button_cancel(self, cr, uid, ids, context): + self.write(cr, uid, ids, {'state': 'cancelled'}) + return True + +marketing_campaign_mailchimp_account() #}}} + +#class marketing_campaign_mailchimp_list(osv.osv_memory): #{{{ +# _name = "marketing.campaign.mailchimp.list" +# +# _columns = { +# 'name': fields.char('Name', size=64), +# 'mailchimp_account_id': fields.many2one('marketing.campaign.mailchimp.account', 'Account'), +# 'list_id': fields.char('List Id', size=64,), +# } +# +# _defaults = { +# 'state': lambda *a: 'draft' +# } +# +#marketing_campaign_mailchimp_list() #}}} + +class marketing_campaign_segment(osv.osv): #{{{ + _inherit = "marketing.campaign.segment" + + _columns = { + 'synchro': fields.boolean('Mailchimp Synchro'), + 'mailchimp_account_id': fields.many2one( + 'marketing.campaign.mailchimp.account', 'Account'), + 'mailchimp_list': fields.char('List', size=64), + } + + def onchange_mailchimp(self, cr, uid, ids, mailchimp_account_id): + if mailchimp_account_id: + return {'value':{'mailchimp_list':''}} + return {'value':{}} + + def onchange_mailchimp_list(self, cr, uid, ids, mailchimp_account_id, + mailchimp_list): + if mailchimp_account_id and mailchimp_list: + lists = self.pool.get('marketing.campaign.mailchimp.account').get_response(cr, + uid, mailchimp_account_id, 'lists') + list_names = [list['name'] for list in lists] + if mailchimp_list not in list_names: + raise osv.except_osv('Error!!!',"Lists doesn't exists") + else : + return {} + return {'value':{}} +marketing_campaign_segment() #}}} + + + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/marketing_campaign_mailchimp/marketing_campaign_mailchimp_view.xml b/addons/marketing_campaign_mailchimp/marketing_campaign_mailchimp_view.xml new file mode 100644 index 00000000000..6721cfc4fba --- /dev/null +++ b/addons/marketing_campaign_mailchimp/marketing_campaign_mailchimp_view.xml @@ -0,0 +1,87 @@ + + + + + + + + marketing.campaign.segment.form.inherit + marketing.campaign.segment + form + + + + + + + + + + + + + + + + + + + + + marketing.campaign.mailchimp.account.tree + marketing.campaign.mailchimp.account + tree + + + + + + + + + + + + + marketing.campaign.mailchimp.account.form + marketing.campaign.mailchimp.account + form + +
+ + + + + + + + + +