[MERGE] branch merged with lp:~openerp-dev/openobject-addons/trunk-dev-addons3
bzr revid: mtr@mtr-20100708103148-hbhtx4ixce9c7khe
This commit is contained in:
@@ -217,11 +217,11 @@
|
||||
<td><para style="P10">Balance</para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="P14">[[ repeatIn(lines(data['form']), 'a') ]]<font>[[ a['level']>2 and setTag('para','para',{'fontName':"Helvetica"}) ]]</font><i>[[ a['code'] or removeParentNode('tr') ]]</i></para></td>
|
||||
<td><para style="P14"><font>[[ a['level']>2 and setTag('para','para',{'fontName':"Helvetica"}) ]]</font><font color="white">[[ '..'*(a['level']-1) ]]</font><font>[[ a['name'] ]]</font></para></td>
|
||||
<td><para style="P3"><font>[[ a['level']>2 and setTag('para','para',{'fontName':"Helvetica"}) ]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['debit']) ]]</font><font>[[ a['type']<>'view' and removeParentNode('font') ]] [[formatLang(a['debit']) ]]</font></para></td>
|
||||
<td><para style="P3"><font>[[ a['level']>2 and setTag('para','para',{'fontName':"Helvetica"}) ]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['credit']) ]]</font><font>[[ a['type']<>'view' and removeParentNode('font') ]] [[ formatLang(a['credit']) ]]</font></para></td>
|
||||
<td><para style="P3"><font>[[ a['level']>2 and setTag('para','para',{'fontName':"Helvetica"}) ]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['balance']) ]]</font><font>[[ a['type']<>'view' and removeParentNode('font') ]] [[ formatLang(a['balance']) ]]</font></para></td>
|
||||
<td><para style="P14">[[ repeatIn(lines(data['form']), 'a') ]]<font>[[ (a['level']>2 and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]]</font><i>[[ a['code'] or removeParentNode('tr') ]]</i></para></td>
|
||||
<td><para style="P14"><font>[[ (a['level']>2 and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]]</font><font color="white">[[ '..'*(a['level']-1) ]]</font><font>[[ a['name'] ]]</font></para></td>
|
||||
<td><para style="P3"><font>[[ (a['level']>2 and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['debit']) ]]</font><font>[[ a['type']<>'view' and removeParentNode('font') ]] [[formatLang(a['debit']) ]]</font></para></td>
|
||||
<td><para style="P3"><font>[[ (a['level']>2 and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font')]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['credit']) ]]</font><font>[[ a['type']<>'view' and removeParentNode('font') ]] [[ formatLang(a['credit']) ]]</font></para></td>
|
||||
<td><para style="P3"><font>[[ (a['level']>2 and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]]</font><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['balance']) ]]</font><font>[[ a['type']<>'view' and removeParentNode('font') ]] [[ formatLang(a['balance']) ]]</font></para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</story>
|
||||
|
||||
@@ -50,36 +50,42 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Entries Analysis">
|
||||
<group colspan="10" col="12">
|
||||
<filter string="Income" name="profit" icon="terp-document-new" domain="[('user_type.report_type','=','income')]"/>
|
||||
<filter string="Expense" name="loss" icon="terp-document-new" domain="[('user_type.report_type','=','expense')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Asset" name="asset" icon="terp-document-new" domain="[('user_type.report_type','=','asset')]"/>
|
||||
<filter string="Liability" name="liability" icon="terp-document-new" domain="[('user_type.report_type','=','liability')]"/>
|
||||
<filter string="Receivable" name="asset" icon="terp-document-new" domain="[('type','=','receivable')]"/>
|
||||
<filter string="Payable" name="asset" icon="terp-document-new" domain="[('type','=','payable')]"/>
|
||||
<filter icon="terp-go-year" string="This Year"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Tasks performed in this year"/>
|
||||
<filter icon="terp-go-month" string="This Month"
|
||||
name="month"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Tasks performed in this month"/>
|
||||
<filter icon="terp-go-week"
|
||||
string="7 Days"
|
||||
separator="1"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Tasks during last 7 days"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Draft" icon="terp-document-new" domain="[('state','=','draft')]" help = "Draft entries"/>
|
||||
<filter string="Posted" icon="terp-camera_test" domain="[('state','=','posted')]" help = "Posted entries"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="journal_id"/>
|
||||
<field name="period_id"/>
|
||||
<field name="account_id"/>
|
||||
<field name="analytic_account_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By...">
|
||||
<filter string="Journal" name="group_journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
|
||||
<filter string="Account" name="group_account" icon="terp-folder-orange" context="{'group_by':'account_id'}"/>
|
||||
<filter string="Fiscal Year" icon="terp-go-month" context="{'group_by':'fiscalyear_id'}"/>
|
||||
<filter string="Period" icon="terp-go-month" name="group_period" context="{'group_by':'period_id'}"/>
|
||||
<filter string="Journal" name="group_journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Analytic" name="analytic_account" icon="terp-folder-orange" context="{'group_by':'analytic_account_id'}"/>
|
||||
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
|
||||
<filter string="Type" icon="terp-stock_symbol-selection" context="{'group_by':'user_type'}"/>
|
||||
<filter string="Int.Type" icon="terp-stock_symbol-selection" context="{'group_by':'type'}"/>
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Analytic" name="analytic_account" icon="terp-folder-orange" context="{'group_by':'analytic_account_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Period" icon="terp-go-month" name="group_period" context="{'group_by':'period_id'}"/>
|
||||
<filter string="Fiscal Year" icon="terp-go-month" context="{'group_by':'fiscalyear_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-go-today" context="{'group_by':'date'}"/>
|
||||
@@ -88,12 +94,20 @@
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended options..." groups="base.group_extended">
|
||||
<field name="journal_id"/>
|
||||
<field name="fiscalyear_id"/>
|
||||
<field name="period_id"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="analytic_account_id"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="product_id"/>
|
||||
<field name="partner_id"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<newline/>
|
||||
<field name="date"/>
|
||||
<field name="date_created"/>
|
||||
<field name="date_maturity"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="product_id" />
|
||||
<field name="partner_id" />
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -103,7 +117,7 @@
|
||||
<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_profit': 1,'search_default_group_journal':1,'search_default_group_period': 1, 'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
<field name="context">{'search_default_profit': 1,'search_default_group_account':1,'search_default_group_month': 1, 'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
</record>
|
||||
<menuitem action="action_account_entries_report_all" id="menu_action_account_entries_report_all" parent="account.menu_finance_statistic_report_statement" sequence="2"/>
|
||||
</data>
|
||||
|
||||
@@ -77,84 +77,83 @@ class account_invoice_report(osv.osv):
|
||||
tools.drop_view_if_exists(cr, 'account_invoice_report')
|
||||
cr.execute("""
|
||||
create or replace view account_invoice_report as (
|
||||
select
|
||||
min(l.id) as id,
|
||||
s.date_invoice as date,
|
||||
to_char(s.date_invoice, 'YYYY') as year,
|
||||
to_char(s.date_invoice, 'MM') as month,
|
||||
to_char(s.date_invoice, 'YYYY-MM-DD') as day,
|
||||
l.product_id as product_id,
|
||||
sum(case when s.type in ('out_refund','in_invoice') then
|
||||
l.quantity * u.factor * -1
|
||||
else
|
||||
l.quantity * u.factor
|
||||
end) as product_qty,
|
||||
s.partner_id as partner_id,
|
||||
s.reconciled::integer,
|
||||
s.payment_term as payment_term,
|
||||
s.period_id as period_id,
|
||||
u.name as uom_name,
|
||||
s.currency_id as currency_id,
|
||||
s.journal_id as journal_id,
|
||||
s.fiscal_position as fiscal_position,
|
||||
s.user_id as user_id,
|
||||
s.company_id as company_id,
|
||||
sum(case when s.type in ('out_refund','in_invoice') then
|
||||
l.quantity*l.price_unit * -1
|
||||
else
|
||||
l.quantity*l.price_unit
|
||||
end) as price_total,
|
||||
sum(case when s.type in ('out_refund','in_invoice') then
|
||||
l.quantity*l.price_unit * -1
|
||||
else
|
||||
l.quantity*l.price_unit
|
||||
end) / sum(l.quantity * u.factor)::decimal(16,2) as price_average,
|
||||
count(*) as nbr,
|
||||
s.type as type,
|
||||
s.state,
|
||||
pt.categ_id,
|
||||
s.date_due as date_due,
|
||||
s.address_contact_id as address_contact_id,
|
||||
s.address_invoice_id as address_invoice_id,
|
||||
s.account_id as account_id,
|
||||
s.partner_bank as partner_bank,
|
||||
sum(case when s.type in ('out_refund','in_invoice') then
|
||||
s.residual * -1
|
||||
else
|
||||
s.residual
|
||||
end) as residual,
|
||||
case when s.state != 'paid' then null else
|
||||
extract(epoch from avg(am.date_created-l.create_date))/(24*60*60)::decimal(16,2)
|
||||
end as delay_to_pay
|
||||
from account_invoice_line l
|
||||
left join account_invoice s on (s.id=l.invoice_id)
|
||||
left join product_template pt on (pt.id=l.product_id)
|
||||
left join product_uom u on (u.id=l.uos_id),
|
||||
account_move_line am left join account_invoice i on (i.move_id=am.move_id)
|
||||
where am.account_id=i.account_id
|
||||
group by
|
||||
s.type,
|
||||
s.date_invoice,
|
||||
s.partner_id,
|
||||
l.product_id,
|
||||
u.name,
|
||||
l.uos_id,
|
||||
s.reconciled,
|
||||
s.user_id,
|
||||
s.state,
|
||||
s.residual,
|
||||
pt.categ_id,
|
||||
s.company_id,
|
||||
s.payment_term,
|
||||
s.period_id,
|
||||
s.fiscal_position,
|
||||
s.currency_id,
|
||||
s.journal_id,
|
||||
s.date_due,
|
||||
s.address_contact_id,
|
||||
s.address_invoice_id,
|
||||
s.account_id,
|
||||
s.partner_bank
|
||||
select min(ail.id) as id,
|
||||
ai.date_invoice as date,
|
||||
to_char(ai.date_invoice, 'YYYY') as year,
|
||||
to_char(ai.date_invoice, 'MM') as month,
|
||||
to_char(ai.date_invoice, 'YYYY-MM-DD') as day,
|
||||
ail.product_id,
|
||||
ai.partner_id as partner_id,
|
||||
ai.reconciled::integer,
|
||||
ai.payment_term as payment_term,
|
||||
ai.period_id as period_id,
|
||||
u.name as uom_name,
|
||||
ai.currency_id as currency_id,
|
||||
ai.journal_id as journal_id,
|
||||
ai.fiscal_position as fiscal_position,
|
||||
ai.user_id as user_id,
|
||||
ai.company_id as company_id,
|
||||
count(ail.*) as nbr,
|
||||
ai.type as type,
|
||||
ai.state,
|
||||
pt.categ_id,
|
||||
ai.date_due as date_due,
|
||||
ai.address_contact_id as address_contact_id,
|
||||
ai.address_invoice_id as address_invoice_id,
|
||||
ai.account_id as account_id,
|
||||
ai.partner_bank as partner_bank,
|
||||
sum(case when ai.type in ('out_refund','in_invoice') then
|
||||
ail.quantity * u.factor * -1
|
||||
else
|
||||
ail.quantity * u.factor
|
||||
end) as product_qty,
|
||||
sum(case when ai.type in ('out_refund','in_invoice') then
|
||||
ail.quantity*ail.price_unit * -1
|
||||
else
|
||||
ail.quantity*ail.price_unit
|
||||
end) as price_total,
|
||||
sum(case when ai.type in ('out_refund','in_invoice') then
|
||||
ail.quantity*ail.price_unit * -1
|
||||
else
|
||||
ail.quantity*ail.price_unit
|
||||
end) / sum(ail.quantity * u.factor)*count(ail.product_id)::decimal(16,2) as price_average,
|
||||
sum((select extract(epoch from avg(aml.date_created-l.create_date))/(24*60*60)::decimal(16,2)
|
||||
from account_move_line as aml
|
||||
left join account_invoice as a ON (a.move_id=aml.move_id)
|
||||
left join account_invoice_line as l ON (a.id=l.invoice_id)
|
||||
where a.id=ai.id)) as delay_to_pay,
|
||||
sum(case when ai.type in ('out_refund','in_invoice') then
|
||||
ai.residual * -1
|
||||
else
|
||||
ai.residual
|
||||
end) as residual
|
||||
from account_invoice_line as ail
|
||||
left join account_invoice as ai ON (ai.id=ail.invoice_id)
|
||||
left join product_template pt on (pt.id=ail.product_id)
|
||||
left join product_uom u on (u.id=ail.uos_id)
|
||||
group by ail.product_id,
|
||||
ai.date_invoice,
|
||||
to_char(ai.date_invoice, 'YYYY'),
|
||||
to_char(ai.date_invoice, 'MM'),
|
||||
to_char(ai.date_invoice, 'YYYY-MM-DD'),
|
||||
ai.partner_id,
|
||||
ai.reconciled,
|
||||
ai.payment_term,
|
||||
ai.period_id,
|
||||
u.name,
|
||||
ai.currency_id,
|
||||
ai.journal_id,
|
||||
ai.fiscal_position,
|
||||
ai.user_id,
|
||||
ai.company_id,
|
||||
ai.type,
|
||||
ai.state,
|
||||
pt.categ_id,
|
||||
ai.date_due,
|
||||
ai.address_contact_id,
|
||||
ai.address_invoice_id,
|
||||
ai.account_id,
|
||||
ai.partner_bank
|
||||
)
|
||||
""")
|
||||
account_invoice_report()
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
help = "Done Invoices"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="user_id" widget="selection">
|
||||
<field name="user_id" >
|
||||
<filter icon="terp-dolar"
|
||||
string="My Invoices"
|
||||
help="My Invoices"
|
||||
@@ -107,7 +107,7 @@
|
||||
<filter string="Force Period" icon="terp-go-month" context="{'group_by':'period_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<newline/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" name="day" icon="terp-go-today" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" name="month" icon="terp-go-month" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" name="year" icon="terp-go-year" context="{'group_by':'year'}"/>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
|
||||
<lineMode width="0.7"/>
|
||||
<lines>1cm 27.7cm 20cm 27.7cm</lines>
|
||||
<lines>0.88cm 27.7cm 20.12cm 27.7cm</lines>
|
||||
<setFont name="Helvetica" size="8"/>
|
||||
</pageGraphics>
|
||||
</pageTemplate>
|
||||
@@ -105,7 +105,7 @@
|
||||
</blockTable>
|
||||
<section>
|
||||
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
|
||||
<blockTable rowHeights="0.65cm" colWidths="66.0,124.0,70.0,40.0,80.0,59.0,52.0,54.0" style="tbl_content">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="66.0,124.0,70.0,40.0,80.0,59.0,52.0,54.0" style="tbl_content">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="280.0,100.0,52.5,52.5,52.5" style="Table5">
|
||||
@@ -141,7 +141,7 @@
|
||||
|
||||
|
||||
|
||||
<blockTable colWidths="72.0,93.0,66.0,40.0,100.0,50.0,50.0,50.0,40.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="72.0,93.0,65.0,40.0,89.0,49.0,49.0,49.0,40.0" style="tbl_header" repeatRows="1">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="date">Date</para></td>
|
||||
<td><para style="P3">Partner</para></td>
|
||||
@@ -156,10 +156,10 @@
|
||||
</blockTable>
|
||||
<section>
|
||||
<para>[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]</para>
|
||||
<blockTable rowHeights="0.65cm" colWidths="72.0,93.0,66.0,40.0,100.0,50.0,50.0,50.0,40.0" style="tbl_content">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="72.0,93.0,65.0,40.0,89.0,49.0,49.0,49.0,40.0" style="tbl_content">[[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<blockTable colWidths="264.00,100.0,50.0,50.0,49.0,40.00" style="Table5">
|
||||
<blockTable colWidths="260.00,93.0,49.0,49.0,48.0,40.00" style="Table5">
|
||||
<tr>
|
||||
<td><para style="Standard">[[ o.code or '' ]] [[ o.name or '' ]]</para></td>
|
||||
<td><para style="Standard"></para></td>
|
||||
|
||||
@@ -107,182 +107,6 @@
|
||||
<paraStyle name="Caption" fontName="Helvetica" fontSize="10.0" leading="11" spaceBefore="6.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Index" fontName="Helvetica"/>
|
||||
|
||||
<blockTableStyle id="TrLevel8">
|
||||
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevel7">
|
||||
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevel6">
|
||||
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevel5">
|
||||
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevel4">
|
||||
<blockLeftPadding length="0" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevel3">
|
||||
<lineStyle kind="LINEBELOW" colorName="#777777" start="1,0" stop="1,0"/>
|
||||
<blockLeftPadding length="0" start="0,3" stop="1,3"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevel2">
|
||||
<lineStyle kind="LINEBELOW" colorName="#777777" start="1,0" stop="-1,0"/>
|
||||
<blockLeftPadding length="0" start="0,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="TrLevel1">
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
<blockLeftPadding length="0" start="0,0" stop="1,0"/>
|
||||
</blockTableStyle>
|
||||
|
||||
<blockTableStyle id="TrLevel0">
|
||||
<lineStyle kind="LINEBELOW" colorName="#777777" start="0,2" stop="1,2"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#ffffff" start="2,2" stop="-1,2"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="LineLevel1">
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,2" stop="-1,-1"/>
|
||||
</blockTableStyle>
|
||||
|
||||
<blockTableStyle id="Line1">
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
|
||||
</blockTableStyle>
|
||||
|
||||
<blockTableStyle id="Line2">
|
||||
<lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
|
||||
</blockTableStyle>
|
||||
|
||||
<paraStyle
|
||||
name="Level8"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" />
|
||||
<paraStyle
|
||||
name="Level7"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" />
|
||||
<paraStyle
|
||||
name="Level6"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" />
|
||||
<paraStyle
|
||||
name="Level5"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" />
|
||||
<paraStyle
|
||||
name="Level4"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" />
|
||||
<paraStyle
|
||||
name="Level3"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" />
|
||||
<paraStyle name="Level2"
|
||||
fontSize="8.0"
|
||||
fontName="Helvetica-Bold"
|
||||
/>
|
||||
<paraStyle name="Level1"
|
||||
fontSize="8.0"
|
||||
fontName="Helvetica-Bold"
|
||||
/>
|
||||
|
||||
<paraStyle
|
||||
name="Amt_Level8"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle
|
||||
name="Amt_Level7"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle
|
||||
name="Amt_Level6"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle
|
||||
name="Amt_Level5"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle
|
||||
name="Amt_Level4"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle
|
||||
name="Amt_Level3"
|
||||
fontName="Helvetica-Bold"
|
||||
fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Amt_Level2"
|
||||
fontSize="8.0"
|
||||
fontName="Helvetica-Bold" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"
|
||||
/>
|
||||
<paraStyle name="Amt_Level1"
|
||||
fontSize="8.0"
|
||||
fontName="Helvetica-Bold" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"
|
||||
/>
|
||||
|
||||
<paraStyle
|
||||
name="Det_Level8"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5"/>
|
||||
<paraStyle
|
||||
name="Det_Level7"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5"/>
|
||||
<paraStyle
|
||||
name="Det_Level6"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5"/>
|
||||
<paraStyle
|
||||
name="Det_Level5"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5"/>
|
||||
<paraStyle
|
||||
name="Det_Level4"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5"/>
|
||||
<paraStyle
|
||||
name="Det_Level3"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5"/>
|
||||
<paraStyle name="Det_Level2"
|
||||
fontSize="8.0" leading="5"
|
||||
fontName="Times-Italic"
|
||||
/>
|
||||
<paraStyle name="Det_Level1"
|
||||
fontSize="8.0" leading="5"
|
||||
fontName="Times-Italic"
|
||||
/>
|
||||
|
||||
<paraStyle
|
||||
name="Det_Amt_Level8"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle
|
||||
name="Det_Amt_Level7"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle
|
||||
name="Det_Amt_Level6"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle
|
||||
name="Det_Amt_Level5"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle
|
||||
name="Det_Amt_Level4"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle
|
||||
name="Det_Amt_Level3"
|
||||
fontName="Times-Italic"
|
||||
fontSize="8.0" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="Det_Amt_Level2"
|
||||
fontSize="8.0"
|
||||
fontName="Times-Italic" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"
|
||||
/>
|
||||
<paraStyle name="Det_Amt_Level1"
|
||||
fontSize="8.0"
|
||||
fontName="Times-Italic" leading="5" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"
|
||||
/>
|
||||
|
||||
</stylesheet>
|
||||
<story>
|
||||
<para style="P12a"></para>
|
||||
@@ -305,19 +129,19 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="P7">Balance</para></td>
|
||||
<td><para style="P8"></para></td>
|
||||
<td><para style="P8"></para></td>
|
||||
<td><para style="P8">[[ formatLang(solde_debit(data)) ]]</para></td>
|
||||
<td><para style="P8">[[ formatLang(solde_credit(data)) ]]</para></td>
|
||||
<td><para style="P8"></para></td>
|
||||
<td><para style="P8"></para></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><para style="P3">[[ repeatIn(lines(data), 'a') ]]<font>[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]][[ a['ref'] ]] [[ a['type']==3 and a['code'] ]]</font></para></td>
|
||||
<td><para style="P3">[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]][[ a['name'] ]]</para></td>
|
||||
<td><para style="P4">[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]][[ formatLang(a['debit']) ]]</para></td>
|
||||
<td><para style="P4">[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]][[ formatLang(a['credit']) ]]</para></td>
|
||||
<td><para style="P4">[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]][[ formatLang(a['balance']) ]]</para></td>
|
||||
<td><para style="P4">[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]][[ formatLang(a['enlitige'] or 0.00) ]]</para></td>
|
||||
<td><para style="P3">[[ repeatIn(lines(data), 'a') ]]<font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font><font>[[ a['ref'] ]] [[ a['type']==3 and a['code'] ]]</font></para></td>
|
||||
<td><para style="P3"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ a['name'] ]]</para></td>
|
||||
<td><para style="P4"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ formatLang(a['debit']) ]]</para></td>
|
||||
<td><para style="P4"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ formatLang(a['credit']) ]]</para></td>
|
||||
<td><para style="P4"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ formatLang(a['balance']) ]]</para></td>
|
||||
<td><para style="P4"><font>[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font>[[ formatLang(a['enlitige'] or 0.00) ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</story>
|
||||
|
||||
@@ -38,7 +38,6 @@ the "Dashboard" menu.
|
||||
'update_xml': [
|
||||
'security/ir.model.access.csv',
|
||||
'wizard/report_menu_create_view.xml',
|
||||
'wizard/report_open_view.xml',
|
||||
'base_report_creator_wizard.xml',
|
||||
'base_report_creator_view.xml'
|
||||
],
|
||||
|
||||
@@ -98,7 +98,7 @@ class report_creator(osv.osv):
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
data = context and context.get('report_id', False) or False
|
||||
data = context and context.get('report_id', False) or False
|
||||
if (not context) or 'report_id' not in context:
|
||||
return super(report_creator, self).fields_view_get(cr, user, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
|
||||
report = self.browse(cr, user, data)
|
||||
@@ -114,7 +114,7 @@ class report_creator(osv.osv):
|
||||
else:
|
||||
fields['column_count'] = {'readonly': True, 'type': 'integer', 'string': 'Count', 'size': 64, 'name': 'column_count'}
|
||||
|
||||
arch = '<?xml version="1.0" encoding="utf-8"?>\n'
|
||||
arch = '<?xml version="1.0"?>'
|
||||
if view_type == 'graph':
|
||||
orientation_eval = {'horz':'horizontal','vert' :'vertical'}
|
||||
orientation = eval(report.view_graph_orientation,orientation_eval)
|
||||
@@ -163,14 +163,14 @@ class report_creator(osv.osv):
|
||||
arch += '''>'''
|
||||
arch += ''.join(temp_list)
|
||||
else:
|
||||
arch += '<%s string="%s">\n' % (view_type, report.name)
|
||||
arch += '<%s string="%s">' % (view_type, report.name)
|
||||
i = 0
|
||||
for f in report.field_ids:
|
||||
if f.field_id.model:
|
||||
arch += '<field name="%s" select="1"/>' % ('field' + str(i),)
|
||||
arch += '<field name="%s"/>' % ('field' + str(i),)
|
||||
i += 1
|
||||
else:
|
||||
arch += '<field name="%s" select="1"/>' % ('column_count',)
|
||||
arch += '<field name="%s"/>' % ('column_count',)
|
||||
arch += '</%s>' % (view_type,)
|
||||
result = {
|
||||
'arch': arch,
|
||||
@@ -181,7 +181,6 @@ class report_creator(osv.osv):
|
||||
'action': [],
|
||||
'relate': []
|
||||
}
|
||||
|
||||
return result
|
||||
|
||||
def read(self, cr, user, ids, fields = None, context = None, load = '_classic_read'):
|
||||
@@ -406,55 +405,85 @@ class report_creator(osv.osv):
|
||||
return result
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Report Name', size=64, required=True),
|
||||
'name': fields.char('Report Name', size=64, required=True),
|
||||
'type': fields.selection([('list', 'Rows And Columns Report'), ], 'Report Type', required=True), #('sum','Summation Report')
|
||||
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the report without removing it."),
|
||||
'view_type1': fields.selection([('form', 'Form'),
|
||||
('tree', 'Tree'),
|
||||
('graph', 'Graph'),
|
||||
('calendar', 'Calendar')], 'First View', required=True),
|
||||
'view_type2': fields.selection([('', '/'),
|
||||
('form', 'Form'),
|
||||
('tree', 'Tree'),
|
||||
('graph', 'Graph'),
|
||||
('calendar', 'Calendar')], 'Second View'),
|
||||
'view_type3': fields.selection([('', '/'),
|
||||
('form', 'Form'),
|
||||
('tree', 'Tree'),
|
||||
('graph', 'Graph'),
|
||||
('calendar', 'Calendar')], 'Third View'),
|
||||
'view_graph_type': fields.selection([('pie', 'Pie Chart'),
|
||||
('bar', 'Bar Chart')], 'Graph Type', required=True),
|
||||
'view_graph_orientation': fields.selection([('horz', 'Horizontal'),
|
||||
('vert', 'Vertical')], 'Graph Orientation', required=True),
|
||||
'model_ids': fields.many2many('ir.model', 'base_report_creator_report_model_rel', 'report_id', 'model_id', 'Reported Objects'),
|
||||
'field_ids': fields.one2many('base_report_creator.report.fields', 'report_id', 'Fields to Display'),
|
||||
'filter_ids': fields.one2many('base_report_creator.report.filter', 'report_id', 'Filters'),
|
||||
'state': fields.selection([
|
||||
('draft', 'Draft'),
|
||||
('valid', 'Valid')],
|
||||
'State', required=True,
|
||||
help=' * The \'Draft\' state is used when a user is encoding a new and unconfirmed custom report. \
|
||||
\n* The \'Valid\' state is used when user validates the custom report.'),
|
||||
'sql_query': fields.function(_sql_query_get, method=True, type="text", string='SQL Query', store=True),
|
||||
'group_ids': fields.many2many('res.groups', 'base_report_creator_group_rel', 'report_id', 'group_id', 'Authorized Groups'),
|
||||
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the report without removing it."),
|
||||
'view_type1': fields.selection([('form', 'Form'),
|
||||
('tree', 'Tree'),
|
||||
('graph', 'Graph'),
|
||||
('calendar', 'Calendar')], 'First View', required=True),
|
||||
'view_type2': fields.selection([('', '/'),
|
||||
('form', 'Form'),
|
||||
('tree', 'Tree'),
|
||||
('graph', 'Graph'),
|
||||
('calendar', 'Calendar')], 'Second View'),
|
||||
'view_type3': fields.selection([('', '/'),
|
||||
('form', 'Form'),
|
||||
('tree', 'Tree'),
|
||||
('graph', 'Graph'),
|
||||
('calendar', 'Calendar')], 'Third View'),
|
||||
'view_graph_type': fields.selection([('pie', 'Pie Chart'),
|
||||
('bar', 'Bar Chart')], 'Graph Type', required=True),
|
||||
'view_graph_orientation': fields.selection([('horz', 'Horizontal'),
|
||||
('vert', 'Vertical')], 'Graph Orientation', required=True),
|
||||
'model_ids': fields.many2many('ir.model', 'base_report_creator_report_model_rel', 'report_id', 'model_id', 'Reported Objects'),
|
||||
'field_ids': fields.one2many('base_report_creator.report.fields', 'report_id', 'Fields to Display'),
|
||||
'filter_ids': fields.one2many('base_report_creator.report.filter', 'report_id', 'Filters'),
|
||||
'sql_query': fields.function(_sql_query_get, method=True, type="text", string='SQL Query', store=True),
|
||||
'group_ids': fields.many2many('res.groups', 'base_report_creator_group_rel', 'report_id', 'group_id', 'Authorized Groups'),
|
||||
'menu_id': fields.many2one('ir.ui.menu', "Menu", readonly=True),
|
||||
}
|
||||
_defaults = {
|
||||
'type': lambda *args: 'list',
|
||||
'state': lambda *args: 'draft',
|
||||
'active': lambda *args: True,
|
||||
'view_type1': lambda *args: 'tree',
|
||||
'view_type2': lambda *args: 'graph',
|
||||
'view_graph_type': lambda *args: 'bar',
|
||||
'view_graph_orientation': lambda *args: 'horz',
|
||||
'type': lambda *args: 'list',
|
||||
'active': lambda *args: True,
|
||||
'view_type1': lambda *args: 'tree',
|
||||
'view_type2': lambda *args: 'graph',
|
||||
'view_graph_type': lambda *args: 'bar',
|
||||
'view_graph_orientation': lambda *args: 'horz',
|
||||
}
|
||||
|
||||
def open_report(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
This Function opens base creator report view
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of report open's IDs
|
||||
@param context: A standard dictionary for contextual values
|
||||
@return : Dictionary value for base creator report form
|
||||
"""
|
||||
if not context:
|
||||
context = {}
|
||||
|
||||
rep = self.browse(cr, uid, ids, context=context)
|
||||
if not rep:
|
||||
return False
|
||||
|
||||
rep = rep[0]
|
||||
view_mode = rep.view_type1
|
||||
if rep.view_type2:
|
||||
view_mode += ',' + rep.view_type2
|
||||
if rep.view_type3:
|
||||
view_mode += ',' + rep.view_type3
|
||||
value = {
|
||||
'name': rep.name,
|
||||
'view_type': 'form',
|
||||
'view_mode': view_mode,
|
||||
'res_model': 'base_report_creator.report',
|
||||
'type': 'ir.actions.act_window',
|
||||
'context': "{'report_id':%d}" % (rep.id,),
|
||||
'nodestroy': True,
|
||||
}
|
||||
|
||||
return value
|
||||
|
||||
def _function_field(self, cr, uid, ids):
|
||||
"""
|
||||
constraints function which specify that
|
||||
constraints function which specify that
|
||||
not display field which are not stored in Database.
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of Report creator's id.
|
||||
@param ids: List of Report creator's id.
|
||||
@return: True if display field which are stored in database.
|
||||
or false if display field which are not store in dtabase.
|
||||
"""
|
||||
@@ -514,10 +543,11 @@ class report_creator(osv.osv):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
_constraints = [
|
||||
(_function_field, 'You can not display field which are not stored in Database.', ['field_ids']),
|
||||
(_aggregation_error, 'You can apply aggregate function to the non calculated field.', ['field_ids']),
|
||||
(_calander_view_error, "You must have to give calendar view's color,start date and delay.", ['field_ids']),
|
||||
(_function_field, 'You can not display field which are not stored in Database.', ['field_ids']),
|
||||
(_aggregation_error, 'You can apply aggregate function to the non calculated field.', ['field_ids']),
|
||||
(_calander_view_error, "You must have to give calendar view's color,start date and delay.", ['field_ids']),
|
||||
]
|
||||
report_creator()
|
||||
|
||||
@@ -531,25 +561,25 @@ class report_creator_field(osv.osv):
|
||||
_rec_name = 'field_id'
|
||||
_order = "sequence,id"
|
||||
_columns = {
|
||||
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of fields."),
|
||||
'field_id': fields.many2one('ir.model.fields', 'Field'),
|
||||
'report_id': fields.many2one('base_report_creator.report', 'Report', on_delete='cascade'),
|
||||
'group_method': fields.selection([('group', 'Grouped'),
|
||||
('sum', 'Sum'),
|
||||
('min', 'Minimum'),
|
||||
('count', 'Count'),
|
||||
('max', 'Maximum'),
|
||||
('avg', 'Average')], 'Grouping Method', required=True),
|
||||
'graph_mode': fields.selection([('', '/'),
|
||||
('x', 'X Axis'),
|
||||
('y', 'Y Axis')], 'Graph Mode'),
|
||||
'calendar_mode': fields.selection([('', '/'),
|
||||
('date_start', 'Starting Date'),
|
||||
('date_end', 'Ending Date'), ('date_delay', 'Delay'), ('date_stop', 'End Date'), ('color', 'Unique Colors')], 'Calendar Mode'),
|
||||
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of fields."),
|
||||
'field_id': fields.many2one('ir.model.fields', 'Field'),
|
||||
'report_id': fields.many2one('base_report_creator.report', 'Report', on_delete='cascade'),
|
||||
'group_method': fields.selection([('group', 'Grouped'),
|
||||
('sum', 'Sum'),
|
||||
('min', 'Minimum'),
|
||||
('count', 'Count'),
|
||||
('max', 'Maximum'),
|
||||
('avg', 'Average')], 'Grouping Method', required=True),
|
||||
'graph_mode': fields.selection([('', '/'),
|
||||
('x', 'X Axis'),
|
||||
('y', 'Y Axis')], 'Graph Mode'),
|
||||
'calendar_mode': fields.selection([('', '/'),
|
||||
('date_start', 'Starting Date'),
|
||||
('date_end', 'Ending Date'), ('date_delay', 'Delay'), ('date_stop', 'End Date'), ('color', 'Unique Colors')], 'Calendar Mode'),
|
||||
}
|
||||
_defaults = {
|
||||
'group_method': lambda *args: 'group',
|
||||
'graph_mode': lambda *args: '',
|
||||
'group_method': lambda *args: 'group',
|
||||
'graph_mode': lambda *args: '',
|
||||
}
|
||||
report_creator_field()
|
||||
|
||||
@@ -561,14 +591,14 @@ class report_creator_filter(osv.osv):
|
||||
_name = "base_report_creator.report.filter"
|
||||
_description = "Report Filters"
|
||||
_columns = {
|
||||
'name': fields.char('Filter Name', size=64, required=True),
|
||||
'expression': fields.text('Value', required=True, help='Provide an expression for the field based on which you want to filter the records.\n e.g. res_partner.id=3'),
|
||||
'report_id': fields.many2one('base_report_creator.report', 'Report', on_delete='cascade'),
|
||||
'condition': fields.selection([('and', 'AND'),
|
||||
'name': fields.char('Filter Name', size=64, required=True),
|
||||
'expression': fields.text('Value', required=True, help='Provide an expression for the field based on which you want to filter the records.\n e.g. res_partner.id=3'),
|
||||
'report_id': fields.many2one('base_report_creator.report', 'Report', on_delete='cascade'),
|
||||
'condition': fields.selection([('and', 'AND'),
|
||||
('or', 'OR')], 'Condition')
|
||||
}
|
||||
_defaults = {
|
||||
'condition': lambda *args: 'and',
|
||||
'condition': lambda *args: 'and',
|
||||
}
|
||||
report_creator_filter()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<field eval=""tree"" name="view_type1"/>
|
||||
<field eval=""list"" name="type"/>
|
||||
<field eval=""horz"" name="view_graph_orientation"/>
|
||||
<field eval=""valid"" name="state"/>
|
||||
</record>
|
||||
<record id="base_report_creator_report_fields_0" model="base_report_creator.report.fields">
|
||||
<field name="report_id" ref="base_report_creator_report_salesanalysis0"/>
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
<tree string="Report Creator">
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -42,12 +41,21 @@
|
||||
<notebook colspan="4">
|
||||
<page string="General Configuration">
|
||||
<field name="model_ids" colspan="4"
|
||||
context="{'model_ids':model_ids}" />
|
||||
<separator string="State" colspan="4"/>
|
||||
<field name="state"/>
|
||||
<button string="Create Menu"
|
||||
name="%(action_report_menu_create)d" type="action"
|
||||
colspan="2" icon="gtk-justify-fill" />
|
||||
context="{'model_ids':model_ids}" nolabel="1" />
|
||||
<separator string="" colspan="4"/>
|
||||
<group colspan="4" col="4">
|
||||
<group colspan="2">
|
||||
<field name="menu_id"/>
|
||||
</group>
|
||||
<group colspan="2">
|
||||
<button string="Create Menu"
|
||||
name="%(action_report_menu_create)d" type="action"
|
||||
icon="gtk-justify-fill" attrs="{'invisible':[('menu_id','!=',False)]}"/>
|
||||
<button string="Open Report"
|
||||
name="open_report" type="object"
|
||||
icon="gtk-open" />
|
||||
</group>
|
||||
</group>
|
||||
</page><page string="View parameters">
|
||||
<separator string="Used View" colspan="4"/>
|
||||
<field name="view_type1"/>
|
||||
@@ -112,6 +120,17 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_report_filter" model="ir.ui.view">
|
||||
<field name="name">Report Name</field>
|
||||
<field name="model">base_report_creator.report</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Report">
|
||||
<field name="name"></field>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Action for Report creator form -->
|
||||
|
||||
<record model="ir.actions.act_window" id="base_report_creator_action">
|
||||
@@ -119,6 +138,7 @@
|
||||
<field name="res_model">base_report_creator.report</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_report_filter"/>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
@@ -152,11 +172,5 @@
|
||||
id="menu_base_report_creator_action"
|
||||
action="base_report_creator_action_tree"/>
|
||||
|
||||
<act_window id="action_report_open"
|
||||
key2="client_action_multi" name="Open Report"
|
||||
res_model="report.open" src_model="base_report_creator.report"
|
||||
view_mode="form" target="new" view_type="form" />
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
<data>
|
||||
<wizard id="wizard_set_filter_fields" string="Set Filter Fields"
|
||||
name="base_report_creator.report_filter.fields" />
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -21,6 +21,5 @@
|
||||
|
||||
import wiz_set_filter_fields
|
||||
import report_menu_create
|
||||
import report_open
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
# -*- 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 wizard
|
||||
import netsvc
|
||||
import time
|
||||
import pooler
|
||||
from osv import osv
|
||||
from tools.translate import _
|
||||
|
||||
|
||||
|
||||
class report_creator_open(wizard.interface):
|
||||
def _open_report(self, cr, uid, data, context):
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
if context.get('report_id',False):
|
||||
raise wizard.except_wizard(_('UserError'),_('No Wizards available for this object!'))
|
||||
rep = pool.get('base_report_creator.report').browse(cr, uid, data['id'], context)
|
||||
view_mode = rep.view_type1
|
||||
if rep.view_type2:
|
||||
view_mode += ','+rep.view_type2
|
||||
if rep.view_type3:
|
||||
view_mode += ','+rep.view_type3
|
||||
value = {
|
||||
'name': rep.name,
|
||||
'view_type': 'form',
|
||||
'view_mode': view_mode,
|
||||
'res_model': 'base_report_creator.report',
|
||||
'context': {'report_id': data['id']},
|
||||
'view_id': False,
|
||||
'type': 'ir.actions.act_window'
|
||||
}
|
||||
return value
|
||||
|
||||
states = {
|
||||
'init' : {
|
||||
'actions' : [],
|
||||
'result' : {'type':'action', 'action':_open_report, 'state':'end'}
|
||||
}
|
||||
}
|
||||
report_creator_open('base_report_creator.report.open')
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -43,31 +43,41 @@ class report_menu_create(osv.osv_memory):
|
||||
if not context:
|
||||
context = {}
|
||||
context_id = context and context.get('active_id', False) or False
|
||||
obj_menu = self.pool.get('ir.ui.menu')
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
obj_board = self.pool.get('base_report_creator.report')
|
||||
if context_id:
|
||||
board = self.pool.get('base_report_creator.report').browse(cr, uid, context_id)
|
||||
data = self.browse(cr, uid, ids, context=context)
|
||||
if not data:
|
||||
return {}
|
||||
data = data[0]
|
||||
|
||||
board = obj_board.browse(cr, uid, context_id)
|
||||
view = board.view_type1
|
||||
if board.view_type2:
|
||||
view += ',' + board.view_type2
|
||||
if board.view_type3:
|
||||
view += ',' + board.view_type3
|
||||
|
||||
result = data_obj._get_id(cr, uid, 'base_report_creator', 'view_report_filter')
|
||||
res = data_obj.read(cr, uid, result, ['res_id'])
|
||||
action_id = self.pool.get('ir.actions.act_window').create(cr, uid, {
|
||||
'name': board.name,
|
||||
'view_type':'form',
|
||||
'view_mode':view,
|
||||
'context': "{'report_id':%d}" % (board.id,),
|
||||
'res_model': 'base_report_creator.report'
|
||||
})
|
||||
obj_menu = self.pool.get('ir.ui.menu')
|
||||
#start Loop
|
||||
for data in self.read(cr, uid, ids):
|
||||
obj_menu.create(cr, uid, {
|
||||
'name': data.get('menu_name'),
|
||||
'parent_id': data.get('menu_parent_id'),
|
||||
'res_model': 'base_report_creator.report',
|
||||
'search_view_id': res['res_id']
|
||||
})
|
||||
|
||||
menu_id = obj_menu.create(cr, uid, {
|
||||
'name': data.menu_name,
|
||||
'parent_id': data.menu_parent_id.id,
|
||||
'icon': 'STOCK_SELECT_COLOR',
|
||||
'action': 'ir.actions.act_window, ' + str(action_id)
|
||||
}, context=context)
|
||||
return {}
|
||||
#End Loop
|
||||
obj_board.write(cr, uid, context_id, {'menu_id': menu_id})
|
||||
return {}
|
||||
report_menu_create()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
|
||||
class report_open(osv.osv_memory):
|
||||
"""
|
||||
Open report
|
||||
"""
|
||||
_name = "report.open"
|
||||
_description = __doc__
|
||||
|
||||
def open_report(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
This Function opens base creator report view
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of report open's IDs
|
||||
@param context: A standard dictionary for contextual values
|
||||
@return : Dictionary value for base creator report form
|
||||
"""
|
||||
|
||||
if not context:
|
||||
context = {}
|
||||
|
||||
context_id = context and context.get('active_id', False) or False
|
||||
|
||||
if context.get('report_id', False):
|
||||
raise osv.except_osv(_('UserError'), _('No Wizards available for this object!'))
|
||||
|
||||
rep = self.pool.get('base_report_creator.report').browse(cr, uid, context_id, context)
|
||||
view_mode = rep.view_type1
|
||||
|
||||
if rep.view_type2:
|
||||
view_mode += ',' + rep.view_type2
|
||||
if rep.view_type3:
|
||||
view_mode += ',' + rep.view_type3
|
||||
value = {
|
||||
'name': rep.name,
|
||||
'view_type': 'form',
|
||||
'view_mode': view_mode,
|
||||
'res_model': 'base_report_creator.report',
|
||||
'context': {'report_id': context_id},
|
||||
'view_id': False,
|
||||
'type': 'ir.actions.act_window'
|
||||
}
|
||||
|
||||
return value
|
||||
|
||||
report_open()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Report Open wizard -->
|
||||
|
||||
<record id="view_report_open" model="ir.ui.view">
|
||||
<field name="name">report.open.form</field>
|
||||
<field name="model">report.open</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Report open">
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<button icon="gtk-cancel" special="cancel"
|
||||
string="Cancel" />
|
||||
<button icon="gtk-open" string="Open Report"
|
||||
name="open_report" type="object" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_report_open" model="ir.actions.act_window">
|
||||
<field name="name">Open Report</field>
|
||||
<field name="res_model">report.open</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_report_open"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -67,7 +67,7 @@
|
||||
|
||||
<record id="base_setup_company_todo" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_base_setup_company"/>
|
||||
<field name="sequence">1</field>
|
||||
<field name="sequence">3</field>
|
||||
<field name="restart">onskip</field>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
@@ -10,50 +10,50 @@
|
||||
<form position="attributes">
|
||||
<attribute name="string">Contact Information</attribute>
|
||||
</form>
|
||||
<xpath expr="//label[@string='description']" position="attributes">
|
||||
<attribute name="string">To receive more information, please fill in the form about you and your company. Documentation and/or information will be sent to you as soon as possible.</attribute>
|
||||
</xpath>
|
||||
<xpath expr='//separator[@string="title"]' position='attributes'>
|
||||
<attribute name='string'>Would you like more information or documentation ?</attribute>
|
||||
<attribute name='colspan'>4</attribute>
|
||||
</xpath>
|
||||
<xpath expr='//separator[@string="vsep"]' position='attributes'>
|
||||
<attribute name='rowspan'>22</attribute>
|
||||
<attribute name='string'></attribute>
|
||||
</xpath>
|
||||
<xpath expr="//label[@string='description']" position="attributes">
|
||||
<attribute name="string">To receive more information, please fill in the form about you and your company. Documentation and/or information will be sent to you as soon as possible.</attribute>
|
||||
</xpath>
|
||||
<xpath expr='//separator[@string="title"]' position='attributes'>
|
||||
<attribute name='string'>Would you like more information or documentation ?</attribute>
|
||||
<attribute name='colspan'>4</attribute>
|
||||
</xpath>
|
||||
<xpath expr='//separator[@string="vsep"]' position='attributes'>
|
||||
<attribute name='rowspan'>22</attribute>
|
||||
<attribute name='string'></attribute>
|
||||
</xpath>
|
||||
<group string="res_config_contents" position="replace">
|
||||
<group colspan="4" height="450" width="600">
|
||||
<group colspan="4">
|
||||
<field name="ebook" nolabel="1"/>
|
||||
<label align="0.0" string="I want to receive the Open ERP ebook (PDF) by email." colspan="3"/>
|
||||
<field name="updates" nolabel="1"/>
|
||||
<label align="0.0" string="Yes, I would like to receive information updates from OpenERP." colspan="3"/>
|
||||
</group>
|
||||
<group colspan="4" attrs="{'invisible':[('ebook','=',False),('updates','=',False)]}">
|
||||
<separator colspan="4" string="About You"/>
|
||||
<field name="name" colspan="2" attrs="{'required':[('ebook','=',True),('updates','=',True)]}"/>
|
||||
<field name="job" colspan="2"/>
|
||||
<field name="email" colspan="2" attrs="{'required':[('ebook','=',True),('updates','=',True)]}"/>
|
||||
<field name="phone" colspan="2" attrs="{'required':[('ebook','=',True),('updates','=',True)]}"/>
|
||||
<field name="total_employees" colspan="2"/>
|
||||
<field name="industry" colspan="2"/>
|
||||
</group>
|
||||
<group colspan="4" attrs="{'invisible':[('ebook','=',False),('updates','=',False)]}">
|
||||
<separator string="Your projects with OpenERP" colspan="4"/>
|
||||
<field name="use_openerp" align="0.0" colspan="1"/>
|
||||
<field name="already_using_openerp" align="0.0" colspan="1"/>
|
||||
<field name="sell_openerp" align="0.0" colspan="1"/>
|
||||
<field name="already_selling__openerp" align="0.0" colspan="1"/>
|
||||
<separator colspan="4" string="You would like to know more about"/>
|
||||
<field name="features" align="0.0" colspan="1"/>
|
||||
<field name="training" align="0.0" colspan="1"/>
|
||||
<field name="saas" align="0.0" colspan="1"/>
|
||||
<field name="support" align="0.0" colspan="1"/>
|
||||
<field name="partners_program" align="0.0" colspan="1"/>
|
||||
<field name="other" align="0.0" colspan="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
<group colspan="4" height="450" width="600">
|
||||
<group colspan="4">
|
||||
<field name="ebook" nolabel="1"/>
|
||||
<label align="0.0" string="I want to receive the Open ERP ebook (PDF) by email." colspan="3"/>
|
||||
<field name="updates" nolabel="1"/>
|
||||
<label align="0.0" string="Yes, I would like to receive information updates from OpenERP." colspan="3"/>
|
||||
</group>
|
||||
<group colspan="4" attrs="{'invisible':[('ebook','=',False),('updates','=',False)]}">
|
||||
<separator colspan="4" string="About You"/>
|
||||
<field name="name" colspan="2" attrs="{'required':[('ebook','=',True),('updates','=',True)]}"/>
|
||||
<field name="job" colspan="2"/>
|
||||
<field name="email" colspan="2" attrs="{'required':[('ebook','=',True),('updates','=',True)]}"/>
|
||||
<field name="phone" colspan="2" attrs="{'required':[('ebook','=',True),('updates','=',True)]}"/>
|
||||
<field name="total_employees" colspan="2"/>
|
||||
<field name="industry" colspan="2"/>
|
||||
</group>
|
||||
<group colspan="4" attrs="{'invisible':[('ebook','=',False),('updates','=',False)]}">
|
||||
<separator string="Your projects with OpenERP" colspan="4"/>
|
||||
<field name="use_openerp" align="0.0" colspan="1"/>
|
||||
<field name="already_using_openerp" align="0.0" colspan="1"/>
|
||||
<field name="sell_openerp" align="0.0" colspan="1"/>
|
||||
<field name="already_selling__openerp" align="0.0" colspan="1"/>
|
||||
<separator colspan="4" string="You would like to know more about"/>
|
||||
<field name="features" align="0.0" colspan="1"/>
|
||||
<field name="training" align="0.0" colspan="1"/>
|
||||
<field name="saas" align="0.0" colspan="1"/>
|
||||
<field name="support" align="0.0" colspan="1"/>
|
||||
<field name="partners_program" align="0.0" colspan="1"/>
|
||||
<field name="other" align="0.0" colspan="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
@@ -70,7 +70,7 @@
|
||||
|
||||
<record id="base_setup_contact_todo" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_base_contact"/>
|
||||
<field name="sequence">1</field>
|
||||
<field name="sequence">5</field>
|
||||
<field name="restart">never</field>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
+10
-1
@@ -168,6 +168,9 @@ and users"),
|
||||
"""
|
||||
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')})
|
||||
for (id, name) in self.name_get(cr, uid, ids):
|
||||
message = _('Lead ') + " '" + name + "' "+ _("is Open.")
|
||||
self.log(cr, uid, id, message)
|
||||
return res
|
||||
|
||||
def case_close(self, cr, uid, ids, *args):
|
||||
@@ -180,6 +183,9 @@ and users"),
|
||||
"""
|
||||
res = super(crm_lead, self).case_close(cr, uid, ids, args)
|
||||
self.write(cr, uid, ids, {'date_closed': time.strftime('%Y-%m-%d %H:%M:%S')})
|
||||
for (id, name) in self.name_get(cr, uid, ids):
|
||||
message = _('Lead ') + " '" + name + "' "+ _("is Closed.")
|
||||
self.log(cr, uid, id, message)
|
||||
return res
|
||||
|
||||
def convert_opportunity(self, cr, uid, ids, context=None):
|
||||
@@ -276,7 +282,10 @@ and users"),
|
||||
vals.update(res)
|
||||
|
||||
res = self.create(cr, uid, vals, context)
|
||||
|
||||
|
||||
message = _('A Lead created') + " '" + subject + "' " + _("from Mailgate.")
|
||||
self.log(cr, uid, res, message)
|
||||
|
||||
attachents = msg.get('attachments', [])
|
||||
for attactment in attachents or []:
|
||||
data_attach = {
|
||||
|
||||
@@ -65,6 +65,9 @@ class crm_opportunity(osv.osv):
|
||||
"""
|
||||
res = super(crm_opportunity, self).case_close(cr, uid, ids, args)
|
||||
self.write(cr, uid, ids, {'probability' : 100.0, 'date_closed': time.strftime('%Y-%m-%d %H:%M:%S')})
|
||||
for (id, name) in self.name_get(cr, uid, ids):
|
||||
message = _('Opportunity ') + " '" + name + "' "+ _("is Won.")
|
||||
self.log(cr, uid, id, message)
|
||||
return res
|
||||
|
||||
def case_cancel(self, cr, uid, ids, *args):
|
||||
@@ -77,6 +80,9 @@ class crm_opportunity(osv.osv):
|
||||
"""
|
||||
res = super(crm_opportunity, self).case_cancel(cr, uid, ids, args)
|
||||
self.write(cr, uid, ids, {'probability' : 0.0})
|
||||
for (id, name) in self.name_get(cr, uid, ids):
|
||||
message = _('Opportunity ') + " '" + name + "' "+ _("is Lost.")
|
||||
self.log(cr, uid, id, message)
|
||||
return res
|
||||
|
||||
def case_open(self, cr, uid, ids, *args):
|
||||
|
||||
@@ -51,7 +51,7 @@ class crm_lead_report(osv.osv):
|
||||
for case in self.browse(cr, uid, ids, context):
|
||||
if field_name != 'avg_answers':
|
||||
state = field_name[5:]
|
||||
cr.execute("select count(id) from crm_opportunity where \
|
||||
cr.execute("select count(id) from crm_lead where \
|
||||
section_id =%s and state='%s'"%(case.section_id.id, state))
|
||||
state_cases = cr.fetchone()[0]
|
||||
perc_state = (state_cases / float(case.nbr)) * 100
|
||||
|
||||
@@ -41,12 +41,25 @@
|
||||
<field name="arch" type="xml">
|
||||
<graph orientation="vertical" string="Leads Analysis" type="bar">
|
||||
<field name="stage_id"/>
|
||||
<field name="planned_revenue" operator="+"/>
|
||||
<field name="nbr" operator="+"/>
|
||||
<field group="True" name="user_id"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_report_crm_opportunity_graph" model="ir.ui.view">
|
||||
<field name="name">crm.opportunity.report.graph</field>
|
||||
<field name="model">crm.lead.report</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph orientation="vertical" string="Leads Analysis" type="bar">
|
||||
<field name="stage_id"/>
|
||||
<field name="planned_revenue" operator="+"/>
|
||||
<field group="True" name="user_id"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Leads by user and section Search View -->
|
||||
|
||||
<record id="view_report_crm_lead_filter" model="ir.ui.view">
|
||||
@@ -208,7 +221,7 @@
|
||||
<record model="ir.actions.act_window.view" id="action_report_crm_opportunity_graph">
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="view_mode">graph</field>
|
||||
<field name="view_id" ref="view_report_crm_lead_graph"/>
|
||||
<field name="view_id" ref="view_report_crm_opportunity_graph"/>
|
||||
<field name="act_window_id" ref="action_report_crm_opportunity"/>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class crm_phonecall_report(osv.osv):
|
||||
for case in self.browse(cr, uid, ids, context):
|
||||
if field_name != 'avg_answers':
|
||||
state = field_name[5:]
|
||||
cr.execute("select count(*) from crm_opportunity where \
|
||||
cr.execute("select count(*) from crm_lead where \
|
||||
section_id =%s and state='%s'"%(case.section_id.id, state))
|
||||
state_cases = cr.fetchone()[0]
|
||||
perc_state = (state_cases / float(case.nbr)) * 100
|
||||
@@ -143,7 +143,6 @@ class crm_phonecall_report(osv.osv):
|
||||
extract('epoch' from (c.date_open-c.create_date))/(3600*24) as delay_open
|
||||
from
|
||||
crm_phonecall c
|
||||
where c.categ_id in (select res_id from ir_model_data where (name = 'categ_phone1' or name ='categ_phone2') and model = 'crm.case.categ')
|
||||
)""")
|
||||
|
||||
crm_phonecall_report()
|
||||
|
||||
@@ -86,7 +86,8 @@ class crm_lead2opportunity(osv.osv_memory):
|
||||
if lead.partner_id:
|
||||
msg_ids = [ x.id for x in lead.message_ids]
|
||||
self.pool.get('mailgate.message').write(cr, uid, msg_ids, {'partner_id': lead.partner_id.id}, context=context)
|
||||
|
||||
message = _('Lead ') + " '" + lead.name + "' "+ _("is converted to Opportunity.")
|
||||
self.log(cr, uid, lead.id, message)
|
||||
value = {
|
||||
'name': _('Opportunity'),
|
||||
'view_type': 'form',
|
||||
@@ -99,6 +100,7 @@ class crm_lead2opportunity(osv.osv_memory):
|
||||
'type': 'ir.actions.act_window',
|
||||
'search_view_id': res['res_id']
|
||||
}
|
||||
|
||||
return value
|
||||
|
||||
_columns = {
|
||||
|
||||
@@ -103,7 +103,7 @@ class crm_send_new_email2(osv.osv_memory):
|
||||
ref_id = hist.ref_id
|
||||
case = model_pool.browse(cr, uid, res_id)
|
||||
emails = [obj.email_to]
|
||||
email_cc = (obj.email_cc or '').split(',')
|
||||
email_cc = obj.email_cc and obj.email_cc.split(',') or ''
|
||||
emails = filter(None, emails)
|
||||
body = obj.text
|
||||
|
||||
|
||||
@@ -76,7 +76,9 @@ class crm_helpdesk(osv.osv, crm.crm_case):
|
||||
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\'.\
|
||||
\nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
|
||||
\nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
|
||||
'message_ids': fields.one2many('mailgate.message', 'res_id', 'Messages', domain=[('history', '=', True),('model','=',_name)]),
|
||||
'log_ids': fields.one2many('mailgate.message', 'res_id', 'Logs', domain=[('history', '=', False),('model','=',_name)]),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
|
||||
@@ -277,6 +277,8 @@ class hr_applicant(osv.osv, crm.crm_case):
|
||||
vals.update(res)
|
||||
res = self.create(cr, uid, vals, context)
|
||||
|
||||
message = _('A Job Request created') + " '" + subject + "' " + _("from Mailgate.")
|
||||
self.log(cr, uid, res, message)
|
||||
|
||||
attachents = msg.get('attachments', [])
|
||||
for attactment in attachents or []:
|
||||
@@ -338,6 +340,34 @@ class hr_applicant(osv.osv, crm.crm_case):
|
||||
@param **args: Return Dictionary of Keyword Value
|
||||
"""
|
||||
return True
|
||||
|
||||
def case_open(self, cr, uid, ids, *args):
|
||||
"""
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of case's Ids
|
||||
@param *args: Give Tuple Value
|
||||
"""
|
||||
res = super(hr_applicant, self).case_open(cr, uid, ids, *args)
|
||||
for (id, name) in self.name_get(cr, uid, ids):
|
||||
message = _('Job request for') + " '" + name + "' "+ _("is Open.")
|
||||
self.log(cr, uid, id, message)
|
||||
return res
|
||||
|
||||
def case_close(self, cr, uid, ids, *args):
|
||||
"""
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of case's Ids
|
||||
@param *args: Give Tuple Value
|
||||
"""
|
||||
res = super(hr_applicant, self).case_close(cr, uid, ids, *args)
|
||||
for (id, name) in self.name_get(cr, uid, ids):
|
||||
message = _('Applicant ') + " '" + name + "' "+ _("is Hired.")
|
||||
self.log(cr, uid, id, message)
|
||||
return res
|
||||
|
||||
hr_applicant()
|
||||
|
||||
|
||||
@@ -5,3 +5,4 @@
|
||||
"access_idea_vote_stat","idea.vote.stat","model_idea_vote_stat","base.group_user",1,0,0,0
|
||||
"access_idea_category_system","idea.category system","model_idea_category","base.group_system",1,1,1,1
|
||||
"access_idea_comment","idea.comment","model_idea_comment","base.group_system",1,1,1,1
|
||||
"access_idea_comment_user","idea.comment","model_idea_comment","base.group_user",1,1,1,0
|
||||
|
||||
|
@@ -44,9 +44,6 @@
|
||||
!record {model: res.users, id: res_users_user1}:
|
||||
company_id: base.main_company
|
||||
context_lang: en_US
|
||||
groups_id:
|
||||
- base.group_system
|
||||
- base.group_user
|
||||
login: user2
|
||||
name: user2
|
||||
password: user2
|
||||
@@ -54,16 +51,12 @@
|
||||
- |
|
||||
In order to post vote I connect as user1 and open the idea page
|
||||
I click on "Submit Vote" wizard button and vote the idea as "Normal"
|
||||
-
|
||||
!record {model: idea.post.vote, id: idea_post_vote_0}:
|
||||
vote: 50
|
||||
|
||||
- |
|
||||
Now I click on "Post" button of this wizard.
|
||||
-
|
||||
!python {model: idea.post.vote}: |
|
||||
uid = ref('res_users_user0')
|
||||
self.do_vote(cr, uid, [ref("idea_post_vote_0")], {'active_ids': [ref('idea_idea_0')]})
|
||||
uid = ref('res_users_user0')
|
||||
new_id = self.create(cr, uid, {'vote': 50}, {"active_ids": [ref("idea_idea_0")]})
|
||||
self.do_vote(cr, uid, [new_id], {"active_ids": [ref("idea_idea_0")]})
|
||||
|
||||
- |
|
||||
To add other vote I connect as user2 and open the idea page.
|
||||
@@ -72,16 +65,11 @@
|
||||
|
||||
and put comment "We can learn many things from technical presentation".
|
||||
|
||||
-
|
||||
!record {model: idea.post.vote, id: idea_post_vote_1}:
|
||||
vote: 100
|
||||
note: 'We can learn many things from technical presentation'
|
||||
- |
|
||||
I click on "Post" button of this wizard.
|
||||
-
|
||||
!python {model: idea.post.vote}: |
|
||||
uid = ref('res_users_user1')
|
||||
self.do_vote(cr, uid, [ref("idea_post_vote_1")], {'active_ids': [ref('idea_idea_0')]})
|
||||
new_id = self.create(cr, uid, {'vote': 100, 'note': 'We can learn many things from technical presentation'}, {"active_ids": [ref("idea_idea_0")]})
|
||||
self.do_vote(cr, uid, [new_id], {'active_ids': [ref('idea_idea_0')]})
|
||||
|
||||
- |
|
||||
I can see that the Average score changed in "Average score" field with value 75
|
||||
@@ -99,4 +87,3 @@
|
||||
-
|
||||
!assert {model: idea.idea, id: idea_idea_0}:
|
||||
- state == 'close'
|
||||
|
||||
|
||||
+6
-2
@@ -757,9 +757,11 @@ class mrp_production(osv.osv):
|
||||
new_parent_ids.append(final_product.id)
|
||||
for new_parent_id in new_parent_ids:
|
||||
stock_mov_obj.write(cr, uid, [raw_product.id], {'move_history_ids': [(4,new_parent_id)]})
|
||||
|
||||
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'mrp.production', production_id, 'button_produce_done', cr)
|
||||
message = _('Manufacturing order ') + " '" + production.name + "' "+ _("is finished.")
|
||||
self.log(cr, uid, production_id, message)
|
||||
return True
|
||||
|
||||
def _costs_generate(self, cr, uid, production):
|
||||
@@ -925,9 +927,11 @@ class mrp_production(osv.osv):
|
||||
'company_id': production.company_id.id,
|
||||
})
|
||||
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
|
||||
proc_ids.append(proc_id)
|
||||
proc_ids.append(proc_id)
|
||||
wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
|
||||
self.write(cr, uid, [production.id], {'picking_id': picking_id, 'move_lines': [(6,0,moves)], 'state':'confirmed'})
|
||||
message = _('Manufacturing order ') + " '" + production.name + "' "+ _("is confirmed.")
|
||||
self.log(cr, uid, production.id, message)
|
||||
return picking_id
|
||||
|
||||
def force_production(self, cr, uid, ids, *args):
|
||||
|
||||
@@ -40,8 +40,11 @@ class procurement_order(osv.osv):
|
||||
"""
|
||||
properties = [x.id for x in procurement.property_ids]
|
||||
bom_id = self.pool.get('mrp.bom')._bom_find(cr, uid, procurement.product_id.id, procurement.product_uom.id, properties)
|
||||
if not bom_id:
|
||||
if not bom_id:
|
||||
cr.execute('update procurement_order set message=%s where id=%s', (_('No BoM defined for this product !'), procurement.id))
|
||||
for (id, name) in self.name_get(cr, uid, procurement.id):
|
||||
message = _('Procurement ') + " '" + name + "' "+ _("has an exception.") + _('No BoM defined for this product !')
|
||||
self.log(cr, uid, id, message)
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ from osv import osv,fields
|
||||
class company(osv.osv):
|
||||
_inherit = 'res.company'
|
||||
_columns = {
|
||||
'schedule_range': fields.float('Scheduler Range', required=True,
|
||||
'schedule_range': fields.float('Scheduler Range Days', required=True,
|
||||
help="This is the time frame analysed by the scheduler when "\
|
||||
"computing procurements. All procurements that are not between "\
|
||||
"today and today+range are skipped for futur computation."),
|
||||
|
||||
@@ -331,6 +331,8 @@ class procurement_order(osv.osv):
|
||||
})
|
||||
move_obj.action_confirm(cr, uid, [id], context=context)
|
||||
self.write(cr, uid, [procurement.id], {'move_id': id, 'close_move': 1})
|
||||
message = _('Procurement ') + " '" + procurement.name + "' "+ _("is running.")
|
||||
self.log(cr, uid, procurement.id, message)
|
||||
self.write(cr, uid, ids, {'state': 'confirmed', 'message': ''})
|
||||
return True
|
||||
|
||||
@@ -355,8 +357,10 @@ class procurement_order(osv.osv):
|
||||
if not (procurement.move_id.state in ('done','assigned','cancel')):
|
||||
ok = ok and self.pool.get('stock.move').action_assign(cr, uid, [id])
|
||||
cr.execute('select count(id) from stock_warehouse_orderpoint where product_id=%s', (procurement.product_id.id,))
|
||||
if not cr.fetchone()[0]:
|
||||
if not cr.fetchone()[0]:
|
||||
cr.execute('update procurement_order set message=%s where id=%s', (_('Not enough stock and no minimum orderpoint rule defined.'), procurement.id))
|
||||
message = _('Procurement ') + " '" + procurement.name + "' "+ _("has an exception.") + _('Not enough stock and no minimum orderpoint rule defined.')
|
||||
self.log(cr, uid, procurement.id, message)
|
||||
return ok
|
||||
|
||||
def action_produce_assign_service(self, cr, uid, ids, context={}):
|
||||
@@ -434,6 +438,8 @@ class procurement_order(osv.osv):
|
||||
if procurement.move_id:
|
||||
if procurement.close_move and (procurement.move_id.state <> 'done'):
|
||||
move_obj.action_done(cr, uid, [procurement.move_id.id])
|
||||
message = _('Procurement ') + " '" + procurement.name + "' "+ _("is done.")
|
||||
self.log(cr, uid, procurement.id, message)
|
||||
res = self.write(cr, uid, ids, {'state': 'done', 'date_close': time.strftime('%Y-%m-%d')})
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for id in ids:
|
||||
@@ -472,7 +478,7 @@ class stock_warehouse_orderpoint(osv.osv):
|
||||
help="When the virtual stock goes belong the Min Quantity, Open ERP generates "\
|
||||
"a procurement to bring the virtual stock to the Max Quantity."),
|
||||
'product_max_qty': fields.float('Max Quantity', required=True,
|
||||
help="When the virtual stock goes belong the Mix Quantity, Open ERP generates "\
|
||||
help="When the virtual stock goes belong the Max Quantity, Open ERP generates "\
|
||||
"a procurement to bring the virtual stock to the Max Quantity."),
|
||||
'qty_multiple': fields.integer('Qty Multiple', required=True,
|
||||
help="The procurement quantity will by rounded up to this multiple."),
|
||||
|
||||
@@ -174,6 +174,9 @@ class project(osv.osv):
|
||||
|
||||
def set_done(self, cr, uid, ids, context=None):
|
||||
self.write(cr, uid, ids, {'state':'close'}, context=context)
|
||||
for (id, name) in self.name_get(cr, uid, ids):
|
||||
message = _('Project ') + " '" + name + "' "+ _("is Closed.")
|
||||
self.log(cr, uid, id, message)
|
||||
return True
|
||||
|
||||
def set_cancel(self, cr, uid, ids, context=None):
|
||||
@@ -190,6 +193,9 @@ class project(osv.osv):
|
||||
|
||||
def reset_project(self, cr, uid, ids, context=None):
|
||||
res = self.setActive(cr, uid, ids, value=True, context=context)
|
||||
for (id, name) in self.name_get(cr, uid, ids):
|
||||
message = _('Project ') + " '" + name + "' "+ _("is Open.")
|
||||
self.log(cr, uid, id, message)
|
||||
return res
|
||||
|
||||
def copy(self, cr, uid, id, default={}, context=None):
|
||||
@@ -434,6 +440,8 @@ class task(osv.osv):
|
||||
elif project.warn_manager:
|
||||
task_id = ids[0]
|
||||
mail_send = True
|
||||
message = _('Task ') + " '" + task.name + "' "+ _("is Done.")
|
||||
self.log(cr, uid, task.id, message)
|
||||
self.write(cr, uid, [task.id], {'state': 'done', 'date_end':time.strftime('%Y-%m-%d %H:%M:%S'), 'remaining_hours': 0.0})
|
||||
for parent_id in task.parent_ids:
|
||||
if parent_id.state in ('pending','draft'):
|
||||
@@ -494,6 +502,8 @@ class task(osv.osv):
|
||||
'ref_doc1': 'project.task,%d' % task.id,
|
||||
'ref_doc2': 'project.project,%d' % project.id,
|
||||
})
|
||||
message = _('Task ') + " '" + task.name + "' "+ _("is Cancelled.")
|
||||
self.log(cr, uid, task.id, message)
|
||||
self.write(cr, uid, [task.id], {'state': 'cancelled', 'remaining_hours':0.0})
|
||||
return True
|
||||
|
||||
@@ -501,6 +511,8 @@ class task(osv.osv):
|
||||
tasks= self.browse(cr,uid,ids)
|
||||
for t in tasks:
|
||||
self.write(cr, uid, [t.id], {'state': 'open'})
|
||||
message = _('Task ') + " '" + t.name + "' "+ _("is Open.")
|
||||
self.log(cr, uid, t.id, message)
|
||||
return True
|
||||
|
||||
def do_draft(self, cr, uid, ids, *args):
|
||||
@@ -510,6 +522,9 @@ class task(osv.osv):
|
||||
|
||||
def do_pending(self, cr, uid, ids, *args):
|
||||
self.write(cr, uid, ids, {'state': 'pending'})
|
||||
for (id, name) in self.name_get(cr, uid, ids):
|
||||
message = _('Task ') + " '" + name + "' "+ _("is Pending.")
|
||||
self.log(cr, uid, id, message)
|
||||
return True
|
||||
|
||||
def next_type(self, cr, uid, ids, *args):
|
||||
|
||||
@@ -82,12 +82,13 @@ class project_task_delegate(osv.osv_memory):
|
||||
'prefix': _get_prefix,
|
||||
'new_task_description': _get_new_desc,
|
||||
'state': 'pending',
|
||||
}
|
||||
}
|
||||
|
||||
def validate(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
task_obj = self.pool.get('project.task')
|
||||
user_obj = self.pool.get('res.users')
|
||||
delegate_data = self.read(cr, uid, ids, context=context)[0]
|
||||
task = task_obj.browse(cr, uid, context['active_id'], context=context)
|
||||
newname = delegate_data['prefix'] or ''
|
||||
@@ -111,6 +112,9 @@ class project_task_delegate(osv.osv_memory):
|
||||
task_obj.do_pending(cr, uid, [task.id])
|
||||
else:
|
||||
task_obj.do_close(cr, uid, [task.id])
|
||||
delegrate_user = user_obj.browse(cr, uid, delegate_data['user_id'], context=context)
|
||||
message = _('Task ') + " '" + delegate_data['name'] + "' "+ _("is Delegated to User:") +" '"+ delegrate_user.name +"' "
|
||||
self.log(cr, uid, task.id, message)
|
||||
return {}
|
||||
|
||||
project_task_delegate()
|
||||
|
||||
@@ -52,8 +52,26 @@ class project_issue(osv.osv, crm.crm_case):
|
||||
|
||||
res = super(project_issue, self).case_open(cr, uid, ids, *args)
|
||||
self.write(cr, uid, ids, {'date_open': time.strftime('%Y-%m-%d %H:%M:%S')})
|
||||
for (id, name) in self.name_get(cr, uid, ids):
|
||||
message = _('Issue ') + " '" + name + "' "+ _("is Open.")
|
||||
self.log(cr, uid, id, message)
|
||||
return res
|
||||
|
||||
def case_close(self, cr, uid, ids, *args):
|
||||
"""
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of case's Ids
|
||||
@param *args: Give Tuple Value
|
||||
"""
|
||||
|
||||
res = super(project_issue, self).case_close(cr, uid, ids, *args)
|
||||
for (id, name) in self.name_get(cr, uid, ids):
|
||||
message = _('Issue ') + " '" + name + "' "+ _("is Closed.")
|
||||
self.log(cr, uid, id, message)
|
||||
return res
|
||||
|
||||
def _compute_day(self, cr, uid, ids, fields, args, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
@@ -319,6 +337,8 @@ class project_issue(osv.osv, crm.crm_case):
|
||||
if res:
|
||||
vals.update(res)
|
||||
res = self.create(cr, uid, vals, context)
|
||||
message = _('An Issue created') + " '" + subject + "' " + _("from Mailgate.")
|
||||
self.log(cr, uid, res, message)
|
||||
self.convert_to_bug(cr, uid, [res], context=context)
|
||||
|
||||
attachents = msg.get('attachments', [])
|
||||
|
||||
@@ -137,6 +137,7 @@ class project_phase(osv.osv):
|
||||
"""
|
||||
uom_obj = self.pool.get('product.uom')
|
||||
resource_obj = self.pool.get('resource.resource')
|
||||
model_data_obj = self.pool.get('ir.model.data')
|
||||
cal_obj = self.pool.get('resource.calendar')
|
||||
calendar_id = phase.project_id.resource_calendar_id and phase.project_id.resource_calendar_id.id or False
|
||||
resource_id = resource_obj.search(cr, uid, [('user_id', '=', phase.responsible_id.id)])
|
||||
@@ -146,7 +147,7 @@ class project_phase(osv.osv):
|
||||
cal_id = res.get('calendar_id', False) and res.get('calendar_id')[0] or False
|
||||
if cal_id:
|
||||
calendar_id = cal_id
|
||||
default_uom_id = uom_obj.search(cr, uid, [('name', '=', 'Hour')], context=context)[0]
|
||||
default_uom_id = model_data_obj._get_id(cr, uid, 'product', 'uom_hour')
|
||||
avg_hours = uom_obj._compute_qty(cr, uid, phase.product_uom.id, phase.duration, default_uom_id)
|
||||
work_times = cal_obj.interval_min_get(cr, uid, calendar_id, date_end, avg_hours or 0.0, resource_id and resource_id[0] or False)
|
||||
dt_start = work_times[0][0].strftime('%Y-%m-%d %H:%M:%S')
|
||||
@@ -159,6 +160,7 @@ class project_phase(osv.osv):
|
||||
Check And Compute date_end of phase if change in date_end > older time.
|
||||
"""
|
||||
uom_obj = self.pool.get('product.uom')
|
||||
model_data_obj = self.pool.get('ir.model.data')
|
||||
resource_obj = self.pool.get('resource.resource')
|
||||
cal_obj = self.pool.get('resource.calendar')
|
||||
calendar_id = phase.project_id.resource_calendar_id and phase.project_id.resource_calendar_id.id or False
|
||||
@@ -169,7 +171,7 @@ class project_phase(osv.osv):
|
||||
cal_id = res.get('calendar_id', False) and res.get('calendar_id')[0] or False
|
||||
if cal_id:
|
||||
calendar_id = cal_id
|
||||
default_uom_id = uom_obj.search(cr, uid, [('name', '=', 'Hour')], context=context)[0]
|
||||
default_uom_id = model_data_obj._get_id(cr, uid, 'product', 'uom_hour')
|
||||
avg_hours = uom_obj._compute_qty(cr, uid, phase.product_uom.id, phase.duration, default_uom_id)
|
||||
work_times = cal_obj.interval_get(cr, uid, calendar_id, date_start, avg_hours or 0.0, resource_id and resource_id[0] or False)
|
||||
dt_end = work_times[-1][1].strftime('%Y-%m-%d %H:%M:%S')
|
||||
@@ -179,6 +181,7 @@ class project_phase(osv.osv):
|
||||
resource_calendar_obj = self.pool.get('resource.calendar')
|
||||
resource_obj = self.pool.get('resource.resource')
|
||||
uom_obj = self.pool.get('product.uom')
|
||||
model_data_obj = self.pool.get('ir.model.data')
|
||||
if context is None:
|
||||
context = {}
|
||||
if context.get('scheduler',False):
|
||||
@@ -192,7 +195,7 @@ class project_phase(osv.osv):
|
||||
cal_id = resource_obj.browse(cr, uid, resource_id[0], context=context).calendar_id.id
|
||||
if cal_id:
|
||||
calendar_id = cal_id
|
||||
default_uom_id = uom_obj.search(cr, uid, [('name', '=', 'Hour')])[0]
|
||||
default_uom_id = model_data_obj._get_id(cr, uid, 'product', 'uom_hour')
|
||||
avg_hours = uom_obj._compute_qty(cr, uid, phase.product_uom.id, phase.duration, default_uom_id)
|
||||
|
||||
# Change the date_start and date_end
|
||||
|
||||
@@ -60,6 +60,7 @@ class project_compute_phases(osv.osv_memory):
|
||||
phase_obj = self.pool.get('project.phase')
|
||||
resource_obj = self.pool.get('resource.resource')
|
||||
uom_obj = self.pool.get('product.uom')
|
||||
model_data_obj = self.pool.get('ir.model.data')
|
||||
phase_resource_obj = False
|
||||
|
||||
if context is None:
|
||||
@@ -81,7 +82,7 @@ class project_compute_phases(osv.osv_memory):
|
||||
'vacation': tuple(leaves),
|
||||
'efficiency': time_efficiency
|
||||
})
|
||||
default_uom_id = uom_obj.search(cr, uid, [('name','=','Hour')])[0]
|
||||
default_uom_id = model_data_obj._get_id(cr, uid, 'product', 'uom_hour')
|
||||
avg_hours = uom_obj._compute_qty(cr, uid, phase.product_uom.id, phase.duration, default_uom_id)
|
||||
duration = str(avg_hours) + 'H'
|
||||
# Create a new project for each phase
|
||||
|
||||
@@ -88,26 +88,12 @@ class report_intrastat(osv.osv):
|
||||
else 0
|
||||
end) as value,
|
||||
sum(
|
||||
case when uom.category_id != puom.category_id then pt.weight_net * inv_line.quantity
|
||||
else
|
||||
case when uom.factor_inv_data > 0
|
||||
then
|
||||
pt.weight_net * inv_line.quantity * uom.factor_inv_data
|
||||
else
|
||||
pt.weight_net * inv_line.quantity / uom.factor
|
||||
end
|
||||
end
|
||||
case when uom.category_id != puom.category_id then (pt.weight_net * inv_line.quantity)
|
||||
else (pt.weight_net * inv_line.quantity * uom.factor) end
|
||||
) as weight,
|
||||
sum(
|
||||
case when uom.category_id != puom.category_id then inv_line.quantity
|
||||
else
|
||||
case when uom.factor_inv_data > 0
|
||||
then
|
||||
inv_line.quantity * uom.factor_inv_data
|
||||
else
|
||||
inv_line.quantity / uom.factor
|
||||
end
|
||||
end
|
||||
else (inv_line.quantity * uom.factor) end
|
||||
) as supply_units,
|
||||
|
||||
inv.currency_id as currency_id,
|
||||
|
||||
@@ -98,7 +98,7 @@ class crm_make_sale(osv.osv_memory):
|
||||
raise osv.except_osv(_('Data Insufficient!'),_('Customer has no addresses defined!'))
|
||||
|
||||
vals = {
|
||||
'origin': 'CRM-Opportunity:%s' % str(case.id),
|
||||
'origin': 'Opportunity:%s' % str(case.id),
|
||||
'section_id': case.section_id and case.section_id.id or False,
|
||||
'picking_policy': make.picking_policy,
|
||||
'shop_id': make.shop_id.id,
|
||||
@@ -129,6 +129,8 @@ class crm_make_sale(osv.osv_memory):
|
||||
|
||||
case_obj.write(cr, uid, [case.id], {'ref': 'sale.order,%s' % new_id})
|
||||
new_ids.append(new_id)
|
||||
message = _('Opportunity ') + " '" + case.name + "' "+ _("is converted to Sales Quotation.")
|
||||
self.log(cr, uid, case.id, message)
|
||||
|
||||
if make.close:
|
||||
case_obj.case_close(cr, uid, data)
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import sale
|
||||
import sale_order_dates
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -92,10 +92,16 @@ class scrum_sprint(osv.osv):
|
||||
|
||||
def button_open(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'open'}, context=context)
|
||||
for (id, name) in self.name_get(cr, uid, ids):
|
||||
message = _('Sprint ') + " '" + name + "' "+ _("is Open.")
|
||||
self.log(cr, uid, id, message)
|
||||
return True
|
||||
|
||||
def button_close(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'done'}, context=context)
|
||||
for (id, name) in self.name_get(cr, uid, ids):
|
||||
message = _('Sprint ') + " '" + name + "' "+ _("is Closed.")
|
||||
self.log(cr, uid, id, message)
|
||||
return True
|
||||
|
||||
def button_pending(self, cr, uid, ids, context={}):
|
||||
@@ -205,12 +211,17 @@ class scrum_product_backlog(osv.osv):
|
||||
|
||||
def button_open(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'open'}, context=context)
|
||||
for (id, name) in self.name_get(cr, uid, ids):
|
||||
message = _('Product Backlog ') + " '" + name + "' "+ _("is Open.")
|
||||
self.log(cr, uid, id, message)
|
||||
return True
|
||||
|
||||
def button_close(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids, {'state':'done'}, context=context)
|
||||
for backlog in self.browse(cr, uid, ids, context=context):
|
||||
self.pool.get('project.task').write(cr, uid, [i.id for i in backlog.tasks_id], {'state': 'done'})
|
||||
message = _('Product Backlog ') + " '" + backlog.name + "' "+ _("is Closed.")
|
||||
self.log(cr, uid, backlog.id, message)
|
||||
return True
|
||||
|
||||
def button_pending(self, cr, uid, ids, context={}):
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#
|
||||
##############################################################################
|
||||
from osv import osv, fields
|
||||
from tools.translate import _
|
||||
|
||||
class backlog_sprint_assign(osv.osv_memory):
|
||||
_name = 'backlog.assign.sprint'
|
||||
@@ -35,6 +36,7 @@ class backlog_sprint_assign(osv.osv_memory):
|
||||
|
||||
def assign_sprint(self, cr, uid, ids, context=None):
|
||||
backlog_obj = self.pool.get('scrum.product.backlog')
|
||||
sprint_obj = self.pool.get('scrum.sprint')
|
||||
task = self.pool.get('project.task')
|
||||
backlog_ids = []
|
||||
if context is None:
|
||||
@@ -43,7 +45,7 @@ class backlog_sprint_assign(osv.osv_memory):
|
||||
for backlog in backlog_obj.browse(cr, uid, context['active_ids'], context=context):
|
||||
backlog_ids.append(backlog.id)
|
||||
if data['convert_to_task']:
|
||||
task.create(cr, uid, {
|
||||
task_id = task.create(cr, uid, {
|
||||
'product_backlog_id': backlog.id,
|
||||
'name': backlog.name,
|
||||
'description': backlog.note,
|
||||
@@ -52,11 +54,16 @@ class backlog_sprint_assign(osv.osv_memory):
|
||||
'planned_hours':backlog.expected_hours,
|
||||
'remaining_hours':backlog.expected_hours,
|
||||
})
|
||||
message = _('Product Backlog') + " '" + backlog.name + "' "+ _("is converted into Task %d."%(task_id,))
|
||||
self.log(cr, uid, backlog.id, message)
|
||||
if data['state_open'] and backlog.state == "draft":
|
||||
backlog_obj.write(cr, uid, backlog.id, {'state':'open'})
|
||||
sprint = sprint_obj.browse(cr, uid, data['sprint_id'], context=context)
|
||||
message = _('Product Backlog') + " '" + backlog.name + "' "+ _("is assigned sprint:%s"%(sprint.name))
|
||||
self.log(cr, uid, backlog.id, message)
|
||||
backlog_obj.write(cr, uid, backlog_ids, {'sprint_id': data['sprint_id']}, context=context)
|
||||
return {}
|
||||
|
||||
backlog_sprint_assign()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
+11
-2
@@ -1843,7 +1843,9 @@ class stock_move(osv.osv):
|
||||
'line_id': line,
|
||||
'ref': move.picking_id and move.picking_id.name,
|
||||
})
|
||||
|
||||
|
||||
message = _('Move line') + " '" + move.name + "' "+ _("is processed.")
|
||||
self.log(cr, uid, move.id, message)
|
||||
# This can be removed
|
||||
#tracking_lot = False
|
||||
#if context:
|
||||
@@ -1864,7 +1866,7 @@ class stock_move(osv.osv):
|
||||
wf_service.trg_write(uid, 'stock.picking', pick_id, cr)
|
||||
|
||||
for (id,name) in picking_obj.name_get(cr, uid, picking_ids):
|
||||
message = _('Document') + " '" + name + "' "+ _("is processed")
|
||||
message = _('Document') + " '" + name + "' "+ _("is processed.")
|
||||
self.log(cr, uid, id, message)
|
||||
return True
|
||||
|
||||
@@ -1938,6 +1940,8 @@ class stock_move(osv.osv):
|
||||
new_move = self.copy(cr, uid, move.id, default_val)
|
||||
#self.write(cr, uid, [new_move], {'move_history_ids':[(4,move.id)]}) #TODO : to track scrap moves
|
||||
res += [new_move]
|
||||
message = _('Product ') + " '" + move.product_id.name + "' "+ _("is scraped with") + " '" + str(move.product_qty) + "' "+ _("quantity.")
|
||||
self.log(cr, uid, move.id, message)
|
||||
self.action_done(cr, uid, res)
|
||||
return res
|
||||
|
||||
@@ -2064,6 +2068,8 @@ class stock_move(osv.osv):
|
||||
}
|
||||
|
||||
self.write(cr, uid, [move.id], update_val)
|
||||
message = _('Product ') + " '" + move.product_id.name + "' "+ _("is consumed with") + " '" + str(move.product_qty) + "' "+ _("quantity.")
|
||||
self.log(cr, uid, move.id, message)
|
||||
self.action_done(cr, uid, res)
|
||||
|
||||
return res
|
||||
@@ -2229,6 +2235,7 @@ class stock_inventory(osv.osv):
|
||||
|
||||
# price = line.product_id.standard_price or 0.0
|
||||
amount = self.pool.get('stock.location')._product_get(cr, uid, line.location_id.id, [pid], {'uom': line.product_uom.id})[pid]
|
||||
#TOCHECK: Why put restriction like new inventory qty should greater available qty ?
|
||||
change = line.product_qty - amount
|
||||
lot_id = line.prod_lot_id.id
|
||||
if change:
|
||||
@@ -2260,6 +2267,8 @@ class stock_inventory(osv.osv):
|
||||
'product_qty': line.product_qty
|
||||
})
|
||||
move_ids.append(self._inventory_line_hook(cr, uid, line, value))
|
||||
message = _('Inventory') + " '" + inv.name + "' "+ _("is done.")
|
||||
self.log(cr, uid, inv.id, message)
|
||||
self.write(cr, uid, [inv.id], {'state': 'done', 'date_done': time.strftime('%Y-%m-%d %H:%M:%S'), 'move_ids': [(6, 0, move_ids)]})
|
||||
return True
|
||||
|
||||
|
||||
@@ -47,7 +47,11 @@ class stock_inventory_line_split(osv.osv_memory):
|
||||
res = {}
|
||||
line = self.pool.get('stock.inventory.line').browse(cr, uid, record_id)
|
||||
if 'product_id' in fields:
|
||||
res.update({'product_id':line.product_id.id})
|
||||
res.update({'product_id':line.product_id.id})
|
||||
if 'product_uom' in fields:
|
||||
res.update({'product_uom': line.product_uom.id})
|
||||
if 'qty' in fields:
|
||||
res.update({'qty': line.product_qty})
|
||||
return res
|
||||
|
||||
def split(self, cr, uid, ids, line_ids, context=None):
|
||||
@@ -68,11 +72,13 @@ class stock_inventory_line_split(osv.osv_memory):
|
||||
for inv_line in line_obj.browse(cr, uid, line_ids):
|
||||
line_qty = inv_line.product_qty
|
||||
quantity_rest = inv_line.product_qty
|
||||
new_line = []
|
||||
for line in data.line_ids:
|
||||
new_line = []
|
||||
if data.use_exist:
|
||||
lines = [l for l in data.line_exist_ids if l]
|
||||
else:
|
||||
lines = [l for l in data.line_ids if l]
|
||||
for line in lines:
|
||||
quantity = line.quantity
|
||||
|
||||
|
||||
if quantity <= 0 or line_qty == 0:
|
||||
continue
|
||||
quantity_rest -= quantity
|
||||
@@ -85,14 +91,13 @@ class stock_inventory_line_split(osv.osv_memory):
|
||||
current_line = line_obj.copy(cr, uid, inv_line.id, default_val)
|
||||
new_line.append(current_line)
|
||||
prodlot_id = False
|
||||
if line.use_exist and line.name:
|
||||
prodlot_id = prodlot_obj.search(cr, uid, [('prefix','=',line.name),('product_id','=',data.product_id.id)])
|
||||
if prodlot_id:
|
||||
prodlot_id = prodlot_id[0]
|
||||
if data.use_exist:
|
||||
prodlot_id = line.prodlot_id.id
|
||||
if not prodlot_id:
|
||||
sequence = ir_sequence_obj.get(cr, uid, 'stock.lot.serial')
|
||||
prodlot_id = prodlot_obj.create(cr, uid, {'name': sequence, 'prefix' : line.name},
|
||||
{'product_id': data.product_id.id})
|
||||
prodlot_id = prodlot_obj.create(cr, uid, {
|
||||
'name': line.name,
|
||||
'product_id': inv_line.product_id.id},
|
||||
context=context)
|
||||
line_obj.write(cr, uid, [current_line], {'prod_lot_id': prodlot_id})
|
||||
prodlot = prodlot_obj.browse(cr, uid, prodlot_id)
|
||||
|
||||
|
||||
@@ -1,38 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_stock_inventory_line_split" model="ir.ui.view">
|
||||
<field name="name">Split inventory lines</field>
|
||||
<field name="model">stock.inventory.line.split</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Split inventory lines in lots">
|
||||
<field name="product_id" colspan="4" readonly="1"/>
|
||||
<newline/>
|
||||
<field name="line_ids" colspan="4" nolabel="1">
|
||||
<tree string="Lots Number" editable="top">
|
||||
<field name="name" string="Lots"/>
|
||||
<field name="quantity" />
|
||||
<field name="use_exist" />
|
||||
</tree>
|
||||
<form string="Lots Number">
|
||||
<field name="name" string="Lots"/>
|
||||
<field name="quantity" />
|
||||
<field name="use_exist" />
|
||||
</form>
|
||||
</field>
|
||||
<separator string="" colspan="4" />
|
||||
<label string="" colspan="2" />
|
||||
<button icon='gtk-cancel' special="cancel"
|
||||
string="Cancel" />
|
||||
<button name="split_lot" string="Ok"
|
||||
type="object" icon="gtk-ok" />
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_split_in_lots_inherit" model="ir.ui.view">
|
||||
<field name="name">Split Inventory Line</field>
|
||||
<field name="model">stock.inventory.line.split</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Split in lots">
|
||||
<group width="660" height="275">
|
||||
<field name="product_id" colspan="4" readonly="1"/>
|
||||
<newline/>
|
||||
<group colspan="4" col="4">
|
||||
<group colspan="1" col="2">
|
||||
<field name="use_exist"/>
|
||||
</group>
|
||||
<group colspan="1" col="2">
|
||||
<field name="qty" readonly="1"/>
|
||||
</group>
|
||||
<group colspan="1" col="2">
|
||||
<field name="product_uom" readonly="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<group colspan="4" attrs="{'invisible':[('use_exist','=',True)]}">
|
||||
<field name="line_ids" colspan="4" nolabel="1">
|
||||
<tree string="Lots Number" editable="bottom">
|
||||
<field name="name" string="Lots"/>
|
||||
<field name="quantity" />
|
||||
</tree>
|
||||
<form string="Lots Number">
|
||||
<field name="name" string="Lots"/>
|
||||
<field name="quantity" />
|
||||
</form>
|
||||
</field>
|
||||
</group>
|
||||
<group colspan="4" attrs="{'invisible':[('use_exist','!=',True)]}">
|
||||
<field name="line_exist_ids" colspan="4" nolabel="1">
|
||||
<tree string="Lots Number" editable="bottom">
|
||||
<field name="prodlot_id" string="Lots" domain="[('product_id','=',parent.product_id)]"/>
|
||||
<field name="quantity" />
|
||||
</tree>
|
||||
<form string="Lots Number">
|
||||
<field name="prodlot_id" string="Lots" domain="[('product_id','=',parent.product_id)]"/>
|
||||
<field name="quantity" />
|
||||
</form>
|
||||
</field>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<label string="" colspan="2" />
|
||||
<button icon='gtk-cancel' special="cancel"
|
||||
string="Cancel" />
|
||||
<button name="split_lot" string="Ok"
|
||||
type="object" icon="gtk-ok" />
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_view_stock_inventory_line_split" model="ir.actions.act_window">
|
||||
<field name="name">Split inventory lines</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
||||
@@ -67,12 +67,16 @@ class survey_name_wiz(osv.osv_memory):
|
||||
user_rec = user_obj.read(cr, uid, uid)
|
||||
for sur in surv_obj.browse(cr, uid, surv_obj.search(cr, uid, [])):
|
||||
if sur.state == 'open':
|
||||
# if group_id[0] in user_rec['groups_id']:
|
||||
res = False
|
||||
for i in group_id:
|
||||
if i in user_rec['groups_id']:
|
||||
result.append((sur.id, sur.title))
|
||||
res = True
|
||||
break
|
||||
elif sur.id in user_rec['survey_id']:
|
||||
result.append((sur.id, sur.title))
|
||||
res = True
|
||||
break
|
||||
if res:
|
||||
result.append((sur.id, sur.title))
|
||||
return result
|
||||
|
||||
_columns = {
|
||||
@@ -137,14 +141,13 @@ class survey_name_wiz(osv.osv_memory):
|
||||
def on_change_survey(self, cr, uid, ids, survey_id, context=None):
|
||||
"""
|
||||
on change event of survey_id field, if note is available in selected survey then display this note in note fields.
|
||||
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param ids: List of Survey IDs
|
||||
@param survey_id: Id of Survey
|
||||
@param context: A standard dictionary for contextual values
|
||||
@return : Dictionary values of notes fields.
|
||||
"""
|
||||
if not survey_id:
|
||||
return {}
|
||||
notes = self.pool.get('survey').read(cr, uid, survey_id, ['note'])['note']
|
||||
return {'value': {'note': notes}}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class thunderbird_installer(osv.osv_memory):
|
||||
'thunderbird' : True,
|
||||
'name' : 'tiny_plugin-2.0.xpi',
|
||||
'pdf_name' : 'Installation Guide to OpenERP Thunderbid Plug-in.pdf',
|
||||
'description' : """ * Save the Thunderbird plugin. \n * Follow the following step to install Thunderbird plugin. \n -> 1.From Menu Bar of Thunderbird, open Tools > Add ons. \n -> 2. Click on install button and a browser window appears. \n -> 3. Select the plug-in(.xpi file) and click Ok. \n -> 4. Software installation window appears and within a short time “Install Now” button will be enabled -> 5. Click "Install Now". \n -> 6. Restart Thunderbird."""
|
||||
'description' : """ * Save the Thunderbird plugin. \n * Follows the following step to install Thunderbird plugin. \n -> 1.From Menu Bar of Thunderbird, open Tools > Add ons. \n -> 2. Click on install button and a browser window appears. \n -> 3. Select the plug-in(.xpi file) and click Ok. \n -> 4. Software installation window appears and within a short time “Install Now” button will be enabled -> 5. Click "Install Now". \n -> 6. Restart Thunderbird."""
|
||||
}
|
||||
|
||||
thunderbird_installer()
|
||||
|
||||
Binary file not shown.
@@ -42,8 +42,8 @@ keep track for the wiki groups, pages, and history
|
||||
'data/wiki_main.xml',
|
||||
'security/ir.model.access.csv'
|
||||
],
|
||||
'demo_xml': ['test/wiki_test00.yml'],
|
||||
# 'test': ['test/wiki_test00.yml'],
|
||||
'demo_xml': [],
|
||||
'test': ['test/wiki_test00.yml'],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '0086363630317',
|
||||
|
||||
@@ -21,11 +21,7 @@
|
||||
FAQs, quality manuals, technical references, etc.
|
||||
|
||||
'
|
||||
-
|
||||
I Get Help on this current page by clicking on "Basic wiki Editing" wizard
|
||||
-
|
||||
!python {model: wiki.wiki}: |
|
||||
self.open_wiki_page(cr, uid, [ref("wiki_wiki_openerpwikiediting0")], context)
|
||||
|
||||
-
|
||||
I create Index on this current page by clicking on "Create Index" wizard
|
||||
-
|
||||
|
||||
Reference in New Issue
Block a user