[Merge] Merge with Trunk Addons

bzr revid: vir@tinyerp.com-20100601053558-6bg9olji4ouwv805
This commit is contained in:
Vir (Open ERP) 2010-06-01 11:05:58 +05:30
commit 24a55b19e5
16 changed files with 405 additions and 79 deletions

View File

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

View File

@ -16,8 +16,10 @@
<field name="company_id" invisible="1"/>
<field name="partner_id" invisible="1"/>
<field name="product_id" invisible="1"/>
<field name="product_qty" invisible="1"/>
<field name="uom_name" invisible="not context.get('set_visible',False)"/>
<field name="categ_id" invisible="1"/>
<field name="nbr" sum="# of Lines"/>
<field name="product_qty"/>
<field name="price_average" avg="Average Price"/>
<field name="price_total" sum="Total Price"/>
<field name="state" invisible="1"/>
@ -97,16 +99,17 @@
<group expand="1" string="Group By...">
<filter string="Salesman" name='User' icon="terp-account" context="{'group_by':'user_id'}"/>
<filter string="Partner" icon="terp-account" context="{'group_by':'partner_id'}"/>
<filter string="Product" icon="terp-account" context="{'group_by':'product_id'}"/>
<filter string="Product" icon="terp-account" context="{'group_by':'product_id','set_visible':True}"/>
<separator orientation="vertical"/>
<filter string="Company" icon="terp-account" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<filter string="State" icon="terp-account" context="{'group_by':'state'}"/>
<filter string="Type" icon="terp-account" context="{'group_by':'type'}"/>
<separator orientation="vertical"/>
<filter string="Default UoM" icon="terp-account" context="{'group_by':'uom_name'}"/>
<filter string="Journal" icon="terp-account" context="{'group_by':'journal_id'}"/>
<filter string="Account" icon="terp-account" context="{'group_by':'account_id'}"/>
<filter string="Bank Account" icon="terp-account" context="{'group_by':'partner_bank'}"/>
<separator orientation="vertical"/>
<filter string="Category of Product" icon="terp-account" context="{'group_by':'categ_id'}"/>
<filter string="Currency" icon="terp-account" context="{'group_by':'currency_id'}"/>
<filter string="Force Period" icon="terp-account" context="{'group_by':'period_id'}"/>
<newline/>

View File

@ -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 <Unknown>\n"
"PO-Revision-Date: 2010-05-31 22:24+0000\n"
"Last-Translator: victor tejada yau <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 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

View File

@ -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) <fp@tinyerp.com>\n"
"PO-Revision-Date: 2010-06-01 01:00+0000\n"
"Last-Translator: Pandu Pradana <p4ndupr4d4n4@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 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"

View File

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

View File

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

View File

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import marketing_campaign_mailchimp
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
"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:

View File

@ -0,0 +1,131 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from 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:

View File

@ -0,0 +1,86 @@
<?xml version="1.0"?>
<openerp>
<data>
<!--
================================================================
Marketing Segments Inherited View - mailchimp
================================================================
-->
<record model="ir.ui.view" id="view_marketing_campaign_segment_form_inherit">
<field name="name">marketing.campaign.segment.form.inherit</field>
<field name="model">marketing.campaign.segment</field>
<field name="type">form</field>
<field name="inherit_id" ref="marketing_campaign.view_marketing_campaign_segment_form"/>
<field name="arch" type="xml">
<field name="date_done" position="after">
<separator string="Mailchimp Synchronization" colspan="4"/>
<field name="synchro"/>
<group colspan="2" attrs="{'invisible':[('synchro','!=',True)]}">
<field name="mailchimp_account_id" attrs="{'required':[('synchro','=',True)]}" domain="[('state','=','approved')]" on_change="onchange_mailchimp(mailchimp_account_id)"/>
<field name="mailchimp_list" attrs="{'required':[('synchro','=',True)]}" on_change="onchange_mailchimp_list(mailchimp_account_id,mailchimp_list)"/>
</group>
</field>
</field>
</record>
<!--
================================================================
Mailchimp Account
================================================================
-->
<menuitem name="Tools" id="base.menu_tools" icon="STOCK_PREFERENCES" sequence="15"/>
<menuitem name="Mailchimps" id="menu_action_mailchimp" parent="base.menu_tools" />
<record model="ir.ui.view" id="view_marketing_campaign_mailchimp_account_tree">
<field name="name">marketing.campaign.mailchimp.account.tree</field>
<field name="model">marketing.campaign.mailchimp.account</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="All Accounts">
<field name="name"/>
<field name="username" />
<field name="data_center"/>
<field name="state"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_marketing_campaign_mailchimp_account_form">
<field name="name">marketing.campaign.mailchimp.account.form</field>
<field name="model">marketing.campaign.mailchimp.account</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Account">
<field name="name" select="1"/>
<newline/>
<field name="username" select="1"/>
<field name="password" select="1" password="True"/>
<field name="apikey" />
<field name="data_center" required="1"/>
<separator string="Status" colspan="4"/>
<group col="13" colspan="4">
<field name="state" nolabel="1"/>
<button name="button_approve" string="Approve" states="draft" type="object"/>
<button name="button_cancel" string="Cancel" states="draft,approved" type="object"/>
</group>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_marketing_campaign_mailchimp_account">
<field name="name">All Mailchimp Accounts</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">marketing.campaign.mailchimp.account</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_marketing_campaign_mailchimp_account_tree"/>
</record>
<menuitem id="menu_action_marketing_campaign_mailchimp_account" parent="menu_action_mailchimp" action="action_marketing_campaign_mailchimp_account" sequence="40"/>
</data>
</openerp>

