[MERGE] Merged from main branch.

bzr revid: vra@tinyerp.com-20100524081117-s63vktc1m3grcu8v
This commit is contained in:
vra 2010-05-24 13:41:17 +05:30
parent e277449755
commit ff1b4fd3f0
143 changed files with 7082 additions and 2503 deletions

View File

@ -107,8 +107,11 @@ module named account_voucherss
'company_view.xml',
'account_installer.xml',
'report/account_invoice_report_view.xml',
'report/account_entries_report_view.xml',
'report/account_report_view.xml',
'report/account_analytic_report_view.xml',
'report/account_account_report_view.xml',
'report/account_analytic_entries_report_view.xml'
],
'demo_xml': [
#'demo/price_accuracy00.yml',

View File

@ -478,14 +478,9 @@
<act_window domain="[('journal_id','=',active_id),('state','!=','draft'),('reconciled','=',False)]" id="act_account_journal_2_account_invoice_opened" name="Unpaid invoices" res_model="account.invoice" src_model="account.journal"/>
<act_window domain="[('account_analytic_id', '=', active_id)]" id="act_account_analytic_account_2_account_invoice_line" name="Invoice lines" res_model="account.invoice.line" src_model="account.analytic.account"/>
<<<<<<< TREE
<act_window domain="[('partner_id', '=', partner_id), ('account_id.type', 'in', ['receivable', 'payable']), ('reconcile_id','=',False)]" id="act_account_invoice_account_move_unreconciled" name="Unreconciled Receivables &amp; Payables" res_model="account.move.line" src_model="account.invoice"/>
<!-- Partners inherited form -->
=======
<!-- Partners inherited form -->
>>>>>>> MERGE-SOURCE
<record id="view_invoice_partner_info_form" model="ir.ui.view">
<field name="name">res.partner.invoice.info.inherit</field>

View File

@ -22,6 +22,7 @@
groups="group_account_user"/>
<menuitem id="menu_account_end_year_treatments" name="End of Year Treatments" parent="account.menu_finance_periodical_processing" sequence="20"/>
<menuitem id="menu_finance_statastic_report_statement" name="Satistic Reports" parent="account.menu_finance_reporting" sequence="3"/>
</data>
</openerp>

View File

@ -351,7 +351,7 @@
<page string="Entry encoding">
<field colspan="4" name="line_ids" nolabel="1">
<tree editable="bottom" string="Statement lines">
<field name="sequence"/>
<field name="sequence" invisible="1"/>
<field name="date"/>
<field name="ref"/>
<field name="name"/>

View File

@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-05-17 13:10+0000\n"
"Last-Translator: Jon A. Ortuondo (Euskotec) <Unknown>\n"
"PO-Revision-Date: 2010-05-23 09:59+0000\n"
"Last-Translator: ninaiz <inigo.rekalde@gmail.com>\n"
"Language-Team: Basque <eu@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-05-19 05:12+0000\n"
"X-Launchpad-Export-Date: 2010-05-24 03:46+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@ -236,7 +236,7 @@ msgstr ""
#: field:account.tax.template,amount:0
#: xsl:account.transfer:0
msgid "Amount"
msgstr ""
msgstr "Kopurua"
#. module: account
#: model:ir.actions.report.xml,name:account.account_3rdparty_ledger
@ -338,7 +338,7 @@ msgstr ""
#: field:account.invoice,amount_tax:0
#: field:account.move.line,account_tax_id:0
msgid "Tax"
msgstr ""
msgstr "Zerga"
#. module: account
#: rml:account.general.journal:0
@ -465,7 +465,7 @@ msgstr ""
#. module: account
#: rml:account.invoice:0
msgid "Disc.(%)"
msgstr ""
msgstr "Desk. (%)"
#. module: account
#: rml:account.general.ledger:0

View File

@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.1\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-02-18 09:24+0000\n"
"Last-Translator: Olivier Dony (OpenERP) <Unknown>\n"
"PO-Revision-Date: 2010-05-21 17:48+0000\n"
"Last-Translator: Christophe Chauvet - http://www.syleam.fr/ <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:06+0000\n"
"X-Launchpad-Export-Date: 2010-05-22 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@ -2495,7 +2495,8 @@ msgid "Analytic Entry"
msgstr "Ecriture analytique"
#. module: account
#: view:res.company:0 field:res.company,overdue_msg:0
#: view:res.company:0
#: field:res.company,overdue_msg:0
msgid "Overdue Payments Message"
msgstr "Message pour les paiements en retard"
@ -2784,7 +2785,7 @@ msgstr "Ouvrir journal"
#. module: account
#: rml:account.analytic.account.journal:0
msgid "KI"
msgstr ""
msgstr "KI"
#. module: account
#: model:ir.actions.wizard,name:account.action_account_analytic_line
@ -3034,7 +3035,7 @@ msgstr "-"
#. module: account
#: rml:account.analytic.account.journal:0
msgid "asgfas"
msgstr ""
msgstr "asgfas"
#. module: account
#: model:ir.actions.act_window,name:account.action_account_analytic_account_tree2
@ -6082,3 +6083,6 @@ msgid ""
msgstr ""
"Cochez cette case si l'utilisateur peut réconcilier les entrées dans ce "
"compte."
#~ msgid "account.config.wizard"
#~ msgstr "account.config.wizard"

View File

@ -37,6 +37,8 @@ import compare_account_balance
import account_invoice_report
import account_report
import account_analytic_report
import account_account_report
import account_entries_report
import account_analytic_entries_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,86 @@
# -*- 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 tools
from osv import fields,osv
class account_account_report(osv.osv):
_name = "account.account.report"
_description = "Account Report"
_auto = False
_columns = {
'name': fields.char('Name', size=128, readonly=True),
'code': fields.char('Code', size=64, readonly=True),
'type': fields.selection([
('receivable', 'Receivable'),
('payable', 'Payable'),
('view', 'View'),
('consolidation', 'Consolidation'),
('other', 'Others'),
('closed', 'Closed'),
], 'Internal Type', readonly=True),
'company_id': fields.many2one('res.company', 'Company', required=True),
'currency_mode': fields.selection([('current', 'At Date'), ('average', 'Average Rate')], 'Outgoing Currencies Rate',readonly=True),
'user_type': fields.many2one('account.account.type', 'Account Type',readonly=True),
'quantity': fields.float('Quantity', readonly=True),
'amount_total': fields.float('Total Amount', readonly=True),
'credit': fields.float('Credit', readonly=True),
'debit': fields.float('Debit', readonly=True),
'balance': fields.float('Balance', readonly=True),
'nbr': fields.integer('#Accounts', readonly=True),
'parent_account_id': fields.many2one('account.account', 'Parent Account', required=True),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'account_account_report')
cr.execute("""
create or replace view account_account_report as (
select
min(a.id) as id,
count(distinct a.id) as nbr,
a.name,
a.code,
a.type as type,
a.company_id as company_id,
a.currency_mode as currency_mode,
a.user_type as user_type,
a.parent_id as parent_account_id,
sum(ail.quantity) as quantity,
sum(ail.price_subtotal) as amount_total,
sum(m.credit) as credit,
sum(m.debit) as debit,
(sum(m.credit)-sum(m.debit)) as balance
from
account_account as a
left join account_move_line as m on m.account_id=a.id
left join account_invoice_line as ail on ail.account_id=a.id
left join account_invoice as ai on ai.account_id=a.id
group by
a.name,
a.code,
a.type,
a.company_id,
a.currency_mode,
a.user_type,
m.account_id,
a.parent_id
)
""")
account_account_report()

View File

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_account_report_tree" model="ir.ui.view">
<field name="name">account.account.report.tree</field>
<field name="model">account.account.report</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Account Report">
<field name="name" invisible="1" string="Account"/>
<field name="code" invisible="1"/>
<field name="type" invisible="1"/>
<field name="company_id" invisible="1" group="base.multi_company"/>
<field name="currency_mode" invisible="1"/>
<field name="nbr" sum="#Accounts"/>
<field name="user_type" invisible="1"/>
<field name="parent_account_id" invisible="1"/>
<field name="quantity" sum="Quantity"/>
<field name="amount_total" sum="Total Amount"/>
<field name="credit" sum="Credit"/>
<field name="debit" sum="Debit"/>
<field name="balance" sum="Balance"/>
</tree>
</field>
</record>
<record id="view_account_account_report_graph" model="ir.ui.view">
<field name="name">account.account.report.graph</field>
<field name="model">account.account.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Accounts" type="bar">
<field name="name"/>
<field name="credit" operator="+"/>
<field name="debit" operator="+"/>
<field name="balance" operator="+"/>
</graph>
</field>
</record>
<record id="view_account_account_report_search" model="ir.ui.view">
<field name="name">account.account.report.search</field>
<field name="model">account.account.report</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Accounts">
<group>
<filter icon="terp-account"
string="At Date"
domain="[('currency_mode','=', 'current')]"/>
<filter icon="terp-account"
string="Average Rate"
domain="[('currency_mode','=','average')]"/>
<separator orientation="vertical"/>
<field name="name" string="Account"/>
<field name="code"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
<newline/>
<group expand="0" string="Extended options..." colspan="10" col="12">
<field name="type" />
<field name="user_type" widget="selection"/>
<field name="parent_account_id" />
</group>
<newline/>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter string="Account" name="Account" icon="terp-account" context="{'group_by':'name'}"/>
<filter string="Code" icon="terp-account" context="{'group_by':'code'}"/>
<filter string="Company" icon="terp-account" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator orientation="vertical"/>
<filter string="Currencies Rate" icon="terp-account" context="{'group_by':'currency_mode'}"/>
<filter string="Internal Type" icon="terp-account" context="{'group_by':'type'}"/>
<filter string="Account Type" icon="terp-account" context="{'group_by':'user_type'}"/>
<filter string="Parent Account" icon="terp-account" context="{'group_by':'parent_account_id'}"/>
</group>
</search>
</field>
</record>
<record id="action_account_account_report" model="ir.actions.act_window">
<field name="name">Accounts</field>
<field name="res_model">account.account.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{"search_default_Account":1,"search_default_At Date":1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="search_view_id" ref="view_account_account_report_search"/>
</record>
<menuitem action="action_account_account_report" id="menu_action_account_account_report" parent="account.menu_finance_statastic_report_statement" sequence="6"/>
</data>
</openerp>

View File

@ -0,0 +1,83 @@
# -*- 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 tools
from osv import fields,osv
class analytic_entries_report(osv.osv):
_name = "analytic.entries.report"
_description = "Analytic Entries Statistics"
_auto = False
_columns = {
'date': fields.date('Date', readonly=True),
'year': fields.char('Year', size=4, readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
'user_id' : fields.many2one('res.users', 'User',readonly=True),
'name': fields.char('Description', size=64, readonly=True),
'company_id': fields.many2one('res.company', 'Company', required=True),
'currency_id': fields.many2one('res.currency', 'Currency', required=True),
'account_id': fields.many2one('account.analytic.account', 'Account', required=True),
'general_account_id': fields.many2one('account.account', 'General Account', required=True),
'journal_id': fields.many2one('account.analytic.journal', 'Journal', required=True),
'move_id': fields.many2one('account.move.line', 'Move', required=True),
'product_id': fields.many2one('product.product', 'Product', required=True),
'product_uom_id': fields.many2one('product.uom', 'Product UOM', required=True),
'amount': fields.float('Amount', readonly=True),
'unit_amount': fields.float('Unit Amount', readonly=True),
'amount_currency': fields.float('Amount Currency', readonly=True),
'nbr': fields.integer('#Entries', readonly=True),
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'analytic_entries_report')
cr.execute("""
create or replace view analytic_entries_report as (
select
min(a.id) as id,
count(distinct a.id) as nbr,
a.create_date as date,
to_char(a.create_date, 'YYYY') as year,
to_char(a.create_date, 'MM') as month,
to_char(a.create_date, 'YYYY-MM-DD') as day,
a.user_id as user_id,
a.name as name,
a.company_id as company_id,
a.currency_id as currency_id,
a.account_id as account_id,
a.general_account_id as general_account_id,
a.journal_id as journal_id,
a.move_id as move_id,
a.product_id as product_id,
a.product_uom_id as product_uom_id,
sum(a.amount) as amount,
sum(a.unit_amount) as unit_amount,
sum(a.amount_currency) as amount_currency
from
account_analytic_line a
group by
a.create_date, a.user_id,a.name,company_id,a.currency_id,
a.account_id,a.general_account_id,a.journal_id,
a.move_id,a.product_id,a.product_uom_id
)
""")
analytic_entries_report()

View File

@ -0,0 +1,112 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_analytic_entries_report_tree" model="ir.ui.view">
<field name="name">analytic.entries.report.tree</field>
<field name="model">analytic.entries.report</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Analytic Entries Statistics">
<field name="date" invisible="1"/>
<field name="year" invisible="1"/>
<field name="day" invisible="1"/>
<field name="month" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="name" invisible="1"/>
<field name="company_id" invisible="1" groups="base.multi_company"/>
<field name="currency_id" invisible="1"/>
<field name="account_id" invisible="1"/>
<field name="general_account_id" invisible="1"/>
<field name="journal_id" invisible="1"/>
<field name="product_id" invisible="1"/>
<field name="product_uom_id" invisible="1"/>
<field name="nbr" sum="Entries"/>
<field name="amount" sum="Amount"/>
<field name="unit_amount" sum="Unit Amount"/>
<field name="amount_currency" sum="Amount Currency"/>
</tree>
</field>
</record>
<record id="view_analytic_entries_report_search" model="ir.ui.view">
<field name="name">analytic.entries.report.search</field>
<field name="model">analytic.entries.report</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Analytic Entries">
<group col="10" colspan="12">
<filter icon="terp-account" string="Last 365 DAys"
domain="[('day','&lt;=', time.strftime('%%Y-%%m-%%d')),('day','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Analytic Entries of the year"/>
<filter icon="terp-account" string="Last 30 Days"
name="month"
domain="[('day','&lt;=', time.strftime('%%Y-%%m-%%d')), ('day','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
help="Analytic Entries of this month"/>
<filter icon="gtk-media-rewind"
string=" 7 Days "
separator="1"
domain="[('day','&lt;=', time.strftime('%%Y-%%m-%%d')), ('day','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Analytic Entries during last 7 days"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="user_id" widget="selection">
<filter icon="terp-partner" domain="[('user_id','=',uid)]" help="My Case"/>
</field>
<field name="currency_id"/>
</group>
<newline/>
<group expand="0" string="Extended options..." colspan="10" col="12">
<field name="account_id" />
<field name="general_account_id" widget="selection"/>
<field name="journal_id" widget="selection"/>
<separator orientation="vertical"/>
<field name="product_id" />
<field name="product_uom_id" widget="selection"/>
<field name="company_id" widget="selection" groups="base.multi_company"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter string="User" name="User" icon="terp-account" context="{'group_by':'user_id'}"/>
<filter string="Currency" icon="terp-account" context="{'group_by':'currency_id'}"/>
<filter string="Company" icon="terp-account" context="{'group_by':'company_id'}" groups="base.multi_company"/>
<separator orientation="vertical"/>
<filter string="Account" icon="terp-account" context="{'group_by':'account_id'}"/>
<filter string="General Account" icon="terp-account" context="{'group_by':'general_account_id'}"/>
<filter string="Journal" icon="terp-account" context="{'group_by':'journal_id'}"/>
<separator orientation="vertical"/>
<filter string="Product" icon="terp-account" context="{'group_by':'product_id'}"/>
<filter string="Product UOM" icon="terp-account" context="{'group_by':'product_uom_id'}"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-account" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-account" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-account" context="{'group_by':'year'}"/>
</group>
</search>
</field>
</record>
<record id="view_account_analytic_entries_search" model="ir.ui.view">
<field name="name">account.analytic.entries.graph</field>
<field name="model">analytic.entries.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Analytic Entries" type="bar">
<field name="user_id"/>
<field name="amount" operator="+"/>
<field name="unit_amount" operator="+"/>
<field name="amount_currency" operator="+"/>
</graph>
</field>
</record>
<record id="action_analytic_entries_report" model="ir.actions.act_window">
<field name="name">Analytic Entries</field>
<field name="res_model">analytic.entries.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="search_view_id" ref="view_analytic_entries_report_search"/>
</record>
<menuitem action="action_analytic_entries_report" id="menu_action_analytic_entries_report" parent="account.menu_finance_statastic_report_statement" sequence="4"/>
</data>
</openerp>

View File

@ -35,7 +35,7 @@ class analytic_report(osv.osv):
'parent_id': fields.many2one('account.analytic.account', 'Parent Analytic Account', readonly=True),
'user_id' : fields.many2one('res.users', 'Account Manager',readonly=True),
'product_id' : fields.many2one('product.product', 'Product',readonly=True),
'quantity': fields.float('Quantity',readonly=True),
'total_quantity': fields.float('# Total Quantity',readonly=True),
'debit' : fields.float('Debit',readonly=True),
'credit' : fields.float('Credit',readonly=True),
'balance' : fields.float('Balance',readonly=True),
@ -43,6 +43,11 @@ class analytic_report(osv.osv):
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'nbr':fields.integer('# of Lines', readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
'type': fields.selection([('view','View'), ('normal','Normal')], 'Account Type'),
'state': fields.selection([('draft','Draft'),
('open','Open'),
('pending','Pending'),
@ -50,6 +55,7 @@ class analytic_report(osv.osv):
('close','Close'),
('template', 'Template')],
'State', readonly=True),
}
_order = 'date_start desc'
def init(self, cr):
@ -60,15 +66,18 @@ class analytic_report(osv.osv):
min(s.id) as id,
to_char(s.create_date, 'YYYY') as year,
to_char(s.create_date, 'MM') as month,
to_char(s.create_date, 'YYYY-MM-DD') as day,
l.journal_id,
l.product_id,
s.parent_id,
s.date_start,
s.date as date_end,
s.user_id,
s.company_id,
s.type,
s.name,
s.partner_id,
s.quantity,
sum(s.quantity) as total_quantity,
s.debit,
s.credit,
s.balance,
@ -77,7 +86,8 @@ class analytic_report(osv.osv):
from account_analytic_account s
left join account_analytic_line l on (s.id=l.account_id)
GROUP BY s.create_date,s.state,l.journal_id,s.name,
s.partner_id,s.date_start,s.date,s.user_id,s.quantity,
s.partner_id,s.date_start,s.date,s.user_id,
s.company_id,s.type,
s.debit,s.credit,s.balance,s.parent_id,l.product_id
)
""")

View File

@ -9,23 +9,26 @@
<tree string="Analytic Accounts Statistics">
<field name="parent_id" invisible="1" string="Analytic Account"/>
<field name="product_id" invisible="1"/>
<field name="name"/>
<field name="partner_id"/>
<field name="journal_id" string="Analytic Journal"/>
<field name="user_id"/>
<field name="date_start"/>
<field name="date_end"/>
<field name="quantity"/>
<field name="name" invisible="1"/>
<field name="partner_id" invisible="1"/>
<field name="journal_id" string="Analytic Journal" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="date_start" invisible="1"/>
<field name="date_end" invisible="1"/>
<field name="total_quantity" sum=" # Total Quantity"/>
<field name="nbr" sum ="# of Lines"/>
<field name="company_id" invisible="1" groups="base.group_multi_company"/>
<field name="type" invisible="1"/>
<field name="debit"/>
<field name="credit"/>
<field name="balance"/>
<field name="state"/>
<field name="state" invisible="1"/>
<field name="day" invisible="1"/>
<field name="month" invisible="1"/>
<field name="year" invisible="1"/>
</tree>
</field>
</record>
<record id="view_analytic_report_search" model="ir.ui.view">
<field name="name">analytic.report.search</field>
<field name="model">analytic.report</field>
@ -38,23 +41,15 @@
domain="[('year','=',time.strftime('%%Y'))]"/>
<filter icon="terp-account"
string="This Month"
name="This Month"
domain="[('month','=',time.strftime('%%m'))]"/>
<filter icon="gtk-media-rewind"
string=" 7 Days "
separator="1"
domain="[('day','&lt;=', time.strftime('%%Y-%%m-%%d')), ('day','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Entries during last 7 days"/>
<separator orientation="vertical"/>
<filter string="Start" icon="terp-account" domain="[('date_start','=',time.strftime('%%Y/%%m/%%d'))]"/>
<filter string="End" icon="terp-account" domain="[('date_end','=',time.strftime('%%Y/%%m/%%d'))]"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="user_id" widget="selection">
<filter icon="terp-account"
string="My Accounts"
name="User"
domain="[('user_id','=',uid)]"/>
</field>
<field name="partner_id"/>
</group>
<newline/>
<group expand="1" string="Extended options..." colspan="10" col="12">
<filter icon="terp-account"
<filter icon="terp-account"
string="Draft"
domain="[('state','=','draft')]"/>
<filter icon="terp-account"
@ -63,6 +58,18 @@
<filter icon="terp-account"
string="Pending"
domain="[('state','=','pending')]"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="user_id" widget="selection">
<filter icon="terp-account"
string="My Accounts"
help="My Account"
domain="[('user_id','=',uid)]"/>
</field>
<field name="partner_id"/>
</group>
<newline/>
<group expand="0" string="Extended options..." colspan="10" col="12">
<filter icon="terp-account"
string="Close"
domain="[('state','=','close')]"/>
@ -70,40 +77,59 @@
string="Template"
domain="[('state','=','template')]"/>
<separator orientation="vertical"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="parent_id"/>
<field name="journal_id"/>
<field name="product_id"/>
<field name="journal_id" widget="selection"/>
<newline/>
<field name="product_id" />
<field name="type"/>
<separator orientation="vertical"/>
<field name="date_start"/>
<field name="date_end"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter string="Partner" icon="terp-account" context="{'group_by':'partner_id'}"/>
<filter string="User" name='User' icon="terp-account" context="{'group_by':'user_id'}"/>
<filter string="User" name="User" icon="terp-account" context="{'group_by':'user_id'}"/>
<filter string="Associated Partner" icon="terp-account" context="{'group_by':'partner_id'}"/>
<separator orientation="vertical"/>
<filter string="Company" icon="terp-account" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<filter string="Analytic Account" icon="terp-account" context="{'group_by':'parent_id'}"/>
<filter string="Analytic Journal" icon="terp-account" context="{'group_by':'journal_id'}"/>
<separator orientation="vertical"/>
<filter string="Product" icon="terp-account" context="{'group_by':'product_id'}"/>
<filter string="Analytic Journal" icon="terp-account" context="{'group_by':'journal_id'}"/>
<filter string="Analytic Account" icon="terp-account" context="{'group_by':'parent_id'}"/>
<filter string="Account Type" icon="terp-account" context="{'group_by':'type'}"/>
<filter string="State" icon="terp-account" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-account" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-account" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-account" context="{'group_by':'year'}"/>
</group>
</search>
</field>
</record>
<record id="view_account_analytic_report_search" model="ir.ui.view">
<field name="name">account.analytic.report.graph</field>
<field name="model">analytic.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Analytic Accounts" type="bar">
<field name="user_id"/>
<field name="credit" operator="+"/>
<field name="debit" operator="+"/>
<field name="balance" operator="+"/>
<field name="nbr" operator="+"/>
</graph>
</field>
</record>
<record id="action_analytic_report_all" model="ir.actions.act_window">
<field name="name">Analytic Accounts</field>
<field name="res_model">analytic.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
<field name="context">{'search_default_User':1,'search_default_user_id':uid}</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'search_default_This Month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="search_view_id" ref="view_analytic_report_search"/>
</record>
<menuitem action="action_analytic_report_all" id="menu_action_analytic_report_all" parent="account.menu_finance_reporting" sequence="0"/>
<menuitem action="action_analytic_report_all" id="menu_action_analytic_report_all" parent="account.menu_finance_statastic_report_statement" sequence="8"/>
</data>
</openerp>

View File

@ -0,0 +1,123 @@
# -*- 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 tools
from osv import fields,osv
class account_entries_report(osv.osv):
_name = "account.entries.report"
_description = "Entries"
_auto = False
_rec_name = 'date'
_columns = {
'date': fields.date('Effective Date', readonly=True),
'date_created': fields.date('Date Created', readonly=True),
'date_maturity': fields.date('Date Maturity', readonly=True),
'nbr':fields.integer('# of Entries', readonly=True),
'nbl':fields.integer('# of Lines', readonly=True),
'amount': fields.float('Amount',readonly=True),
'year': fields.char('Year', size=4, readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
'ref': fields.char('Reference', size=64,readonly=True),
'period_id': fields.many2one('account.period', 'Period', readonly=True),
'account_id': fields.many2one('account.account', 'Account', readonly=True),
'journal_id': fields.many2one('account.journal', 'Journal', readonly=True),
'product_id': fields.many2one('product.product', 'Product', readonly=True),
'state': fields.selection([('draft','Draft'), ('posted','Posted')], 'State',readonly=True,
help='When new account move is created the state will be \'Draft\'. When all the payments are done it will be in \'Posted\' state.'),
'state_2': fields.selection([('draft','Draft'), ('valid','Valid')], 'State of Move Line', readonly=True,
help='When new move line is created the state will be \'Draft\'.\n* When all the payments are done it will be in \'Valid\' state.'),
'partner_id': fields.many2one('res.partner','Partner', readonly=True),
'period_id2': fields.many2one('account.period', 'Move Line Period', readonly=True),
'analytic_account_id' : fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
'journal_id2': fields.many2one('account.journal', 'Move Line Journal', readonly=True),
'type': fields.selection([
('pay_voucher','Cash Payment'),
('bank_pay_voucher','Bank Payment'),
('rec_voucher','Cash Receipt'),
('bank_rec_voucher','Bank Receipt'),
('cont_voucher','Contra'),
('journal_sale_vou','Journal Sale'),
('journal_pur_voucher','Journal Purchase'),
('journal_voucher','Journal Voucher'),
],'Type',readonly=True),
'quantity': fields.float('Products Quantity', digits=(16,2), readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
}
_order = 'date desc'
def init(self, cr):
tools.drop_view_if_exists(cr, 'account_entries_report')
cr.execute("""
create or replace view account_entries_report as (
select
min(l.id) as id,
am.ref as ref,
sum(l.quantity) as quantity,
am.state as state,
l.state as state_2,
am.date as date,
count(l.id) as nbr,
count(distinct am.id) as nbl,
l.debit as amount,
to_char(am.date, 'YYYY') as year,
to_char(am.date, 'MM') as month,
to_char(am.date, 'YYYY-MM-DD') as day,
am.company_id as company_id,
l.account_id as account_id,
l.analytic_account_id as analytic_account_id,
l.date_created as date_created,
l.date_maturity as date_maturity,
am.journal_id as journal_id,
l.journal_id as journal_id2,
l.period_id as period_id2,
am.period_id as period_id,
l.partner_id as partner_id,
l.product_id as product_id,
am.type as type
from
account_move_line l
left join
account_move am on (am.id=l.move_id)
group by am.ref,
am.state,
am.date,
am.company_id,
am.journal_id,
l.journal_id,
am.period_id,
l.period_id,
am.type,
l.partner_id,
l.analytic_account_id,
l.product_id,
l.date_created,
l.date_maturity,
l.account_id,
l.state,
l.debit
)
""")
account_entries_report()

View File

@ -0,0 +1,127 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_entries_report_tree" model="ir.ui.view">
<field name="name">account.entries.report.tree</field>
<field name="model">account.entries.report</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Invoices Statistics">
<field name="date" invisible="1"/>
<field name="date_created" invisible="1"/>
<field name="date_maturity" invisible="1"/>
<field name="ref" invisible="1"/>
<field name="state" invisible="1"/>
<field name="state_2" invisible="1"/>
<field name="year" invisible="1"/>
<field name="day" invisible="1"/>
<field name="month" invisible="1"/>
<field name="partner_id" invisible="1"/>
<field name="product_id" invisible="1"/>
<field name="company_id" invisible="1" groups="base.group_multi_company"/>
<field name="journal_id" invisible="1"/>
<field name="account_id" invisible="1"/>
<field name="analytic_account_id" invisible="1"/>
<field name="period_id" invisible="1"/>
<field name="period_id2" invisible="1"/>
<field name="type" invisible="1"/>
<field name="nbr" sum="# of Entries "/>
<field name="nbl" sum="# of Lines "/>
<field name="amount" sum="# of Amount "/>
<field name="quantity" sum="# of Products Qty "/>
</tree>
</field>
</record>
<record id="view_account_entries_report_graph" model="ir.ui.view">
<field name="name">account.entries.report.graph</field>
<field name="model">account.entries.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Entries" type="bar">
<field name="partner_id"/>
<field name="amount"/>
</graph>
</field>
</record>
<record id="view_account_entries_report_search" model="ir.ui.view">
<field name="name">account.entries.report.search</field>
<field name="model">account.entries.report</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Entries">
<group colspan="10" col="12">
<filter icon="terp-account" string="This Year"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Entries of the year"/>
<filter icon="terp-account" string="This Month"
name="This Month"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
help="Entries of this month"/>
<filter icon="gtk-media-rewind"
string=" 7 Days "
separator="1"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Entries during last 7 days"/>
<separator orientation="vertical"/>
<filter string="Draft"
icon="terp-account"
domain="[('state','=','draft')]"
help = "Draft tasks"/>
<separator orientation="vertical"/>
<field name="journal_id" widget="selection"/>
<field name="account_id"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="partner_id" />
</group>
<newline/>
<group expand="0" string="Extended options..." colspan="10" col="12">
<filter string="Posted"
icon="terp-account"
domain="[('state','=','posted')]"
help = "Posted tasks"/>
<field name="state_2"/>
<separator orientation="vertical"/>
<field name="period_id" widget="selection"/>
<field name="period_id2" widget="selection"/>
<field name="type"/>
<field name="product_id" />
<field name="analytic_account_id"/>
<newline/>
<separator orientation="vertical"/>
<field name="date_created"/>
<field name="date"/>
<field name="date_maturity"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter string="Journal" name="Journal" icon="terp-account" context="{'group_by':'journal_id'}"/>
<filter string="Account" name="Account" icon="terp-account" context="{'group_by':'account_id'}"/>
<filter string="Analytic Account" name="Analytic Account" icon="terp-account" context="{'group_by':'analytic_account_id'}"/>
<filter string="Company" icon="terp-account" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<filter string="Partner" icon="terp-account" context="{'group_by':'partner_id'}"/>
<filter string="Product" icon="terp-account" context="{'group_by':'product_id'}"/>
<separator orientation="vertical"/>
<filter string="State" icon="terp-account" context="{'group_by':'state'}"/>
<filter string="State of Move Line" icon="terp-account" context="{'group_by':'state_2'}"/>
<filter string="Period" icon="terp-account" context="{'group_by':'period_id'}"/>
<filter string="Period of Move Line" icon="terp-account" context="{'group_by':'period_id2'}"/>
<filter string="Type" icon="terp-account" context="{'group_by':'type'}"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-account" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-account" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-account" context="{'group_by':'year'}"/>
</group>
</search>
</field>
</record>
<record id="action_account_entries_report_all" model="ir.actions.act_window">
<field name="name">Entries</field>
<field name="res_model">account.entries.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'search_default_This Month':1,'search_default_Journal':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="search_view_id" ref="view_account_entries_report_search"/>
</record>
<menuitem action="action_account_entries_report_all" id="menu_action_account_entries_report_all" parent="account.menu_finance_statastic_report_statement" sequence="2"/>
</data>
</openerp>

View File

@ -61,6 +61,13 @@ class account_invoice_report(osv.osv):
('paid','Done'),
('cancel','Cancelled')
], 'Order State', readonly=True),
'date_due': fields.date('Due Date', readonly=True),
'address_contact_id': fields.many2one('res.partner.address', 'Contact Address Name', readonly=True),
'address_invoice_id': fields.many2one('res.partner.address', 'Invoice Address Name', readonly=True),
'account_id': fields.many2one('account.account', 'Account',readonly=True),
'partner_bank': fields.many2one('res.partner.bank', 'Bank Account',readonly=True),
'residual':fields.float('Total Residual', readonly=True),
'delay_to_pay':fields.float('Avg. Delay To Pay', readonly=True, group_operator="avg"),
}
_order = 'date desc'
def init(self, cr):
@ -87,12 +94,24 @@ class account_invoice_report(osv.osv):
(sum(l.quantity*l.price_unit)/sum(l.quantity * u.factor))::decimal(16,2) as price_average,
count(*) as nbr,
s.type as type,
s.state
from
s.state,
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,
case when s.state != 'paid' then null else
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)
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
group by
s.type,
s.date_invoice,
@ -101,12 +120,18 @@ class account_invoice_report(osv.osv):
l.uos_id,
s.user_id,
s.state,
s.residual,
s.company_id,
s.payment_term,
s.period_id,
s.fiscal_position,
s.currency_id,
s.journal_id
s.journal_id,
s.date_due,
s.address_contact_id,
s.address_invoice_id,
s.account_id,
s.partner_bank
)
""")
account_invoice_report()

View File

@ -17,7 +17,6 @@
<field name="partner_id" invisible="1"/>
<field name="product_id" invisible="1"/>
<field name="product_qty" invisible="1"/>
<!--field name="delay" avg="Days to Close"/-->
<field name="nbr" sum="# of Lines"/>
<field name="price_average" avg="Average Price"/>
<field name="price_total" sum="Total Price"/>
@ -27,6 +26,13 @@
<field name="fiscal_position" invisible="1"/>
<field name="currency_id" invisible="1"/>
<field name="journal_id" invisible="1"/>
<field name="date_due" invisible="1"/>
<field name="address_contact_id" invisible="1"/>
<field name="address_invoice_id" invisible="1"/>
<field name="account_id" invisible="1"/>
<field name="partner_bank" invisible="1"/>
<field name="residual" sum="Total Residual"/>
<field name="delay_to_pay" avg="Avg. Delay To Pay"/>
</tree>
</field>
</record>
@ -49,14 +55,14 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Invoices">
<group>
<filter icon="terp-account" string="This Year"
<group col="10" colspan="12">
<filter icon="terp-account" string="Last 365 Days"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Invoices of the year"/>
<filter icon="terp-account" string="This Month"
help="Invoices of last 365 days"/>
<filter icon="terp-account" string="Last 30 Days"
name="month"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
help="Invoices of this month"/>
help="Invoices of last 30 days"/>
<filter icon="gtk-media-rewind"
string=" 7 Days "
separator="1"
@ -75,10 +81,13 @@
icon="terp-account"
domain="[('state', '=' ,'open')]"
help = "In progress tasks"/>
<filter string="Done"
icon="terp-account"
domain="[('state','=','paid')]"
help = "Done tasks"/>
<separator orientation="vertical"/>
<field name="product_id"/>
<field name="user_id" widget="selection">
<field name="partner_id"/>
<field name="user_id" widget="selection">
<filter icon="terp-account"
string="My Invoices"
help = "My Invoices"
@ -87,49 +96,50 @@
string="Invoices Non Users"
help="Invoices Non Users"
domain="[('user_id','=',False)]"/>
</field>
<field name="partner_id"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
</field>
</group>
<newline/>
<group expand="0" string="Extended options..." colspan="10" col="12">
<filter string="Done"
icon="terp-account"
domain="[('state','=','paid')]"
help = "Done tasks"/>
<filter string="Cancelled"
icon="terp-account"
domain="[('state', '=' ,'cancel')]"
help = "Cancelled tasks"/>
<separator orientation="vertical"/>
<field name="payment_term" widget="selection"/>
<field name="currency_id" widget="selection"/>
<field name="journal_id" widget="selection"/>
<field name="type"/>
<field name="currency_id" widget="selection"/>
<field name="partner_bank" widget="selection"/>
<field name="fiscal_position" widget="selection"/>
<separator orientation="vertical"/>
<field name="address_contact_id"/>
<field name="account_id"/>
<newline/>
<field name="payment_term" widget="selection"/>
<field name="journal_id" widget="selection"/>
<field name="period_id" widget="selection"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<separator orientation="vertical"/>
<field name="address_invoice_id"/>
<field name="product_id"/>
<newline/>
<field name="type"/>
<field name="period_id" widget="selection"/>
<field name="fiscal_position" widget="selection"/>
<field name="date"/>
<field name="date" string="Date Invoiced"/>
<field name="date_due"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter string="Company" icon="terp-account" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<filter string="Salesman" name='User' icon="terp-account" context="{'group_by':'user_id'}"/>
<filter string="Payment Term" icon="terp-account" context="{'group_by':'payment_term'}"/>
<separator orientation="vertical"/>
<filter string="Currency" icon="terp-account" context="{'group_by':'currency_id'}"/>
<filter string="Journal" icon="terp-account" context="{'group_by':'journal_id'}"/>
<filter string="Partner" icon="terp-account" context="{'group_by':'partner_id'}"/>
<filter string="Product" icon="terp-account" context="{'group_by':'product_id'}"/>
<separator orientation="vertical"/>
<filter string="Partner" icon="terp-account" context="{'group_by':'partner_id'}"/>
<filter string="Type" icon="terp-account" context="{'group_by':'type'}"/>
<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="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="Currency" icon="terp-account" context="{'group_by':'currency_id'}"/>
<filter string="Payment Term" icon="terp-account" context="{'group_by':'payment_term'}"/>
<filter string="Force Period" icon="terp-account" context="{'group_by':'period_id'}"/>
<filter string="Fiscal Position" icon="terp-account" context="{'group_by':'fiscal_position'}"/>
<separator orientation="vertical"/>
<newline/>
<filter string="Day" icon="terp-account" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-account" context="{'group_by':'date'}"/>
<filter string="Month" icon="terp-account" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-account" context="{'group_by':'year'}"/>
</group>
</search>
@ -145,7 +155,7 @@
<field name="search_view_id" ref="view_account_invoice_report_search"/>
</record>
<menuitem action="action_account_invoice_report_all" id="menu_action_account_invoice_report_all" parent="account.menu_finance_reporting" sequence="0"/>
<menuitem action="action_account_invoice_report_all" id="menu_action_account_invoice_report_all" parent="account.menu_finance_statastic_report_statement" sequence="0"/>
</data>
</openerp>

View File

@ -47,7 +47,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
</record>
<menuitem action="action_account_receivable_graph" id="menu_account_receivable_graph" parent="account.menu_finance_reporting"/>
<!-- <menuitem action="action_account_receivable_graph" id="menu_account_receivable_graph" parent="account.menu_finance_reporting"/> -->
<!-- Report for Aged Receivable -->
@ -116,7 +116,7 @@
</record>
<!-- <menuitem id="menu_report_this_month" name="This Month" parent="account.menu_finance_reporting"/>-->
<menuitem id="menu_report_all_months" name="Sales by Account" parent="account.menu_finance_reporting"/>
<!-- <menuitem id="menu_report_all_months" name="Sales by Account" parent="account.menu_finance_reporting"/> -->
<!-- Report of the sales by product and account -->
<record id="view_report_account_sales_tree" model="ir.ui.view">
<field name="name">report.account.sales.tree</field>
@ -169,7 +169,7 @@
<field name="view_mode">graph,tree</field>
<field name="search_view_id" ref="view_report_account_sales_search"/>
</record>
<menuitem action="action_report_account_sales_tree_all" id="menu_report_account_sales_all" parent="menu_report_all_months"/>
<!-- <menuitem action="action_report_account_sales_tree_all" id="menu_report_account_sales_all" parent="menu_report_all_months"/> -->
<!-- Report of the sales by product and account type -->
<record id="view_report_account_type_sales_tree" model="ir.ui.view">
@ -237,7 +237,7 @@
<field name="view_mode">graph,tree</field>
<field name="search_view_id" ref="view_report_account_type_sales_search"/>
</record>
<menuitem action="action_report_account_type_sales_tree_all" id="menu_report_account_type_sales_all" parent="menu_report_all_months"/>
<!-- <menuitem action="action_report_account_type_sales_tree_all" id="menu_report_account_type_sales_all" parent="menu_report_all_months"/> -->
</data>
</openerp>

View File

@ -0,0 +1,25 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 coda
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,39 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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":"Account CODA - import bank statements from coda file",
"version":"1.0",
"author":"Tiny",
"category":"Account CODA",
"description":"""Module provides functionality to import
bank statements from coda files.
""",
"depends":["base", "account"],
"demo_xml":["coda_demo.xml"],
"init_xml":[],
"update_xml" : ["security/ir.model.access.csv","coda_wizard.xml","coda_view.xml"],
"active":False,
"installable":True,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,50 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 time
from osv import osv,fields
class account_coda(osv.osv):
_name = "account.coda"
_description = "coda for an Account"
_columns = {
'name': fields.binary('Coda file', readonly=True),
'statement_ids': fields.one2many('account.bank.statement','coda_id','Generated Bank Statement', readonly=True),
'note': fields.text('Import log', readonly=True),
'journal_id': fields.many2one('account.journal','Bank Journal', readonly=True,select=True),
'date': fields.date('Import Date', readonly=True,select=True),
'user_id': fields.many2one('res.users','User', readonly=True, select=True),
}
_defaults = {
'date': lambda *a: time.strftime('%Y-%m-%d'),
'user_id': lambda self,cr,uid,context: uid,
}
account_coda()
class account_bank_statement(osv.osv):
_inherit = "account.bank.statement"
_columns = {
'coda_id':fields.many2one('account.coda','Coda'),
}
account_bank_statement()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,5 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
</data>
</openerp>

View File

@ -0,0 +1,63 @@
<?xml version="1.0" ?>
<openerp>
<data>
<record model="ir.ui.view" id="view_account_coda_form">
<field name="name">account.coda.form</field>
<field name="model">account.coda</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Coda import">
<field name="name" />
<field name="journal_id" />
<field name="date" />
<field name="user_id" />
<notebook colspan="4">
<page string="Log">
<field name="note" colspan="4"/>
</page>
<page string="Statements">
<field name="statement_ids" colspan="4"/>
</page>
</notebook>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_account_coda_tree">
<field name="name">account.coda.tree</field>
<field name="model">account.coda</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Coda import">
<field name="journal_id" />
<field name="date" />
<field name="user_id" />
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_account_coda">
<field name="name">Coda import</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.coda</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Coda Statements" parent="account.menu_finance_reporting" id="menu_account_coda" action="action_account_coda" sequence="12"/>
<menuitem name="Import Coda Statements" action="wizard_account_coda_import" parent="account.menu_finance_periodical_processing"
type="wizard" id="menu_account_coda_wizard" sequence="15"/>
<act_window name="Coda File"
domain="[('statement_ids', 'in', [active_id])]"
res_model="account.coda"
src_model="account.bank.statement"
view_type="form"
view_mode="tree,form"
id="act_account_payment_account_bank_statement"/>
</data>
</openerp>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" ?>
<openerp>
<data>
<wizard
string="Import Coda File"
model="account.bank.statement"
name="account.coda_import"
id="wizard_account_coda_import"
menu="False"
/>
</data>
</openerp>

View File

@ -0,0 +1,163 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * account_coda
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.6\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-11-24 13:11:29+0000\n"
"PO-Revision-Date: 2009-11-24 13:11:29+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: account_coda
#: field:account.coda,journal_id:0
#: wizard_field:account.coda_import,init,journal_id:0
msgid "Bank Journal"
msgstr ""
#. module: account_coda
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: account_coda
#: wizard_field:account.coda_import,extraction,note:0
msgid "Log"
msgstr ""
#. module: account_coda
#: wizard_button:account.coda_import,extraction,open:0
msgid "_Open Statement"
msgstr ""
#. module: account_coda
#: model:ir.module.module,shortdesc:account_coda.module_meta_information
msgid "Account CODA"
msgstr ""
#. module: account_coda
#: field:account.coda,name:0
msgid "Coda file"
msgstr ""
#. module: account_coda
#: wizard_view:account.coda_import,init:0
msgid "Clic on 'New' to select your file :"
msgstr ""
#. module: account_coda
#: model:ir.actions.wizard,name:account_coda.wizard_account_coda_import
msgid "Import Coda File"
msgstr ""
#. module: account_coda
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
#. module: account_coda
#: field:account.coda,note:0
msgid "Import log"
msgstr ""
#. module: account_coda
#: wizard_field:account.coda_import,init,def_receivable:0
msgid "Default receivable Account"
msgstr ""
#. module: account_coda
#: model:ir.module.module,description:account_coda.module_meta_information
msgid "Module provides functionality to import\n"
" bank statements from .csv file.\n"
" Import coda file wizard is used to import bank statements."
msgstr ""
#. module: account_coda
#: wizard_button:account.coda_import,extraction,end:0
msgid "_Close"
msgstr ""
#. module: account_coda
#: field:account.coda,statement_id:0
msgid "Generated Bank Statement"
msgstr ""
#. module: account_coda
#: view:account.coda:0
#: model:ir.actions.act_window,name:account_coda.act_account_payment_account_bank_statement
#: model:ir.actions.act_window,name:account_coda.action_account_coda
msgid "Coda import"
msgstr ""
#. module: account_coda
#: field:account.coda,user_id:0
msgid "User"
msgstr ""
#. module: account_coda
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: account_coda
#: model:ir.model,name:account_coda.model_account_coda
msgid "coda for an Account"
msgstr ""
#. module: account_coda
#: wizard_field:account.coda_import,init,def_payable:0
msgid "Default Payable Account"
msgstr ""
#. module: account_coda
#: model:ir.ui.menu,name:account_coda.menu_account_coda
msgid "Coda Statements"
msgstr ""
#. module: account_coda
#: model:ir.ui.menu,name:account_coda.menu_account_coda_wizard
msgid "Import Coda Statements"
msgstr ""
#. module: account_coda
#: wizard_button:account.coda_import,init,extraction:0
msgid "_Ok"
msgstr ""
#. module: account_coda
#: wizard_view:account.coda_import,extraction:0
#: wizard_view:account.coda_import,init:0
msgid "Import Coda Statement"
msgstr ""
#. module: account_coda
#: field:account.bank.statement,coda_id:0
msgid "Coda"
msgstr ""
#. module: account_coda
#: wizard_view:account.coda_import,extraction:0
msgid "Results :"
msgstr ""
#. module: account_coda
#: wizard_field:account.coda_import,init,coda:0
msgid "Coda File"
msgstr ""
#. module: account_coda
#: field:account.coda,date:0
msgid "Import Date"
msgstr ""
#. module: account_coda
#: wizard_view:account.coda_import,init:0
msgid "Select your bank journal :"
msgstr ""

View File

@ -0,0 +1,163 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * account_coda
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.6\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-11-24 13:11:29+0000\n"
"PO-Revision-Date: 2009-11-24 13:11:29+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: account_coda
#: field:account.coda,journal_id:0
#: wizard_field:account.coda_import,init,journal_id:0
msgid "Bank Journal"
msgstr ""
#. module: account_coda
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: account_coda
#: wizard_field:account.coda_import,extraction,note:0
msgid "Log"
msgstr ""
#. module: account_coda
#: wizard_button:account.coda_import,extraction,open:0
msgid "_Open Statement"
msgstr ""
#. module: account_coda
#: model:ir.module.module,shortdesc:account_coda.module_meta_information
msgid "Account CODA"
msgstr ""
#. module: account_coda
#: field:account.coda,name:0
msgid "Coda file"
msgstr ""
#. module: account_coda
#: wizard_view:account.coda_import,init:0
msgid "Clic on 'New' to select your file :"
msgstr ""
#. module: account_coda
#: model:ir.actions.wizard,name:account_coda.wizard_account_coda_import
msgid "Import Coda File"
msgstr ""
#. module: account_coda
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
#. module: account_coda
#: field:account.coda,note:0
msgid "Import log"
msgstr ""
#. module: account_coda
#: wizard_field:account.coda_import,init,def_receivable:0
msgid "Default receivable Account"
msgstr ""
#. module: account_coda
#: model:ir.module.module,description:account_coda.module_meta_information
msgid "Module provides functionality to import\n"
" bank statements from .csv file.\n"
" Import coda file wizard is used to import bank statements."
msgstr ""
#. module: account_coda
#: wizard_button:account.coda_import,extraction,end:0
msgid "_Close"
msgstr ""
#. module: account_coda
#: field:account.coda,statement_id:0
msgid "Generated Bank Statement"
msgstr ""
#. module: account_coda
#: view:account.coda:0
#: model:ir.actions.act_window,name:account_coda.act_account_payment_account_bank_statement
#: model:ir.actions.act_window,name:account_coda.action_account_coda
msgid "Coda import"
msgstr ""
#. module: account_coda
#: field:account.coda,user_id:0
msgid "User"
msgstr ""
#. module: account_coda
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: account_coda
#: model:ir.model,name:account_coda.model_account_coda
msgid "coda for an Account"
msgstr ""
#. module: account_coda
#: wizard_field:account.coda_import,init,def_payable:0
msgid "Default Payable Account"
msgstr ""
#. module: account_coda
#: model:ir.ui.menu,name:account_coda.menu_account_coda
msgid "Coda Statements"
msgstr ""
#. module: account_coda
#: model:ir.ui.menu,name:account_coda.menu_account_coda_wizard
msgid "Import Coda Statements"
msgstr ""
#. module: account_coda
#: wizard_button:account.coda_import,init,extraction:0
msgid "_Ok"
msgstr ""
#. module: account_coda
#: wizard_view:account.coda_import,extraction:0
#: wizard_view:account.coda_import,init:0
msgid "Import Coda Statement"
msgstr ""
#. module: account_coda
#: field:account.bank.statement,coda_id:0
msgid "Coda"
msgstr ""
#. module: account_coda
#: wizard_view:account.coda_import,extraction:0
msgid "Results :"
msgstr ""
#. module: account_coda
#: wizard_field:account.coda_import,init,coda:0
msgid "Coda File"
msgstr ""
#. module: account_coda
#: field:account.coda,date:0
msgid "Import Date"
msgstr ""
#. module: account_coda
#: wizard_view:account.coda_import,init:0
msgid "Select your bank journal :"
msgstr ""

View File

@ -0,0 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_account_coda","account.coda","model_account_coda","account.group_account_user",1,0,0,0
"access_account_coda_manager","account.coda","model_account_coda","account.group_account_manager",1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_account_coda account.coda model_account_coda account.group_account_user 1 0 0 0
3 access_account_coda_manager account.coda model_account_coda account.group_account_manager 1 1 1 1

View File

@ -0,0 +1,10 @@
0000006060712505 00000CPH CODA TINY 0047747270100477472701 00000 1
1 049126201326907 EUR0BE 0000000015632900050607TINY COMPTE COURANT ORDINAIRE 049
2100010000 0000000001150000060607001500000INVOICE OF 2006-12-19 0606070020100
2200010000 EUR000000001150000 100
2300010000301915554082 PROLIBRE SARL CAROUGE GE 000
2100020000 0000000000500000060607001500000CONTRACT PARTNER ERREUR ECART YEA 0606070030100
2200020000RTY CONTRACT PARTNER EUR000000000500000 100
2300020000050000000017 SEDNACOM 43 ALLEE DES FOUGERES 9522 0 HERBLAY 000
8049126201326907 0000000017282900060607
9 000008000000000000000000000001650000 2

View File

@ -0,0 +1,25 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 coda_import
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,339 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 pooler
import time
import datetime
import wizard
import netsvc
import base64
from osv import osv
from tools.translate import _
codawiz_form = """<?xml version="1.0"?>
<form string="Import Coda Statement">
<separator colspan="4" string="Select your bank journal :" />
<field name="journal_id" colspan="1" domain="[('type','=','cash')]" />
<newline />
<field name="def_payable" /> <field name="def_receivable" />
<newline />
<field name="awaiting_account" />
<separator string="Clic on 'New' to select your file :" colspan="4"/>
<field name="coda"/>
</form>
"""
codawiz_fields = {
'journal_id' : {
'string':'Bank Journal',
'type':'many2one',
'relation':'account.journal',
'required':True,
},
'coda' : {
'string':'Coda File',
'type':'binary',
'required':True,
},
'def_payable' : {
'string' : 'Default Payable Account',
'type' : 'many2one',
'relation': 'account.account',
'required':True,
'domain':[('type','=','payable')],
'help': 'Set here the payable account that will be used, by default, if the partner is not found',
},
'def_receivable' : {
'string' : 'Default receivable Account',
'type' : 'many2one',
'relation': 'account.account',
'required':True,
'domain':[('type','=','receivable')],
'help': 'Set here the receivable account that will be used, by default, if the partner is not found',
},
'awaiting_account' : {
'string' : 'Default Account for Unrecognized Movement',
'type' : 'many2one',
'relation': 'account.account',
'required':True,
'help': 'Set here the default account that will be used, if the partner is found but does not have the bank account , or if he is domiciled',
}
}
result_form = """<?xml version="1.0"?>
<form string="Import Coda Statement">
<separator colspan="4" string="Results :" />
<field name="note" colspan="4" nolabel="1" width="500"/>
</form>
"""
result_fields = {
'note' : {'string':'Log','type':'text'}
}
def _coda_parsing(self, cr, uid, data, context):
pool = pooler.get_pool(cr.dbname)
codafile = data['form']['coda']
journal_code = pool.get('account.journal').browse(cr, uid, data['form']['journal_id'], context).code
def_pay_acc = data['form']['def_payable']
def_rec_acc = data['form']['def_receivable']
str_log = ""
err_log = "Errors:\n------\n"
nb_err=0
std_log=''
str_log1 = "Coda File is Imported : "
str_not=''
str_not1=''
bank_statements=[]
recordlist = base64.decodestring(codafile).split('\n')
recordlist.pop()
for line in recordlist:
if line[0] == '0':
# header data
bank_statement = {}
bank_statement["bank_statement_line"]={}
bank_statement_lines = {}
bank_statement['date'] = str2date(line[5:11])
bank_statement['journal_id']=data['form']['journal_id']
period_id = pool.get('account.period').search(cr,uid,[('date_start','<=',time.strftime('%Y-%m-%d',time.strptime(bank_statement['date'],"%y/%m/%d"))),('date_stop','>=',time.strftime('%Y-%m-%d',time.strptime(bank_statement['date'],"%y/%m/%d")))])
bank_statement['period_id'] = period_id[0]
bank_statement['state']='draft'
elif line[0] == '1':
# old balance data
bal_start = list2float(line[43:58])
if line[42] == '1':
bal_start = - bal_start
bank_statement["balance_start"]= bal_start
bank_statement["acc_number"]=line[5:17]
bank_statement["acc_holder"]=line[64:90]
bank_statement['name'] = journal_code + ' ' + str(line[2:5])
elif line[0]=='2':
# movement data record 2
if line[1]=='1':
# movement data record 2.1
if bank_statement_lines.has_key(line[2:6]):
continue
st_line = {}
st_line['extra_note'] = ''
st_line['statement_id']=0
st_line['ref'] = line[2:10]
st_line['date'] = time.strftime('%Y-%m-%d',time.strptime(str2date(line[115:121]),"%y/%m/%d")),
st_line_amt = list2float(line[32:47])
if line[61]=='1':
st_line['toreconcile'] = True
st_line['name']=line[65:77]
else:
st_line['toreconcile'] = False
st_line['name']=line[62:115]
st_line['free_comm'] = st_line['name']
st_line['val_date']=time.strftime('%Y-%m-%d',time.strptime(str2date(line[47:53]),"%y/%m/%d")),
st_line['entry_date']=time.strftime('%Y-%m-%d',time.strptime(str2date(line[115:121]),"%y/%m/%d")),
st_line['partner_id']=0
if line[31] == '1':
st_line_amt = - st_line_amt
st_line['account_id'] = def_pay_acc
else:
st_line['account_id'] = def_rec_acc
st_line['amount'] = st_line_amt
bank_statement_lines[line[2:6]]=st_line
bank_statement["bank_statement_line"]=bank_statement_lines
elif line[1] == '2':
st_line_name = line[2:6]
bank_statement_lines[st_line_name].update({'account_id': data['form']['awaiting_account']})
elif line[1] == '3':
# movement data record 3.1
st_line_name = line[2:6]
st_line_partner_acc = str(line[10:47]).strip()
cntry_number=line[10:47].strip()
contry_name=line[47:125].strip()
bank_ids = pool.get('res.partner.bank').search(cr,uid,[('acc_number','=',st_line_partner_acc)])
bank_statement_lines[st_line_name].update({'cntry_number': cntry_number, 'contry_name': contry_name})
if bank_ids:
bank = pool.get('res.partner.bank').browse(cr,uid,bank_ids[0],context)
if line and bank.partner_id:
bank_statement_lines[st_line_name].update({'partner_id': bank.partner_id.id})
if bank_statement_lines[st_line_name]['amount'] < 0 :
bank_statement_lines[st_line_name].update({'account_id': bank.partner_id.property_account_payable.id})
else :
bank_statement_lines[st_line_name].update({'account_id': bank.partner_id.property_account_receivable.id})
else:
nb_err += 1
err_log += _('The bank account %s is not defined for the partner %s.\n')%(cntry_number,contry_name)
bank_statement_lines[st_line_name].update({'account_id': data['form']['awaiting_account']})
bank_statement["bank_statement_line"]=bank_statement_lines
elif line[0]=='3':
if line[1] == '1':
st_line_name = line[2:6]
bank_statement_lines[st_line_name]['extra_note'] += '\n' + line[40:113]
elif line[1] == '2':
st_line_name = line[2:6]
bank_statement_lines[st_line_name]['extra_note'] += '\n' + line[10:115]
elif line[1] == '3':
st_line_name = line[2:6]
bank_statement_lines[st_line_name]['extra_note'] += '\n' + line[10:100]
elif line[0]=='8':
# new balance record
bal_end = list2float(line[42:57])
if line[41] == '1':
bal_end = - bal_end
bank_statement["balance_end_real"]= bal_end
elif line[0]=='9':
# footer record
bank_statements.append(bank_statement)
#end for
bkst_list=[]
for statement in bank_statements:
try:
bk_st_id = pool.get('account.bank.statement').create(cr,uid,{
'journal_id': statement['journal_id'],
'date':time.strftime('%Y-%m-%d',time.strptime(statement['date'],"%y/%m/%d")),
'period_id':statement['period_id'],
'balance_start': statement["balance_start"],
'balance_end_real': statement["balance_end_real"],
'state': 'draft',
'name': statement['name'],
})
lines=statement["bank_statement_line"]
for value in lines:
line=lines[value]
reconcile_id = False
if line['toreconcile']:
rec_id = pool.get('account.move.line').search(cr, uid, [('name','=',line['name']),('reconcile_id','=',False),('account_id.reconcile','=',True)])
if rec_id:
reconcile_id = pool.get('account.bank.statement.reconcile').create(cr, uid, {
'line_ids': [(6, 0, rec_id)]
}, context=context)
str_not1 = ''
if line.has_key('contry_name') and line.has_key('cntry_number'):
str_not1="Partner name:%s \n Partner Account Number:%s \n Communication:%s \n Value Date:%s \n Entry Date:%s \n"%(line["contry_name"],line["cntry_number"],line["free_comm"]+line['extra_note'],line["val_date"][0],line["entry_date"][0])
id=pool.get('account.bank.statement.line').create(cr,uid,{
'name':line['name'],
'date': line['date'],
'amount': line['amount'],
'partner_id':line['partner_id'] or 0,
'account_id':line['account_id'],
'statement_id': bk_st_id,
'reconcile_id': reconcile_id,
'note':str_not1,
'ref':line['ref'],
})
str_not= "\n \n Account Number: %s \n Account Holder Name: %s " %(statement["acc_number"],statement["acc_holder"])
std_log += "\nStatement : %s , Date : %s, Starting Balance : %.2f , Ending Balance : %.2f \n"\
%(statement['name'], statement['date'], float(statement["balance_start"]), float(statement["balance_end_real"]))
bkst_list.append(bk_st_id)
except osv.except_osv, e:
cr.rollback()
nb_err+=1
err_log += '\n Application Error : ' + str(e)
raise # REMOVEME
except Exception, e:
cr.rollback()
nb_err+=1
err_log += '\n System Error : '+str(e)
raise # REMOVEME
except :
cr.rollback()
nb_err+=1
err_log += '\n Unknown Error'
raise
err_log += '\n\nNumber of statements : '+ str(len(bkst_list))
err_log += '\nNumber of error :'+ str(nb_err) +'\n'
pool.get('account.coda').create(cr, uid,{
'name':codafile,
'statement_ids': [(6, 0, bkst_list,)],
'note':str_log1+str_not+std_log+err_log,
'journal_id':data['form']['journal_id'],
'date':time.strftime("%Y-%m-%d"),
'user_id':uid,
})
return {'note':str_log1 + std_log + err_log ,'journal_id': data['form']['journal_id'], 'coda': data['form']['coda'],'statment_ids':bkst_list}
def str2date(date_str):
return time.strftime("%y/%m/%d",time.strptime(date_str,"%d%m%y"))
def str2float(str):
try:
return float(str)
except:
return 0.0
def list2float(lst):
try:
return str2float((lambda s : s[:-3] + '.' + s[-3:])(lst))
except:
return 0.0
class coda_import(wizard.interface):
def _action_open_window(self, cr, uid, data, context):
form=data['form']
return {
'domain':"[('id','in',%s)]"%(form['statment_ids']),
'name': 'Statement',
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'account.bank.statement',
'view_id': False,
'type': 'ir.actions.act_window',
}
states = {
'init' : {
'actions' : [],
'result' : {'type' : 'form',
'arch' : codawiz_form,
'fields' : codawiz_fields,
'state' : [('end', '_Close'),('extraction', '_Ok') ]}
},
'extraction' : {
'actions' : [_coda_parsing],
'result' : {'type' : 'form',
'arch' : result_form,
'fields' : result_fields,
'state' : [('end', '_Close'),('open', '_Open Statement')]}
},
'open': {
'actions': [],
'result': {'type': 'action', 'action': _action_open_window, 'state': 'end'}
},
}
coda_import("account.coda_import")
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -7,19 +7,19 @@ 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:56+0000\n"
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
"PO-Revision-Date: 2010-05-21 17:51+0000\n"
"Last-Translator: Christophe Chauvet - http://www.syleam.fr/ <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:17+0000\n"
"X-Launchpad-Export-Date: 2010-05-22 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: audittrail
#: model:ir.module.module,shortdesc:audittrail.module_meta_information
msgid "Audit Trail"
msgstr ""
msgstr "Rapport de l' audit"
#. module: audittrail
#: constraint:ir.model:0
@ -72,7 +72,7 @@ msgstr "Ancienne valeur"
#. module: audittrail
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
msgstr "Nom de modèle invalide pour la définition de l'action"
#. module: audittrail
#: model:ir.actions.wizard,name:audittrail.wizard_audittrail_log
@ -143,7 +143,7 @@ msgstr "Règle AuditTrail"
#. module: audittrail
#: wizard_field:audittrail.view.log,init,to:0
msgid "Log To"
msgstr ""
msgstr "Connecter à"
#. module: audittrail
#: view:audittrail.log:0
@ -158,6 +158,10 @@ msgid ""
" Subscribe Rules for read, write, create and delete on objects and check "
"logs"
msgstr ""
"Autorise un administrateur à tracer toutes les manipulations des "
"utilisateurs sur tous les objets du système.\n"
" Règles d'abonnement pour la lecture, l'écriture, la création, la "
"suppression des objets et la consultation des journaux"
#. module: audittrail
#: field:audittrail.log,timestamp:0

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,7 +15,7 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -26,23 +26,24 @@
'description': """Full featured calendar system that supports:
- Alerts (create requests)
- Recurring events (*)
- Invitations to others people""",
"author" : "Tiny",
'category': 'Generic Modules/Others',
'website': 'http://www.openerp.com',
- Invitations to others people""",
"author" : "Tiny",
'category': 'Generic Modules/Others',
'website': 'http://www.openerp.com',
"init_xml" : [
'base_calendar_data.xml'
],
"demo_xml" : [],
],
"demo_xml" : [],
"update_xml" : [
'security/ir.model.access.csv',
'wizard/calendar_event_edit_all_view.xml',
'wizard/base_calendar_invite_attendee_view.xml',
'wizard/calendar_event_edit_all_view.xml',
'wizard/base_calendar_invite_attendee_view.xml',
'wizard/base_calendar_set_exrule_view.xml',
'base_calendar_view.xml'
],
"test" : ['test/base_calendar_test.yml'],
"installable" : True,
"active" : False,
],
# "test" : ['test/base_calendar_test.yml'],
"installable" : True,
"active" : False,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Attendee form view-->
<record id="base_calendar_attendee_form_view" model="ir.ui.view">
<field name="name">calendar.attendee.form</field>
@ -65,6 +67,8 @@
</form>
</field>
</record>
<!-- Attendee tree view-->
<record id="base_calendar_attendee_tree_view" model="ir.ui.view">
<field name="name">calendar.attendee.tree</field>
@ -77,10 +81,14 @@
<field name="partner_address_id" string="Contact" />
<field name="role" />
<field name="state" />
<field name="cutype" invisible="1"/>
<field name="rsvp" invisible="1"/>
</tree>
</field>
</record>
<!-- Attendee search view-->
<record id="base_calendar_attendee_search_view" model="ir.ui.view">
<field name="name">calendar.attendee.search</field>
<field name="model">calendar.attendee</field>
@ -99,11 +107,26 @@
<separator orientation="vertical"/>
<field name="cutype" string="Invitation type" select="1"/>
<field name="event_date" select="1"/>
<newline/>
<group expand="0" string="Group By..." colspan="16">
<filter string="Type" icon="terp-project" help="Invitation Type"
domain="[]" context="{'group_by':'cutype'}" />
<filter string="Role" icon="terp-project"
domain="[]" context="{'group_by':'role'}" />
<filter string="Required Reply" icon="terp-crm"
domain="[]" context="{'group_by':'rsvp'}" />
<separator orientation="vertical" />
<filter string="User" icon="terp-partner" domain="[]"
context="{'group_by':'user_id'}" />
<filter string="Contact" icon="terp-partner" domain="[]"
context="{'group_by':'partner_address_id'}" />
</group>
</search>
</field>
</record>
<!-- Action for attendee view-->
<record id="action_view_attendee_form" model="ir.actions.act_window">
<field name="name">Event Invitations</field>
<field name="type">ir.actions.act_window</field>
@ -115,10 +138,12 @@
</record>
<!-- Calenadar's menu -->
<menuitem id="base.menu_calendar_configuration" name="Calendar"
parent="base.menu_base_config" sequence="10" />
<!-- Invitation menu -->
<menuitem id="menu_attendee_invitations"
name="Event Invitations" parent="base.menu_calendar_configuration"
sequence="10" action="action_view_attendee_form" />
@ -138,9 +163,6 @@
<field name="trigger_interval" select="1" />
<field name="trigger_occurs" select="1" />
<field name="trigger_related" select="1" />
<separator string="" colspan="4" />
<field name="duration" />
<field name="repeat" />
</form>
</field>
</record>
@ -162,7 +184,8 @@
</field>
</record>
<!-- Action for alarms view-->
<record id="action_res_alarm_view" model="ir.actions.act_window">
<field name="name">Available Alarms</field>
<field name="type">ir.actions.act_window</field>
@ -170,6 +193,8 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<!-- Menu for Alarms-->
<menuitem id="menu_crm_meeting_avail_alarm"
groups="base.group_extended"
@ -405,6 +430,7 @@
</record>
<!-- Event menu -->
<menuitem id="menu_events"
name="Events" parent="base.menu_calendar_configuration"
sequence="5" action="action_view_event" />

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
@ -15,12 +15,13 @@
# 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/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import calendar_event_edit_all
import base_calendar_invite_attendee
import base_calendar_set_exrule
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -13,37 +13,38 @@
<field name="type" />
<field name="send_mail" />
<newline />
<group col="1" colspan="4"
<group col="2" colspan="6"
attrs="{'invisible': [('type', '!=', 'external')]}">
<field name="email" colspan="4"
attrs="{'required': [('type', '=', 'external')]}" />
</group>
<group col="1" colspan="4"
<group col="2" colspan="6"
attrs="{'invisible': [('type', '!=', 'internal')]}">
<separator string="Users" colspan="4" />
<field name="user_ids" select="1" colspan="4"
nolabel="1" />
<newline />
</group>
<group col="2" colspan="4"
<group col="2" colspan="6"
attrs="{'invisible': [('type', '!=', 'partner')]}">
<field name="partner_id" colspan="2"
on_change="onchange_partner_id(partner_id)"
attrs="{'required': [('type', '=', 'partner')]}" />
<newline />
<separator string="Partner Contacts"
colspan="4" />
colspan="6" />
<field name="contact_ids" select="1" colspan="4"
nolabel="1" domain="[('partner_id', '=', partner_id)]"
attrs="{'readonly': [('type', '!=', 'partner')]}" />
</group>
<newline />
<separator string="" colspan="6" />
<label string="" colspan="2" />
<group col="4" colspan="4">
<button icon='gtk-cancel' special="cancel"
string="Cancel" />
<button name="do_invite" string="Invite"
type="object" icon="gtk-ok" />
</group>
</form>
</field>
</record>

View File

@ -0,0 +1,162 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 base_calendar import base_calendar
from osv import fields, osv
from tools.translate import _
import tools
import mx.DateTime
import re
months = {
1: "January", 2: "February", 3: "March", 4: "April", \
5: "May", 6: "June", 7: "July", 8: "August", 9: "September", \
10: "October", 11: "November", 12: "December"
}
class base_calendar_set_exrule(osv.osv_memory):
"""
Set Exrule.
"""
_name = "base.calendar.set.exrule"
_description = "Set Exrule"
_columns = {
'freq': fields.selection([('None', 'No Repeat'), \
('secondly', 'Secondly'), \
('minutely', 'Minutely'), \
('hourly', 'Hourly'), \
('daily', 'Daily'), \
('weekly', 'Weekly'), \
('monthly', 'Monthly'), \
('yearly', 'Yearly')], 'Frequency',required=True),
'interval': fields.integer('Interval'),
'count': fields.integer('Count'),
'mo': fields.boolean('Mon'),
'tu': fields.boolean('Tue'),
'we': fields.boolean('Wed'),
'th': fields.boolean('Thu'),
'fr': fields.boolean('Fri'),
'sa': fields.boolean('Sat'),
'su': fields.boolean('Sun'),
'select1': fields.selection([('date', 'Date of month'), \
('day', 'Day of month')], 'Option'),
'day': fields.integer('Date of month'),
'week_list': fields.selection([('MO', 'Monday'), ('TU', 'Tuesday'), \
('WE', 'Wednesday'), ('TH', 'Thursday'), \
('FR', 'Friday'), ('SA', 'Saturday'), \
('SU', 'Sunday')], 'Weekday'),
'byday': fields.selection([('1', 'First'), ('2', 'Second'), \
('3', 'Third'), ('4', 'Fourth'), \
('5', 'Fifth'), ('-1', 'Last')], 'By day'),
'month_list': fields.selection(months.items(),'Month'),
'end_date': fields.date('Repeat Until'),
}
def view_init(self, cr, uid, fields, context=None):
"""
This function checks for precondition before wizard executes
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param fields: List of fields for default value
@param context: A standard dictionary for contextual values
"""
crm_obj = self.pool.get('crm.meeting')
for meeting in crm_obj.browse(cr, uid, context.get('active_ids', [])):
if not meeting.rrule:
raise osv.except_osv(_("Warning !"), _("Please Apply Recurrency after Apply Exception Rule"))
return False
def compute_exrule_string(self, cr, uid, ids, context=None):
"""
Compute rule string.
@param self: the object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param datas: dictionary of freq and interval value.
@return: string value which compute FREQILY;INTERVAL
"""
weekdays = ['mo', 'tu', 'we', 'th', 'fr', 'sa', 'su']
weekstring = ''
monthstring = ''
yearstring = ''
for datas in self.read(cr, uid, ids, context=context):
freq = datas.get('freq')
if freq == 'None':
return ''
interval_srting = datas.get('interval') and (';INTERVAL=' + str(datas.get('interval'))) or ''
if freq == 'weekly':
byday = map(lambda x: x.upper(), filter(lambda x: datas.get(x) and x in weekdays, datas))
if byday:
weekstring = ';BYDAY=' + ','.join(byday)
elif freq == 'monthly':
if datas.get('select1')=='date' and (datas.get('day') < 1 or datas.get('day') > 31):
raise osv.except_osv(_('Error!'), ("Please select proper Day of month"))
if datas.get('select1')=='day':
monthstring = ';BYDAY=' + datas.get('byday') + datas.get('week_list')
elif datas.get('select1')=='date':
monthstring = ';BYMONTHDAY=' + str(datas.get('day'))
elif freq == 'yearly':
if datas.get('select1')=='date' and (datas.get('day') < 1 or datas.get('day') > 31):
raise osv.except_osv(_('Error!'), ("Please select proper Day of month"))
bymonth = ';BYMONTH=' + str(datas.get('month_list'))
if datas.get('select1')=='day':
bystring = ';BYDAY=' + datas.get('byday') + datas.get('week_list')
elif datas.get('select1')=='date':
bystring = ';BYMONTHDAY=' + str(datas.get('day'))
yearstring = bymonth + bystring
if datas.get('end_date'):
datas['end_date'] = ''.join((re.compile('\d')).findall(datas.get('end_date'))) + '235959Z'
enddate = (datas.get('count') and (';COUNT=' + str(datas.get('count'))) or '') +\
((datas.get('end_date') and (';UNTIL=' + datas.get('end_date'))) or '')
exrule_string = 'FREQ=' + freq.upper() + weekstring + interval_srting \
+ enddate + monthstring + yearstring
ex_id = base_calendar.base_calendar_id2real_id(context['active_id'])
model = context.get('model', False)
model_obj = self.pool.get(model)
exrule_value = model_obj.write(cr, uid,ex_id,{
'exrule': exrule_string,
})
return {}
_defaults = {
'freq': lambda *x: 'None',
'select1': lambda *x: 'date',
'interval': lambda *x: 1,
}
base_calendar_set_exrule()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_base_calendar_set_exrule" model="ir.ui.view">
<field name="name">base.calendar.set.exrule.form</field>
<field name="model">base.calendar.set.exrule</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Set Exrule">
<separator string="Select data for ExRule" colspan="8"/>
<group col="8" colspan="6">
<field name="freq" />
<field name="interval" />
<field name="count" />
<field name="end_date" />
</group>
<group col="8" colspan="8" name="Select weekdays"
attrs="{'invisible' : [('freq','!=','weekly')]}">
<field name="mo" colspan="1" />
<field name="tu" colspan="1" />
<field name="we" colspan="1" />
<field name="th" colspan="1" />
<field name="fr" colspan="1" />
<field name="sa" colspan="1" />
<field name="su" colspan="1" />
<newline />
</group>
<group col="8" colspan="6"
attrs="{'invisible' : [('freq','!=','monthly'), ('freq','!=','yearly')]}">
<group col="2" colspan="1">
<field name="select1" />
</group>
<group col="2" colspan="1"
attrs="{'invisible' : [('select1','=','day')]}">
<field name="day"
attrs="{'required' : [('select1','=','date')]}"/>
</group>
<group col="3" colspan="1"
attrs="{'invisible' : [('select1','=','date')]}">
<field name="byday" string="The"
attrs="{'required' : [('select1','=','day')]}"/>
<field name="week_list" nolabel="1"
attrs="{'required' : [('select1','=','day')]}"/>
</group>
<group col="1" colspan="1"
attrs="{'invisible' : [('freq','!=','yearly')]}">
<field name="month_list" string="of"
colspan="1"
attrs="{'required' : [('freq','=','yearly')]}"/>
</group>
</group>
<group colspan="4" col="6">
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-ok" string="ok" name="compute_exrule_string" type="object"/>
</group>
</form>
</field>
</record>
<record id="action_base_calendar_set_exrule" model="ir.actions.act_window">
<field name="name">Set Exrule</field>
<field name="res_model">base.calendar.set.exrule</field>
<field name="view_type">form</field>
<field name="view_mode">form,tree</field>
<field name="target">new</field>
</record>
</data>
</openerp>

View File

@ -72,8 +72,8 @@ class res_partner_contact(osv.osv):
it will allow you to hide the partner contact without removing it."),
'partner_id': fields.related('job_ids','address_id','partner_id',type='many2one',\
relation='res.partner', string='Main Employer'),
'function_id': fields.related('job_ids','function_id',type='many2one', \
relation='res.partner.function', string='Main Function'),
'function': fields.related('job_ids', 'function', type='char', \
string='Main Function'),
'job_id': fields.function(_main_job, method=True, type='many2one',\
relation='res.partner.job', string='Main Job'),
'email': fields.char('E-Mail', size=240),
@ -164,7 +164,7 @@ class res_partner_job(osv.osv):
return []
res = []
for r in self.browse(cr, uid, ids):
funct = r.function_id and (", " + r.function_id.name) or ""
funct = r.function and (", " + r.function) or ""
res.append((r.id, self.pool.get('res.partner.contact').name_get(cr, uid, \
[r.contact_id.id])[0][1] + funct))
return res
@ -212,11 +212,10 @@ class res_partner_job(osv.osv):
'name': fields.related('address_id', 'partner_id', type='many2one',\
relation='res.partner', string='Partner', help="You may\
enter Address first,Partner will be linked automatically if any."),
'address_id': fields.many2one('res.partner.address', 'Address', domain=[('partner_id', '=', name)], \
help='Address which is linked to the Partner'),
'address_id': fields.many2one('res.partner.address', 'Address', \
help='Address which is linked to the Partner'), # TO Correct: domain=[('partner_id', '=', name)]
'contact_id': fields.many2one('res.partner.contact','Contact', required=True, ondelete='cascade'),
'function_id': fields.many2one('res.partner.function','Partner Function', \
help="Function of this contact with this partner"),
'function': fields.char('Partner Function', size=34, help="Function of this contact with this partner"),
'sequence_contact': fields.integer('Contact Seq.',help='Order of\
importance of this address in the list of addresses of the linked contact'),
'sequence_partner': fields.integer('Partner Seq.',help='Order of importance\

View File

@ -1,11 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Create the functions -->
<record id="res_partner_function_privateaddress0" model="res.partner.function">
<field eval="&quot;&quot;&quot;Private Address&quot;&quot;&quot;" name="name"/>
<field name="code">PA</field>
</record>
<!-- Create the contacts -->
<record id="res_partner_contact_mortier0" model="res.partner.contact">
@ -171,35 +166,35 @@
<!-- Create the jobs -->
<record id="res_partner_job_0" model="res.partner.job">
<field name="address_id" ref="base.res_partner_address_1"/>
<field name="function_id" ref="base.function_sale"/>
<field name="function">Salesman</field>
<field name="contact_id" ref="res_partner_contact_mortier0"/>
<field name="sequence_partner">2</field>
</record>
<record id="res_partner_job_1" model="res.partner.job">
<field name="address_id" ref="base.res_partner_address_2"/>
<field name="function_id" ref="base.function_sale"/>
<field name="function">Salesman</field>
<field eval="&quot;&quot;&quot;contact@tecsas.fr&quot;&quot;&quot;" name="email"/>
<field name="contact_id" ref="res_partner_contact_jacot0"/>
</record>
<record id="res_partner_job_2" model="res.partner.job">
<field name="address_id" ref="base.res_partner_address_3"/>
<field name="function_id" ref="base.function_it"/>
<field name="function">CTO</field>
<field eval="&quot;&quot;&quot;info@mediapole.net&quot;&quot;&quot;" name="email"/>
<field name="contact_id" ref="res_partner_contact_passot0"/>
</record>
<record id="res_partner_job_3" model="res.partner.job">
<field name="address_id" ref="base.res_partner_address_tang"/>
<field name="function_id" ref="base.function_sale"/>
<field name="function">Salesman</field>
<field name="contact_id" ref="res_partner_contact_tang0"/>
</record>
<record id="res_partner_job_4" model="res.partner.job">
<field name="address_id" ref="base.res_partner_address_wong"/>
<field name="function_id" ref="base.function_sale"/>
<field name="function">Salesman</field>
<field name="contact_id" ref="res_partner_contact_wong0"/>
</record>
<record id="res_partner_job_5" model="res.partner.job">
<field name="address_id" ref="base.res_partner_address_6"/>
<field name="function_id" ref="base.function_director"/>
<field name="function">CEO</field>
<field name="contact_id" ref="res_partner_contact_lacarte0"/>
<field name="sequence_contact">1</field>
<field name="sequence_partner">0</field>
@ -207,120 +202,120 @@
</record>
<record id="res_partner_job_6" model="res.partner.job">
<field name="address_id" ref="base.res_partner_address_7"/>
<field name="function_id" ref="base.function_sale"/>
<field name="function">Salesman</field>
<field name="contact_id" ref="res_partner_contact_lavente0"/>
</record>
<record id="res_partner_job_7" model="res.partner.job">
<field name="address_id" ref="base.res_partner_address_8"/>
<field name="function_id" ref="base.function_it"/>
<field name="function">CTO</field>
<field name="contact_id" ref="res_partner_contact_lelitre0"/>
</record>
<record id="res_partner_job_8" model="res.partner.job">
<field name="address_id" ref="base.res_partner_address_9"/>
<field name="function_id" ref="base.function_director"/>
<field name="function">CEO</field>
<field name="contact_id" ref="res_partner_contact_grosbonnet0"/>
</record>
<record id="res_partner_job_9" model="res.partner.job">
<field name="address_id" ref="base.res_partner_address_10"/>
<field name="function_id" ref="base.function_sale"/>
<field name="function">Salesman</field>
<field name="contact_id" ref="res_partner_contact_lesbrouffe0"/>
</record>
<record id="res_partner_job_10" model="res.partner.job">
<field name="address_id" ref="base.res_partner_address_zen"/>
<field name="function_id" ref="base.function_it"/>
<field name="function">CTO</field>
<field name="contact_id" ref="res_partner_contact_zen0"/>
</record>
<record id="res_partner_job_11" model="res.partner.job">
<field name="address_id" ref="base.main_address"/>
<field name="function_id" ref="base.function_sale"/>
<field name="function">Salesman</field>
<field eval="&quot;&quot;&quot;re@mycompany.com&quot;&quot;&quot;" name="email"/>
<field name="contact_id" ref="res_partner_contact_mignon0"/>
</record>
<record id="res_partner_job_12" model="res.partner.job">
<field name="address_id" ref="base.main_address"/>
<field name="function_id" ref="base.function_it"/>
<field name="function">CTO</field>
<field eval="&quot;&quot;&quot;st@mycompany.com&quot;&quot;&quot;" name="email"/>
<field name="contact_id" ref="res_partner_contact_wirtel0"/>
</record>
<record id="res_partner_job_13" model="res.partner.job">
<field name="address_id" ref="base.main_address"/>
<field name="function_id" ref="base.function_it"/>
<field name="function">CTO</field>
<field eval="&quot;&quot;&quot;ch@mycompany.com&quot;&quot;&quot;" name="email"/>
<field name="contact_id" ref="res_partner_contact_simonis0"/>
</record>
<record id="res_partner_job_14" model="res.partner.job">
<field name="address_id" ref="base.main_address"/>
<field name="function_id" ref="base.function_it"/>
<field name="function">CTO</field>
<field eval="&quot;&quot;&quot;ol@mycompany.com&quot;&quot;&quot;" name="email"/>
<field name="contact_id" ref="res_partner_contact_laurent0"/>
</record>
<record id="res_partner_job_15" model="res.partner.job">
<field name="address_id" ref="base.main_address"/>
<field name="function_id" ref="base.function_it"/>
<field name="function">CTO</field>
<field eval="&quot;&quot;&quot;fl@mycompany.com&quot;&quot;&quot;" name="email"/>
<field name="contact_id" ref="res_partner_contact_lambotte0"/>
</record>
<record id="res_partner_job_16" model="res.partner.job">
<field name="address_id" ref="base.main_address"/>
<field name="function_id" ref="base.function_sale"/>
<field name="function">Salesman</field>
<field eval="&quot;&quot;&quot;av@mycompany.com&quot;&quot;&quot;" name="email"/>
<field name="contact_id" ref="res_partner_contact_vandewerve0"/>
</record>
<record id="res_partner_job_17" model="res.partner.job">
<field name="address_id" ref="base.main_address"/>
<field name="function_id" ref="base.function_it"/>
<field name="function">CTO</field>
<field eval="&quot;&quot;&quot;fb@mycompany.com&quot;&quot;&quot;" name="email"/>
<field name="contact_id" ref="res_partner_contact_semal0"/>
</record>
<record id="res_partner_job_18" model="res.partner.job">
<field name="address_id" ref="base.main_address"/>
<field name="function_id" ref="base.function_it"/>
<field name="function">CTO</field>
<field eval="&quot;&quot;&quot;qd@mycompany.com&quot;&quot;&quot;" name="email"/>
<field name="contact_id" ref="res_partner_contact_depaoli0"/>
</record>
<record id="res_partner_job_19" model="res.partner.job">
<field name="address_id" ref="base.main_address"/>
<field name="function_id" ref="base.function_it"/>
<field name="function">CTO</field>
<field eval="&quot;&quot;&quot;ne@mycompany.com&quot;&quot;&quot;" name="email"/>
<field name="contact_id" ref="res_partner_contact_elkhayat0"/>
</record>
<record id="res_partner_job_20" model="res.partner.job">
<field name="address_id" ref="base.main_address"/>
<field name="function_id" ref="base.function_it"/>
<field name="function">CTO</field>
<field eval="&quot;&quot;&quot;ph@mycompany.com&quot;&quot;&quot;" name="email"/>
<field name="contact_id" ref="res_partner_contact_luu0"/>
</record>
<record id="res_partner_job_21" model="res.partner.job">
<field name="address_id" ref="base.main_address"/>
<field name="function_id" ref="base.function_director"/>
<field name="function">CEO</field>
<field eval="&quot;&quot;&quot;fp@mycompany.com&quot;&quot;&quot;" name="email"/>
<field name="contact_id" ref="res_partner_contact_pinckears0"/>
<field name="sequence_partner">-1</field>
</record>
<record id="res_partner_job_22" model="res.partner.job">
<field name="address_id" ref="base.main_address"/>
<field name="function_id" ref="base.function_sale"/>
<field name="function">Salesman</field>
<field eval="&quot;&quot;&quot;cd@mycompany.com&quot;&quot;&quot;" name="email"/>
<field name="contact_id" ref="res_partner_contact_debois0"/>
</record>
<record id="res_partner_job_23" model="res.partner.job">
<field name="address_id" ref="res_partner_address_0"/>
<field name="contact_id" ref="res_partner_contact_mortier0"/>
<field name="function_id" ref="res_partner_function_privateaddress0"/>
<field name="sequence_contact">5</field>
<field name="function">PA</field>
</record>
<record id="res_partner_job_24" model="res.partner.job">
<field eval="1" name="sequence_contact"/>
<field name="address_id" ref="res_partner_address_1"/>
<field name="contact_id" ref="res_partner_contact_lacarte0"/>
<field name="function_id" ref="res_partner_function_privateaddress0"/>
<field name="function">PA</field>
<field name="sequence_contact">5</field>
</record>
<record id="res_partner_job_25" model="res.partner.job">
<field eval="2" name="sequence_contact"/>
<field name="address_id" ref="base.res_partner_address_1"/>
<field name="contact_id" ref="res_partner_contact_lacarte0"/>
<field name="function_id" ref="base.function_director"/>
<field name="function">CEO</field>
<field name="sequence_contact">1</field>
</record>
</data>

View File

@ -16,7 +16,7 @@
<field name="email"/>
<field name="lang_id"/>
<field name="partner_id"/>
<field name="function_id"/>
<field name="function"/>
</tree>
</field>
</record>
@ -38,7 +38,7 @@
<group string="Partner" colspan="2" col="2">
<field name="partner_id" invisible="1" select="1"/>
<field name="title" select="1"/>
<field name="function_id" invisible="1"/>
<field name="function" invisible="1"/>
<field name="email"/>
<field name="lang_id"/>
<field name="active"/>
@ -51,7 +51,7 @@
<field name="job_ids" colspan="4" nolabel="1" mode="tree,form">
<form string="Functions and Addresses">
<group string="Partner" colspan="2" col="4">
<field name="function_id"/>
<field name="function"/>
<field name="address_id"/>
<field name="name"/>
<field name="date_start" />
@ -69,7 +69,7 @@
</form>
<tree string="Functions and Addresses">
<field name="sequence_contact" string="Seq."/>
<field name="function_id"/>
<field name="function"/>
<field name="name"/>
<field name="address_id"/>
<field name="phone"/>
@ -152,7 +152,7 @@
<tree string="Contacts" editable="top">
<field name="sequence_partner"/>
<field name="contact_id"/>
<field name="function_id"/>
<field name="function"/>
<field name="phone"/>
<field name="fax"/>
<field name="extension"/>
@ -164,7 +164,7 @@
<field name="sequence_partner"/>
<field name="name"/>
<field name="contact_id"/>
<field name="function_id"/>
<field name="function"/>
</group>
<group string="Communication" colspan="2" col="2">
<field name="phone"/>
@ -337,7 +337,7 @@
<field name="arch" type="xml">
<tree string="Contact Functions">
<field name="contact_id"/>
<field name="function_id"/>
<field name="function"/>
<field name="name"/>
<field name="address_id"/>
<field name="email"/>
@ -360,7 +360,7 @@
<field name="name" select="1" on_change="onchange_partner(name)"/>
<field name="address_id" select="1" attrs="{'required': [('name', '!=', False)]}" on_change="onchange_address(address_id)"/>
<field name="contact_id" select="1"/>
<field name="function_id" select="1"/>
<field name="function" select="1"/>
<field name="email" widget="email"/>
<field name="phone"/>
<field name="fax"/>

View File

@ -23,7 +23,7 @@
first_name: Laura
job_ids:
- email: lwilliams@mydomain.com
function_id: base_contact.res_partner_function_privateaddress0
function: PA
phone: (+32).10.45.18.77
sequence_contact: 1
state: current
@ -44,7 +44,7 @@
zip: '2324324'
job_ids:
- address_id: res_partner_address_1
function_id: base.function_director
function: CEO
contact_id: res_partner_contact_williams0
sequence_partner: 2
state: current
@ -66,10 +66,10 @@
first_name: Nicolas
job_ids:
- address_id: base.main_address
function_id: base.function_it
function: CTO
state: current
- address_id: base.res_partner_address_3000
function_id: base.function_director
function: CEO
state: current
lang_id: res_lang_french0
mobile: (+32).23.44.32.12
@ -84,10 +84,10 @@
first_name: Christina
job_ids:
- address_id: base.res_partner_address_1
function_id: base.function_director
function: CEO
state: past
- address_id: base.res_partner_address_1
function_id: base.function_it
function: CTO
state: current
lang_id: base_contact.res_lang_french0
mobile: (+32).10.45.18.77

View File

@ -11,7 +11,7 @@
<field name="name">My Expenses</field>
<field name="res_model">hr.expense.expense</field>
<field name="view_type">form</field>
<field name="domain">[('state','=','draft'),('user_id','=',uid)]</field>
<field name="domain">[('state','in',('draft', 'confirm')),('user_id','=',uid)]</field>
<field name="view_id" ref="hr_expense.view_editable_expenses_tree"/>
</record>

View File

@ -7,19 +7,19 @@ 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-21 15:58+0000\n"
"Last-Translator: Andrzej MoST (Marcin Ostajewski) <Unknown>\n"
"PO-Revision-Date: 2010-05-23 20:02+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:00+0000\n"
"X-Launchpad-Export-Date: 2010-05-24 03:46+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: board_manufacturing
#: view:board.board:0
msgid "Procurement in Exception"
msgstr ""
msgstr "Niepoprawne nabycia"
#. module: board_manufacturing
#: view:board.board:0
@ -34,7 +34,7 @@ msgstr "XML niewłaściwy dla tej architektury wyświetlania!"
#. module: board_manufacturing
#: view:board.board:0
msgid "Deliveries (Out packing)"
msgstr ""
msgstr "Dostawy do klientów"
#. module: board_manufacturing
#: view:board.board:0
@ -49,7 +49,7 @@ msgstr "Produkcja"
#. module: board_manufacturing
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
msgstr "Nieprawidłowa nazwa modelu w definicji akcji."
#. module: board_manufacturing
#: model:ir.actions.act_window,name:board_manufacturing.open_board_manufacturing
@ -65,9 +65,9 @@ msgstr "Konsola dla produkcji"
#. module: board_manufacturing
#: view:board.board:0
msgid "Stock value variation"
msgstr ""
msgstr "Zmiany wartości zapasów"
#. module: board_manufacturing
#: view:board.board:0
msgid "Workcenter futur load"
msgstr "Przyszłe obiciążenie centrum roboczego"
msgstr "Obciążenie centrów roboczych"

View File

@ -7,24 +7,72 @@
<field name="res_model">project.issue</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('create_date', '&gt;=', time.strftime('%Y-%m-%d 00:00:00')),('create_date', '&lt;=', time.strftime('%Y-%m-%d 23:59:59'))]</field>
<field name="domain">[('user_id','=',uid),('state','in',['draft','open'])]</field>
<field name="view_id" ref="project_issue.project_issue_tree_view"/>
</record>
<record id="action_view_pending_project_issue_tree" model="ir.actions.act_window">
<field name="name">Project issues</field>
<field name="res_model">project.issue</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('user_id','=',uid),('state','=','pending')]</field>
<field name="view_id" ref="project_issue.project_issue_tree_view"/>
</record>
<record id="action_project_issue_graph_state" model="ir.actions.act_window">
<field name="name">Project Issue</field>
<field name="res_model">project.issue.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph</field>
<field name="domain">[('user_id','=',uid)]</field>
<field name="view_id" ref="project_issue.view_project_issue_report_graph"/>
</record>
<record id="view_project_issue_graph_stage" model="ir.ui.view">
<field name="name">project.issue.report.graph</field>
<field name="model">project.issue.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="vertical" string="Project Issue" type="bar">
<field name="stage_id"/>
<field name="nbr" operator="+"/>
<field group="True" name="user_id"/>
</graph>
</field>
</record>
<record id="action_project_issue_graph_stage" model="ir.actions.act_window">
<field name="name">Project Issue</field>
<field name="res_model">project.issue.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph</field>
<field name="domain">[('user_id','=',uid)]</field>
<field name="view_id" ref="view_project_issue_graph_stage"/>
</record>
<record id="board_project_issue_form" model="ir.ui.view">
<field name="name">board.project.issue.form</field>
<field name="model">board.board</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Project Issue Board">
<vpaned>
<form string="My Board">
<hpaned>
<child1>
<action colspan="4" height="220" name="%(action_view_current_project_issue_tree)d" string="Current Project Issues" width="510"/>
<action colspan="4" name="%(action_view_current_project_issue_tree)d" string="Current Issues" width="510"/>
<action colspan="4" name="%(action_view_pending_project_issue_tree)d" string="Pending Issues" width="510"/>
</child1>
<child2>
<action colspan="4" height="220" name="%(project.action_task_by_days_graph)d" string="Project Tasks By Days" width="510"/>
<vpaned>
<child1>
<action colspan="4" name="%(action_project_issue_graph_state)d" string="Issues By State" />
</child1>
<child2>
<action colspan="4" name="%(action_project_issue_graph_stage)d" string="Issues By Stage" />
</child2>
</vpaned>
</child2>
</vpaned>
</hpaned>
</form>
</field>
</record>

View File

@ -8,6 +8,15 @@
name="Purchase"
parent="base.dashboard"/>
<record id="purchase_draft" model="ir.actions.act_window">
<field name="name">Draft Purchases</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">purchase.order</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('date_order','&gt;',time.strftime('%Y-01-01 00:00:00')),('date_order','&lt;',time.strftime('%Y-12-31 23:59:59')), ('state','=','draft')]</field>
<field name="search_view_id" ref="purchase.purchase_order_tree"/>
</record>
<record id="purchase_waiting" model="ir.actions.act_window">
<field name="name">Quotation Request</field>
<field name="type">ir.actions.act_window</field>
@ -26,7 +35,7 @@
<form string="My Board">
<hpaned>
<child1>
<action colspan="4" height="220" name="%(purchase.purchase_rfq)d" string="Draft Purchase Order" width="510"/>
<action colspan="4" height="220" name="%(purchase_draft)d" string="Draft Purchase Order" width="510"/>
<action colspan="4" height="220" name="%(purchase_waiting)d" string="Purchase Order in Waiting" width="510"/>
</child1>
<child2>

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: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-05-14 16:28+0000\n"
"PO-Revision-Date: 2010-05-21 19:22+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-05-15 04:58+0000\n"
"X-Launchpad-Export-Date: 2010-05-22 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: board_sale
@ -40,7 +40,7 @@ msgstr "Konsola szefa sprzedaży"
#. module: board_sale
#: view:board.board:0
msgid "Cases of the month"
msgstr "Zdarzenia miesiąca"
msgstr "Sprawy miesiąca"
#. module: board_sale
#: constraint:ir.ui.view:0
@ -65,9 +65,9 @@ msgstr "Sprzedaż"
#. module: board_sale
#: view:board.board:0
msgid "Cases statistics"
msgstr "Statystyka zdarzeń"
msgstr "Statystyka spraw"
#. module: board_sale
#: view:board.board:0
msgid "Top ten sales of the month"
msgstr "Dziesięć najlepszych sprzedaży w miesiącu"
msgstr "Najlepsze sprzedaże w miesiącu"

View File

@ -21,9 +21,9 @@
{
'name': 'Customer & Supplier Relationship Management',
'version': '1.0',
'category': 'Generic Modules/CRM & SRM',
'name': 'Customer & Supplier Relationship Management',
'version': '1.0',
'category': 'Generic Modules/CRM & SRM',
'description': """The generic Open ERP Customer Relationship Management
system enables a group of people to intelligently and efficiently manage
leads, opportunities, meeting, phonecall etc.
@ -41,70 +41,70 @@ appropriate staff, and make sure all future correspondence gets to the right
place.
The CRM module has a email gateway for the synchronisation interface
between mails and Open ERP.""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
between mails and Open ERP.""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': [
'base',
'base_action_rule',
'process',
'mail_gateway',
'base_calendar',
'resource',
],
'base',
'base_action_rule',
'process',
'mail_gateway',
'base_calendar',
'resource',
],
'init_xml': [
'crm_data.xml',
'crm_meeting_data.xml',
'crm_lead_data.xml',
'crm_meeting_data.xml',
'crm_opportunity_data.xml',
'crm_phonecall_data.xml',
],
'crm_data.xml',
'crm_meeting_data.xml',
'crm_lead_data.xml',
'crm_meeting_data.xml',
'crm_opportunity_data.xml',
'crm_phonecall_data.xml',
],
'update_xml': [
'wizard/crm_lead_to_partner_view.xml',
'wizard/crm_lead_to_opportunity_view.xml',
'wizard/crm_lead_to_partner_view.xml',
'wizard/crm_lead_to_opportunity_view.xml',
'wizard/crm_phonecall_to_phonecall_view.xml',
'wizard/crm_phonecall_to_partner_view.xml',
'wizard/crm_phonecall_to_opportunity_view.xml',
'wizard/crm_phonecall_to_phonecall_view.xml',
'wizard/crm_phonecall_to_partner_view.xml',
'wizard/crm_phonecall_to_opportunity_view.xml',
'wizard/crm_opportunity_to_phonecall_view.xml',
'wizard/crm_partner_to_opportunity_view.xml',
'wizard/crm_opportunity_to_phonecall_view.xml',
'wizard/crm_partner_to_opportunity_view.xml',
'wizard/crm_forward_to_partner_view.xml',
'wizard/crm_send_email_view.xml',
'crm_view.xml',
'wizard/crm_forward_to_partner_view.xml',
'wizard/crm_send_email_view.xml',
'crm_view.xml',
'crm_action_rule_view.xml',
'crm_lead_view.xml',
'crm_lead_menu.xml',
'crm_meeting_view.xml',
'crm_meeting_menu.xml',
'crm_phonecall_view.xml',
'crm_phonecall_menu.xml',
'crm_opportunity_view.xml',
'crm_opportunity_menu.xml',
'security/crm_security.xml',
'security/ir.model.access.csv',
'crm_action_rule_view.xml',
'crm_lead_view.xml',
'crm_lead_menu.xml',
'report/crm_lead_report_view.xml',
'report/crm_phonecall_report_view.xml',
'crm_meeting_view.xml',
'crm_meeting_menu.xml',
'process/crm_configuration_process.xml',
'crm_phonecall_view.xml',
'crm_phonecall_menu.xml',
'crm_opportunity_view.xml',
'crm_opportunity_menu.xml',
'security/crm_security.xml',
'security/ir.model.access.csv',
'report/crm_lead_report_view.xml',
'report/crm_phonecall_report_view.xml',
'process/crm_configuration_process.xml',
'crm_installer_view.xml'
],
],
'demo_xml': [
'crm_demo.xml',
'crm_lead_demo.xml',
'crm_meeting_demo.xml',
'crm_opportunity_demo.xml',
'crm_demo.xml',
'crm_lead_demo.xml',
'crm_meeting_demo.xml',
'crm_opportunity_demo.xml',
'crm_phonecall_demo.xml'
],
],
'test': [
# 'test/test_crm_lead.yml',
# 'test/test_crm_meeting.yml',
@ -113,6 +113,6 @@ between mails and Open ERP.""",
],
'installable': True,
'active': False,
'certificate': '0079056041421',
'certificate': '0079056041421',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -202,7 +202,11 @@ class crm_case(object):
return {'value': {'email_from': False}}
address = self.pool.get('res.partner.address').browse(cr, uid, add)
return {'value': {'email_from': address.email}}
def _history(self, cr, uid, cases, keyword, history=False, email=False, details=None, email_from=False, message_id=False, context={}):
mailgate_pool = self.pool.get('mailgate.thread')
return mailgate_pool._history(cr, uid, cases, keyword, history=history, email=email, details=details, email_from=email_from, message_id=message_id, context=context)
def case_open(self, cr, uid, ids, *args):
"""Opens Case
@param self: The object pointer
@ -311,6 +315,107 @@ class crm_case(object):
self._action(cr, uid, cases, 'draft')
return True
def remind_partner(self, cr, uid, ids, context={}, attach=False):
"""
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of Remind Partner's IDs
@param context: A standard dictionary for contextual values
"""
return self.remind_user(cr, uid, ids, context, attach,
destination=False)
def remind_user(self, cr, uid, ids, context={}, attach=False,destination=True):
"""
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of Remind user's IDs
@param context: A standard dictionary for contextual values
"""
for case in self.browse(cr, uid, ids):
if not case.section_id.reply_to:
raise osv.except_osv(_('Error!'), ("Reply To is not specified in the sales team"))
if not case.email_from:
raise osv.except_osv(_('Error!'), ("Partner Email is not specified in Case"))
if case.section_id.reply_to and case.email_from:
src = case.email_from
dest = case.section_id.reply_to
body = ""
body = case.email_last or case.description
if not destination:
src, dest = dest, src
if body and case.user_id.signature:
body += '\n\n%s' % (case.user_id.signature)
body = self.format_body(body)
dest = [dest]
attach_to_send = None
if attach:
attach_ids = self.pool.get('ir.attachment').search(cr, uid, [('res_model', '=', 'mailgate.thread'), ('res_id', '=', case.id)])
attach_to_send = self.pool.get('ir.attachment').read(cr, uid, attach_ids, ['datas_fname','datas'])
attach_to_send = map(lambda x: (x['datas_fname'], base64.decodestring(x['datas'])), attach_to_send)
# Send an email
flag = tools.email_send(
src,
dest,
"Reminder: [%s] %s" % (str(case.id), case.name, ),
body,
reply_to=case.section_id.reply_to,
openobject_id=str(case.id),
attach=attach_to_send
)
self._history(cr, uid, [case], _('Send'), history=True, email=dest, details=body, email_from=src)
#if flag:
# raise osv.except_osv(_('Email!'),("Email Successfully Sent"))
#else:
# raise osv.except_osv(_('Email Fail!'),("Email is not sent successfully"))
return True
def _check(self, cr, uid, ids=False, context={}):
"""
Function called by the scheduler to process cases for date actions
Only works on not done and cancelled cases
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param context: A standard dictionary for contextual values
"""
cr.execute('select * from crm_case \
where (date_action_last<%s or date_action_last is null) \
and (date_action_next<=%s or date_action_next is null) \
and state not in (\'cancel\',\'done\')',
(time.strftime("%Y-%m-%d %H:%M:%S"),
time.strftime('%Y-%m-%d %H:%M:%S')))
ids2 = map(lambda x: x[0], cr.fetchall() or [])
cases = self.browse(cr, uid, ids2, context)
return self._action(cr, uid, cases, False, context=context)
def _action(self, cr, uid, cases, state_to, scrit=None, context={}):
if not context:
context = {}
context['state_to'] = state_to
rule_obj = self.pool.get('base.action.rule')
model_obj = self.pool.get('ir.model')
model_ids = model_obj.search(cr, uid, [('model','=',self._name)])
rule_ids = rule_obj.search(cr, uid, [('name','=',model_ids[0])])
return rule_obj._action(cr, uid, rule_ids, cases, scrit=scrit, context=context)
def format_body(self, body):
return self.pool.get('base.action.rule').format_body(body)
def format_mail(self, obj, body):
return self.pool.get('base.action.rule').format_mail(obj, body)
class crm_case_section(osv.osv):
"""Sales Team"""
@ -506,62 +611,6 @@ def _links_get(self, cr, uid, context=None):
res = obj.read(cr, uid, ids, ['object', 'name'], context)
return [(r['object'], r['name']) for r in res]
class crm_case_log(osv.osv):
""" Case Communication History """
_name = "crm.case.log"
_description = "Case Communication History"
_order = "id desc"
_columns = {
'name': fields.char('Status', size=64),
'date': fields.datetime('Date'),
'section_id': fields.many2one('crm.case.section', 'Section'),
'user_id': fields.many2one('res.users', 'User Responsible', readonly=True),
'model_id': fields.many2one('ir.model', "Model"),
'res_id': fields.integer('Resource ID'),
}
_defaults = {
'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
}
crm_case_log()
class crm_case_history(osv.osv):
"""Case history"""
_name = "crm.case.history"
_description = "Case history"
_order = "id desc"
_inherits = {'crm.case.log': "log_id"}
def _note_get(self, cursor, user, ids, name, arg, context=None):
""" Gives case History Description
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of case Historys IDs
@param context: A standard dictionary for contextual values
"""
res = {}
for hist in self.browse(cursor, user, ids, context or {}):
res[hist.id] = (hist.email_from or '/') + ' (' + str(hist.date) + ')\n'
res[hist.id] += (hist.description or '')
return res
_columns = {
'description': fields.text('Description'),
'note': fields.function(_note_get, method=True, string="Description", type="text"),
'email_to': fields.char('Email To', size=84),
'email_from' : fields.char('Email From', size=84),
'log_id': fields.many2one('crm.case.log','Log',ondelete='cascade'),
'message_id': fields.char('Message Id', size=1024, readonly=True, help="Message Id on Email Server.", select=True),
}
crm_case_history()
class users(osv.osv):
_inherit = 'res.users'
_description = "Users"

View File

@ -34,138 +34,24 @@ from osv.orm import except_orm
import crm
class case(osv.osv):
""" Case """
_inherit = 'mailgate.thread'
_description = 'case'
_columns = {
'date_action_last': fields.datetime('Last Action', readonly=1),
'date_action_next': fields.datetime('Next Action', readonly=1),
}
def remind_partner(self, cr, uid, ids, context={}, attach=False):
"""
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of Remind Partner's IDs
@param context: A standard dictionary for contextual values
"""
return self.remind_user(cr, uid, ids, context, attach,
destination=False)
def remind_user(self, cr, uid, ids, context={}, attach=False,destination=True):
"""
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of Remind user's IDs
@param context: A standard dictionary for contextual values
"""
for case in self.browse(cr, uid, ids):
if not case.section_id.reply_to:
raise osv.except_osv(_('Error!'), ("Reply To is not specified in the sales team"))
if not case.email_from:
raise osv.except_osv(_('Error!'), ("Partner Email is not specified in Case"))
if case.section_id.reply_to and case.email_from:
src = case.email_from
dest = case.section_id.reply_to
body = ""
body = case.email_last or case.description
if not destination:
src, dest = dest, src
if body and case.user_id.signature:
body += '\n\n%s' % (case.user_id.signature)
body = self.format_body(body)
dest = [dest]
attach_to_send = None
if attach:
attach_ids = self.pool.get('ir.attachment').search(cr, uid, [('res_model', '=', 'mailgate.thread'), ('res_id', '=', case.id)])
attach_to_send = self.pool.get('ir.attachment').read(cr, uid, attach_ids, ['datas_fname','datas'])
attach_to_send = map(lambda x: (x['datas_fname'], base64.decodestring(x['datas'])), attach_to_send)
# Send an email
flag = tools.email_send(
src,
dest,
"Reminder: [%s] %s" % (str(case.id), case.name, ),
body,
reply_to=case.section_id.reply_to,
openobject_id=str(case.id),
attach=attach_to_send
)
self._history(cr, uid, [case], _('Send'), history=True, email=dest, details=body, email_from=src)
#if flag:
# raise osv.except_osv(_('Email!'),("Email Successfully Sent"))
#else:
# raise osv.except_osv(_('Email Fail!'),("Email is not sent successfully"))
return True
def _check(self, cr, uid, ids=False, context={}):
"""
Function called by the scheduler to process cases for date actions
Only works on not done and cancelled cases
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param context: A standard dictionary for contextual values
"""
cr.execute('select * from crm_case \
where (date_action_last<%s or date_action_last is null) \
and (date_action_next<=%s or date_action_next is null) \
and state not in (\'cancel\',\'done\')',
(time.strftime("%Y-%m-%d %H:%M:%S"),
time.strftime('%Y-%m-%d %H:%M:%S')))
ids2 = map(lambda x: x[0], cr.fetchall() or [])
cases = self.browse(cr, uid, ids2, context)
return self._action(cr, uid, cases, False, context=context)
def _action(self, cr, uid, cases, state_to, scrit=None, context={}):
if not context:
context = {}
context['state_to'] = state_to
rule_obj = self.pool.get('base.action.rule')
model_obj = self.pool.get('ir.model')
model_ids = model_obj.search(cr, uid, [('model','=',self._name)])
rule_ids = rule_obj.search(cr, uid, [('name','=',model_ids[0])])
return rule_obj._action(cr, uid, rule_ids, cases, scrit=scrit, context=context)
def format_body(self, body):
return self.pool.get('base.action.rule').format_body(body)
def format_mail(self, obj, body):
return self.pool.get('base.action.rule').format_mail(obj, body)
case()
class base_action_rule(osv.osv):
""" Base Action Rule """
_inherit = 'base.action.rule'
_description = 'Action Rules'
_columns = {
'trg_section_id': fields.many2one('crm.case.section', 'Sales Team'),
'trg_max_history': fields.integer('Maximum Communication History'),
'trg_categ_id': fields.many2one('crm.case.categ', 'Category'),
'regex_history' : fields.char('Regular Expression on Case History', size=128),
'act_section_id': fields.many2one('crm.case.section', 'Set Team to'),
'act_categ_id': fields.many2one('crm.case.categ', 'Set Category to'),
'act_mail_to_partner': fields.boolean('Mail to partner',help="Check \
this if you want the rule to send an email to the partner."),
'trg_section_id': fields.many2one('crm.case.section', 'Sales Team'),
'trg_max_history': fields.integer('Maximum Communication History'),
'trg_categ_id': fields.many2one('crm.case.categ', 'Category'),
'regex_history' : fields.char('Regular Expression on Case History', size=128),
'act_section_id': fields.many2one('crm.case.section', 'Set Team to'),
'act_categ_id': fields.many2one('crm.case.categ', 'Set Category to'),
'act_mail_to_partner': fields.boolean('Mail to Partner', help="Check \
this if you want the rule to send an email to the partner."),
}
def email_send(self, cr, uid, obj, emails, body, emailfrom=tools.config.get('email_from',False), context={}):
def email_send(self, cr, uid, obj, emails, body, emailfrom=tools.config.get('email_from', False), context={}):
body = self.format_mail(obj, body)
if not emailfrom:
if hasattr(obj, 'user_id') and obj.user_id and obj.user_id.address_id and obj.user_id.address_id.email:
@ -178,7 +64,7 @@ this if you want the rule to send an email to the partner."),
else:
reply_to = emailfrom
if not emailfrom:
raise osv.except_osv(_('Error!'),
raise osv.except_osv(_('Error!'),
_("No E-Mail ID Found for your Company address!"))
return tools.email_send(emailfrom, emails, name, body, reply_to=reply_to, openobject_id=str(obj.id))
@ -253,7 +139,7 @@ this if you want the rule to send an email to the partner."),
@param context: A standard dictionary for contextual values """
res = super(base_action_rule, self).state_get(cr, uid, context=context)
return res + [('escalate','Escalate')] + crm.AVAILABLE_STATES
return res + [('escalate', 'Escalate')] + crm.AVAILABLE_STATES
def priority_get(self, cr, uid, context={}):

View File

@ -34,7 +34,8 @@ class crm_lead(osv.osv, crm_case):
_name = "crm.lead"
_description = "Leads Cases"
_order = "priority, id desc"
_inherit = ['res.partner.address', 'mailgate.thread']
_inherit = ['res.partner.address']
_inherits = {'mailgate.thread': 'thread_id'}
def _compute_day(self, cr, uid, ids, fields, args, context={}):
"""
@ -74,7 +75,7 @@ class crm_lead(osv.osv, crm_case):
duration = float(ans.days)
if lead.section_id and lead.section_id.resource_calendar_id:
duration = float(ans.days) * 24
duration = float(ans.days) * 24
new_dates = cal_obj.interval_get(cr,
uid,
lead.section_id.resource_calendar_id and lead.section_id.resource_calendar_id.id or False,
@ -95,18 +96,23 @@ class crm_lead(osv.osv, crm_case):
_columns = {
# From crm.case
'email_from': fields.char('Email', size=128, help="These people will receive email."),
'name': fields.char('Name', size=64),
'active': fields.boolean('Active', required=False),
'date_action_last': fields.datetime('Last Action', readonly=1),
'date_action_next': fields.datetime('Next Action', readonly=1),
'email_from': fields.char('Email', size=128, help="These people will receive email."),
'section_id': fields.many2one('crm.case.section', 'Sales Team', \
select=True, help='Sales team to which Case belongs to.\
Define Responsible user and Email account for mail gateway.'),
Define Responsible user and Email account for mail gateway.'),
'create_date': fields.datetime('Creation Date' , readonly=True),
'email_cc': fields.text('Watchers Emails', size=252 , help="These \
people will receive a copy of the future communication between partner \
and users by email"),
'description': fields.text('Notes'),
'write_date': fields.datetime('Update Date' , readonly=True),
'description': fields.text('Description'),
'write_date': fields.datetime('Update Date' , readonly=True),
# Lead fields
# Lead fields
'thread_id': fields.many2one('mailgate.thread', 'Thread', required=False),
'categ_id': fields.many2one('crm.case.categ', 'Lead Source', \
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.lead')]"),
@ -117,22 +123,22 @@ and users by email"),
'type':fields.selection([
('lead','Lead'),
('opportunity','Opportunity'),
],'Type', help="Type is used to separate Leads and Opportunities"),
],'Type', help="Type is used to separate Leads and Opportunities"),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
'date_closed': fields.datetime('Closed', readonly=True),
'stage_id': fields.many2one('crm.case.stage', 'Stage', \
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.lead')]"),
'user_id': fields.many2one('res.users', 'Salesman'),
'user_id': fields.many2one('res.users', 'Salesman',help='By Default Salesman is Administrator when create New User'),
'referred': fields.char('Referred By', size=64),
'date_open': fields.datetime('Opened', readonly=True),
'day_open': fields.function(_compute_day, string='Days to Open', \
method=True, multi='day_open', type="float", store=True),
'day_close': fields.function(_compute_day, string='Days to Close', \
method=True, multi='day_close', type="float", store=True),
'function_name': fields.char('Function', size=64),
'state': fields.selection(crm.AVAILABLE_STATES, 'State', size=16, readonly=True,
'function_name': fields.char('Function', size=64),
'state': fields.selection(crm.AVAILABLE_STATES, 'State', size=16, readonly=True,
help='The state is set to \'Draft\', when a case is created.\
\nIf the case is in progress the state is set to \'Open\'.\
\nWhen the case is over, the state is set to \'Done\'.\
@ -140,15 +146,15 @@ and users by email"),
}
_defaults = {
'active': lambda *a: 1,
'user_id': crm_case._get_default_user,
'email_from': crm_case._get_default_email,
'state': lambda *a: 'draft',
'section_id': crm_case._get_section,
'active': lambda *a: 1,
'user_id': crm_case._get_default_user,
'email_from': crm_case._get_default_email,
'state': lambda *a: 'draft',
'section_id': crm_case._get_section,
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.lead', context=c),
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
}
def case_open(self, cr, uid, ids, *args):
"""Overrides cancel for crm_case for setting Open Date
@param self: The object pointer
@ -160,7 +166,7 @@ and users by email"),
res = super(crm_lead, self).case_open(cr, uid, ids, *args)
self.write(cr, uid, ids, {'date_open': time.strftime('%Y-%m-%d %H:%M:%S')})
return res
def case_close(self, cr, uid, ids, *args):
"""Overrides close for crm_case for setting close date
@param self: The object pointer

View File

@ -9,7 +9,7 @@
<field name="domain">['|', ('type','=','lead'), ('type','=',False)]</field>
<field name="view_id" ref="crm_case_tree_view_leads"/>
<field name="search_view_id" ref="crm.view_crm_case_leads_filter"/>
<field name="context">{'search_default_current':1}</field>
<field name="context">{'search_default_current':1, 'default_type': 'lead'}</field>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_tree_view_leads_all">

View File

@ -2,7 +2,7 @@
<openerp>
<data>
<!--Lead Stage Form view -->
<!--Lead Stage Form view -->
<record id="crm_lead_stage_act" model="ir.actions.act_window">
<field name="name">Lead Stages</field>
@ -16,7 +16,7 @@
groups="base.group_extended"
parent="crm.menu_crm_case_stage" />
<!-- Resource Type Form View -->
<!-- Resource Type Form View -->
<record id="crm_lead_resource_act" model="ir.actions.act_window">
<field name="name">Lead Resource Type</field>
@ -31,7 +31,7 @@
groups="base.group_extended"
parent="crm.menu_crm_case_resource_type" />
<!-- CRM Lead Form View -->
<!-- CRM Lead Form View -->
<record model="ir.ui.view" id="crm_case_form_view_leads">
<field name="name">CRM - Leads Form</field>
@ -47,7 +47,7 @@
name="convert_opportunity"
string="Convert"
help="Convert to Opportunity"
icon="gtk-index"
icon="gtk-index"
type="object"/>
<newline />
<field name="section_id" colspan="1"
@ -175,7 +175,7 @@
<field name="email_to"/>
<field name="description"/>
</tree>
</field>
</field>
<button colspan="2" string="Send New Email"
name="%(action_crm_send_mail)d"
context="{'mail':'new', 'model': 'crm.lead'}"
@ -190,7 +190,7 @@
</field>
</record>
<!-- CRM Lead Tree View -->
<!-- CRM Lead Tree View -->
<record model="ir.ui.view" id="crm_case_tree_view_leads">
<field name="name">CRM - Leads Tree</field>
@ -238,7 +238,7 @@
</field>
</record>
<!-- CRM Lead Calendar View -->
<!-- CRM Lead Calendar View -->
<record model="ir.ui.view" id="crm_case_calendar_view_leads">
<field name="name">CRM - Leads Calendar</field>
@ -256,7 +256,7 @@
</field>
</record>
<!-- CRM Lead Search View -->
<!-- CRM Lead Search View -->
<record id="view_crm_case_leads_filter" model="ir.ui.view">
<field name="name">CRM - Leads Search</field>
@ -326,6 +326,5 @@
</field>
</record>
</data>
</openerp>

View File

@ -43,7 +43,8 @@ class crm_meeting(osv.osv, crm_case):
_name = 'crm.meeting'
_description = "Meeting Cases"
_order = "id desc"
_inherit = ["mailgate.thread", "calendar.event"]
_inherit = ["calendar.event"]
_inherits = {'mailgate.thread': 'thread_id'}
_columns = {
# From crm.case
@ -58,6 +59,7 @@ class crm_meeting(osv.osv, crm_case):
'id': fields.integer('ID'),
# Meeting fields
'thread_id': fields.many2one('mailgate.thread', 'Thread', required=False),
'categ_id': fields.many2one('crm.case.categ', 'Meeting Type', \
domain="[('object_id.model', '=', 'crm.meeting')]", \
),
@ -157,6 +159,22 @@ class calendar_attendee(osv.osv):
calendar_attendee()
class res_users(osv.osv):
_name = 'res.users'
_inherit = 'res.users'
def create(self, cr, uid, data, context={}):
user_id = super(res_users, self).create(cr, uid, data, context)
data_obj = self.pool.get('ir.model.data')
data_id = data_obj._get_id(cr, uid, 'crm', 'ir_ui_view_sc_calendar0')
view_id = data_obj.browse(cr, uid, data_id, context=context).res_id
copy_id = self.pool.get('ir.ui.view_sc').copy(cr, uid, view_id, default = {
'user_id': user_id}, context=context)
return user_id
res_users()
class res_partner(osv.osv):
""" Inherits partner and adds meetings information in the partner form """
_inherit = 'res.partner'

View File

@ -110,7 +110,8 @@
<menuitem id="menu_attendee_invitations"
name="Meeting Invitations" parent="crm.menu_meeting_sale"
sequence="10" action="action_view_attendee_form" />
sequence="10" action="action_view_attendee_form"
groups="base.group_extended" />
</data>
</openerp>

View File

@ -24,18 +24,18 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Meetings">
<group col="6" colspan="4">
<group col="6" colspan="4">
<field name="name" select="1" string="Summary"
colspan="2" />
required="1" colspan="2" />
<field name="categ_id" widget="selection"
string="Meeting Type"
groups="base.group_extended"
domain="[('object_id.model', '=', 'crm.meeting')]" />
<field name="allday" colspan="2" on_change="onchange_allday(allday)" />
<field name="date" string="Start Date" required="1"
on_change="onchange_dates(date,duration,False)" />
<field name="allday" colspan="2" on_change="onchange_allday(allday)" />
<field name="date" string="Start Date" required="1"
on_change="onchange_dates(date,duration,False,allday)" />
<field name="duration" widget="float_time"
on_change="onchange_dates(date,duration,False)" />
on_change="onchange_dates(date,duration,False,allday)" />
<field name="date_deadline" string="End Date"
required="1"
on_change="onchange_dates(date,False,date_deadline)" />
@ -50,6 +50,10 @@
attrs="{'invisible':[('rrule_type','in', ('none', False))]}"
name="open_meeting" icon="gtk-edit"
type="object" />
<button string="ExRule"
name="%(base_calendar.action_base_calendar_set_exrule)d" icon="gtk-zoom-out" type="action"
context="{'model' : 'crm.meeting'}"
attrs="{'invisible':[('rrule_type','in', ('none', False))]}"/>
</group>
</group>
<group col="4" colspan="4" name="rrule" attrs="{'invisible': [('rrule_type','!=','custom')]}">
@ -213,7 +217,6 @@
<field name="partner_id" string="Partner" />
<field name="date" string="Meeting Date" />
<field name="duration" />
<field name="user_id" />
<field name="state"/>
</tree>
</field>
@ -324,7 +327,7 @@
</field>
</field>
</record>
<!-- Partners inherited form -->
<record id="view_meeting_partner_info_form" model="ir.ui.view">

View File

@ -2,16 +2,6 @@
<openerp>
<data noupdate="1">
<act_window
id="act_crm_opportunity_crm_meeting_new"
name="Meetings"
res_model="crm.meeting"
src_model="crm.lead"
view_mode="tree,form,calendar,"
context="{'default_duration': 4.0, 'default_opportunity_id': active_id}"
domain="[('user_id','=',uid), ('opportunity_id', '=', active_id)]"
view_type="form"/>
<act_window
id="act_crm_opportunity_crm_phonecall_new"
name="Phone calls"
@ -22,12 +12,22 @@
domain="[('user_id','=',uid),('opportunity_id', '=', active_id)]"
view_type="form"/>
<act_window
id="act_crm_opportunity_crm_meeting_new"
name="Meetings"
res_model="crm.meeting"
src_model="crm.lead"
view_mode="tree,form,calendar,"
context="{'default_duration': 4.0, 'default_opportunity_id': active_id}"
domain="[('user_id','=',uid), ('opportunity_id', '=', active_id)]"
view_type="form"/>
<record model="ir.actions.act_window" id="crm_case_category_act_oppor11">
<field name="name">Opportunities</field>
<field name="res_model">crm.lead</field>
<field name="view_mode">tree,form,graph</field>
<field name="domain">[('type','=','opportunity')]</field>
<field name="context">{'search_default_current':1}</field>
<field name="context">{'search_default_current':1, 'default_type': 'opportunity'}</field>
<field name="view_id" ref="crm_case_tree_view_oppor"/>
<field name="search_view_id" ref="crm.view_crm_case_opportunities_filter"/>
</record>

View File

@ -2,7 +2,7 @@
<openerp>
<data>
<!-- Opportunity Categories Form View -->
<!-- Opportunity Categories Form View -->
<record id="crm_opportunity_categ_action" model="ir.actions.act_window">
<field name="name">Opportunity Categories</field>
@ -17,7 +17,7 @@
id="menu_crm_case_opportunity-act"
parent="crm.menu_crm_case_categ" />
<!-- Opportunity Stages Form View-->
<!-- Opportunity Stages Form View-->
<record id="crm_opportunity_stage_act" model="ir.actions.act_window">
<field name="name">Opportunity Stages</field>
@ -32,7 +32,7 @@
id="menu_crm_opportunity_stage_act"
parent="crm.menu_crm_case_stage" />
<!-- Opportunity Resource Type Form View -->
<!-- Opportunity Resource Type Form View -->
<record id="crm_opportunity_resource_act" model="ir.actions.act_window">
<field name="name">Opportunity Resource Type</field>
@ -47,7 +47,7 @@
id="menu_crm_opportunity_resource_act"
parent="crm.menu_crm_case_resource_type" />
<!-- Opportunities Form View -->
<!-- Opportunities Form View -->
<record model="ir.ui.view" id="crm_case_form_view_oppor">
<field name="name">Opportunities</field>
@ -56,7 +56,7 @@
<field name="arch" type="xml">
<form string="Opportunities">
<group colspan="4" col="7">
<field name="name" string="Opportunity"/>
<field name="name" required="1" string="Opportunity"/>
<label string="Stage:" align="1.0"/>
<group colspan="1" col="4">
<field name="stage_id" nolabel="1"
@ -204,7 +204,7 @@
</field>
</record>
<!-- Opportunities Tree View -->
<!-- Opportunities Tree View -->
<record model="ir.ui.view" id="crm_case_tree_view_oppor">
<field name="name">Opportunities Tree</field>
@ -216,7 +216,7 @@
<field name="name" string="Opportunity"/>
<field name="partner_id"/>
<field name="stage_id"/>
<field name="categ_id" invisible="1"/>
<field name="categ_id" invisible="1" groups="base.group_extended"/>
<button name="stage_previous" string="Previous"
states="open,pending" type="object" icon="gtk-go-back" />
<button name="stage_next" string="Next"
@ -245,7 +245,7 @@
</field>
</record>
<!-- Opportunities Graph View -->
<!-- Opportunities Graph View -->
<record model="ir.ui.view" id="crm_case_graph_view_opportunity">
<field name="name">CRM - Opportunity Graph</field>
@ -260,7 +260,7 @@
</field>
</record>
<!-- Opportunities Search View -->
<!-- Opportunities Search View -->
<record id="view_crm_case_opportunities_filter" model="ir.ui.view">
<field name="name">CRM - Opportunities Search</field>
@ -292,44 +292,41 @@
<field name="user_id" widget="selection">
<filter icon="terp-partner"
domain="[('user_id','=',uid)]"
help="My Opportunities" default="1"
/>
help="My Opportunities" default="1"/>
<filter icon="terp-partner"
domain="[('user_id','=', False)]"
help="Unassigned Opportunities" />
domain="[('user_id','=', uid)]"
help="Unassigned Opportunities"/>
</field>
<field name="section_id"
default="context.get('section_id', False)" select="1"
widget="selection">
<filter icon="terp-crm"
domain="[('section_id','=',context.get('section_id',False))]"
help="My section" />
help="My section"/>
</field>
<newline/>
<group expand="0" string="Group By..." colspan="16">
<filter string="Stage" icon="terp-crm" domain="[]"
context="{'group_by':'stage_id'}" />
context="{'group_by':'stage_id'}"/>
<filter string="Priority" icon="terp-crm" domain="[]"
context="{'group_by':'priority'}" />
context="{'group_by':'priority'}"/>
<filter string="Category" icon="terp-crm"
domain="[]" context="{'group_by':'categ_id'}" />
domain="[]" context="{'group_by':'categ_id'}"/>
<separator orientation="vertical" />
<filter string="Partner" icon="terp-crm" domain="[]"
context="{'group_by':'partner_id'}" />
<separator orientation="vertical"/>
<filter string="Salesman" icon="terp-crm"
domain="[('user_id','=',uid)]" context="{'group_by':'user_id'}" />
<separator orientation="vertical" />
domain="[('user_id','=',uid)]" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Creation" icon="terp-project"
domain="[]" context="{'group_by':'create_date'}" />
domain="[]" context="{'group_by':'create_date'}"/>
<filter string="Exp.Closing" icon="terp-project"
domain="[]" context="{'group_by':'date_deadline'}" />
domain="[]" context="{'group_by':'date_deadline'}"/>
</group>
</search>
</field>
</record>
<!-- Partners inherited form -->
<!-- Partners inherited form -->
<record id="view_opp_partner_info_form" model="ir.ui.view">
<field name="name">res.partner.opportunity.info.inherit</field>
@ -382,6 +379,5 @@
</field>
</record>
</data>
</openerp>

View File

@ -31,10 +31,13 @@ class crm_phonecall(osv.osv, crm_case):
_name = "crm.phonecall"
_description = "Phonecall Cases"
_order = "id desc"
_inherit = 'mailgate.thread'
_inherits = {'mailgate.thread': 'thread_id'}
_columns = {
# From crm.case
'name': fields.char('Name', size=64),
'active': fields.boolean('Active', required=False),
'thread_id': fields.many2one('mailgate.thread', 'Thread', required=False),
'section_id': fields.many2one('crm.case.section', 'Sales Team', \
select=True, help='Sales team to which Case belongs to.\
Define Responsible user and Email account for mail gateway.'),

View File

@ -10,6 +10,7 @@
view_mode="calendar,tree,form"
context="{'default_partner_id': active_id, 'default_duration': 1.0}"
domain="[('partner_id', '=', active_id)]"
groups="base.group_extended"
/>
<!-- PHONE CALLS (menu) -->

View File

@ -16,30 +16,28 @@
<field name="arch" type="xml">
<form string="Sales Team">
<group col="6" colspan="4">
<field name="name" select="1" colspan="4"/>
<field name="name" select="1" colspan="2"/>
<field name="parent_id" select="2" widget="selection"/>
<field name="code" select="1"/>
<newline/>
<field name="resource_calendar_id" select="2"/>
<field name="user_id" select="2"/>
<field name="resource_calendar_id" select="2" widget="selection"/>
<field name="active" select="2"/>
</group>
<notebook colspan="4">
<page string="Sales Team">
<group col="2" colspan="1">
<separator string="Responsible" colspan="2"/>
<field name="parent_id" select="2" widget="selection"/>
<field name="user_id" select="2"/>
</group>
<group col="2" colspan="1">
<separator string="Contact Information" colspan="2"/>
<separator string="Mailgateway" colspan="2"/>
<field name="reply_to" select="2"/>
</group>
<group col="2" colspan="1">
<separator string="Sales Team Property" colspan="2"/>
<field name="active" select="2"/>
<separator string="Configuration" colspan="2"/>
<field name="allow_unlink" select="2"/>
</group>
<separator string="Members List" colspan="4"/>
<separator string="Team Members" colspan="4"/>
<field name="member_ids" nolabel="1" colspan="4"/>
<separator string="Note" colspan="4"/>
</page>
<page string="Notes">
<field name="note" select="1" colspan="4" nolabel="1"/>
</page>
</notebook>
@ -47,7 +45,7 @@
</field>
</record>
<!-- Case Sections Tree View -->
<!-- Case Sections Tree View -->
<record id="crm_case_section_view_tree" model="ir.ui.view">
<field name="name">crm.case.section.tree</field>
@ -63,7 +61,7 @@
</field>
</record>
<!-- Case Sections Action -->
<!-- Case Sections Action -->
<record id="crm_case_section_act" model="ir.actions.act_window">
<field name="name">Sales Team</field>
@ -72,7 +70,7 @@
<field name="view_id" ref="crm_case_section_view_tree"/>
</record>
<!-- CRM Stage Tree View -->
<!-- CRM Stage Tree View -->
<record model="ir.ui.view" id="crm_case_stage_tree">
<field name="name">crm.case.stage.tree</field>
@ -89,7 +87,7 @@
</field>
</record>
<!-- CRM Stage Form View -->
<!-- CRM Stage Form View -->
<record model="ir.ui.view" id="crm_case_stage_form">
<field name="name">crm.case.stage.form</field>
@ -110,7 +108,7 @@
</field>
</record>
<!-- CRM Stage Action -->
<!-- CRM Stage Action -->
<record id="crm_case_stage_act" model="ir.actions.act_window">
<field name="name">Stages</field>
@ -121,8 +119,7 @@
<menuitem id="menu_crm_case_stage" name="Stages" parent="base.menu_crm_configuration" groups="base.group_extended"/>
<!-- Case Categories Form View -->
<!-- Case Categories Form View -->
<record id="crm_case_categ-view" model="ir.ui.view">
<field name="name">crm.case.categ.form</field>
@ -137,7 +134,7 @@
</field>
</record>
<!-- Case Categories Tree View -->
<!-- Case Categories Tree View -->
<record id="crm_case_categ_tree-view" model="ir.ui.view">
<field name="name">crm.case.categ.tree</field>
@ -151,7 +148,7 @@
</field>
</record>
<!-- Case Categories Action -->
<!-- Case Categories Action -->
<record id="crm_case_categ-act" model="ir.actions.act_window">
<field name="name">Categories</field>
@ -166,7 +163,7 @@
parent="base.menu_crm_configuration" />
<!-- Resource Type of case Tree View -->
<!-- Resource Type of case Tree View -->
<record model="ir.ui.view" id="crm_case_resource_type_tree">
<field name="name">crm.case.resource.type.tree</field>
@ -181,7 +178,7 @@
</field>
</record>
<!-- Resource Type of case Form View -->
<!-- Resource Type of case Form View -->
<record model="ir.ui.view" id="crm_case_resource_type_form">
<field name="name">crm.case.resource.type.form</field>
@ -196,7 +193,7 @@
</field>
</record>
<!-- Resource Type of case Action -->
<!-- Resource Type of case Action -->
<record id="crm_case_resource_type_act" model="ir.actions.act_window">
<field name="name">Resource Type</field>
@ -215,7 +212,7 @@
<field name="view_id" ref="crm_case_section_view_tree"/>
</record>
<!-- Cases Tree View -->
<!-- Cases Tree View -->
<record id="crm_case_log_tree-view" model="ir.ui.view">
<field name="name">crm.case.log.tree</field>
@ -235,320 +232,7 @@
</field>
</record>
<!--Case History Tree View -->
<record id="crm_case_history_tree-view" model="ir.ui.view">
<field name="name">crm.case.history.tree</field>
<field name="model">crm.case.history</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Case History">
<field name="date"/>
<field name="name"/>
<field name="user_id"/>
<!--
<field name="som"/>
<field name="canal_id"/>
-->
</tree>
</field>
</record>
<!-- Case Calendar View -->
<record id="crm_case_calendar-view" model="ir.ui.view">
<field name="name">crm.case.calendar</field>
<field name="model">mailgate.thread</field>
<field name="type">calendar</field>
<field name="arch" type="xml">
<calendar color="user_id" date_start="create_date"
date_stop="date_deadline" day_length="12"
string="Cases">
<field name="name" />
<field name="partner_id" />
<field name="state" />
</calendar>
</field>
</record>
<!-- Case Tree View -->
<record id="crm_case_tree-view" model="ir.ui.view">
<field name="name">crm.case.tree</field>
<field name="model">mailgate.thread</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree colors="red:date_deadline&lt;current_date and state=='open';black:state in ('draft', 'cancel','done','pending')" string="Cases">
<field name="id"/>
<field name="section_id"/>
<field name="create_date"/>
<field name="date_deadline"/>
<field name="name"/>
<field name="partner_id"/>
<field name="user_id"/>
<field name="state"/>
<button name="case_close"
states="open,draft,pending" string="Close"
type="object" icon="gtk-close" />
<button name="case_open" states="draft,pending"
string="Open" type="object" icon="gtk-go-forward" />
<button name="case_cancel"
states="draft,open,pending" string="Cancel"
type="object" icon="gtk-cancel" />
<button name="case_pending" states="draft,open"
string="Pending" type="object"
icon="gtk-media-pause" />
<button name="case_escalate"
states="open,draft,pending" string="Escalate"
groups="base.group_extended"
type="object" icon="gtk-go-up" />
<button name="case_reset" states="done,cancel"
string="Reset to Draft" type="object"
icon="gtk-convert" />
</tree>
</field>
</record>
<!-- Case Form View -->
<record id="crm_case-view" model="ir.ui.view">
<field name="name">crm.case.form</field>
<field name="model">mailgate.thread</field>
<field name="type">form</field>
<field name="priority" eval="1"/>
<field name="arch" type="xml">
<form string="Cases">
<field colspan="4" name="name" select="1"/>
<field colspan="2" name="section_id" widget="selection"/>
<field name="create_date" select="1"/>
<field name="date_deadline"/>
<newline />
<notebook colspan="4">
<page string="General">
<group col="8" colspan="4">
<field colspan="4" name="partner_id"
on_change="onchange_partner_id(partner_id, email_from)"
select="1" />
<field colspan="3"
name="partner_address_id"
on_change="onchange_partner_address_id(partner_address_id, email_from)"
/>
<newline />
<field colspan="3" name="email_from"
/>
<button name="remind_partner"
states="open,pending"
string="Send Reminder" type="object"
icon="gtk-go-forward" />
<field name="user_id" select="1" />
<button name="remind_user"
states="open,pending"
string="Send Reminder" type="object"
icon="gtk-go-forward" />
</group>
<separator colspan="4" string="Description"/>
<field name="description" colspan="4" nolabel="1"/>
<separator colspan="4"/>
<group col="8" colspan="4">
<field name="state" select="1"/>
<button name="case_close"
states="open,draft,pending"
string="Close" type="object"
icon="gtk-close" />
<button name="case_open"
states="draft,pending" string="Open"
type="object" icon="gtk-go-forward" />
<button name="case_cancel"
states="draft,open,pending"
string="Cancel" type="object"
icon="gtk-cancel" />
<button name="case_pending"
states="draft,open" string="Pending"
type="object" icon="gtk-media-pause" />
<button name="case_escalate"
states="open,draft,pending"
string="Escalate" type="object"
groups="base.group_extended"
icon="gtk-go-up" />
<button name="case_reset"
states="done,cancel"
string="Reset to Draft" type="object"
icon="gtk-convert" />
</group>
</page>
<page string="History" groups="base.group_extended">
<field name="id" select="1"/>
<field name="active"/>
<separator colspan="4" string="Dates"/>
<field name="create_date"/>
<field colspan="4" name="log_ids" nolabel="1">
<form string="Actions">
<separator colspan="4" string="Action Information"/>
<field colspan="4" name="name"/>
<field name="date"/>
<field name="user_id"/>
</form>
</field>
</page>
<page string="Emails" groups="base.group_extended">
<group colspan="4">
<field colspan="4" name="email_cc" string="CC"/>
</group>
<field name="message_ids" colspan="4" nolabel="1" mode="form,tree">
<form string="Communication history">
<group col="6" colspan="4">
<field name="date"/>
<field name="email_to"/>
<field name="email_from"/>
</group>
<newline/>
<field name="description" colspan="4" nolabel="1"/>
<button colspan="4"
string="Reply to Last Email"
name="%(action_crm_send_mail)d"
context="{'mail':'reply', 'model': 'crm.case'}"
icon="gtk-undo" type="action" />
</form>
<tree string="Communication history">
<field name="description"/>
<field name="email_to"/>
<field name="date"/>
</tree>
</field>
<button colspan="4" string="Send New Email"
name="%(action_crm_send_mail)d"
context="{'mail':'new', 'model': 'crm.case'}"
icon="gtk-go-forward" type="action" />
</page>
</notebook>
</form>
</field>
</record>
<!-- Case Search View -->
<record id="view_crm_case_filter" model="ir.ui.view">
<field name="name">crm.case.select</field>
<field name="model">mailgate.thread</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Case">
<group col='6' colspan='4'>
<filter icon="terp-partner" string="My Cases"
domain="[('user_id','=',uid)]" separator="1"
default="1" help="Cases Related to Current User" />
<field name="state" select="1">
<filter icon="gtk-new"
domain="[('state','in',('draft', 'open'))]"
help="Current Cases" />
<filter icon="gtk-yes"
domain="[('state','=','open')]" help="Open Cases" />
<filter icon="gtk-media-pause"
domain="[('state','=','pending')]"
help="Pending Cases" />
</field>
<separator orientation="vertical" />
<field name="name" select='1' />
<field name="user_id" select="1"
widget="selection" />
</group>
<field name="section_id"
default="context.get('section_id', False)" select="1"
widget="selection"/>
</search>
</field>
</record>
<record id="crm_case_categ0-act" model="ir.actions.act_window">
<field name="name">Cases</field>
<field name="res_model">mailgate.thread</field>
<field name="view_type">form</field>
<field name="view_id" ref="crm_case_tree-view"/>
<field name="search_view_id" ref="view_crm_case_filter"/>
</record>
<record id="crm_case_categ0-act_open" model="ir.actions.act_window">
<field name="name">Open Cases</field>
<field name="res_model">mailgate.thread</field>
<field name="view_type">form</field>
<field name="domain">
[('state','&lt;&gt;','done'),('state','&lt;&gt;','cancel'),('state','&lt;&gt;','pending')]
</field>
<field name="search_view_id" ref="view_crm_case_filter"/>
</record>
<record id="crm_case_section_open_act" model="ir.actions.act_window">
<field name="name">Cases</field>
<field name="res_model">mailgate.thread</field>
<field name="domain">[('section_id','child_of',[active_id])]</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar</field>
</record>
<record id="ir_open_section_case" model="ir.values">
<field eval="'tree_but_open'" name="key2"/>
<field eval="'crm.case.section'" name="model"/>
<field name="name">Open Cases</field>
<field eval="'ir.actions.act_window,%d'%crm_case_section_open_act" name="value"/>
<field eval="True" name="object"/>
</record>
<!--Case History Form View -->
<record id="crm_case_history-view" model="ir.ui.view">
<field name="name">crm.case.history.form</field>
<field name="model">crm.case.history</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Cases">
<separator colspan="4" string="Case Description"/>
<field colspan="4" name="name" select="1"/>
<field name="date" select="1"/>
<field name="user_id" select="1"/>
<field name="model_id"/>
<field name="res_id"/>
<field name="som"/>
<field name="canal_id"/>
<field colspan="4" name="description"/>
</form>
</field>
</record>
<!--Case History Search View -->
<record id="crm_case_history_search" model="ir.ui.view">
<field name="name">crm.case.history.select</field>
<field name="model">crm.case.history</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Histories">
<filter icon="terp-crm" string="My Histories"
domain="[('user_id','=',uid)]"
help="My Histories" />
<separator orientation="vertical"/>
<group col="6" colspan="2">
<field name="date" select="1"/>
<field name="user_id" select="1" widget="selection"/>
<field name="section_id"
default="context.get('section_id', False)"
select="1" widget="selection"/>
</group>
</search>
</field>
</record>
<!--Case History Action -->
<record id="crm_case_history-act" model="ir.actions.act_window">
<field name="name">Histories</field>
<field name="res_model">crm.case.history</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="crm_case_history_tree-view"/>
<field name="search_view_id" ref="crm_case_history_search"/>
</record>
<!-- Segmentation line Tree View -->
<!-- Segmentation line Tree View -->
<record id="crm_segmentation_line_tree-view" model="ir.ui.view">
<field name="name">crm.segmentation.line.tree</field>
@ -565,7 +249,7 @@
</field>
</record>
<!-- Segmentation line Form View -->
<!-- Segmentation line Form View -->
<record id="crm_segmentation_line-view" model="ir.ui.view">
<field name="name">crm.segmentation.line.form</field>
@ -585,7 +269,7 @@
</field>
</record>
<!-- CRM Segmentation Form View -->
<!-- CRM Segmentation Form View -->
<record id="crm_segmentation-view" model="ir.ui.view">
<field name="name">crm.segmentation.form</field>
@ -630,7 +314,7 @@
</field>
</record>
<!-- CRM Segmentation Tree View -->
<!-- CRM Segmentation Tree View -->
<record id="crm_segmentation_tree-view" model="ir.ui.view">
<field name="name">crm.segmentation.tree</field>
@ -690,7 +374,7 @@
</field>
</record>
<!-- Inherit View From Partner -->
<!-- Inherit View From Partner -->
<record id="view_partners_form_crm1" model="ir.ui.view">
<field name="name">view.res.partner.form.crm.inherited1</field>

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-02-24 10:59+0000\n"
"Last-Translator: Carlo Vettore <Unknown>\n"
"PO-Revision-Date: 2010-05-21 06:51+0000\n"
"Last-Translator: eLBati - albatos.com <lorenzo.battistini@albatos.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:02+0000\n"
"X-Launchpad-Export-Date: 2010-05-22 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: crm
@ -2506,7 +2506,7 @@ msgstr ""
#. module: crm
#: model:crm.case.categ,name:crm.categ_meet1
msgid "Customer Meeting"
msgstr "Riunione del cliente"
msgstr "Riunione con il cliente"
#. module: crm
#: wizard_field:crm.new.send.mail,init,doc2:0

File diff suppressed because it is too large Load Diff

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-02-02 17:06+0000\n"
"Last-Translator: pedrobom <pedrobomlimeira@gmail.com>\n"
"PO-Revision-Date: 2010-05-22 04:53+0000\n"
"Last-Translator: Guilherme Santos <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:02+0000\n"
"X-Launchpad-Export-Date: 2010-05-23 03:57+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: crm
@ -111,7 +111,7 @@ msgstr ""
#. module: crm
#: model:ir.ui.menu,name:crm.menu_hr
msgid "Human Resources"
msgstr ""
msgstr "Recursos Humanos"
#. module: crm
#: model:ir.ui.menu,name:crm.menu_action_report_crm_case_oppor_categ_categ2
@ -229,7 +229,7 @@ msgstr "Seção de caso"
#. module: crm
#: view:crm.job:0
msgid "Proposed Salary"
msgstr "Salário proposto"
msgstr "Salário Proposto"
#. module: crm
#: help:crm.case.section,sequence:0
@ -272,7 +272,7 @@ msgstr "Palavras-chave especiais a serem utilizadas no corpo"
#: view:crm.lead:0
#: view:crm.opportunity:0
msgid "Send New Email"
msgstr "Envia Novo Email"
msgstr "Enviar Novo Email"
#. module: crm
#: view:crm.case.history:0

View File

@ -63,7 +63,7 @@
</record>
<!-- Leads by user and section Search View -->
<record id="view_report_crm_lead_filter" model="ir.ui.view">
<field name="name">crm.lead.report.select</field>
<field name="model">crm.lead.report</field>
@ -119,7 +119,7 @@
</field>
</group>
<newline/>
<group expand="1" string="Extended options..." colspan="10" col="12">
<group expand="1" string="Extended options..." colspan="10" col="12" groups="base.group_extended">
<filter icon="terp-sale"
string="Done"
domain="[('state','=','done')]"/>
@ -144,14 +144,14 @@
<filter string="Section" icon="terp-sale"
domain="[]"
context="{'group_by':'section_id'}" />
<separator orientation="vertical" />
<filter string="State" icon="terp-sale"
domain="[]" context="{'group_by':'state'}" />
<filter string="Stage" icon="terp-sale" domain="[]"
context="{'group_by':'stage_id'}" />
<filter string="Category" icon="terp-sale"
domain="[]" context="{'group_by':'categ_id'}" />
@ -180,9 +180,9 @@
<tree string="Opportunities">
<field name="name" invisible="1"/>
<field name="month" invisible="1"/>
<field name="section_id" invisible="1"/>
<field name="section_id" invisible="1" groups="base.group_extended"/>
<field name="user_id" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="company_id" invisible="1" groups="base.group_extended"/>
<field name="partner_id" invisible="1"/>
<field name="day" invisible="1"/>
<field name="nbr" string="#Opportunities" sum="#Opportunities"/>
@ -220,7 +220,7 @@
<field name="view_id" ref="view_report_crm_lead_graph"/>
<field name="act_window_id" ref="action_report_crm_lead"/>
</record>
<record id="action_report_crm_opportunity" model="ir.actions.act_window">
<field name="name">Opportunities</field>
<field name="res_model">crm.lead.report</field>
@ -244,7 +244,7 @@
<field name="view_id" ref="view_report_crm_lead_graph"/>
<field name="act_window_id" ref="action_report_crm_opportunity"/>
</record>
<menuitem name="Leads" id="menu_report_crm_leads_tree"
groups="base.group_extended"
parent="base.next_id_64" action="action_report_crm_lead" />

View File

@ -6,12 +6,8 @@
"access_crm_meeting","crm.meeting","model_crm_meeting","crm.group_crm_manager",1,1,1,1
"access_crm_lead","crm.lead","model_crm_lead","crm.group_crm_manager",1,1,1,1
"access_crm_phonecall","crm.phonecall","model_crm_phonecall","crm.group_crm_manager",1,1,1,1
"access_crm_case_log","crm.case.log","model_crm_case_log","crm.group_crm_user",1,1,1,1
"access_crm_case_history","crm.case.history","model_crm_case_history","crm.group_crm_user",1,1,1,1
"o","crm.case.section.manager","model_crm_case_section","crm.group_crm_manager",1,1,1,1
"access_crm_case_section_manager","crm.case.section.manager","model_crm_case_section","crm.group_crm_manager",1,1,1,1
"access_crm_case_categ_manager","crm.case.categ.manager","model_crm_case_categ","crm.group_crm_manager",1,1,1,1
"access_crm_case_log_manager","crm.case.log manager","model_crm_case_log","crm.group_crm_manager",1,1,1,1
"access_crm_case_history_manager","crm.case.history manager","model_crm_case_history","crm.group_crm_manager",1,1,1,1
"access_crm_case_stage","crm.case.stage","model_crm_case_stage","crm.group_crm_user",1,0,0,0
"access_crm_case_stage_manager","crm.case.stage","model_crm_case_stage","crm.group_crm_manager",1,1,1,1
"access_crm_case_resource_type_user","crm_case_resource_type user","model_crm_case_resource_type","crm.group_crm_user",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
6 access_crm_meeting crm.meeting model_crm_meeting crm.group_crm_manager 1 1 1 1
7 access_crm_lead crm.lead model_crm_lead crm.group_crm_manager 1 1 1 1
8 access_crm_phonecall crm.phonecall model_crm_phonecall crm.group_crm_manager 1 1 1 1
9 access_crm_case_log access_crm_case_section_manager crm.case.log crm.case.section.manager model_crm_case_log model_crm_case_section crm.group_crm_user crm.group_crm_manager 1 1 1 1
access_crm_case_history crm.case.history model_crm_case_history crm.group_crm_user 1 1 1 1
o crm.case.section.manager model_crm_case_section crm.group_crm_manager 1 1 1 1
10 access_crm_case_categ_manager crm.case.categ.manager model_crm_case_categ crm.group_crm_manager 1 1 1 1
access_crm_case_log_manager crm.case.log manager model_crm_case_log crm.group_crm_manager 1 1 1 1
access_crm_case_history_manager crm.case.history manager model_crm_case_history crm.group_crm_manager 1 1 1 1
11 access_crm_case_stage crm.case.stage model_crm_case_stage crm.group_crm_user 1 0 0 0
12 access_crm_case_stage_manager crm.case.stage model_crm_case_stage crm.group_crm_manager 1 1 1 1
13 access_crm_case_resource_type_user crm_case_resource_type user model_crm_case_resource_type crm.group_crm_user 1 0 0 0

View File

@ -16,7 +16,6 @@
login: user_crm
name: user_crm
password: user_crm
- |
I start by creating a new lead "New Customer" and I provide an address to this
@ -25,7 +24,7 @@
!record {model: crm.lead, id: crm_lead_newcustomer0}:
email_from: info@mycustomer.com
name: New Customer
partner_name: Sandip zala
partner_name: Capegemini
phone: (855) 924-4364
mobile: (333) 715-1450
section_id: crm.section_sales_department
@ -41,6 +40,11 @@
-
!python {model: crm.lead}: |
self.case_open(cr, uid, [ref("crm_lead_newcustomer0")])
- |
I check that lead is now in 'open' state.
-
!assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in open state}:
- state == "open"
- |
As the lead seems to be a real business opportunity, I will convert it to a
@ -49,8 +53,8 @@
-
!python {model: crm.lead}: |
lead = self.browse(cr, uid, ref('crm_lead_newcustomer0'))
if not lead.partner_id:
self.convert_opportunity(cr, uid, [ref("crm_lead_newcustomer0")], {'active_ids': [ref("crm_lead_newcustomer0")]})
action = self.convert_opportunity(cr, uid, [ref("crm_lead_newcustomer0")], {'active_ids': [ref("crm_lead_newcustomer0")]})
assert action['res_model'] == 'crm.lead2opportunity.partner'
-
|
Now, select "create a new partner" option in this wizard.
@ -66,7 +70,7 @@
Now, I give value to this wizard field.
-
!record {model: crm.lead2opportunity, id: crm_lead2opportunity_stonage_0}:
name: Sandip zala
name: Capegemini
planned_revenue: 0.00
probability: 0.00
-
@ -79,8 +83,8 @@
I can check that a lead and a business opportunity is now assigned to this
lead.
-
# !python {model: crm.lead, id: crm_lead_newcustomer0}:
# - opportunity_id.id != False
# !python {model: crm.lead, id: crm_lead_newcustomer0}:
# - opportunity_id == False
- |
I check that the partner associated to this lead as the same country, phone number
@ -109,4 +113,4 @@
- |
I Reply to last Email to lead with some document attached.and check that communication history generated or not.

View File

@ -4,44 +4,55 @@
!record {model: crm.phonecall, id: crm_phonecall_interviewcall0}:
date: '2010-04-21 18:59:00'
name: Interview call
partner_address_id: base.res_partner_address_1
partner_id: base.res_partner_9
partner_mobile: (+32)2 211 34 83
section_id: crm.section_sales_department
- |
Now , I select partner by click on "Create a Partner" button.
-
!record {model: crm.phonecall2partner, id: crm_phonecall2partner_1}:
action: exist
partner_id: base.res_partner_9
-
Now, click on "Continue" button of this wizard.
-
!python {model: crm.phonecall2partner}: |
self.make_partner(cr, uid, [ref("crm_phonecall2partner_1")], {"active_ids": [ref("crm_phonecall_interviewcall0")]})
- |
As the success of phonecall seems to be a real business opportunity, I will convert
it to opportunity by clicking on the "Convert to Opportunity" button.
-
!record {model: crm.phonecall2opportunity, id: crm_phonecall2opportunity_interviewcall0}:
name: Interview call
partner_id: base.res_partner_9
planned_revenue: 0.0
probability: 0.0
-
Now, I click on "Convert" button of this wizard.
-
# !python {model: crm.phonecall2opportunity}: |
# self.action_apply(cr, uid, [1], {'active_id': ref('crm_phonecall_interviewcall0')})
!python {model: crm.phonecall2opportunity}: |
self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_interviewcall0")], {"active_id": ref("crm_phonecall_interviewcall0")})
-
# This is not working, find a way to do that in YAML
- |
I can see that a business opportunity is now assigned to this phonecall
- |
I check that the partner associated to this as the same country, phone number
and name than the phonecall.
- |
In order to avoid the duplication of similar partner, OpenERP should be able to
detect if the partner exists or if it should be created from the phonecall during the
conversion.
- |
In order to test this, I log as the user "user_crm2"
- |
Then, I create the same phonecall than the preceeding one but I change the name
of the phonecall. But this customer keeps the same email.
- |
This time OpenERP should detect that this customer already exists in the
partner base and I check that in the wizard, proposes me to link to this existing
partner instead of creating another one.
- |
I confirm the conversion wizard.
-
!assert {model: crm.phonecall, id: crm_phonecall_interviewcall0}:
- opportunity_id == True
- |
And I check that the phonecall and the newly created business opportunity is linked
to the partner
to same partner
-
!python {model: crm.phonecall}: |
xid= ref('crm_phonecall_interviewcall0')
obj_phonecall = self.browse(cr, uid, xid)
ids = self.pool.get('crm.lead').search(cr, uid, [('name', '=', obj_phonecall.opportunity_id.name)])
obj_opp = self.pool.get('crm.lead').browse(cr, uid, ids)[0]
assert obj_phonecall.partner_id == obj_opp.partner_id
- |
I schedule Meeting on this current phonecall by clicking on "schedule
Meeting"

View File

@ -176,7 +176,6 @@ class crm_lead_forward_to_partner(osv.osv_memory):
this = self.browse(cr, uid, ids[0], context=context)
hist_obj = self.pool.get('crm.case.history')
smtp_pool = self.pool.get('email.smtpclient')
case_pool = self.pool.get(model)
case = case_pool.browse(cr, uid, res_id, context=context)

View File

@ -57,7 +57,6 @@ class crm_lead2opportunity(osv.osv_memory):
lead_obj = self.pool.get('crm.lead')
data_obj = self.pool.get('ir.model.data')
history_obj = self.pool.get('crm.case.history')
model_obj = self.pool.get('ir.model')
# Get Opportunity views

View File

@ -42,12 +42,15 @@
</record>
<!-- Lead to Partner wizard -->
<act_window id="action_crm_lead2partner"
key2="client_action_multi" name="Create a Partner"
res_model="crm.lead2partner" src_model="crm.lead"
view_id="view_crm_lead2partner_create"
view_mode="form" target="new" view_type="form" />
<record id="action_crm_lead2partner" model="ir.actions.act_window">
<field name="name">Create a Partner</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">crm.lead2partner</field>
<field name="view_type">form</field>
<field name="view_id" ref="view_crm_lead2partner_create"/>
<field name="target">new</field>
</record>
</data>
</openerp>

View File

@ -39,7 +39,8 @@
key2="client_action_multi" name="Create Opportunity"
res_model="crm.partner2opportunity" src_model="res.partner"
view_id="view_crm_lead2partner_create"
view_mode="form" target="new" view_type="form" />
view_mode="form" target="new" view_type="form"
groups="base.group_extended"/>
</data>
</openerp>

View File

@ -43,11 +43,15 @@
<!-- Phonecall to Partner wizard -->
<act_window id="action_crm_phonecall2partner"
key2="client_action_multi" name="Create a Partner"
res_model="crm.phonecall2partner" src_model="crm.phonecall"
view_id="view_crm_phonecall2partner_create"
view_mode="form" target="new" view_type="form" />
<record id="action_crm_phonecall2partner" model="ir.actions.act_window">
<field name="name">Create a Partner</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">crm.phonecall2partner</field>
<field name="view_type">form</field>
<field name="view_id" ref="view_crm_phonecall2partner_create"/>
<field name="target">new</field>
</record>
</data>
</openerp>

View File

@ -98,7 +98,9 @@ class crm_send_new_email(osv.osv_memory):
message_id = hist.message_id
model = hist.model_id.model
model_pool = self.pool.get(model)
case = model_pool.browse(cr, uid, hist.res_id)
res_ids = model_pool.search(cr, uid, [('thread_id','=', hist.thread_id.id)])
res_id = res_ids and res_ids[0] or False
case = model_pool.browse(cr, uid, res_id)
emails = [obj.email_to] + (obj.email_cc or '').split(',')
emails = filter(None, emails)
body = obj.text
@ -197,7 +199,9 @@ class crm_send_new_email(osv.osv_memory):
return {}
model_pool = self.pool.get(model)
case = model_pool.browse(cr, uid, hist.res_id)
res_ids = model_pool.search(cr, uid, [('thread_id','=', hist.thread_id.id)])
res_id = res_ids and res_ids[0] or False
case = model_pool.browse(cr, uid, res_id)
if 'email_to' in fields:
res.update({'email_to': case.email_from or hist.email_from or False})
if 'email_from' in fields:

View File

@ -29,10 +29,15 @@ class crm_claim(osv.osv, crm.crm_case):
_name = "crm.claim"
_description = "Claim Cases"
_order = "id desc"
_inherit = 'mailgate.thread'
_inherits = {'mailgate.thread': 'thread_id'}
_columns = {
'thread_id': fields.many2one('mailgate.thread', 'Thread', required=False),
'id': fields.integer('ID', readonly=True),
'name': fields.char('Name', size=128, required=True),
'active': fields.boolean('Active', required=False),
'date_action_last': fields.datetime('Last Action', readonly=1),
'date_action_next': fields.datetime('Next Action', readonly=1),
'description': fields.text('Description'),
'create_date': fields.datetime('Creation Date' , readonly=True),
'write_date': fields.datetime('Update Date' , readonly=True),

View File

@ -28,11 +28,15 @@ class crm_fundraising(osv.osv, crm.crm_case):
_name = "crm.fundraising"
_description = "Fund Raising Cases"
_order = "id desc"
_inherit ='mailgate.thread'
_inherits = {'mailgate.thread': 'thread_id'}
_columns = {
'thread_id': fields.many2one('mailgate.thread', 'Thread', required=False),
'id': fields.integer('ID'),
'name': fields.char('Name', size=128, required=True),
'name': fields.char('Name', size=128, required=True),
'active': fields.boolean('Active', required=False),
'date_action_last': fields.datetime('Last Action', readonly=1),
'date_action_next': fields.datetime('Next Action', readonly=1),
'description': fields.text('Description'),
'create_date': fields.datetime('Creation Date' , readonly=True),
'write_date': fields.datetime('Update Date' , readonly=True),

View File

@ -28,11 +28,15 @@ class crm_helpdesk(osv.osv, crm.crm_case):
_name = "crm.helpdesk"
_description = "Helpdesk Cases"
_order = "id desc"
_inherit = 'mailgate.thread'
_inherits = {'mailgate.thread': 'thread_id'}
_columns = {
'thread_id': fields.many2one('mailgate.thread', 'Thread', required=False),
'id': fields.integer('ID', readonly=True),
'name': fields.char('Name', size=128, required=True),
'active': fields.boolean('Active', required=False),
'date_action_last': fields.datetime('Last Action', readonly=1),
'date_action_next': fields.datetime('Next Action', readonly=1),
'description': fields.text('Description'),
'create_date': fields.datetime('Creation Date' , readonly=True),
'write_date': fields.datetime('Update Date' , readonly=True),

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: 2008-12-10 00:48+0000\n"
"Last-Translator: Andrzej MoST (Marcin Ostajewski) <Unknown>\n"
"PO-Revision-Date: 2010-05-21 20:20+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:17+0000\n"
"X-Launchpad-Export-Date: 2010-05-22 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: crm_profiling
@ -49,7 +49,7 @@ msgstr ""
#. module: crm_profiling
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
msgstr "Nieprawidłowa nazwa modelu w definicji akcji."
#. module: crm_profiling
#: field:crm_profiling.answer,name:0
@ -70,7 +70,7 @@ msgstr "Opis"
#. module: crm_profiling
#: field:crm.segmentation,answer_no:0
msgid "Excluded Answers"
msgstr ""
msgstr "Wyłączone odpowiedzi"
#. module: crm_profiling
#: view:crm_profiling.answer:0
@ -111,12 +111,12 @@ msgstr "Kwestionariusz"
#. module: crm_profiling
#: constraint:crm.segmentation:0
msgid "Error ! You can not create recursive profiles."
msgstr ""
msgstr "Błąd ! Nie możesz tworzyć profilów rekurencyjnych."
#. module: crm_profiling
#: field:crm.segmentation,profiling_active:0
msgid "Use The Profiling Rules"
msgstr ""
msgstr "Stosuj reguły profili"
#. module: crm_profiling
#: view:crm_profiling.question:0
@ -127,7 +127,7 @@ msgstr "Dostępne odpowiedzi"
#. module: crm_profiling
#: field:crm.segmentation,answer_yes:0
msgid "Included Answers"
msgstr ""
msgstr "Włączone odpowiedzi"
#. module: crm_profiling
#: help:crm.segmentation,profiling_active:0
@ -147,7 +147,7 @@ msgstr "Pytania"
#. module: crm_profiling
#: field:crm.segmentation,parent_id:0
msgid "Parent Profile"
msgstr ""
msgstr "Profil nadrzędny"
#. module: crm_profiling
#: wizard_button:open_questionnaire,init,end:0
@ -158,12 +158,12 @@ msgstr "Anuluj"
#. module: crm_profiling
#: view:crm.segmentation:0
msgid "Partner Segmentations"
msgstr ""
msgstr "Segmentacja partnera"
#. module: crm_profiling
#: model:ir.actions.wizard,name:crm_profiling.wizard_open_questionnaire
msgid "Using a questionnaire"
msgstr "Uzywanie kwestionariusza"
msgstr "Używanie kwestionariusza"
#. module: crm_profiling
#: wizard_button:open_questionnaire,open,compute:0

View File

@ -23,32 +23,32 @@
<record model="document.directory.ics.fields" id="dir_field1">
<field name="name">dtstart</field>
<field name="field_id" ref="crm.field_crm_case_create_date"/>
<field name="field_id" ref="crm.field_crm_meeting_create_date"/>
<field name="content_id" ref="dir_content_calendar"/>
</record>
<record model="document.directory.ics.fields" id="dir_field6">
<field name="name">dtend</field>
<field name="field_id" ref="crm.field_crm_case_date_deadline"/>
<field name="field_id" ref="crm.field_crm_meeting_date_deadline"/>
<field name="content_id" ref="dir_content_calendar"/>
</record>
<record model="document.directory.ics.fields" id="dir_field2">
<field name="name">summary</field>
<field name="field_id" ref="crm.field_crm_case_name"/>
<field name="field_id" ref="crm.field_crm_meeting_name"/>
<field name="content_id" ref="dir_content_calendar"/>
</record>
<record model="document.directory.ics.fields" id="dir_field3">
<field name="name">uid</field>
<field name="field_id" ref="field_crm_case_code"/>
<field name="field_id" ref="field_crm_meeting_code"/>
<field name="content_id" ref="dir_content_calendar"/>
</record>
<record model="document.directory.ics.fields" id="dir_field4">
<field name="name">description</field>
<field name="field_id" ref="crm.field_crm_case_description"/>
<field name="field_id" ref="crm.field_crm_meeting_description"/>
<field name="content_id" ref="dir_content_calendar"/>
</record>
<record model="document.directory.ics.fields" id="dir_field5">
<field name="name">url</field>
<field name="field_id" ref="crm.field_crm_case_email_from"/>
<field name="field_id" ref="crm.field_crm_meeting_email_from"/>
<field name="content_id" ref="dir_content_calendar"/>
</record>

View File

@ -45,7 +45,7 @@
<field name="type">form</field>
<field name="inherit_id" ref="crm.crm_case_form_view_meet"/>
<field name="arch" type="xml">
<field name="priority" position="after">
<field name="show_as" position="after">
<field name="code"/>
</field>
</field>

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: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-11-09 17:33+0000\n"
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
"PO-Revision-Date: 2010-05-21 20:29+0000\n"
"Last-Translator: Christophe Chauvet - http://www.syleam.fr/ <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:18+0000\n"
"X-Launchpad-Export-Date: 2010-05-22 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: document_ics
@ -37,17 +37,17 @@ msgstr "Erreur ! Vous ne pouvez pas créer de Répertoires récursivement."
#. module: document_ics
#: field:document.ics.crm.wizard,jobs:0
msgid "Jobs Hiring Process"
msgstr ""
msgstr "Procédure de recrutement"
#. module: document_ics
#: view:document.ics.crm.wizard:0
msgid "Configure Calendars for CRM Sections"
msgstr ""
msgstr "Configure les calendriers pour les sections de la CRM"
#. module: document_ics
#: field:document.ics.crm.wizard,helpdesk:0
msgid "Helpdesk"
msgstr ""
msgstr "Support"
#. module: document_ics
#: field:document.directory.ics.fields,field_id:0
@ -57,7 +57,7 @@ msgstr "Champ Open ERP"
#. module: document_ics
#: view:document.ics.crm.wizard:0
msgid "Next"
msgstr ""
msgstr "Suivant"
#. module: document_ics
#: field:document.directory.ics.fields,content_id:0
@ -67,7 +67,7 @@ msgstr "Contenu"
#. module: document_ics
#: field:document.ics.crm.wizard,meeting:0
msgid "Calendar of Meetings"
msgstr ""
msgstr "Calendrier des Rendez Vous"
#. module: document_ics
#: model:crm.case.section,name:document_ics.section_meeting
@ -82,12 +82,14 @@ msgstr "url"
#. module: document_ics
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
msgstr "Nom de modèle invalide pour la définition de l'action"
#. module: document_ics
#: help:document.ics.crm.wizard,bugs:0
msgid "Used by companies to track bugs and support requests on softwares"
msgstr ""
"Utilisé par les sociétés pour suivre des anomalies et des demandes de "
"supports sur les logiciels"
#. module: document_ics
#: model:ir.actions.todo,note:document_ics.config_wizard_step_case_section_menu
@ -95,6 +97,8 @@ msgid ""
"This Configuration step use to create Calendars in document for all Case "
"Sections"
msgstr ""
"Cette étape de configuration est utilisé pour créer un calendrier dans la "
"GED pour toutes les sections"
#. module: document_ics
#: selection:document.directory.ics.fields,name:0
@ -107,6 +111,8 @@ msgid ""
"Help you to organise the jobs hiring process: evaluation, meetings, email "
"integration..."
msgstr ""
"Aide à organiser le processus d'embauche: évaluation, rendez vous, gestion "
"des emails"
#. module: document_ics
#: selection:document.directory.ics.fields,name:0
@ -116,28 +122,30 @@ msgstr "description"
#. module: document_ics
#: model:ir.actions.act_window,name:document_ics.action_view_document_ics_config_directories
msgid "Configure Calendars for Sections "
msgstr ""
msgstr "Configurer les Calendriers pour ces Sections "
#. module: document_ics
#: help:document.ics.crm.wizard,opportunity:0
msgid "Tracks identified business opportunities for your sales pipeline."
msgstr ""
msgstr "Suivi des occasions identifiées d'affaires pour vos canaux de vente."
#. module: document_ics
#: help:document.ics.crm.wizard,fund:0
msgid ""
"This may help associations in their fund raising process and tracking."
msgstr ""
"Ceci peut aider les associations dans leur procédure de collecte de fonds et "
"de suivi."
#. module: document_ics
#: help:document.ics.crm.wizard,helpdesk:0
msgid "Manages an Helpdesk service."
msgstr ""
msgstr "Diriger un service d'assistance"
#. module: document_ics
#: field:document.ics.crm.wizard,fund:0
msgid "Fund Raising Operations"
msgstr ""
msgstr "Opérations de levée de fonds"
#. module: document_ics
#: field:document.directory.content,ics_object_id:0
@ -147,12 +155,12 @@ msgstr "Objet"
#. module: document_ics
#: constraint:crm.case.section:0
msgid "Error ! You cannot create recursive sections."
msgstr ""
msgstr "Erreur ! Vous ne pouvez pas créer de sections récursives."
#. module: document_ics
#: model:ir.module.module,shortdesc:document_ics.module_meta_information
msgid "Support for iCal based on Document Management System"
msgstr ""
msgstr "Support iCal basé sur la gestion documentaire"
#. module: document_ics
#: selection:document.directory.ics.fields,name:0
@ -173,6 +181,7 @@ msgstr "Valeur ICS"
#: model:ir.module.module,description:document_ics.module_meta_information
msgid "Allows to synchronise calendars with others applications."
msgstr ""
"Autorise la syncrhonisation des calendriers avec les autres applications."
#. module: document_ics
#: constraint:ir.ui.view:0
@ -189,12 +198,12 @@ msgstr ""
#. module: document_ics
#: field:document.ics.crm.wizard,name:0
msgid "Name"
msgstr ""
msgstr "Nom"
#. module: document_ics
#: help:document.ics.crm.wizard,meeting:0
msgid "Manages the calendar of meetings of the users."
msgstr ""
msgstr "Gère le calendrier des rendez-vous des utilisateurs"
#. module: document_ics
#: field:document.directory.content,ics_domain:0
@ -207,6 +216,8 @@ msgid ""
"Manages the supplier and customers claims, including your corrective or "
"preventive actions."
msgstr ""
"Gérér les réclamations fournisseurs et clients, incluant vos actions "
"correctives ou préventives."
#. module: document_ics
#: selection:document.directory.ics.fields,name:0
@ -221,17 +232,17 @@ msgstr "Correspondance ICS"
#. module: document_ics
#: view:crm.case:0
msgid "Duration(In Hour)"
msgstr ""
msgstr "Durée (en heure)"
#. module: document_ics
#: field:document.ics.crm.wizard,document_ics:0
msgid "Shared Calendar"
msgstr ""
msgstr "Calendrier partagé"
#. module: document_ics
#: field:document.ics.crm.wizard,claims:0
msgid "Claims"
msgstr ""
msgstr "Réclamations"
#. module: document_ics
#: help:document.ics.crm.wizard,phonecall:0
@ -239,6 +250,8 @@ msgid ""
"Help you to encode the result of a phone call or to planify a list of phone "
"calls to process."
msgstr ""
"Aide à encoder le résultat d'une conversation téléphonique ou à plannifier "
"une liste"
#. module: document_ics
#: selection:document.directory.ics.fields,name:0
@ -248,12 +261,12 @@ msgstr "dtstart"
#. module: document_ics
#: field:document.ics.crm.wizard,phonecall:0
msgid "Phone Calls"
msgstr ""
msgstr "Appels téléphoniques"
#. module: document_ics
#: field:document.ics.crm.wizard,bugs:0
msgid "Bug Tracking"
msgstr ""
msgstr "Suivi des Bugs"
#. module: document_ics
#: selection:document.directory.ics.fields,name:0
@ -263,12 +276,12 @@ msgstr "catégories"
#. module: document_ics
#: field:document.ics.crm.wizard,lead:0
msgid "Prospect"
msgstr ""
msgstr "Prospect"
#. module: document_ics
#: view:document.ics.crm.wizard:0
msgid "Create Pre-Configured Calendars"
msgstr ""
msgstr "Création de calendriers pré-configurer"
#. module: document_ics
#: selection:document.directory.ics.fields,name:0
@ -278,7 +291,7 @@ msgstr "créé"
#. module: document_ics
#: field:crm.case,code:0
msgid "Calendar Code"
msgstr ""
msgstr "Code Calendrier"
#. module: document_ics
#: selection:document.directory.ics.fields,name:0
@ -288,7 +301,7 @@ msgstr "résumé"
#. module: document_ics
#: model:ir.model,name:document_ics.model_document_ics_crm_wizard
msgid "document.ics.crm.wizard"
msgstr ""
msgstr "document.ics.crm.wizard"
#. module: document_ics
#: selection:document.directory.ics.fields,name:0
@ -308,14 +321,14 @@ msgstr "Correspondance des champs"
#. module: document_ics
#: view:document.ics.crm.wizard:0
msgid "Cancel"
msgstr ""
msgstr "Annuler"
#. module: document_ics
#: field:document.ics.crm.wizard,opportunity:0
msgid "Business Opportunities"
msgstr ""
msgstr "Opportunités d'affaire"
#. module: document_ics
#: selection:document.directory.ics.fields,name:0
msgid "dtstamp"
msgstr ""
msgstr "dtstamp"

View File

@ -27,23 +27,12 @@ import tools
from tools.translate import _
from crm import crm
class crm_case_log(osv.osv):
_inherit = 'crm.case.log'
_description = 'crm.case.log'
def create(self, cr, uid, vals, *args, **kwargs):
if not 'name' in vals:
vals['name']='Historize'
return super(osv.osv,self).create(cr, uid, vals, *args, **kwargs)
_defaults = {
'user_id': lambda self,cr,uid,context: uid,
}
crm_case_log()
class event_type(osv.osv):
_name = 'event.type'
_description= 'Event type'
_columns = {
'name': fields.char('Event type', size=64, required=True),
'name': fields.char('Event type', size=64, required=True),
}
event_type()
@ -54,58 +43,53 @@ class event(osv.osv):
_order = 'date_begin'
def copy(self, cr, uid, id, default=None, context=None):
return super(event, self).copy(cr, uid,id, default={'code': self.pool.get('ir.sequence').get(cr, uid, 'event.event'),'state':'draft'})
return super(event, self).copy(cr, uid, id, default={'code': self.pool.get('ir.sequence').get(cr, uid, 'event.event'), 'state': 'draft'})
def button_draft(self, cr, uid, ids, context={}):
return self.write(cr, uid, ids, {'state':'draft'})
return self.write(cr, uid, ids, {'state': 'draft'})
def button_cancel(self, cr, uid, ids, context={}):
return self.write(cr, uid, ids, {'state':'cancel'})
return self.write(cr, uid, ids, {'state': 'cancel'})
def button_done(self, cr, uid, ids, context={}):
return self.write(cr, uid, ids, {'state':'done'})
return self.write(cr, uid, ids, {'state': 'done'})
def button_confirm(self, cr, uid, ids, context={}):
for eve in self.browse(cr, uid, ids):
if eve.mail_auto_confirm:
#send reminder that will confirm the event for all the people that were already confirmed
reg_ids = self.pool.get('event.registration').search(cr, uid, [('event_id','=',eve.id),('state','not in',['draft','cancel'])])
reg_ids = self.pool.get('event.registration').search(cr, uid, [('event_id', '=', eve.id), ('state', 'not in', ['draft', 'cancel'])])
if reg_ids:
self.pool.get('event.registration').mail_user_confirm(cr, uid, reg_ids)
return self.write(cr, uid, ids, {'state':'confirm'})
return self.write(cr, uid, ids, {'state': 'confirm'})
def _get_register(self, cr, uid, ids, name, args, context=None):
res={}
for event in self.browse(cr, uid, ids, context):
query = """select sum(nb_register) from crm_case c left join crm_case_section s on (c.section_id=s.id) right join event_event e on (e.section_id=s.id) right join event_registration r on (r.case_id=c.id) where e.section_id = %s and c.state in ('open','done')"""
cr.execute(query,(event.section_id.id,))
res[event.id] = {}
state = 'draft'
if name[0] == 'register_current':
state = 'open'
query = """SELECT sum(r.nb_register)
from event_registration r
where state=%s and event_id=%s"""
cr.execute(query, (state, event.id, ))
res2 = cr.fetchone()
if res2 and res2[0]:
res[event.id] = res2[0]
res[event.id][name[0]] = res2[0]
else:
res[event.id] = 0
res[event.id][name[0]] = 0
return res
def _get_prospect(self, cr, uid, ids, name, args, context=None):
res={}
for event in self.browse(cr, uid, ids, context):
query = """select sum(nb_register) from crm_case c left join crm_case_section s on (c.section_id=s.id) right join event_event e on (e.section_id=s.id) right join event_registration r on (r.case_id=c.id) where e.section_id = %s and c.state = 'draft'"""
cr.execute(query,(event.section_id.id,))
res2 = cr.fetchone()
if res2 and res2[0]:
res[event.id] = res2[0]
else:
res[event.id] = 0
return res
def write(self, cr, uid, ids,vals, *args, **kwargs):
res = super(event,self).write(cr, uid, ids,vals, *args, **kwargs)
def write(self, cr, uid, ids, vals, *args, **kwargs):
res = super(event, self).write(cr, uid, ids, vals, *args, **kwargs)
if 'date_begin' in vals and vals['date_begin']:
for eve in self.browse(cr, uid, ids):
#change the deadlines of the registration linked to this event
reg_ids = self.pool.get('event.registration').search(cr, uid, [('event_id','=',eve.id)])
reg_ids = self.pool.get('event.registration').search(cr, uid, [('event_id', '=', eve.id)])
if reg_ids:
self.pool.get('event.registration').write(cr, uid, reg_ids, {'date_deadline':vals['date_begin']})
self.pool.get('event.registration').write(cr, uid, reg_ids, {'date_deadline': vals['date_begin']})
#change the description of the registration linked to this event
if 'mail_auto_confirm' in vals:
@ -117,36 +101,36 @@ class event(osv.osv):
vals['mail_confirm']=False
if 'mail_confirm' in vals:
for eve in self.browse(cr, uid, ids):
reg_ids = self.pool.get('event.registration').search(cr, uid, [('event_id','=',eve.id)])
reg_ids = self.pool.get('event.registration').search(cr, uid, [('event_id', '=', eve.id)])
if reg_ids:
self.pool.get('event.registration').write(cr, uid, reg_ids, {'description':vals['mail_confirm']})
self.pool.get('event.registration').write(cr, uid, reg_ids, {'description': vals['mail_confirm']})
return res
_columns = {
'type': fields.many2one('event.type', 'Type'),
'section_id': fields.many2one('crm.case.section', 'Case section', required=True),
'register_max': fields.integer('Maximum Registrations'),
'register_min': fields.integer('Minimum Registrations'),
'register_current': fields.function(_get_register, method=True, string='Confirmed Registrations'),
'register_prospect': fields.function(_get_prospect, method=True, string='Unconfirmed Registrations'),
'date_begin': fields.datetime('Beginning date', required=True),
'date_end': fields.datetime('Ending date', required=True),
'state': fields.selection([('draft','Draft'),('confirm','Confirmed'),('done','Done'),('cancel','Cancelled')], 'State', readonly=True, required=True,
'type': fields.many2one('event.type', 'Type'),
'section_id': fields.many2one('crm.case.section', 'Case section', required=True),
'register_max': fields.integer('Maximum Registrations'),
'register_min': fields.integer('Minimum Registrations'),
'register_current': fields.function(_get_register, method=True, string='Confirmed Registrations', multi='register_current'),
'register_prospect': fields.function(_get_register, method=True, string='Unconfirmed Registrations', multi='register_prospect'),
'date_begin': fields.datetime('Beginning date', required=True),
'date_end': fields.datetime('Ending date', required=True),
'state': fields.selection([('draft', 'Draft'), ('confirm', 'Confirmed'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, required=True,
help='If event is created, the state is \'Draft\'.\n If event is confirmed for the particular dates the state is set to \'Confirmed\'.\
\nIf the event is over, the state is set to \'Done\'.\n If event is cancelled the state is set to \'Cancelled\'.'),
'mail_auto_registr':fields.boolean('Mail Auto Register',help='Check this box if you want to use the automatic mailing for new registration'),
'mail_auto_confirm':fields.boolean('Mail Auto Confirm',help='Check this box if you want ot use the automatic confirmation emailing or the reminder'),
'mail_registr':fields.text('Registration Email',help='This email will be sent when someone subscribes to the event.'),
'mail_confirm': fields.text('Confirmation Email', help="This email will be sent when the event gets confimed or when someone subscribes to a confirmed event. This is also the email sent to remind someone about the event."),
'product_id':fields.many2one('product.product','Product', required=True),
\nIf the event is over, the state is set to \'Done\'.\n If event is cancelled the state is set to \'Cancelled\'.'),
'mail_auto_registr': fields.boolean('Mail Auto Register', help='Check this box if you want to use the automatic mailing for new registration'),
'mail_auto_confirm': fields.boolean('Mail Auto Confirm', help='Check this box if you want ot use the automatic confirmation emailing or the reminder'),
'mail_registr': fields.text('Registration Email', help='This email will be sent when someone subscribes to the event.'),
'mail_confirm': fields.text('Confirmation Email', help="This email will be sent when the event gets confimed or when someone subscribes to a confirmed event. This is also the email sent to remind someone about the event."),
'product_id': fields.many2one('product.product', 'Product', required=True),
}
_defaults = {
'state': lambda *args: 'draft',
'code': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'event.event'),
'user_id': lambda self,cr,uid,ctx: uid,
'state': lambda *args: 'draft',
'code': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'event.event'),
'user_id': lambda self, cr, uid, ctx: uid,
}
event()
class event_registration(osv.osv):
@ -156,48 +140,45 @@ class event_registration(osv.osv):
current_registration = self.browse(cr, uid, [ids[0]])[0]
total_confirmed = current_registration.event_id.register_current + current_registration.nb_register
if total_confirmed <= current_registration.event_id.register_max or current_registration.event_id.register_max == 0:
self.write(cr, uid, [ids[0]], {'state':'open'}, context=context)
self.write(cr, uid, [ids[0]], {'state': 'open'}, context=context)
self._history(cr, uid, [ids[0]], 'Open', history=True)
self.mail_user(cr, uid, [ids[0]])
return True
else:
model_data_ids = mod_obj.search(cr,uid,[('model','=','ir.ui.view'),('name','=','view_event_confirm_registration')], context=context)
model_data_ids = mod_obj.search(cr, uid, [('model', '=', 'ir.ui.view'), ('name', '=', 'view_event_confirm_registration')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
context.update({'reg_id': ids[0]})
return {
'name': _('Confirm Registration'),
'context': context,
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'event.confirm.registration',
'views': [(resource_id,'form')],
'type': 'ir.actions.act_window',
'target': 'new',
'name': _('Confirm Registration'),
'context': context,
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'event.confirm.registration',
'views': [(resource_id, 'form')],
'type': 'ir.actions.act_window',
'target': 'new',
'nodestroy': True
}
def _history(self, cr, uid,ids,keyword, history=False, email=False, context={}):
def _history(self, cr, uid, ids, keyword, history=False, email=False, context={}):
for case in self.browse(cr, uid, ids):
if not case.case_id:
return True
data = {
'name': keyword,
'som': case.som.id,
'canal_id': case.canal_id.id,
'user_id': uid,
'case_id': case.case_id.id
'name': keyword,
'som': case.som.id,
'canal_id': case.canal_id.id,
'user_id': uid,
}
obj = self.pool.get('crm.case.log')
obj.create(cr, uid, data, context)
obj = self.pool.get('mailgate.message')
obj.create(cr, uid, data, context=context)
return True
def button_reg_close(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {'state':'done',})
self.write(cr, uid, ids, {'state': 'done', })
self._history(cr, uid, ids, 'Done', history=True)
return True
def button_reg_cancel(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {'state':'cancel',})
self.write(cr, uid, ids, {'state': 'cancel', })
self._history(cr, uid, ids, 'Cancel', history=True)
return True
@ -207,7 +188,7 @@ class event_registration(osv.osv):
args[0]['date_deadline']= event.date_begin
args[0]['description']= event.mail_confirm
res = super(event_registration, self).create(cr, uid, *args, **argv)
self._history(cr, uid,[res], 'Created', history=True)
self._history(cr, uid, [res], 'Created', history=True)
return res
def write(self, cr, uid, *args, **argv):
@ -228,7 +209,7 @@ class event_registration(osv.osv):
if reg_id.email_cc:
dest += [reg_id.email_cc]
if dest and src:
tools.email_send(src, dest,'Auto Confirmation: '+'['+str(reg_id.id)+']'+' '+reg_id.name, reg_id.event_id.mail_confirm, openobject_id = str(reg_id.case_id.id))
tools.email_send(src, dest, 'Auto Confirmation: '+'['+str(reg_id.id)+']'+' '+reg_id.name, reg_id.event_id.mail_confirm, openobject_id = str(reg_id.id))
if not src:
raise osv.except_osv(_('Error!'), _('You must define a reply-to address in order to mail the participant. You can do this in the Mailing tab of your event. Note that this is also the place where you can configure your event to not send emails automaticly while registering'))
return False
@ -244,49 +225,50 @@ class event_registration(osv.osv):
dest += [reg_id.email_cc]
if reg_id.event_id.mail_auto_confirm or reg_id.event_id.mail_auto_registr:
if dest and src:
if reg_id.event_id.state in ['draft', 'fixed', 'open','confirm','running'] and reg_id.event_id.mail_auto_registr:
tools.email_send(src, dest,'Auto Registration: '+'['+str(reg_id.id)+']'+' '+reg_id.name, reg_id.event_id.mail_registr, openobject_id = str(reg_id.case_id.id))
if (reg_id.event_id.state in ['confirm','running']) and reg_id.event_id.mail_auto_confirm:
tools.email_send(src, dest,'Auto Confirmation: '+'['+str(reg_id.id)+']'+' '+reg_id.name, reg_id.event_id.mail_confirm, openobject_id = str(reg_id.case_id.id))
if reg_id.event_id.state in ['draft', 'fixed', 'open', 'confirm', 'running'] and reg_id.event_id.mail_auto_registr:
tools.email_send(src, dest, 'Auto Registration: '+'['+str(reg_id.id)+']'+' '+reg_id.name, reg_id.event_id.mail_registr, openobject_id = str(reg_id.id))
if (reg_id.event_id.state in ['confirm', 'running']) and reg_id.event_id.mail_auto_confirm:
tools.email_send(src, dest, 'Auto Confirmation: '+'['+str(reg_id.id)+']'+' '+reg_id.name, reg_id.event_id.mail_confirm, openobject_id = str(reg_id.id))
if not src:
raise osv.except_osv(_('Error!'), _('You must define a reply-to address in order to mail the participant. You can do this in the Mailing tab of your event. Note that this is also the place where you can configure your event to not send emails automaticly while registering'))
return False
def _create_invoice_lines(self, cr, uid, ids, vals):
return self.pool.get('account.invoice.line').create(cr, uid,vals )
return self.pool.get('account.invoice.line').create(cr, uid, vals)
_name= 'event.registration'
_description = 'Event Registration'
_inherits = {'crm.case': 'case_id'}
_inherit = 'crm.meeting'
_columns = {
'case_id':fields.many2one('crm.case','Case'),
'nb_register': fields.integer('Number of Registration', readonly=True, states={'draft':[('readonly',False)]}),
'event_id':fields.many2one('event.event', 'Event Related', required=True),
"partner_invoice_id":fields.many2one('res.partner', 'Partner Invoiced'),
"contact_id":fields.many2one('res.partner.contact', 'Partner Contact'), #TODO: filter only the contacts that have a function into the selected partner_id
"unit_price": fields.float('Unit Price'),
"badge_title":fields.char('Badge Title',size=128),
"badge_name":fields.char('Badge Name',size=128),
"badge_partner":fields.char('Badge Partner',size=128),
"invoice_label":fields.char("Label Invoice",size=128,required=True),
"tobe_invoiced":fields.boolean("To be Invoiced"),
"invoice_id":fields.many2one("account.invoice","Invoice"),
'date_closed': fields.datetime('Closed', readonly=True),
'ref' : fields.reference('Reference', selection=crm._links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128),
'categ_id': fields.many2one('crm.case.categ','Category', domain="[('section_id','=',section_id)]"),
'canal_id': fields.many2one('res.partner.canal', 'Channel',help="The channels represent the different communication modes available with the customer." \
" With each commercial opportunity, you can indicate the canall which is this opportunity source."),
'email_cc': fields.text('Watchers Emails', size=252 , help="These \
people will receive a copy of the future communication between partner \
and users by email"),
'nb_register': fields.integer('Number of Registration', readonly=True, states={'draft': [('readonly', False)]}),
'event_id': fields.many2one('event.event', 'Event Related', required=True),
"partner_invoice_id": fields.many2one('res.partner', 'Partner Invoiced'),
"contact_id": fields.many2one('res.partner.contact', 'Partner Contact'), #TODO: filter only the contacts that have a function into the selected partner_id
"unit_price": fields.float('Unit Price'),
"badge_title": fields.char('Badge Title', size=128),
"badge_name": fields.char('Badge Name', size=128),
"badge_partner": fields.char('Badge Partner', size=128),
"invoice_label": fields.char("Label Invoice", size=128, required=True),
"tobe_invoiced": fields.boolean("To be Invoiced"),
"invoice_id": fields.many2one("account.invoice", "Invoice"),
'date_closed': fields.datetime('Closed', readonly=True),
'ref': fields.reference('Reference', selection=crm._links_get, size=128),
'ref2': fields.reference('Reference 2', selection=crm._links_get, size=128),
'canal_id': fields.many2one('res.partner.canal', 'Channel', help="The channels represent the different communication modes available with the customer." \
" With each commercial opportunity, you can indicate the canall which is this opportunity source."),
'som': fields.many2one('res.partner.som', 'State of Mind', help="The minds states allow to define a value scale which represents" \
"the partner mentality in relation to our services.The scale has" \
"to be created with a factor for each level from 0 (Very dissatisfied) to 10 (Extremely satisfied)."),
"to be created with a factor for each level from 0 (Very dissatisfied) to 10 (Extremely satisfied)."),
}
_defaults = {
'nb_register': lambda *a: 1,
'tobe_invoiced' : lambda *a: True,
'name': lambda *a: 'Registration',
'state': lambda *b: 'draft'
'nb_register': lambda *a: 1,
'tobe_invoiced': lambda *a: True,
'name': lambda *a: 'Registration',
}
def onchange_badge_name(self, cr, uid, ids, badge_name):
@ -294,7 +276,7 @@ class event_registration(osv.osv):
if not badge_name:
return data
data['name'] = 'Registration: ' + badge_name
return {'value':data}
return {'value': data}
def onchange_contact_id(self, cr, uid, ids, contact, partner):
data ={}
@ -304,109 +286,76 @@ class event_registration(osv.osv):
data['badge_name'] = contact_id.name
data['badge_title'] = contact_id.title
if partner:
partner_addresses = self.pool.get('res.partner.address').search(cr, uid, [('partner_id','=',partner)])
job_ids = self.pool.get('res.partner.job').search(cr, uid, [('contact_id','=',contact),('address_id','in',partner_addresses)])
partner_addresses = self.pool.get('res.partner.address').search(cr, uid, [('partner_id', '=', partner)])
job_ids = self.pool.get('res.partner.job').search(cr, uid, [('contact_id', '=', contact), ('address_id', 'in', partner_addresses)])
if job_ids:
data['email_from'] = self.pool.get('res.partner.job').browse(cr, uid, job_ids[0]).email
d = self.onchange_badge_name(cr, uid, ids,data['badge_name'])
d = self.onchange_badge_name(cr, uid, ids, data['badge_name'])
data.update(d['value'])
return {'value':data}
return {'value': data}
def onchange_event(self, cr, uid, ids, event_id, partner_invoice_id):
context={}
if not event_id:
return {'value':{'unit_price' : False ,'invoice_label' : False }}
data_event = self.pool.get('event.event').browse(cr,uid,event_id)
return {'value': {'unit_price': False , 'invoice_label': False }}
data_event = self.pool.get('event.event').browse(cr, uid, event_id)
if data_event.product_id:
if not partner_invoice_id:
unit_price=self.pool.get('product.product').price_get(cr, uid, [data_event.product_id.id],context=context)[data_event.product_id.id]
return {'value':{'unit_price' : unit_price , 'invoice_label' : data_event.product_id.name}}
data_partner = self.pool.get('res.partner').browse(cr,uid,partner_invoice_id)
context.update({'partner_id':data_partner})
unit_price = self.pool.get('product.product')._product_price(cr, uid, [data_event.product_id.id], False, False, {'pricelist':data_partner.property_product_pricelist.id})[data_event.product_id.id]
return {'value':{'unit_price' :unit_price , 'invoice_label' : data_event.product_id.name}}
return {'value':{'unit_price' : False,'invoice_label' : False}}
unit_price=self.pool.get('product.product').price_get(cr, uid, [data_event.product_id.id], context=context)[data_event.product_id.id]
return {'value': {'unit_price': unit_price , 'invoice_label': data_event.product_id.name}}
data_partner = self.pool.get('res.partner').browse(cr, uid, partner_invoice_id)
context.update({'partner_id': data_partner})
unit_price = self.pool.get('product.product')._product_price(cr, uid, [data_event.product_id.id], False, False, {'pricelist': data_partner.property_product_pricelist.id})[data_event.product_id.id]
return {'value': {'unit_price': unit_price , 'invoice_label': data_event.product_id.name}}
return {'value': {'unit_price': False, 'invoice_label': False}}
def onchange_partner_id(self, cr, uid, ids, part, event_id, email=False):
data={}
data['badge_partner'] = data['contact_id'] = data['partner_invoice_id'] = data['email_from'] = data['badge_title'] = data['badge_name'] = False
if not part:
return {'value':data}
return {'value': data}
data['partner_invoice_id']=part
# this calls onchange_partner_invoice_id
d = self.onchange_partner_invoice_id(cr, uid, ids, event_id,part)
d = self.onchange_partner_invoice_id(cr, uid, ids, event_id, part)
# this updates the dictionary
data.update(d['value'])
addr = self.pool.get('res.partner').address_get(cr, uid, [part])
if addr:
if addr.has_key('default'):
job_ids = self.pool.get('res.partner.job').search(cr, uid, [('address_id','=',addr['default'])])
job_ids = self.pool.get('res.partner.job').search(cr, uid, [('address_id', '=', addr['default'])])
if job_ids:
data['contact_id'] = self.pool.get('res.partner.job').browse(cr, uid, job_ids[0]).contact_id.id
d = self.onchange_contact_id(cr, uid, ids, data['contact_id'],part)
d = self.onchange_contact_id(cr, uid, ids, data['contact_id'], part)
data.update(d['value'])
partner_data = self.pool.get('res.partner').browse(cr, uid, part)
data['badge_partner'] = partner_data.name
return {'value':data}
return {'value': data}
def onchange_partner_invoice_id(self, cr, uid, ids, event_id, partner_invoice_id):
data={}
context={}
data['unit_price']=False
if not event_id:
return {'value':data}
data_event = self.pool.get('event.event').browse(cr,uid,event_id)
return {'value': data}
data_event = self.pool.get('event.event').browse(cr, uid, event_id)
if data_event.product_id:
if not partner_invoice_id:
data['unit_price']=self.pool.get('product.product').price_get(cr, uid, [data_event.product_id.id],context=context)[data_event.product_id.id]
return {'value':data}
data_partner = self.pool.get('res.partner').browse(cr,uid,partner_invoice_id)
context.update({'partner_id':data_partner})
data['unit_price'] = self.pool.get('product.product')._product_price(cr, uid, [data_event.product_id.id], False, False, {'pricelist':data_partner.property_product_pricelist.id})[data_event.product_id.id]
return {'value':data}
return {'value':data}
data['unit_price']=self.pool.get('product.product').price_get(cr, uid, [data_event.product_id.id], context=context)[data_event.product_id.id]
return {'value': data}
data_partner = self.pool.get('res.partner').browse(cr, uid, partner_invoice_id)
context.update({'partner_id': data_partner})
data['unit_price'] = self.pool.get('product.product')._product_price(cr, uid, [data_event.product_id.id], False, False, {'pricelist': data_partner.property_product_pricelist.id})[data_event.product_id.id]
return {'value': data}
return {'value': data}
def onchange_categ_id(self, cr, uid, ids, categ, context={}):
if not categ:
return {'value':{}}
return {'value': {}}
cat = self.pool.get('crm.case.categ').browse(cr, uid, categ, context).probability
return {'value':{'probability':cat}}
def _map_ids(self,method,cr, uid, ids, *args, **argv):
case_data = self.browse(cr,uid,ids)
new_ids=[]
for case in case_data:
if case.case_id:
new_ids.append(case.case_id.id)
return getattr(self.pool.get('crm.case'),method)(cr, uid, new_ids, *args, **argv)
def case_close(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_close',cr,uid,ids,*args,**argv)
def case_escalate(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_escalate',cr,uid,ids,*args,**argv)
def case_open(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_open',cr,uid,ids,*args,**argv)
def case_cancel(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_cancel',cr,uid,ids,*args,**argv)
def case_pending(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_pending',cr,uid,ids,*args,**argv)
def case_reset(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_reset',cr,uid,ids,*args,**argv)
def case_log(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_log',cr,uid,ids,*args,**argv)
def case_log_reply(self,cr, uid, ids, *args, **argv):
return self._map_ids('case_log_reply',cr,uid,ids,*args,**argv)
def add_reply(self,cr, uid, ids, *args, **argv):
return self._map_ids('add_reply',cr,uid,ids,*args,**argv)
def remind_partner(self,cr, uid, ids, *args, **argv):
return self._map_ids('remind_partner',cr,uid,ids,*args,**argv)
def remind_user(self,cr, uid, ids, *args, **argv):
return self._map_ids('remind_user',cr,uid,ids,*args,**argv)
return {'value': {'probability': cat}}
event_registration()
@ -417,12 +366,12 @@ class report_event_registration(osv.osv):
_description = "Events on registrations"
_auto = False
_columns = {
'name': fields.char('Event',size=20),
'date_begin': fields.datetime('Beginning date', required=True),
'date_end': fields.datetime('Ending date', required=True),
'draft_state': fields.integer('Draft Registration',size=20),
'confirm_state': fields.integer('Confirm Registration',size=20),
'register_max': fields.integer('Maximum Registrations'),
'name': fields.char('Event', size=20),
'date_begin': fields.datetime('Beginning date', required=True),
'date_end': fields.datetime('Ending date', required=True),
'draft_state': fields.integer('Draft Registration', size=20),
'confirm_state': fields.integer('Confirm Registration', size=20),
'register_max': fields.integer('Maximum Registrations'),
}
def init(self, cr):
cr.execute("""
@ -432,8 +381,8 @@ class report_event_registration(osv.osv):
c.name as name,
e.date_begin as date_begin,
e.date_end as date_end,
(SELECT sum(nb_register) FROM event_registration x , crm_case c WHERE x.case_id=c.id and c.section_id=e.section_id and state in ('draft')) as draft_state,
(SELECT sum(nb_register) FROM event_registration x , crm_case c WHERE x.case_id=c.id and c.section_id=e.section_id and state in ('open')) as confirm_state,
(SELECT sum(c.nb_register) FROM event_registration c WHERE c.section_id=e.section_id and state in ('draft')) as draft_state,
(SELECT sum(c.nb_register) FROM event_registration c WHERE c.section_id=e.section_id and state in ('open')) as confirm_state,
e.register_max as register_max
from
event_event e,crm_case_section c
@ -448,19 +397,21 @@ class report_event_type_registration(osv.osv):
_description = "Event type on registration"
_auto = False
_columns = {
'name': fields.char('Event Type',size=20),
'nbevent':fields.integer('Number Of Events'),
'draft_state': fields.integer('Draft Registrations',size=20),
'confirm_state': fields.integer('Confirm Registrations',size=20),
'name': fields.char('Event Type', size=20),
'nbevent': fields.integer('Number Of Events'),
'draft_state': fields.integer('Draft Registrations', size=20),
'confirm_state': fields.integer('Confirm Registrations', size=20),
}
def init(self, cr):
cr.execute("""
create or replace view report_event_type_registration as (
select
count(t.id) as id,
t.name as name,
(select sum(nb_register) from event_registration r , crm_case c , event_event e where c.section_id=e.section_id and r.case_id=c.id and c.state='draft' and e.type=t.id ) as draft_state ,
(select sum(nb_register) from event_registration r , crm_case c , event_event e where c.section_id=e.section_id and r.case_id=c.id and c.state='open' and e.type=t.id ) as confirm_state,
(select sum(c.nb_register) from event_registration c, event_event e where c.section_id=e.section_id and c.state='draft' and e.type=t.id ) as draft_state ,
(select sum(c.nb_register) from event_registration c, event_event e where c.section_id=e.section_id and c.state='open' and e.type=t.id ) as confirm_state,
count(t.id) as nbevent
from
event_event e

View File

@ -33,8 +33,8 @@
<field name="res_model">event.type</field>
<field name="view_type">form</field>
</record>
<menuitem name="Configuration" id="menu_event_config" parent="menu_marketing_event_main" sequence="30"/>
<menuitem name="Types of Events" id="menu_event_type" action="action_event_type" parent="menu_event_config"/>
<menuitem name="Configuration" id="menu_event_config" parent="menu_marketing_event_main" sequence="30" groups="base.group_extended"/>
<menuitem name="Types of Events" id="menu_event_type" action="action_event_type" parent="menu_event_config" groups="base.group_extended,crm.group_crm_manager"/>
<!-- The base section for all events -->
@ -221,23 +221,26 @@
<field name="ref2" colspan="4"/>
</page>
<page string="History">
<field name="history_line" colspan="4" nolabel="1" mode="tree,form">
<form string="Communication history">
<field name="date"/>
<field name="som"/>
<newline/>
<field name="canal_id"/>
<field name="email"/>
<newline/>
<field name="description" colspan="4"/>
</form>
<tree string="Communication history">
<field name="date"/>
<field name="description"/>
<field name="som"/>
<field name="user_id"/>
<field name="canal_id"/>
</tree>
<field name="message_ids" colspan="4" nolabel="1" mode="tree,form">
<form string="Communication history">
<group col="6" colspan="4">
<field name="date"/>
<field name="email_to"/>
<field name="email_from"/>
</group>
<newline/>
<field name="description" colspan="4" nolabel="1"/>
<button colspan="4"
string="Reply to Last Email"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'reply', 'model': 'crm.lead'}"
icon="gtk-undo" type="action" />
</form>
<tree string="Communication history">
<field name="description"/>
<field name="email_to"/>
<field name="date"/>
</tree>
</field>
<field name="log_ids" nolabel="1" colspan="4" mode="tree,form" readonly="1">
<tree string="Actions">

View File

@ -2,11 +2,11 @@
<openerp>
<data>
<record id="menu_event_config" model="ir.ui.menu">
<field name="groups_id" eval="[(6,0,[ref('crm.group_crm_manager')])]"/>
<field name="groups_id" eval="[(6,0,[ref('crm.group_crm_manager'), ref('base.group_extended')])]"/>
</record>
<record id="menu_report_event" model="ir.ui.menu">
<field name="groups_id" eval="[(6,0,[ref('crm.group_crm_manager')])]"/>
<field name="groups_id" eval="[(6,0,[ref('crm.group_crm_manager'), ref('base.group_extended')])]"/>
</record>
</data>
</openerp>

View File

@ -27,21 +27,23 @@ class event_confirm_registration(osv.osv_memory):
"""
_name = "event.confirm.registration"
_description = "Event Registraion"
_columns = {
'msg': fields.text('Message', readonly=True),
'msg': fields.text('Message', readonly=True),
}
_defaults={
'msg':lambda *a:'The event limit is reached. What do you want to do?'
'msg':lambda *a:'The event limit is reached. What do you want to do?'
}
def confirm(self, cr, uid, ids, context):
registration_obj = self.pool.get('event.registration')
reg_id = context.get('reg_id', False) or context.get('active_id', False)
if reg_id:
registration_obj.write(cr, uid, [reg_id], {'state':'open',})
registration_obj.write(cr, uid, [reg_id], {'state':'open', })
registration_obj._history(cr, uid, [reg_id], 'Open', history=True)
registration_obj.mail_user(cr,uid,[reg_id])
registration_obj.mail_user(cr, uid, [reg_id])
return {}
event_confirm_registration()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -36,10 +36,8 @@ class event_registration_list(osv.osv_memory):
'type': 'ir.actions.act_window'
}
cr.execute('SELECT section_id FROM event_event WHERE id = %s', (context['active_id'],))
res = cr.fetchone()
return {
'domain': [('section_id', '=', res[0])],
'domain': [('section_id', '=', context['active_id'])],
'name': 'Event Registrations',
'view_type': 'form',
'view_mode': 'tree,form',

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: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-09-08 16:09+0000\n"
"Last-Translator: Fabien (Open ERP) <fp@tinyerp.com>\n"
"PO-Revision-Date: 2010-05-21 21:05+0000\n"
"Last-Translator: Christophe Chauvet - http://www.syleam.fr/ <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:18+0000\n"
"X-Launchpad-Export-Date: 2010-05-22 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: event_project
@ -24,7 +24,7 @@ msgstr "XML non valide pour l'architecture de la vue"
#. module: event_project
#: model:ir.actions.wizard,name:event_project.wizard_event_task
msgid "Tasks"
msgstr ""
msgstr "Tâches"
#. module: event_project
#: wizard_button:event.project,init,done:0
@ -39,6 +39,10 @@ msgid ""
" This module allow you to create retro planning for managing your "
"events.\n"
msgstr ""
"Organisation et gestion des évènements.\n"
"\n"
" Ce module vous autorise à créer un rétro-planning pour gérer vos "
"évènements.\n"
#. module: event_project
#: view:event.event:0
@ -48,7 +52,7 @@ msgstr "Tâches Restantes"
#. module: event_project
#: model:ir.module.module,shortdesc:event_project.module_meta_information
msgid "Event - Project"
msgstr ""
msgstr "Évènement - Projet"
#. module: event_project
#: field:event.event,project_id:0

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: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-05-12 20:04+0000\n"
"PO-Revision-Date: 2010-05-21 19: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-05-13 04:36+0000\n"
"X-Launchpad-Export-Date: 2010-05-22 04:00+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr
@ -42,7 +42,7 @@ msgstr ""
#: model:ir.module.module,shortdesc:hr.module_meta_information
#: model:ir.ui.menu,name:hr.menu_hr_root
msgid "Human Resources"
msgstr "Zasoby ludzkie"
msgstr "Zasoby kadrowe"
#. module: hr
#: selection:hr.timesheet,dayofweek:0
@ -263,7 +263,7 @@ msgstr ""
#. module: hr
#: field:hr.employee,user_id:0
msgid "Related User"
msgstr ""
msgstr "Powiązany użytkownik"
#. module: hr
#: field:hr.employee,category_id:0

View File

@ -45,9 +45,13 @@ class hr_expense_report(osv.osv):
'department_id':fields.many2one('hr.department','Department',readonly=True),
'company_id':fields.many2one('res.company', 'Company', readonly=True),
'user_id':fields.many2one('res.users', 'User', readonly=True),
'currency_id': fields.many2one('res.currency', 'Currency', readonly=True),
'price_total':fields.float('Total Price', readonly=True),
'analytic_account': fields.many2one('account.analytic.account','Analytic account',readonly=True),
'price_average':fields.float('Average Price', readonly=True),
'nbr':fields.integer('# of Lines', readonly=True),
'no_of_products':fields.integer('# of Products', readonly=True),
'no_of_account':fields.integer('# of Accounts', readonly=True),
'state': fields.selection([
('draft', 'Draft'),
('confirm', 'Waiting confirmation'),
@ -67,6 +71,7 @@ class hr_expense_report(osv.osv):
date_trunc('day',s.create_date) as date,
s.employee_id,
s.journal_id,
s.currency_id,
to_date(to_char(s.date_confirm, 'dd-MM-YYYY'),'dd-MM-YYYY') as date_confirm,
to_date(to_char(s.date_valid, 'dd-MM-YYYY'),'dd-MM-YYYY') as date_valid,
s.invoice_id,
@ -75,27 +80,33 @@ class hr_expense_report(osv.osv):
to_char(date_trunc('day',s.create_date), 'MM') as month,
to_char(date_trunc('day',s.create_date), 'YYYY-MM-DD') as day,
l.product_id as product_id,
l.analytic_account as analytic_account,
sum(l.unit_quantity * u.factor) as product_qty,
s.user_id as user_id,
s.company_id as company_id,
sum(l.unit_quantity*l.unit_amount) as price_total,
(sum(l.unit_quantity*l.unit_amount)/sum(l.unit_quantity * u.factor))::decimal(16,2) as price_average,
count(*) as nbr,
(select unit_quantity from hr_expense_line where id=l.id and product_id is not null) as no_of_products,
(select count(analytic_account) from hr_expense_line where id=l.id and analytic_account is not null) as no_of_account,
s.state
from
hr_expense_line l
left join
hr_expense_expense s on (s.id=l.expense_id)
left join product_uom u on (u.id=l.uom_id)
from hr_expense_line l
left join hr_expense_expense s on (s.id=l.expense_id)
left join product_uom u on (u.id=l.uom_id)
group by
date_trunc('day',s.create_date),
to_char(date_trunc('day',s.create_date), 'YYYY'),
to_char(date_trunc('day',s.create_date), 'MM'),
to_char(date_trunc('day',s.create_date), 'YYYY-MM-DD'),
to_date(to_char(s.date_confirm, 'dd-MM-YYYY'),'dd-MM-YYYY'),
to_date(to_char(s.date_valid, 'dd-MM-YYYY'),'dd-MM-YYYY'),
l.product_id,
l.analytic_account,
s.invoice_id,
s.currency_id,
s.department_id,
l.uom_id,
l.id,
s.user_id,
s.state,
s.journal_id,

View File

@ -14,12 +14,16 @@
<field name="month" invisible="1"/>
<field name="day" invisible="1"/>
<field name="invoice_id" invisible="1"/>
<field name="analytic_account" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="journal_id" invisible="1"/>
<field name="currency_id" invisible="1"/>
<field name="product_id" invisible="1"/>
<field name="product_qty" invisible="1"/>
<field name="nbr" sum="# of Lines"/>
<field name="no_of_products" sum="# of Products"/>
<field name="no_of_account" sum="# of Accounts"/>
<field name="price_average" avg="Average Price"/>
<field name="price_total" sum="Total Price"/>
<field name="state" invisible="1"/>
@ -47,7 +51,7 @@
<field name="arch" type="xml">
<search string="Expenses">
<group>
<filter icon="terp-hr" string="This Year"
<filter icon="terp-hr" string="Last 365 Days"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Expenses during last 7 year"/>
<filter icon="terp-hr" string="This Month"
@ -83,6 +87,8 @@
help="Expenses Non Assigned User"
domain="[('user_id','=',False)]"/>
</field>
<field name="product_id"/>
<field name="employee_id" widget="selection"/>
</group>
<newline/>
<group expand="0" string="Extended options..." colspan="10" col="12">
@ -99,13 +105,11 @@
domain="[('state','=','cancelled')]"
help = "Cancelled Expenses"/>
<separator orientation="vertical"/>
<field name="employee_id" widget="selection"/>
<field name="product_id" widget="selection"/>
<field name="department_id" widget="selection"/>
<newline/>
<field name="journal_id" widget="selection"/>
<field name="currency_id" widget="selection"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<separator orientation="vertical"/>
<newline/>
<field name="date_confirm"/>
<field name="date_valid"/>
</group>
@ -115,13 +119,16 @@
<filter string="Employee" icon="terp-hr" context="{'group_by':'employee_id'}"/>
<filter string="Company" icon="terp-hr" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator orientation="vertical"/>
<filter string="Analytic account" icon="terp-hr" context="{'group_by':'analytic_account'}"/>
<filter string="Currency" icon="terp-hr" context="{'group_by':'currency_id'}"/>
<filter string="Department" icon="terp-hr" context="{'group_by':'department_id'}"/>
<separator orientation="vertical"/>
<filter string="Product" icon="terp-hr" context="{'group_by':'product_id'}"/>
<filter string="State" icon="terp-hr" context="{'group_by':'state'}"/>
<filter string="Force Journal" icon="terp-hr" context="{'group_by':'journal_id'}"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-hr" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-hr" context="{'group_by':'date'}"/>
<filter string="Month" icon="terp-hr" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-hr" context="{'group_by':'year'}"/>
</group>
</search>

View File

@ -25,8 +25,9 @@ class available_holidays_report(osv.osv):
_name = "available.holidays.report"
_auto = False
_columns = {
'date': fields.datetime('Date', readonly=True),
'date': fields.date('Date', readonly=True),
'year': fields.char('Year', size=4, readonly=True),
'day': fields.char('Day', size=15, readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
@ -35,6 +36,7 @@ class available_holidays_report(osv.osv):
'max_leave': fields.float('Allocated Leaves', readonly=True),
'taken_leaves': fields.float('Taken Leaves', readonly=True),
'remaining_leave': fields.float('Remaining Leaves',readonly=True),
'department_id':fields.many2one('hr.department','Department',readonly=True),
'user_id':fields.many2one('res.users', 'User', readonly=True),
}
def init(self, cr):
@ -46,8 +48,10 @@ class available_holidays_report(osv.osv):
date_trunc('day',h.create_date) as date,
to_char(s.create_date, 'YYYY') as year,
to_char(s.create_date, 'MM') as month,
to_char(s.create_date, 'YYYY-MM-DD') as day,
h.employee_id as employee_id,
h.user_id as user_id,
h.department_id,
h.state as state,
h.holiday_status_id as holiday_status_id,
sum(number_of_days) as remaining_leave,
@ -68,7 +72,8 @@ class available_holidays_report(osv.osv):
and s.active <> 'f'
group by h.holiday_status_id, h.employee_id,
date_trunc('day',h.create_date),to_char(s.create_date, 'YYYY'),
to_char(s.create_date, 'MM'),h.user_id,h.state
to_char(s.create_date, 'MM'),to_char(s.create_date, 'YYYY-MM-DD'),h.user_id,
h.state,h.department_id
)""")
available_holidays_report()

View File

@ -10,40 +10,32 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Available Holidays">
<field name="employee_id"/>
<field name="holiday_status_id"/>
<field name="max_leave"/>
<field name="taken_leaves"/>
<field name="employee_id" invisible="1"/>
<field name="holiday_status_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="max_leave" sum="Allocated Leaves"/>
<field name="taken_leaves" sum="Taken Leaves"/>
<field name="user_id" invisible="1"/>
<field name="remaining_leave"/>
<field name="remaining_leave" sum="Remaining Leaves"/>
<field name="year" invisible="1"/>
<field name="day" invisible="1"/>
<field name="month" invisible="1"/>
<field name="date" invisible="1"/>
</tree>
</field>
</record>
<record id="view_hr_available_holidays_report_form" model="ir.ui.view">
<field name="name">available.holidays.report.form</field>
<field name="model">available.holidays.report</field>
<field name="type">form</field>
<field name="arch" type="xml">
<tree string="Available Holidays">
<field name="employee_id" select="1"/>
<field name="holiday_status_id" select="1"/>
<field name="remaining_leave"/>
</tree>
</field>
</record>
<record id="view_hr_available_holidays_report_graph" model="ir.ui.view">
<field name="name">available.holidays.report.graph</field>
<field name="model">available.holidays.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="Available Holidays" type="bar">
<field name="holiday_status_id"/>
<field name="employee_id"/>
<field name="max_leave" operator="+"/>
<field name="taken_leaves" operator="+"/>
<field name="remaining_leave" operator="+"/>
<field group="True" name="employee_id"/>
<field group="True" name="holiday_status_id"/>
</graph>
</field>
</record>
@ -55,32 +47,42 @@
<field name="arch" type="xml">
<search string="Leaves">
<group>
<filter icon="terp-hr"
string="This Year"
domain="[('year','=',time.strftime('%%Y'))]"
help="Leaves of the year"/>
<filter icon="terp-hr"
string="This Month"
domain="[('month','=',time.strftime('%%m'))]"
help="Leaves of this month"/>
<filter icon="terp-hr" string="This Year"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Leaves in this year"/>
<filter icon="terp-hr" string="This Month"
name="month"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
help="Leaves in this month"/>
<filter icon="gtk-media-rewind"
string=" 7 Days "
separator="1"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Leaves during last 7 days"/>
<separator orientation="vertical"/>
<field name="employee_id"/>
<field name="employee_id"/>
<field name="user_id" widget="selection">
<filter icon="terp-sale"
string="My Leaves"
default="1"
domain="[('user_id','=',uid)]"/>
<filter icon="terp-hr"
string="My Leaves"
domain="[('user_id','=',uid)]"/>
</field>
</group>
<newline/>
<group expand="0" string="Extended options..." colspan="10" col="12">
<field name="holiday_status_id" widget="selection"/>
<field name="department_id" widget="selection"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter string="Employee" icon="terp-hr" context="{'group_by':'employee_id'}"/>
<filter string="User" name="User" icon="terp-hr" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="User" icon="terp-hr" context="{'group_by':'user_id'}"/>
<filter string="Type" icon="terp-hr" context="{'group_by':'holiday_status_id'}"/>
<filter string="Department" icon="terp-hr" context="{'group_by':'department_id'}"/>
<separator orientation="vertical"/>
<filter string="Month" icon="terp-sale" context="{'group_by':'date'}"/>
<filter string="Year" icon="terp-sale" context="{'group_by':'year'}"/>
<filter string="Day" icon="terp-hr" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-hr" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-hr" context="{'group_by':'year'}"/>
</group>
</search>
</field>
@ -93,8 +95,8 @@
<field name="res_model">available.holidays.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="view_id" ref="view_hr_available_holidays_report_search"/>
</record>
<record model="ir.actions.act_window.view" id="action_hr_available_holidays_report_tree">

View File

@ -28,16 +28,19 @@ class hr_holidays_report(osv.osv):
_auto = False
_rec_name = 'date'
_columns = {
'date': fields.datetime('Date', readonly=True),
'date': fields.date('Date', readonly=True),
'year': fields.char('Year', size=4, readonly=True),
'day': fields.char('Day', size=15, readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
'date_from' : fields.datetime('Start Date', readonly=True),
'date_to' : fields.datetime('End Date', readonly=True),
'number_of_days_temp': fields.float('Number of Days', readonly=True),
'date_from' : fields.date('Start Date', readonly=True),
'date_to' : fields.date('End Date', readonly=True),
'number_of_days_temp': fields.float('#Days', readonly=True),
'employee_id' : fields.many2one('hr.employee', "Employee's Name",readonly=True),
'user_id':fields.many2one('res.users', 'User', readonly=True),
'holiday_status_id' : fields.many2one("hr.holidays.status", "Leave Type",readonly=True),
'department_id':fields.many2one('hr.department','Department',readonly=True),
'state': fields.selection([('draft', 'Draft'),
('confirm', 'Waiting Validation'),
('refuse', 'Refused'),
@ -52,14 +55,17 @@ class hr_holidays_report(osv.osv):
create or replace view hr_holidays_report as (
select
min(s.id) as id,
date_trunc('seconds',s.create_date) as date,
date_trunc('day',s.create_date) as date,
date_trunc('day',s.date_from) as date_from,
date_trunc('day',s.date_to) as date_to,
s.number_of_days_temp,
sum(s.number_of_days_temp) as number_of_days_temp,
s.employee_id,
s.user_id as user_id,
to_char(s.create_date, 'YYYY') as year,
to_char(s.create_date, 'MM') as month,
to_char(s.create_date, 'YYYY-MM-DD') as day,
s.holiday_status_id,
s.department_id,
s.state
from
hr_holidays s
@ -67,7 +73,8 @@ class hr_holidays_report(osv.osv):
s.employee_id is not null
group by
s.create_date,s.state,s.date_from,s.date_to,
s.number_of_days_temp,s.employee_id,s.user_id
s.employee_id,s.user_id,s.holiday_status_id,
s.department_id
)
""")
hr_holidays_report()

View File

@ -1,20 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<data>
<record id="view_hr_holidays_report_tree" model="ir.ui.view">
<field name="name">hr.holidays.report.tree</field>
<field name="model">hr.holidays.report</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Leaves Statistics">
<field name="date"/>
<field name="employee_id"/>
<field name="date_from"/>
<field name="date_to"/>
<field name="number_of_days_temp"/>
<field name="date" invisible="1"/>
<field name="employee_id" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="date_from" invisible="1"/>
<field name="date_to" invisible="1"/>
<field name="number_of_days_temp" sum="#Days"/>
<field name="holiday_status_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="year" invisible="1"/>
<field name="day" invisible="1"/>
<field name="month" invisible="1"/>
<field name="state"/>
<field name="state" invisible="1"/>
</tree>
</field>
</record>
@ -27,6 +32,7 @@
<graph string="Leaves Statistics" type="bar">
<field name="employee_id"/>
<field name="number_of_days_temp" operator="+"/>
<field name="state" group = "True"/>
</graph>
</field>
</record>
@ -37,45 +43,71 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Leaves">
<filter icon="terp-hr"
string="This Year"
domain="[('year','=',time.strftime('%%Y'))]"
help="Leaves of the year"/>
<filter icon="terp-hr"
string="This Month"
domain="[('month','=',time.strftime('%%m'))]"
help="Leaves of this month"/>
<separator orientation="vertical"/>
<filter icon="terp-hr"
string="Draft"
domain="[('state','=','draft')]"/>
<filter icon="terp-hr"
string="Validate"
domain="[('state','=','validate')]"/>
<filter icon="terp-hr"
string="Start Leaves"
domain="[('date_from','=',time.strftime('%%Y/%%m/%%d'))]"/>
<filter icon="terp-hr"
string="End Leaves"
domain="[('date_to','=',time.strftime('%%Y/%%m/%%d'))]"/>
<separator orientation="vertical"/>
<field name="employee_id"/>
<field name="user_id" widget="selection">
<filter icon="terp-sale"
string="My Leaves"
default="1"
domain="[('user_id','=',uid)]"/>
</field>
<field name="date"/>
<group>
<filter icon="terp-hr" string="This Year"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Leaves in this year"/>
<filter icon="terp-hr" string="This Month"
name="month"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
help="Leaves in this month"/>
<filter icon="gtk-media-rewind"
string=" 7 Days "
separator="1"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Leaves during last 7 days"/>
<separator orientation="vertical"/>
<filter string="Draft"
icon="terp-hr"
domain="[('state','=','draft')]"
help = "Draft Leaves"/>
<filter string="Waiting Validation"
icon="terp-hr"
domain="[('state', '=' ,'confirm')]"
help = "In progress Leaves"/>
<filter string="Validated"
icon="terp-hr"
domain="[('state','=','validate')]"
help = "Pending Leaves"/>
<separator orientation="vertical"/>
<field name="employee_id"/>
<field name="user_id" widget="selection">
<filter icon="terp-hr"
string="My Leaves"
domain="[('user_id','=',uid)]"/>
</field>
</group>
<newline/>
<group expand="0" string="Extended options..." colspan="10" col="12">
<filter icon="terp-hr"
string="Refused"
name="done"
domain="[('state','=','refuse')]"/>
<separator orientation="vertical"/>
<field name="date_from"/>
<separator orientation="vertical"/>
<field name="holiday_status_id" widget="selection"/>
<newline/>
<filter icon="terp-hr"
string="Cancelled"
domain="[('state','=','cancel')]"/>
<separator orientation="vertical"/>
<field name="date_to"/>
<separator orientation="vertical"/>
<field name="department_id" widget="selection"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter string="Employee" name="employee" icon="terp-hr" context="{'group_by':'employee_id'}"/>
<filter string="Employee" name="Employee" icon="terp-hr" context="{'group_by':'employee_id'}"/>
<filter string="User" name="User" icon="terp-hr" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Type" icon="terp-hr" context="{'group_by':'holiday_status_id'}"/>
<filter string="Department" icon="terp-hr" context="{'group_by':'department_id'}"/>
<filter string="State" icon="terp-hr" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Month" icon="terp-sale" context="{'group_by':'date'}"/>
<filter string="Year" icon="terp-sale" context="{'group_by':'year'}"/>
<filter string="Day" icon="terp-hr" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-hr" context="{'group_by':'date'}"/>
<filter string="Year" icon="terp-hr" context="{'group_by':'year'}"/>
</group>
</search>
</field>
@ -86,7 +118,7 @@
<field name="res_model">hr.holidays.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'search_default_employee': 1}</field>
<field name="context">{'search_default_month':1,'search_default_Employee':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="search_view_id" ref="view_hr_holidays_report_search"/>
</record>
@ -117,5 +149,6 @@
</graph>
</field>
</record>
</data>
</data>
</openerp>

View File

@ -57,11 +57,13 @@ class hr_applicant(osv.osv, crm.crm_case):
_name = "hr.applicant"
_description = "Applicant Cases"
_order = "id desc"
_inherit ='mailgate.thread'
_inherits = {'mailgate.thread': 'thread_id'}
_columns = {
'active': fields.boolean('Active', help="If the active field is set to false, it will allow you to hide the case without removing it."),
'description': fields.text('Description'),
'thread_id': fields.many2one('mailgate.thread', 'Thread', required=False),
'name': fields.char('Name', size=128, required=True),
'active': fields.boolean('Active', help="If the active field is set to false, it will allow you to hide the case without removing it."),
'description': fields.text('Description'),
'section_id': fields.many2one('crm.case.section', 'Sales Team', \
select=True, help='Sales team to which Case belongs to.\
Define Responsible user and Email account for mail gateway.'),
@ -103,6 +105,16 @@ class hr_applicant(osv.osv, crm.crm_case):
'survey' : fields.related('job_id', 'survey_id', type='many2one', relation='survey', string='Survey'),
'response' : fields.integer("Response"),
}
_defaults = {
'active': lambda *a: 1,
'user_id': crm.crm_case._get_default_user,
'email_from': crm.crm_case. _get_default_email,
'state': lambda *a: 'draft',
'section_id': crm.crm_case. _get_section,
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.helpdesk', context=c),
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
}
def onchange_job(self,cr, uid, ids, job, context={}):
result = {}

View File

@ -105,6 +105,8 @@ class hr_recruitment_report(osv.osv):
'priority': fields.selection(hr_recruitment.AVAILABLE_PRIORITIES, 'Appreciation'),
'salary_prop' : fields.float("Salary Proposed"),
'salary_exp' : fields.float("Salary Expected"),
'partner_id': fields.many2one('res.partner', 'Partner',readonly=True),
'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact Name',readonly=True),
'available' : fields.float("Availability")
}
@ -121,7 +123,9 @@ class hr_recruitment_report(osv.osv):
to_char(s.create_date, 'MM') as month,
to_char(s.create_date, 'YYYY-MM-DD') as day,
s.state,
s.partner_id,
s.company_id,
s.partner_address_id,
s.user_id,
s.job_id,
s.type_id,
@ -140,6 +144,8 @@ class hr_recruitment_report(osv.osv):
date_trunc('day',s.create_date),
date_trunc('day',s.date_closed),
s.state,
s.partner_id,
s.partner_address_id,
s.company_id,
s.user_id,
s.stage_id,

View File

@ -10,9 +10,11 @@
<field name="date" invisible="1"/>
<field name="user_id" invisible="1"/>
<field name="job_id" invisible="1"/>
<field name="stage_id" invisible="1" widget="selection"/>
<field name="stage_id" invisible="1" />
<field name="department_id" invisible="1"/>
<field name="type_id" invisible="1"/>
<field name="partner_id" invisible="1"/>
<field name="partner_address_id" invisible="1"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="state" invisible="1"/>
<field name="year" invisible="1"/>
@ -100,29 +102,36 @@
string="Hired"
name="done"
domain="[('state','=','done')]"/>
<filter icon="terp-hr"
string="Refused"
domain="[('state','=','cancel')]"/>
<separator orientation="vertical"/>
<field name="date"/>
<separator orientation="vertical"/>
<field name="priority"/>
<field name="stage_id" widget="selection"/>
<field name="job_id" widget="selection"/>
<newline/>
<field name="type_id" widget="selection"/>
<field name="date"/>
<filter icon="terp-hr"
string="Refused"
domain="[('state','=','cancel')]"/>
<separator orientation="vertical"/>
<field name="date_closed"/>
<separator orientation="vertical"/>
<field name="type_id" widget="selection"/>
<field name="partner_id"/>
<field name="partner_address_id"/>
</group>
<newline/>
<group expand="1" string="Group By ..." colspan="10" col="12">
<filter string="User" name='User' icon="terp-hr" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Company" icon="terp-hr" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<filter string="Stage" name="Stage" icon="terp-hr" domain="[]" context="{'group_by':'stage_id'}" />
<filter string="Partner" icon="terp-hr" domain="[]" context="{'group_by':'partner_id'}" />
<filter string="Stage" icon="terp-hr" domain="[]" context="{'group_by':'stage_id'}" />
<separator orientation="vertical"/>
<filter string="State" icon="terp-hr" domain="[]" context="{'group_by':'state'}"/>
<filter string="Jobs" icon="terp-sale" domain="[]" context="{'group_by':'job_id'}"/>
<filter string="Department" icon="terp-hr" domain="[]" context="{'group_by':'department_id'}"/>
<filter string="Degree" icon="terp-hr" domain="[]" context="{'group_by':'type_id'}"/>
<filter string="Partner Contact Name" icon="terp-hr" domain="[]" context="{'group_by':'partner_address_id'}" />
<filter string="Jobs" name="job" icon="terp-sale" domain="[]" context="{'group_by':'job_id'}"/>
<filter string="Department" name="department" icon="terp-hr" domain="[]" context="{'group_by':'department_id'}"/>
<filter string="Degree" name="degree" icon="terp-hr" domain="[]" context="{'group_by':'type_id'}"/>
<separator orientation="vertical"/>
<filter string="State" icon="terp-hr" domain="[]" context="{'group_by':'state'}"/>
<filter string="Day" name = "day" icon="terp-hr" domain="[]" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-hr" domain="[]" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-hr" domain="[]" context="{'group_by':'year'}"/>

View File

@ -103,7 +103,7 @@
<field name="context">{'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="search_view_id" ref="view_timesheet_line_search"/>
</record>
<menuitem action="action_timesheet_line_stat_all" id="menu_report_timesheet_line_all" parent="hr.menu_hr_reporting"/>
<!--menuitem action="action_timesheet_line_stat_all" id="menu_report_timesheet_line_all" parent="hr.menu_hr_reporting"/-->
<!-- Statistics report on timesheet by user -->

View File

@ -33,7 +33,11 @@ class timesheet_report(osv.osv):
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'name': fields.char('Description', size=64,readonly=True),
'product_id' : fields.many2one('product.product', 'Product'),
'general_account_id' : fields.many2one('account.account', 'General Account', readonly=True),
'user_id': fields.many2one('res.users', 'User',readonly=True),
'to_invoice': fields.many2one('hr_timesheet_invoice.factor', 'Type of Invoicing',readonly=True),
'account_id': fields.many2one('account.analytic.account', 'Analytic Account',readonly=True),
'nbr': fields.integer('#Nbr',readonly=True),
'company_id': fields.many2one('res.company', 'Company',readonly=True),
'department_id':fields.many2one('hr.department','Department',readonly=True),
@ -45,9 +49,8 @@ class timesheet_report(osv.osv):
('draft','Draft'),
('confirm','Confirmed'),
('done','Done')], 'State', readonly=True),
'total_att': fields.float('Total Timesheet',readonly=True),
'total_ts': fields.float('Total Attendance',readonly=True),
'total_diff': fields.float('Difference', readonly=True),
'quantity': fields.float('#Quantity',readonly=True),
'cost': fields.float('#Cost',readonly=True),
}
def init(self, cr):
@ -64,10 +67,12 @@ class timesheet_report(osv.osv):
to_char(htss.date_current,'MM') as month,
to_char(htss.date_current, 'YYYY-MM-DD') as day,
count(*) as nbr,
sum(day.total_attendance) as total_att,
sum(day.total_timesheet) as total_ts,
sum(day.total_difference) as total_diff,
sum(aal.unit_amount) as quantity,
sum(aal.amount) as cost,
aal.account_id,
aal.product_id,
aal.to_invoice,
aal.general_account_id,
htss.user_id,
htss.company_id,
htss.department_id,
@ -75,7 +80,6 @@ class timesheet_report(osv.osv):
from account_analytic_line as aal
left join hr_analytic_timesheet as hat ON (hat.line_id=aal.id)
left join hr_timesheet_sheet_sheet as htss ON (hat.line_id=htss.id)
left join hr_timesheet_sheet_sheet_day AS day ON (htss.id = day.sheet_id)
group by
to_char(htss.date_current,'YYYY'),
to_char(htss.date_current,'MM'),
@ -84,6 +88,9 @@ class timesheet_report(osv.osv):
htss.date_from,
htss.date_to,
htss.date_current,
aal.to_invoice,
aal.product_id,
aal.general_account_id,
htss.name,
htss.company_id,
htss.state,

View File

@ -7,10 +7,9 @@
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Timesheet" type="bar">
<field name="name" />
<field name="total_att" operator = "+"/>
<field name="total_ts" operator = "+"/>
<field name="user_id" group = "True"/>
<field name="user_id" />
<field name="quantity" operator = "+"/>
<field name="state" group = "True"/>
</graph>
</field>
</record>
@ -25,12 +24,15 @@
<field name="user_id" invisible="1"/>
<field name="date_from" invisible="1"/>
<field name="date_to" invisible="1"/>
<field name="total_att" sum="Total Timesheet"/>
<field name="total_diff" sum="Total Attendance"/>
<field name="total_ts" sum="Difference"/>
<field name="quantity" sum="#Quantity"/>
<field name="cost" sum="#Cost"/>
<field name="state" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="to_invoice" invisible="1"/>
<field name="product_id" invisible="1"/>
<field name="account_id" invisible="1"/>
<field name="general_account_id" invisible="1"/>
<field name="year" invisible="1"/>
<field name="day" invisible="1"/>
<field name="month" invisible="1"/>
@ -43,7 +45,7 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Timesheet">
<group col="10" colspan="4">
<group col="10" colspan="12">
<filter icon="terp-hr" string="This Year"
domain="[('date_current','&lt;=', time.strftime('%%Y-%%m-%%d')),('date_current','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Timesheet in this year"/>
@ -63,10 +65,8 @@
<filter icon="terp-hr"
string="Confirmed"
domain="[('state','=','confirm')]"/>
<filter icon="terp-hr"
string="Done"
domain="[('state','=','done')]"/>
<separator orientation="vertical"/>
<field name="product_id"/>
<field name="user_id" widget="selection">
<filter icon="terp-hr"
string="My timesheet"
@ -80,26 +80,40 @@
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
<newline/>
<group expand="0" string="Extended options..." colspan="10" col="12">
<filter icon="terp-hr"
string="New"
domain="[('state','=','new')]"/>
<separator orientation="vertical"/>
<field name="department_id" widget="selection"/>
<separator orientation="vertical"/>
<field name="date_from"/>
<field name="date_to"/>
</group>
<group expand="0" string="Extended options..." colspan="10" col="12">
<filter icon="terp-hr"
string="New"
domain="[('state','=','new')]"/>
<separator orientation="vertical"/>
<field name="date_from"/>
<separator orientation="vertical"/>
<field name="account_id"/>
<field name="department_id" widget="selection"/>
<newline/>
<filter icon="terp-hr"
string="Done"
domain="[('state','=','done')]"/>
<separator orientation="vertical"/>
<field name="date_to"/>
<separator orientation="vertical"/>
<field name="general_account_id"/>
<field name="to_invoice" widget="selection"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter string="User" name="User" icon="terp-hr" context="{'group_by':'user_id'}"/>
<filter string="Company" icon="terp-hr" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<filter string="Product" icon="terp-hr" context="{'group_by':'product_id'}"/>
<separator orientation="vertical"/>
<filter string="Type of Invoicing" icon="terp-hr" context="{'group_by':'to_invoice'}"/>
<filter string="Analytic Account" icon="terp-hr" context="{'group_by':'account_id'}"/>
<filter string="General Account" icon="terp-hr" context="{'group_by':'general_account_id'}"/>
<separator orientation="vertical"/>
<filter string="Company" icon="terp-hr" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<filter string="Department" icon="terp-hr" context="{'group_by':'department_id'}"/>
<filter string="State" icon="terp-hr" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-hr" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-hr" context="{'group_by':'date_current'}"/>
<filter string="Month" icon="terp-hr" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-hr" context="{'group_by':'year'}"/>
</group>
</search>

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