View File

@ -7,16 +7,16 @@ 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-09-08 13:21+0000\n"
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
"PO-Revision-Date: 2010-05-31 12:41+0000\n"
"Last-Translator: Grzegorz Grzelak (Cirrus.pl) <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-04-17 04:20+0000\n"
"X-Launchpad-Export-Date: 2010-06-01 03:44+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: profile_crm
#: model:ir.module.module,description:profile_crm.module_meta_information
msgid "Profile for CRM"
msgstr ""
msgstr "Profil dla CRM"

View File

@ -31,6 +31,7 @@ class report_project_task_user(osv.osv):
'day': fields.char('Day', size=128, readonly=True),
'year': fields.char('Year',size=64,required=False, readonly=True),
'user_id':fields.many2one('res.users', 'Assigned To', readonly=True),
'done_by':fields.many2one('res.users', 'Done By', readonly=True),
'date_start': fields.date('Starting Date',readonly=True),
'no_of_days': fields.integer('# of Days', size=128, readonly=True),
'description': fields.text('Description',readonly=True),
@ -90,6 +91,7 @@ class report_project_task_user(osv.osv):
t.company_id,
t.partner_id,
t.type,
w.user_id as done_by,
sum(remaining_hours) as remaining_hours,
sum(total_hours) as total_hours,
sum(planned_hours) as hours_planned,
@ -104,6 +106,7 @@ class report_project_task_user(osv.osv):
to_char(date_start, 'MM'),
t.priority,
t.user_id,
w.user_id,
t.state,
date_trunc('day',t.date_end),
to_date(to_char(t.date_deadline, 'dd-MM-YYYY'),'dd-MM-YYYY'),

View File

@ -12,6 +12,7 @@
<field name="name" invisible="1"/>
<field name="project_id" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="done_by"/>
<field name="date_deadline" invisible="1"/>
<field name="state" invisible="1"/>
<field name="date_start" invisible="1"/>
@ -110,6 +111,7 @@
<separator orientation="vertical"/>
<filter string="Partner" icon="terp-project" context="{'group_by':'partner_id'}" />
<filter string="Task" icon="terp-project" context="{'group_by':'name'}" />
<filter string="Done By" icon="terp-project" context="{'group_by':'done_by'}" />
<separator orientation="vertical"/>
<filter string="State" icon="terp-project" context="{'group_by':'state'}"/>
<filter string="Company" icon="terp-project" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
@ -122,6 +124,7 @@
<newline/>
<group expand="0" string="Extended options..." colspan="10" col="12" groups="base.group_extended">
<field name="type" widget="selection"/>
<field name="done_by" widget="selection"/>
<separator orientation="vertical"/>
<field name="date_start"/>
<field name="date_deadline"/>

View File

@ -113,7 +113,7 @@ class project_issue(osv.osv, crm.crm_case):
'thread_id': fields.many2one('mailgate.thread', 'Thread', required=False),
'id': fields.integer('ID'),
'name': fields.char('Name', size=128, required=True),
'active': fields.boolean('Active', required=False),
'active': fields.boolean('Active', required=False),
'create_date': fields.datetime('Creation Date' , readonly=True),
'write_date': fields.datetime('Update Date' , readonly=True),
'date_deadline': fields.date('Deadline'),

View File

@ -180,6 +180,12 @@
<field name="arch" type="xml">
<search string="Issue Tracker Search">
<group colspan="4" col="20">
<filter string="Current" domain="[('state','in',('open','draft'))]" help="Draft and Open Issues" icon="terp-project" default="1"/>
<filter string="In Progress" domain="[('state','=','open')]" help="Open Issues" icon="terp-project"/>
<filter string="Pending" domain="[('state','=','pending')]" help="Pending Issues" icon="terp-project"/>
<separator orientation="vertical"/>
<filter icon="gtk-home" string=" Today "
separator="1"
domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"
@ -212,6 +218,9 @@
context="{'group_by':'partner_id'}" />
<filter string="Salesman" icon="terp-crm"
domain="[]" context="{'group_by':'user_id'}" />
<separator orientation="vertical" />
<filter string="Month" icon="terp-crm"
domain="[]" context="{'group_by':'create_date'}" />
<separator orientation="vertical" />
</group>
</search>

View File

@ -7,16 +7,16 @@ 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-09-08 14:38+0000\n"
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
"PO-Revision-Date: 2010-05-31 12:41+0000\n"
"Last-Translator: Grzegorz Grzelak (Cirrus.pl) <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-04-17 04:20+0000\n"
"X-Launchpad-Export-Date: 2010-06-01 03:44+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: project_retro_planning
#: model:ir.module.module,shortdesc:project_retro_planning.module_meta_information
msgid "Project Retro planning"
msgstr ""
msgstr "Wsteczne planowanie projektu"