[MERGE]: Merge with lp:~openerp-dev/openobject-addons/trunk-dev-addons1
bzr revid: atp@tinyerp.co.in-20101231050246-qvscv0l2eoyvncfx
This commit is contained in:
@@ -133,7 +133,9 @@ module named account_voucher.
|
||||
'test/account_bank_statement.yml',
|
||||
'test/account_cash_statement.yml',
|
||||
'test/account_report.yml',
|
||||
],
|
||||
|
||||
|
||||
],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': '0080331923549',
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<attribute name='string'></attribute>
|
||||
</xpath>
|
||||
<group colspan="8">
|
||||
<group colspan="4" height="450" width="600">
|
||||
<group colspan="4" width="600">
|
||||
<field name="charts"/>
|
||||
<group colspan="4" groups="base.group_extended">
|
||||
<separator col="4" colspan="4" string="Configure Fiscal Year"/>
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
<field name="currency_id" width="50"/>
|
||||
<button name="%(action_account_change_currency)d" type="action" icon="terp-stock_effects-object-colorize" string="Change" attrs="{'invisible':[('state','!=','draft')]}" groups="account.group_account_user"/>
|
||||
<newline/>
|
||||
<field string="Supplier" name="partner_id" domain="[('supplier','=', 1)]" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)" context="{'default_customer': 0}"/>
|
||||
<field string="Supplier" name="partner_id" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}"/>
|
||||
<field domain="[('partner_id','=',partner_id)]" name="address_invoice_id"/>
|
||||
<field name="fiscal_position" groups="base.group_extended" widget="selection"/>
|
||||
<newline/>
|
||||
@@ -264,7 +264,7 @@
|
||||
<field name="currency_id" width="50"/>
|
||||
<button name="%(action_account_change_currency)d" type="action" icon="terp-stock_effects-object-colorize" string="Change" attrs="{'invisible':[('state','!=','draft')]}" groups="account.group_account_user"/>
|
||||
<newline/>
|
||||
<field string="Customer" name="partner_id" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)" groups="base.group_user"/>
|
||||
<field string="Customer" name="partner_id" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)" groups="base.group_user" context="{'search_default_customer': 1}"/>
|
||||
<field domain="[('partner_id','=',partner_id)]" name="address_invoice_id"/>
|
||||
<field name="fiscal_position" groups="base.group_extended" widget="selection"/>
|
||||
<newline/>
|
||||
@@ -461,7 +461,7 @@
|
||||
<field name="domain">[('type','=','in_invoice')]</field>
|
||||
<field name="context">{'type':'in_invoice', 'journal_type': 'purchase'}</field>
|
||||
<field name="search_view_id" ref="view_account_invoice_filter"/>
|
||||
<field name="help">With Supplier Invoices you can enter and manage invoices issued by your suppliers. OpenERP can also generate draft invoices automatically from purchase order or receipt. This way, you can control the invoice from your supplier according to what you purchased or received.</field>
|
||||
<field name="help">With Supplier Invoices you can enter and manage invoices issued by your suppliers. OpenERP can also generate draft invoices automatically from purchase orders or receipts. This way, you can control the invoice from your supplier according to what you purchased or received.</field>
|
||||
</record>
|
||||
<menuitem action="action_invoice_tree2" id="menu_action_invoice_tree2" parent="menu_finance_payables"/>
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
groups="group_account_user,group_account_manager,group_account_invoice"
|
||||
web_icon="images/accounting.png"
|
||||
web_icon_hover="images/accounting-hover.png"/>
|
||||
<menuitem id="menu_partners" name="Partners" parent="menu_finance" sequence="1"/>
|
||||
<menuitem id="menu_finance_receivables" name="Customers" parent="menu_finance" sequence="2"/>
|
||||
<menuitem id="menu_finance_payables" name="Suppliers" parent="menu_finance" sequence="3"/>
|
||||
<menuitem id="menu_finance_bank_and_cash" name="Bank and Cash" parent="menu_finance" sequence="4"
|
||||
|
||||
@@ -2762,11 +2762,13 @@ action = self.pool.get('res.config').next(cr, uid, [], context)
|
||||
<field name="filter" eval="True"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_partners_partners"
|
||||
name="Partners"
|
||||
parent="menu_partners"
|
||||
action="action_partner_all"
|
||||
sequence="1"/>
|
||||
<menuitem id="menu_account_customer" name="Customers"
|
||||
parent="menu_finance_receivables"
|
||||
action="base.action_partner_customer_form" sequence="100"/>
|
||||
|
||||
<menuitem id="menu_account_supplier" name="Suppliers"
|
||||
parent="menu_finance_payables"
|
||||
action="base.action_partner_supplier_form" sequence="100"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -253,13 +253,13 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9"><font face="Times-Roman">[[ repeatIn(get_lines_another('liability'), 'a') ]]</font>[[ a['code'] ]]<font>[[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]] </font></para>
|
||||
<para style="terp_default_9"><font face="Times-Roman">[[ repeatIn(get_lines_another('liability'), 'a') ]]</font>[[ a['code'] ]]<font>[[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]] </font><font>[[ a['name']=='Net Profit' and setTag('para','para',{'style':'terp_default_Bold_9'}) or removeParentNode('font') ]]</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9"><font color="white">[[ '. '*(a['level']-1) ]]</font><font>[[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]]</font></para>
|
||||
<para style="terp_default_9"><font color="white">[[ '. '*(a['level']-1) ]]</font><font>[[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]]</font><font>[[ a['name']=='Net Profit' and setTag('para','para',{'style':'terp_default_Bold_9'}) or removeParentNode('font') ]]</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9"><font>[[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font><font>[[ formatLang(abs(a['balance'])) ]] [[ company.currency_id.symbol ]]</font></para>
|
||||
<para style="terp_default_Right_9"><font>[[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font><font>[[ formatLang(abs(a['balance'])) ]] [[ company.currency_id.symbol ]]</font><font>[[ a['name']=='Net Profit' and setTag('para','para',{'style':'terp_default_Right_9_Bold'}) or removeParentNode('font') ]]</font></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
@@ -205,13 +205,15 @@
|
||||
<para style="terp_default_Right_9"><font>[[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font><font>[[ formatLang(abs(a['balance1'])) ]] [[ company.currency_id.symbol ]]</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9"><font face="Times-Roman">[[ repeatIn(get_lines(), 'a') ]]</font> <font>[[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]]</font><font>[[ a['code'] ]]</font></para>
|
||||
<para style="terp_default_9"><font face="Times-Roman">[[ repeatIn(get_lines(), 'a') ]]</font> <font>[[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]]</font><font>[[ a['code'] ]]</font><font>[[ a['name']=='Net Profit' and setTag('para','para',{'style':'terp_default_Bold_9'}) or removeParentNode('font') ]]</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9"><font color="white">[[ '. '*(a['level']-1) ]]</font><font>[[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]]</font></para>
|
||||
<para style="terp_default_9"><font color="white">[[ '. '*(a['level']-1) ]]</font><font>[[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]]</font><font>[[ a['name']=='Net Profit' and setTag('para','para',{'style':'terp_default_Bold_9'}) or removeParentNode('font') ]]</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9"><font>[[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font><font>[[(a['code'] and a['name']) and formatLang(abs(a['balance'])) or removeParentNode('font')]] [[ company.currency_id.symbol ]]</font></para>
|
||||
<para style="terp_default_Right_9"><font>[[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font>
|
||||
<font>[[ a['name']=='Net Profit' and setTag('para','para',{'style':'terp_default_Right_9_Bold'}) or removeParentNode('font') ]]</font>
|
||||
<font> [[(a['code'] and a['name']) and formatLang(abs(a['balance'])) or removeParentNode('font')]] [[ company.currency_id.symbol ]]</font></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
@@ -233,7 +233,7 @@
|
||||
<td><para style="terp_header"><font color="white"> </font></para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="90.0,80.0,100.0,130.0,100.0" style="Table2">
|
||||
<blockTable colWidths="130.0,80.0,100.0,130.0,100.0" style="Table2">
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_General_Centre">[[ data['model']=='account.journal.period' and 'Company' or removeParentNode('para') ]]</para>
|
||||
<para style="terp_tblheader_General_Centre"> [[ data['model']=='ir.ui.menu' and 'Chart of Account' or removeParentNode('para') ]]</para></td>
|
||||
@@ -274,7 +274,7 @@
|
||||
<para style="P9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="50.0,260.0,80.0,80.0,80.0" style="Table_Account_detail_Title">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="50.0,240.0,85.0,85.0,90.0" style="Table_Account_detail_Title">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_tblheader_Details">A/C No.</para></td>
|
||||
<td><para style="terp_tblheader_Details">Account Name</para></td>
|
||||
@@ -293,7 +293,7 @@
|
||||
<td><para style="terp_tblheader_Details_Right">Currency</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="50.0,260.0,80.0,80.0,80.0" style="Table_Final_Total">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="50.0,240.0,85.0,85.0,90.0" style="Table_Final_Total">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_default_Bold_9">Total:</para></td>
|
||||
<td><para style="terp_default_Bold_9"><font color="white"> </font></para></td>
|
||||
@@ -314,7 +314,7 @@
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(lines(o.period_id.id,o.journal_id.id),'line') ]]</para>
|
||||
<blockTable colWidths="50.0,260.0,80.0,80.0,80.0" style="Table_Journal_Line_Content">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<blockTable colWidths="50.0,240.0,85.0,85.0,90.0" style="Table_Journal_Line_Content">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="terp_default_9">[[ line['code'] ]]</para></td>
|
||||
<td><para style="terp_default_9">[[ line['name'] ]]</para></td>
|
||||
|
||||
@@ -479,7 +479,7 @@
|
||||
<para style="terp_default_Bold_9_Right">[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.code or '' ]]</para>
|
||||
<para style="terp_default_Bold_9_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.symbol or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
@@ -616,4 +616,4 @@
|
||||
</section>
|
||||
</pto>
|
||||
</story>
|
||||
</document>
|
||||
</document>
|
||||
|
||||
@@ -263,11 +263,11 @@
|
||||
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_7" fontName="Helvetica-Bold" fontSize="7.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_8_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_7_Right" fontName="Helvetica-Bold" fontSize="7.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Heading 3" fontName="Helvetica-Bold" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<images/>
|
||||
</stylesheet>
|
||||
@@ -313,7 +313,7 @@
|
||||
<para style="terp_tblheader_Details_Right">Currency</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</blockTable>
|
||||
<blockTable colWidths="45.0,35.0,30.0,105.0,80.0,55.0,130.0,95.0,65.0,65.0,75.0" style="Table10">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
@@ -496,19 +496,19 @@
|
||||
<blockTable rowHeights="0.55cm" colWidths="490.0,65.0,65.0,75.0,75.0" style="Table8">[[data['form']['amount_currency'] == True or removeParentNode('blockTable')]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_8"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code ]] [[ o.name ]]</para>
|
||||
<para style="terp_default_Bold_7"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code ]] [[ o.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_8_Right">[[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]]</para>
|
||||
<para style="terp_default_Bold_7_Right">[[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_8_Right">[[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]]</para>
|
||||
<para style="terp_default_Bold_7_Right">[[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_8_Right">[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_Bold_7_Right">[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_8_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.code or '' ]]</para>
|
||||
<para style="terp_default_Bold_7_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.symbol or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
@@ -526,7 +526,7 @@
|
||||
<para style="terp_default_7">[[ line['lcode'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_7">[[ strip_name(line['partner_name'],21) ]]</para>
|
||||
<para style="terp_default_7">[[ strip_name(line['partner_name'],20) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_7">[[ strip_name(line['lref'],17) ]]</para>
|
||||
@@ -535,7 +535,7 @@
|
||||
<para style="terp_default_7">[[ line['move'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_7">[[ strip_name(line['lname'],26) ]]</para>
|
||||
<para style="terp_default_7">[[ strip_name(line['lname'],22) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_7">[[ strip_name(line['line_corresp'],18) ]]</para>
|
||||
@@ -598,16 +598,16 @@
|
||||
<blockTable rowHeights="0.55cm" colWidths="575.0,65.0,65.0,75.0" style="Table11">[[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_8"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code ]] [[ o.name ]]</para>
|
||||
<para style="terp_default_Bold_7"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code ]] [[ o.name ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_8_Right">[[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]]</para>
|
||||
<para style="terp_default_Bold_7_Right">[[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_8_Right">[[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]]</para>
|
||||
<para style="terp_default_Bold_7_Right">[[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_8_Right">[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_Bold_7_Right">[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
@@ -625,7 +625,7 @@
|
||||
<para style="terp_default_7">[[ line['lcode'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_7">[[ strip_name(line['partner_name'],25) ]]</para>
|
||||
<para style="terp_default_7">[[ strip_name(line['partner_name'],24) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_7">[[ strip_name(line['lref'],21) ]]</para>
|
||||
@@ -634,7 +634,7 @@
|
||||
<para style="terp_default_7">[[ line['move'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_7">[[ strip_name(line['lname'],35) ]]</para>
|
||||
<para style="terp_default_7">[[ strip_name(line['lname'],28) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_7">[[ strip_name(line['line_corresp'],23) ]]</para>
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
<para style="P9">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable rowHeights="0.55cm" colWidths="40.0,75.0,50.0,50.0,72.0,131.0,68.0,68.0" style="Table1" repeatRows="1">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<blockTable rowHeights="0.55cm" colWidths="45.0,55.0,55.0,50.0,80.0,120.0,70.0,70.0" style="Table1" repeatRows="1">[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="P10a">Date</para></td>
|
||||
<td><para style="P10a">Ref</para></td>
|
||||
@@ -256,14 +256,14 @@
|
||||
<td><para style="terp_default_8">[[ strip_name(line.ref,20) ]]</para></td>
|
||||
<td><para style="terp_default_8">[[ line.move_id.name <> '/' and line.move_id.name or ('*'+str(line.move_id.id)) ]]</para></td>
|
||||
<td><para style="terp_default_8">[[ line.account_id.code ]]</para></td>
|
||||
<td><para style="terp_default_8">[[ line.partner_id and strip_name(line.partner_id.name,16) ]]</para></td>
|
||||
<td><para style="terp_default_8">[[ strip_name(line.name,35) ]]</para></td>
|
||||
<td><para style="terp_default_8">[[ line.partner_id and strip_name(line.partner_id.name,17) ]]</para></td>
|
||||
<td><para style="terp_default_8">[[ strip_name(line.name,27) ]]</para></td>
|
||||
<td><para style="P8">[[ formatLang(line.debit) ]] [[ company.currency_id.symbol ]]</para></td>
|
||||
<td><para style="P8">[[ formatLang(line.credit) ]] [[ company.currency_id.symbol ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
<blockTable rowHeights="0.55cm" colWidths="40.0,75.0,50.0,50.0,72.0,66.0,68.0,68.0,68.0" style="Table1" repeatRows="1">[[ display_currency(data) or removeParentNode('blockTable') ]]
|
||||
<blockTable rowHeights="0.55cm" colWidths="45.0,50.0,52.0,50.0,70.0,80.0,70.0,70.0,70.0" style="Table1" repeatRows="1">[[ display_currency(data) or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td><para style="P10a">Date</para></td>
|
||||
<td><para style="P10a">Ref</para></td>
|
||||
@@ -293,7 +293,7 @@
|
||||
<td><para style="terp_default_8">[[ strip_name(line.ref,20) ]]</para></td>
|
||||
<td><para style="terp_default_8">[[ line.move_id.name <> '/' and line.move_id.name or ('*'+str(line.move_id.id)) ]]</para></td>
|
||||
<td><para style="terp_default_8">[[ line.account_id.code ]]</para></td>
|
||||
<td><para style="terp_default_8">[[ line.partner_id and strip_name(line.partner_id.name,16) ]]</para></td>
|
||||
<td><para style="terp_default_8">[[ line.partner_id and strip_name(line.partner_id.name,15) ]]</para></td>
|
||||
<td><para style="terp_default_8">[[ strip_name(line.name,17) ]]</para></td>
|
||||
<td><para style="P8">[[ formatLang(line.debit) ]] [[ company.currency_id.symbol ]]</para></td>
|
||||
<td><para style="P8">[[ formatLang(line.credit) ]] [[ company.currency_id.symbol ]]</para></td>
|
||||
|
||||
@@ -28,8 +28,6 @@ from common_report_header import common_report_header
|
||||
class partner_balance(report_sxw.rml_parse, common_report_header):
|
||||
|
||||
def __init__(self, cr, uid, name, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
super(partner_balance, self).__init__(cr, uid, name, context=context)
|
||||
self.account_ids = []
|
||||
self.localcontext.update( {
|
||||
@@ -276,6 +274,7 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
|
||||
return temp_res
|
||||
|
||||
def _sum_litige(self):
|
||||
#gives the total of move lines with blocked boolean set to TRUE for the report selection
|
||||
move_state = ['draft','posted']
|
||||
if self.target_move == 'posted':
|
||||
move_state = ['posted']
|
||||
@@ -296,12 +295,15 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
|
||||
return temp_res
|
||||
|
||||
def _get_partners(self):
|
||||
cr, uid = self.cr, self.uid
|
||||
context = self.localcontext # all of it?
|
||||
|
||||
if self.result_selection == 'customer':
|
||||
return 'Receivable Accounts'
|
||||
return _('Receivable Accounts')
|
||||
elif self.result_selection == 'supplier':
|
||||
return 'Payable Accounts'
|
||||
return _('Payable Accounts')
|
||||
elif self.result_selection == 'customer_supplier':
|
||||
return 'Receivable and Payable Accounts'
|
||||
return _('Receivable and Payable Accounts')
|
||||
return ''
|
||||
|
||||
report_sxw.report_sxw('report.account.partner.balance', 'res.partner', 'account/report/account_partner_balance.rml',parser=partner_balance, header="internal")
|
||||
|
||||
@@ -262,11 +262,11 @@
|
||||
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="8.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_9_italic" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Heading 3" fontName="Helvetica-Bold" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<images/>
|
||||
@@ -274,67 +274,65 @@
|
||||
<story>
|
||||
<pto>
|
||||
<pto_header>
|
||||
<blockTable colWidths="42.0,31.0,62.0,62.0,133.0,64.0,64.0,79.0" style="Table2">
|
||||
[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">JNRL</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Ref</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Account</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Entry Label</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Credit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="42.0,31.0,62.0,62.0,62.0,64.0,64.0,79.0,71.0" style="Table8">
|
||||
[[ display_currency(data) == True or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">JNRL</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Ref</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Account</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Entry Label</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Credit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Currency</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="50.0,30.0,60.0,60.0,130.0,64.0,64.0,79.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">JNRL</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Ref</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Account</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Entry Label</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Credit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="45.0,30.0,60.0,50.0,75.0,64.0,64.0,79.0,70.0" style="Table8">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">JNRL</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Ref</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Account</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Entry Label</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Credit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Currency</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</pto_header>
|
||||
<para style="terp_default_8">[[ repeatIn(objects, 'p') ]]</para>
|
||||
<para style="terp_default_8">[[ setLang(p.lang) ]]</para>
|
||||
@@ -439,7 +437,7 @@
|
||||
<para style="terp_default_2">
|
||||
<font face="Helvetica" color="white">[[ display_currency(data) == False or removeParentNode('section') ]]</font>
|
||||
</para>
|
||||
<blockTable colWidths="42.0,31.0,62.0,62.0,133.0,64.0,64.0,79.0" style="Table2">
|
||||
<blockTable colWidths="50.0,30.0,60.0,60.0,130.0,64.0,64.0,79.0" style="Table2">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Date</para>
|
||||
@@ -490,47 +488,47 @@
|
||||
<blockTable rowHeights="0.55cm" colWidths="332.0,64.0,64.0,79.0" style="Table5">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">Initial Balance</para>
|
||||
<para style="terp_default_8">Initial Balance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][0])]]</para>
|
||||
<para style="terp_default_Right_8">[[ formatLang(get_intial_balance(p)[0][0])]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][1]) ]]</para>
|
||||
<para style="terp_default_Right_8">[[ formatLang(get_intial_balance(p)[0][1]) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][2]) ]] [[ company.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_Right_8">[[ formatLang(get_intial_balance(p)[0][2]) ]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(lines(p), 'line') ]]</para>
|
||||
<blockTable rowHeights="0.55cm" colWidths="42.0,31.0,62.0,62.0,133.0,64.0,64.0,79.0" style="Table6">
|
||||
<blockTable rowHeights="0.55cm" colWidths="50.0,30.0,60.0,60.0,130.0,64.0,64.0,79.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ formatLang(line['date'],date=True) ]]</para>
|
||||
<para style="terp_default_8">[[ formatLang(line['date'],date=True) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ line['code'] ]]</para>
|
||||
<para style="terp_default_8">[[ line['code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ line['move_name'] ]]</para>
|
||||
<para style="terp_default_8">[[ line['move_name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ line['a_code'] ]]</para>
|
||||
<para style="terp_default_8">[[ line['a_code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ strip_name(line['ref'],10) ]] - [[ strip_name(line['name'],15) ]]</para>
|
||||
<para style="terp_default_8">[[ strip_name(line['ref'],10) ]] - [[ strip_name(line['name'],15) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang((line['debit'])) ]]</para>
|
||||
<para style="terp_default_Right_8">[[ formatLang((line['debit'])) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang((line['credit'])) ]]</para>
|
||||
<para style="terp_default_Right_8">[[ formatLang((line['credit'])) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_Right_8">[[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
@@ -540,7 +538,7 @@
|
||||
<para style="terp_default_2">
|
||||
<font face="Helvetica" color="white">[[ display_currency(data) == True or removeParentNode('section') ]]</font>
|
||||
</para>
|
||||
<blockTable colWidths="42.0,31.0,62.0,62.0,62.0,64.0,64.0,79.0,71.0" style="Table8">
|
||||
<blockTable colWidths="45.0,30.0,60.0,50.0,75.0,64.0,64.0,79.0,70.0" style="Table8">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Date</para>
|
||||
@@ -571,7 +569,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable rowHeights="0.55cm" colWidths="261.0,64.0,64.0,79.0,71.0" style="Table12">
|
||||
<blockTable rowHeights="0.55cm" colWidths="262.0,64.0,64.0,79.0,70.0" style="Table12">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">[[ p.ref ]] - [[ p.name ]]</para>
|
||||
@@ -594,7 +592,7 @@
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_2"><font color="white">[[ data['form']['initial_balance']==True or removeParentNode('section') ]]</font></para>
|
||||
<blockTable rowHeights="0.55cm" colWidths="261.0,64.0,64.0,79.0,71.0" style="Table13">
|
||||
<blockTable rowHeights="0.55cm" colWidths="262.0,64.0,64.0,79.0,70.0" style="Table13">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">Initial Balance</para>
|
||||
@@ -618,35 +616,35 @@
|
||||
</section>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(lines(p), 'line') ]]</para>
|
||||
<blockTable rowHeights="0.55cm" colWidths="42.0,31.0,62.0,62.0,62.0,64.0,64.0,79.0,71.0" style="Table14">
|
||||
<blockTable rowHeights="0.55cm" colWidths="45.0,30.0,60.0,50.0,75.0,64.0,64.0,79.0,70.0" style="Table14">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ formatLang(line['date'],date=True) ]]</para>
|
||||
<para style="terp_default_8">[[ formatLang(line['date'],date=True) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ line['code'] ]]</para>
|
||||
<para style="terp_default_8">[[ line['code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ line['move_name'] ]]</para>
|
||||
<para style="terp_default_8">[[ line['move_name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ line['a_code'] ]]</para>
|
||||
<para style="terp_default_8">[[ line['a_code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ strip_name(line['ref'],5) ]] - [[ strip_name(line['name'],5) ]]</para>
|
||||
<para style="terp_default_8">[[ strip_name(line['ref'],8) ]] - [[ strip_name(line['name'],7) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang((line['debit'])) ]]</para>
|
||||
<para style="terp_default_Right_8">[[ formatLang((line['debit'])) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang((line['credit'])) ]]</para>
|
||||
<para style="terp_default_Right_8">[[ formatLang((line['credit'])) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_Right_8">[[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_8">
|
||||
<font face="Helvetica" size="8.0">[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]</font>
|
||||
<font>[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -655,4 +653,4 @@
|
||||
</section>
|
||||
</pto>
|
||||
</story>
|
||||
</document>
|
||||
</document>
|
||||
|
||||
@@ -262,11 +262,11 @@
|
||||
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="8.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_9_italic" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_Bold_9_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
|
||||
<paraStyle name="Heading 3" fontName="Helvetica-Bold" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
|
||||
<images/>
|
||||
@@ -274,67 +274,67 @@
|
||||
<story>
|
||||
<pto>
|
||||
<pto_header>
|
||||
<blockTable colWidths="42.0,31.0,62.0,62.0,133.0,64.0,64.0,79.0" style="Table2">
|
||||
[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">JNRL</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Ref</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Account</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Entry Label</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Credit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="42.0,31.0,62.0,62.0,62.0,64.0,64.0,79.0,71.0" style="Table8">
|
||||
[[ display_currency(data) == True or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">JNRL</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Ref</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Account</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Entry Label</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Credit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Currency</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="50.0,30.0,60.0,60.0,130.0,64.0,64.0,79.0" style="Table2">
|
||||
[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">JNRL</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Ref</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Account</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Entry Label</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Credit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="50.0,30.0,60.0,50.0,70.0,64.0,64.0,79.0,70.0" style="Table8">
|
||||
[[ display_currency(data) == True or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">JNRL</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Ref</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Account</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Entry Label</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Debit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Credit</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Balance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Currency</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</pto_header>
|
||||
|
||||
<para style="terp_default_8">
|
||||
@@ -434,7 +434,7 @@
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="42.0,31.0,62.0,62.0,133.0,64.0,64.0,79.0" style="Table2">
|
||||
<blockTable colWidths="50.0,30.0,60.0,60.0,130.0,64.0,64.0,79.0" style="Table2">
|
||||
[[ display_currency(data) == False or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
@@ -493,53 +493,53 @@
|
||||
<blockTable rowHeights="0.55cm" colWidths="332.0,64.0,64.0,79.0" style="Table5">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">Initial Balance</para>
|
||||
<para style="terp_default_8">Initial Balance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][0])]]</para>
|
||||
<para style="terp_default_Right_8">[[ formatLang(get_intial_balance(p)[0][0])]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][1]) ]]</para>
|
||||
<para style="terp_default_Right_8">[[ formatLang(get_intial_balance(p)[0][1]) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][2]) ]] [[ company.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_Right_8">[[ formatLang(get_intial_balance(p)[0][2]) ]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(lines(p), 'line') ]]</para>
|
||||
<blockTable rowHeights="0.55cm" colWidths="42.0,31.0,62.0,62.0,133.0,64.0,64.0,79.0" style="Table6">
|
||||
<blockTable rowHeights="0.55cm" colWidths="50.0,30.0,60.0,60.0,130.0,64.0,64.0,79.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ formatLang(line['date'],date=True) ]]</para>
|
||||
<para style="terp_default_8">[[ formatLang(line['date'],date=True) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ line['code'] ]]</para>
|
||||
<para style="terp_default_8">[[ line['code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ line['move_name'] ]]</para>
|
||||
<para style="terp_default_8">[[ line['move_name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ line['a_code'] ]]</para>
|
||||
<para style="terp_default_8">[[ line['a_code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ strip_name(line['ref'],10) ]] - [[ strip_name(line['name'],15) ]]</para>
|
||||
<para style="terp_default_8">[[ strip_name(line['ref'],10) ]] - [[ strip_name(line['name'],15) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang((line['debit'])) ]]</para>
|
||||
<para style="terp_default_Right_8">[[ formatLang((line['debit'])) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang((line['credit'])) ]]</para>
|
||||
<para style="terp_default_Right_8">[[ formatLang((line['credit'])) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_Right_8">[[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
</section>
|
||||
<blockTable colWidths="42.0,31.0,62.0,62.0,62.0,64.0,64.0,79.0,71.0" style="Table8">
|
||||
<blockTable colWidths="50.0,30.0,60.0,50.0,70.0,64.0,64.0,79.0,70.0" style="Table8">
|
||||
[[ display_currency(data) == True or removeParentNode('blockTable') ]]
|
||||
<tr>
|
||||
<td>
|
||||
@@ -578,7 +578,7 @@
|
||||
<font face="Helvetica" color="white">[[ display_currency(data) == True or removeParentNode('section') ]]</font>
|
||||
</para>
|
||||
|
||||
<blockTable rowHeights="0.55cm" colWidths="261.0,64.0,64.0,79.0,71.0" style="Table12">
|
||||
<blockTable rowHeights="0.55cm" colWidths="262.0,64.0,64.0,79.0,70.0" style="Table12">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">[[ p.ref ]] - [[ p.name ]]</para>
|
||||
@@ -601,22 +601,22 @@
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_2"><font color="white">[[ data['form']['initial_balance']==True or removeParentNode('section') ]]</font></para>
|
||||
<blockTable rowHeights="0.55cm" colWidths="261.0,64.0,64.0,79.0,71.0" style="Table13">
|
||||
<blockTable rowHeights="0.55cm" colWidths="262.0,64.0,64.0,79.0,70.0" style="Table13">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">Initial Balance</para>
|
||||
<para style="terp_default_8">Initial Balance</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][0])]]</para>
|
||||
<para style="terp_default_Right_8">[[ formatLang(get_intial_balance(p)[0][0])]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][1]) ]]</para>
|
||||
<para style="terp_default_Right_8">[[ formatLang(get_intial_balance(p)[0][1]) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(get_intial_balance(p)[0][2]) ]] [[ company.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_Right_8">[[ formatLang(get_intial_balance(p)[0][2]) ]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">
|
||||
<para style="terp_default_Right_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
@@ -625,35 +625,35 @@
|
||||
</section>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(lines(p), 'line') ]]</para>
|
||||
<blockTable rowHeights="0.55cm" colWidths="42.0,31.0,62.0,62.0,62.0,64.0,64.0,79.0,71.0" style="Table14">
|
||||
<blockTable rowHeights="0.55cm" colWidths="45.0,30.0,60.0,50.0,75.0,64.0,64.0,79.0,70.0" style="Table14">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ formatLang(line['date'],date=True) ]]</para>
|
||||
<para style="terp_default_8">[[ formatLang(line['date'],date=True) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ line['code'] ]]</para>
|
||||
<para style="terp_default_8">[[ line['code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ line['move_name'] ]]</para>
|
||||
<para style="terp_default_8">[[ line['move_name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ line['a_code'] ]]</para>
|
||||
<para style="terp_default_8">[[ line['a_code'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ strip_name(line['ref'],5) ]] - [[ strip_name(line['name'],5) ]]</para>
|
||||
<para style="terp_default_8">[[ strip_name(line['ref'],8) ]] - [[ strip_name(line['name'],7) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang((line['debit'])) ]]</para>
|
||||
<para style="terp_default_Right_8">[[ formatLang((line['debit'])) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang((line['credit'])) ]]</para>
|
||||
<para style="terp_default_Right_8">[[ formatLang((line['credit'])) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_Right_8">[[ formatLang((line['progress'])) ]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_8">
|
||||
<font face="Helvetica" size="8.0">[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]</font>
|
||||
<font>[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]</font>
|
||||
</para>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -662,4 +662,4 @@
|
||||
</section>
|
||||
</pto>
|
||||
</story>
|
||||
</document>
|
||||
</document>
|
||||
|
||||
@@ -27,6 +27,10 @@
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_General_Detail_Content">
|
||||
<blockAlignment value="LEFT"/>
|
||||
@@ -41,6 +45,10 @@
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table7">
|
||||
<blockAlignment value="LEFT"/>
|
||||
@@ -178,20 +186,23 @@
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="177.0,177.0,177.0" style="Table_Invoice_General_Header">
|
||||
<blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_Invoice_General_Header">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Document</para>
|
||||
<para style="terp_tblheader_General_Centre">Description</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Invoice Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Origin</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Partner Ref.</para>
|
||||
<para style="terp_tblheader_General_Centre">Your Reference</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="177.0,177.0,177.0" style="Table_General_Detail_Content">
|
||||
<blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_General_Detail_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ o.name or ' ' ]]</para>
|
||||
@@ -199,6 +210,9 @@
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ formatLang(o.date_invoice,date=True) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ o.origin or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ (o.address_invoice_id and o.address_invoice_id.partner_id and o.address_invoice_id.partner_id.ref) or ' ' ]]</para>
|
||||
</td>
|
||||
@@ -207,31 +221,31 @@
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="202.0,87.0,71.0,57.0,42.0,71.0" style="Table7">
|
||||
<blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table7">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Description</para>
|
||||
<para style="terp_tblheader_General">Description</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Taxes</para>
|
||||
<para style="terp_tblheader_General_Centre">Taxes</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Quantity</para>
|
||||
<para style="terp_tblheader_General_Right">Quantity</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Unit Price </para>
|
||||
<para style="terp_tblheader_General_Right">Unit Price</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Disc.(%)</para>
|
||||
<para style="terp_tblheader_General_Right">Disc.(%)</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Price</para>
|
||||
<para style="terp_tblheader_General_Right">Price</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<section>
|
||||
<para style="terp_default_2">[[ repeatIn(o.invoice_line,'l') ]]</para>
|
||||
<blockTable colWidths="202.0,88.0,71.0,57.0,42.0,71.0" style="Table8">
|
||||
<blockTable colWidths="185.0,70.0,80.0,60.0,50.0,85.0" style="Table8">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ l.name ]]</para>
|
||||
@@ -246,7 +260,7 @@
|
||||
<para style="terp_default_Right_9">[[ formatLang(l.price_unit) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(l.discount, digits=get_digits(dp='Account')) ]] </para>
|
||||
<para style="terp_default_Centre_9">[[ formatLang(l.discount, digits=get_digits(dp='Account')) ]] </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(l.price_subtotal, digits=get_digits(dp='Account')) ]] [[ o.currency_id.symbol ]]</para>
|
||||
@@ -284,7 +298,7 @@
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<blockTable colWidths="391.0,54.0,85.0" style="Table10">
|
||||
<blockTable colWidths="385.0,60.0,85.0" style="Table10">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_8">
|
||||
@@ -393,4 +407,4 @@
|
||||
</para>
|
||||
</pto>
|
||||
</story>
|
||||
</document>
|
||||
</document>
|
||||
|
||||
@@ -231,7 +231,7 @@
|
||||
<para style="terp_default_Bold_9">[[ final_result()['type'] == 'Net Profit' and final_result()['type'] or removeParentNode('blockTable') ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Loss' and formatLang(abs(final_result()['balance'])) ]] [[ final_result()['balance'] and final_result()['type'] == 'Net Loss' and company.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_Right_9_Bold">[[ final_result()['balance'] and final_result()['type'] == 'Net Profit' and formatLang(abs(final_result()['balance'])) ]] [[ final_result()['balance'] and final_result()['type'] == 'Net Profit' and company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
(data, format) = netsvc.LocalService('report.account.overdue').create(cr, uid, [ref('base.res_partner_asus'),ref('base.res_partner_agrolait'),ref('base.res_partner_c2c')], {}, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-report_overdue.'+format), 'wb+').write(data)
|
||||
|
||||
-
|
||||
In order to test the PDF reports defined on Account Move, we will print the Voucher Report
|
||||
-
|
||||
@@ -37,311 +36,183 @@
|
||||
(data, format) = netsvc.LocalService('report.account.move.voucher').create(cr, uid, [ref('account.account_move_0')], {}, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-voucher-report.'+format), 'wb+').write(data)
|
||||
|
||||
-
|
||||
Print the Aged Partner Balance Report
|
||||
-
|
||||
!python {model: res.partner}: |
|
||||
import time
|
||||
from datetime import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
start = datetime.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d")))
|
||||
start = datetime(int(start.year), int(start.month), int(start.day))
|
||||
res = {}
|
||||
for i in range(5)[::-1]:
|
||||
stop = start - relativedelta(days=30)
|
||||
res[str(i)] = {
|
||||
'name': (i!=0 and (str((5-(i+1)) * 30) + '-' + str((5-i) * 30)) or ('+'+str(4 * 30))),
|
||||
'stop': start.strftime('%Y-%m-%d'),
|
||||
'start': (i!=0 and stop.strftime('%Y-%m-%d') or False),
|
||||
}
|
||||
start = stop - relativedelta(days=1)
|
||||
obj_move = self.pool.get('account.move.line')
|
||||
ctx = {}
|
||||
fy_id = ref('account.data_fiscalyear')
|
||||
period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
|
||||
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
|
||||
ctx['fiscalyear'] = fy_id
|
||||
ctx['journal_ids'] = journal_ids
|
||||
ctx['chart_account_id'] = ref('account.chart0')
|
||||
|
||||
query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
|
||||
|
||||
data_dict = {'model': 'ir.ui.menu', 'form': \
|
||||
{'chart_account_id':ref('account.chart0'),
|
||||
'initial_balance': 1, 'periods': period_list,
|
||||
'journal_ids':journal_ids, 'page_split': 0,
|
||||
'date_from': time.strftime('%Y-%m-%d'),
|
||||
'period_length': 30, 'amount_currency': 0,
|
||||
'query_line' : query_line, 'result_selection':
|
||||
'customer','direction_selection':
|
||||
'past','fiscalyear_id':fy_id } }
|
||||
data_dict['form'].update(res)
|
||||
from tools.test_reports import try_report
|
||||
try_report(cr, uid, 'report.account.aged_trial_balance', [], data_dict, context={})
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
|
||||
data_dict = {'chart_account_id':ref('account.chart0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_aged_balance_view',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the Account Balance Sheet in Horizontal mode
|
||||
-
|
||||
!python {model: account.account}: |
|
||||
import netsvc, tools, os, time
|
||||
data_dict = {'model': 'ir.ui.menu', 'form': {'reserve_account_id':ref('account.rsa') ,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 1,'journal_ids':[],'fiscalyear': ref('account.data_fiscalyear') ,'target_move': 'all'}}
|
||||
(data, format) = netsvc.LocalService('report.account.balancesheet.horizontal').create(cr, uid, [], data_dict, {'periods': []})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-account_balance_sheet_horizontal.'+format), 'wb+').write(data)
|
||||
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_bs_report',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the Account Balance Sheet in Normal mode
|
||||
-
|
||||
!python {model: account.account}: |
|
||||
import netsvc, tools, os, time
|
||||
data_dict = {'model': 'ir.ui.menu', 'form': {'reserve_account_id':ref('account.rsa') ,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':[],'fiscalyear': ref('account.data_fiscalyear') ,'target_move': 'all'}}
|
||||
(data, format) = netsvc.LocalService('report.account.balancesheet').create(cr, uid, [], data_dict, {'periods': []})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-account_balance_sheet.'+format), 'wb+').write(data)
|
||||
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_bs_report',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the Account Balance Report in Normal mode - From Account Chart
|
||||
Print the Account Balance Report in Normal mode through the wizard - From Account Chart
|
||||
-
|
||||
!python {model: account.account}: |
|
||||
import netsvc, tools, os, time
|
||||
data_dict = {'model': 'account.account', 'form': {'chart_account_id':ref('account.chart0'),'select_account': False,'display_account':'bal_all','format_perc':0,'filter': 'filter_no','show_columns' :0, 'account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': ref('account.data_fiscalyear') ,'target_move': 'all','periods': [],'id':ref('account.bal'),'context':{'state':'all'}}}
|
||||
(data, format) = netsvc.LocalService('report.account.account.balance').create(cr, uid, [ref('account.bal'),ref('account.gpf')], data_dict, {'periods': []})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-account_balance-normal.'+format), 'wb+').write(data)
|
||||
|
||||
data_dict.update({'model': 'ir.ui.menu'})
|
||||
data_dict['form'].update({'active_ids':[ref('account.bal'),ref('account.gpf')]})
|
||||
|
||||
(data, format) = netsvc.LocalService('report.account.account.balance').create(cr, uid, [], data_dict, {'periods': []})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-account_balance-normal-menu.'+format), 'wb+').write(data)
|
||||
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_balance_menu',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the Central Journal Report - From Account
|
||||
-
|
||||
!python {model: account.journal.period}: |
|
||||
import netsvc, tools, os, time
|
||||
fy_id = ref('account.data_fiscalyear')
|
||||
period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
|
||||
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
|
||||
journal_period_ids = self.pool.get('account.journal.period').search(cr, uid, [('journal_id', 'in', journal_ids), ('period_id', 'in', period_list)], context=context)
|
||||
|
||||
obj_move = self.pool.get('account.move.line')
|
||||
ctx = {}
|
||||
ctx['fiscalyear'] = fy_id
|
||||
ctx['journal_ids'] = journal_ids
|
||||
ctx['chart_account_id'] = ref('account.chart0')
|
||||
|
||||
query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
|
||||
data_dict = {'model': 'account.journal.period', 'id':journal_period_ids[0], 'form': {'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }}
|
||||
(data, format) = netsvc.LocalService('report.account.central.journal').create(cr, uid, journal_period_ids, data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-central_journal.'+format), 'wb+').write(data)
|
||||
|
||||
data_dict.update({'model': 'ir.ui.menu'})
|
||||
data_dict['form'].update({'active_ids':journal_period_ids})
|
||||
|
||||
(data, format) = netsvc.LocalService('report.account.central.journal').create(cr, uid, [], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-central_journal-menu.'+format), 'wb+').write(data)
|
||||
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),
|
||||
ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.journal.period','active_ids':journal_ids})
|
||||
data_dict = {'chart_account_id':ref('account.chart0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_central_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the General Journal Report - From Journal
|
||||
-
|
||||
!python {model: account.journal.period}: |
|
||||
import netsvc, tools, os, time
|
||||
fy_id = ref('account.data_fiscalyear')
|
||||
period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
|
||||
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
|
||||
journal_period_ids = self.pool.get('account.journal.period').search(cr, uid, [('journal_id', 'in', journal_ids), ('period_id', 'in', period_list)], context=context)
|
||||
|
||||
obj_move = self.pool.get('account.move.line')
|
||||
ctx = {}
|
||||
ctx['fiscalyear'] = fy_id
|
||||
ctx['journal_ids'] = journal_ids
|
||||
ctx['chart_account_id'] = ref('account.chart0')
|
||||
|
||||
query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
|
||||
data_dict = {'model': 'ir.ui.menu','id':journal_period_ids[0], 'form': {'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids, 'active_ids':journal_period_ids}}
|
||||
(data, format) = netsvc.LocalService('report.account.general.journal').create(cr, uid, journal_period_ids, data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-general_journal.'+format), 'wb+').write(data)
|
||||
|
||||
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),
|
||||
ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.journal.period','active_ids':journal_ids})
|
||||
data_dict = {'chart_account_id':ref('account.chart0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_general_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the General Ledger Report in Normal Mode
|
||||
-
|
||||
!python {model: account.account}: |
|
||||
import netsvc, tools, os, time
|
||||
fy_id = ref('account.data_fiscalyear')
|
||||
period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
|
||||
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
|
||||
acc_ids = [ref('account.bal'),ref('account.gpf')]
|
||||
|
||||
obj_move = self.pool.get('account.move.line')
|
||||
ctx = {}
|
||||
ctx['fiscalyear'] = fy_id
|
||||
ctx['journal_ids'] = journal_ids
|
||||
ctx['chart_account_id'] = ref('account.chart0')
|
||||
|
||||
query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
|
||||
|
||||
data_dict = {'model': 'account.account', 'form': {'initial_balance': 1,'initial_bal_query': query_line,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','sortby': 'sort_date','amount_currency': 0,'landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }}
|
||||
(data, format) = netsvc.LocalService('report.account.general.ledger').create(cr, uid, acc_ids, data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-general_ledger.'+format), 'wb+').write(data)
|
||||
|
||||
data_dict.update({'model': 'ir.ui.menu'})
|
||||
data_dict['form'].update({'active_ids': acc_ids})
|
||||
(data, format) = netsvc.LocalService('report.account.general.ledger').create(cr, uid, [], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-general_ledger-menu.'+format), 'wb+').write(data)
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'landscape':False}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the General Ledger Report in Landscape Mode
|
||||
-
|
||||
!python {model: account.account}: |
|
||||
import netsvc, tools, os, time
|
||||
fy_id = ref('account.data_fiscalyear')
|
||||
period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
|
||||
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
|
||||
acc_ids = [ref('account.bal'),ref('account.gpf')]
|
||||
|
||||
obj_move = self.pool.get('account.move.line')
|
||||
ctx = {}
|
||||
ctx['fiscalyear'] = fy_id
|
||||
ctx['journal_ids'] = journal_ids
|
||||
ctx['chart_account_id'] = ref('account.chart0')
|
||||
|
||||
query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
|
||||
|
||||
data_dict = {'model': 'account.account', 'form': {'initial_balance': 1,'initial_bal_query':query_line,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','sortby': 'sort_date','amount_currency': 0,'landscape':1,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }}
|
||||
(data, format) = netsvc.LocalService('report.account.general.ledger_landscape').create(cr, uid, acc_ids, data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-general_ledger-landscape.'+format), 'wb+').write(data)
|
||||
|
||||
data_dict.update({'model': 'ir.ui.menu'})
|
||||
data_dict['form'].update({'active_ids': acc_ids})
|
||||
(data, format) = netsvc.LocalService('report.account.general.ledger_landscape').create(cr, uid, [], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-general_ledger-landscape-menu.'+format), 'wb+').write(data)
|
||||
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'landscape':True}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print Journal Report - From Model
|
||||
-
|
||||
!python {model: account.journal.period}: |
|
||||
import netsvc, tools, os, time
|
||||
fy_id = ref('account.data_fiscalyear')
|
||||
period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
|
||||
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
|
||||
journal_period_ids = self.pool.get('account.journal.period').search(cr, uid, [('journal_id', 'in', journal_ids), ('period_id', 'in', period_list)], context=context)
|
||||
|
||||
obj_move = self.pool.get('account.move.line')
|
||||
ctx = {}
|
||||
ctx['fiscalyear'] = fy_id
|
||||
ctx['journal_ids'] = journal_ids
|
||||
ctx['chart_account_id'] = ref('account.chart0')
|
||||
|
||||
query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
|
||||
|
||||
data_dict = {'model': 'account.journal.period', 'id':journal_period_ids[0], 'form': {'sort_selection': 'date','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'compare_pattern': 'none','account_choice': 'moves','landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':query_line,'target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal') }}
|
||||
(data, format) = netsvc.LocalService('report.account.journal.period.print').create(cr, uid, journal_period_ids, data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-print_journal.'+format), 'wb+').write(data)
|
||||
|
||||
data_dict.update({'model': 'ir.ui.menu'})
|
||||
data_dict['form'].update({'active_ids':journal_period_ids})
|
||||
|
||||
(data, format) = netsvc.LocalService('report.account.journal.period.print').create(cr, uid, [], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-print_journal-menu.'+format), 'wb+').write(data)
|
||||
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.journal.period','active_ids':journal_ids})
|
||||
data_dict = {'chart_account_id':ref('account.chart0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_print_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the Partner Balance Report
|
||||
-
|
||||
!python {model: res.partner}: |
|
||||
import netsvc, tools, os, time
|
||||
fy_id = ref('account.data_fiscalyear')
|
||||
period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
|
||||
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
|
||||
journal_period_ids = self.pool.get('account.journal.period').search(cr, uid, [('journal_id', 'in', journal_ids), ('period_id', 'in', period_list)], context=context)
|
||||
obj_move = self.pool.get('account.move.line')
|
||||
ctx = {}
|
||||
ctx['fiscalyear'] = fy_id
|
||||
ctx['journal_ids'] = journal_ids
|
||||
ctx['chart_account_id'] = ref('account.chart0')
|
||||
|
||||
query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
|
||||
|
||||
data_dict = {'model': 'ir.ui.menu', 'form': {'result_selection': 'customer','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':journal_ids,'active_ids':journal_period_ids,'display_partner': 'all','fiscalyear': fy_id ,'target_move': 'all','query_line':query_line}}
|
||||
(data, format) = netsvc.LocalService('report.account.partner.balance').create(cr, uid, journal_period_ids, data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-partner_balance.'+format), 'wb+').write(data)
|
||||
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
data_dict = {'chart_account_id':ref('account.chart0')}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_partner_balance',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the Partner Ledger Report
|
||||
-
|
||||
!python {model: res.partner}: |
|
||||
import netsvc, tools, os, time
|
||||
fy_id = ref('account.data_fiscalyear')
|
||||
period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
|
||||
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
|
||||
|
||||
obj_move = self.pool.get('account.move.line')
|
||||
ctx = {}
|
||||
ctx['fiscalyear'] = fy_id
|
||||
ctx['journal_ids'] = journal_ids
|
||||
ctx['chart_account_id'] = ref('account.chart0')
|
||||
|
||||
query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
|
||||
|
||||
data_dict = {'model': 'ir.ui.menu', 'form': {'initial_bal_query':query_line,'amount_currency': 0,'reconcil': True,'initial_balance':1,'page_split': True,'result_selection': 'customer','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':journal_ids,'display_partner': 'non-zero_balance','fiscalyear': fy_id ,'target_move': 'all','query_line':query_line}}
|
||||
(data, format) = netsvc.LocalService('report.account.third_party_ledger').create(cr, uid, [], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-partner_ledger.'+format), 'wb+').write(data)
|
||||
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'page_split': True}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_partner_ledger',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the Partner Ledger-Other Report
|
||||
-
|
||||
!python {model: res.partner}: |
|
||||
import netsvc, tools, os, time
|
||||
fy_id = ref('account.data_fiscalyear')
|
||||
period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
|
||||
journal_ids = [ref('account.sales_journal'),ref('account.refund_sales_journal'),ref('account.expenses_journal'),ref('account.refund_expenses_journal'),ref('account.bank_journal'),ref('account.check_journal'),ref('account.cash_journal')]
|
||||
|
||||
obj_move = self.pool.get('account.move.line')
|
||||
ctx = {}
|
||||
ctx['fiscalyear'] = fy_id
|
||||
ctx['journal_ids'] = journal_ids
|
||||
ctx['chart_account_id'] = ref('account.chart0')
|
||||
|
||||
query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
|
||||
data_dict = {'model': 'ir.ui.menu', 'form': {'initial_bal_query':query_line,'amount_currency': 0,'reconcil': True,'initial_balance':1,'page_split': False,'result_selection': 'customer','chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','display_type': 0,'journal_ids':journal_ids,'display_partner': 'non-zero_balance','fiscalyear': fy_id ,'target_move': 'all','query_line':query_line}}
|
||||
(data, format) = netsvc.LocalService('report.account.third_party_ledger_other').create(cr, uid, [], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-partner_ledger-other.'+format), 'wb+').write(data)
|
||||
|
||||
ctx={}
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'page_split': False}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_partner_ledger',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the Profit-Loss Report in Normal Mode
|
||||
-
|
||||
!python {model: account.account}: |
|
||||
import netsvc, tools, os, time
|
||||
fy_id = ref('account.data_fiscalyear')
|
||||
period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
|
||||
journal_ids = []
|
||||
acc_ids = [ref('account.bal'),ref('account.gpf')]
|
||||
data_dict = {'model': 'ir.ui.menu', 'form': {'display_type': False,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':'True ','target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal'),'active_ids':acc_ids }}
|
||||
(data, format) = netsvc.LocalService('report.pl.account').create(cr, uid, [], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-profit-loss.'+format), 'wb+').write(data)
|
||||
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the Profit-Loss Report in Horizontal Mode
|
||||
-
|
||||
!python {model: account.account}: |
|
||||
import netsvc, tools, os, time
|
||||
fy_id = ref('account.data_fiscalyear')
|
||||
period_list = self.pool.get('account.period').search(cr, uid, [('fiscalyear_id', 'in', [fy_id])], context=context)
|
||||
journal_ids = []
|
||||
acc_ids = [ref('account.bal'),ref('account.gpf')]
|
||||
data_dict = {'model': 'ir.ui.menu', 'form': {'display_type': True,'chart_account_id':ref('account.chart0'),'display_account':'bal_all','filter': 'filter_no','amount_currency': 0,'landscape':0,'period_manner': 'actual','fiscalyear_id': fy_id ,'query_line':'True ','target_move': 'all','periods': period_list,'journal_ids':journal_ids,'id':ref('account.bal'),'active_ids':acc_ids }}
|
||||
(data, format) = netsvc.LocalService('report.pl.account.horizontal').create(cr, uid, [], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account-profit-loss-horizontal.'+format), 'wb+').write(data)
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the Analytic Balance Report through the wizard
|
||||
-
|
||||
!python {model: account.analytic.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]})
|
||||
data_dict = {}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_analytic_balance',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
||||
-
|
||||
Print the Cost Ledger Report through the wizard
|
||||
-
|
||||
!python {model: account.analytic.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root'),ref('account.analytic_absences'),ref('account.analytic_internal'),ref('account.analytic_our_super_product')]})
|
||||
data_dict = {}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_analytic_cost',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
||||
-
|
||||
Print the Cost Ledger(Only Quantities) Report through the wizard
|
||||
-
|
||||
!python {model: account.analytic.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root'),ref('account.analytic_absences'),ref('account.analytic_internal'),ref('account.analytic_our_super_product')]})
|
||||
data_dict = {}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_analytic_cost_ledger_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
||||
-
|
||||
Print the Analytic Journal Report through the wizard
|
||||
-
|
||||
!python {model: account.analytic.journal}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.analytic.journal','active_ids': [ref('account.cose_journal_sale'), ref('account.exp'), ref('account.sit')]})
|
||||
data_dict = {}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_analytic_journal',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
||||
-
|
||||
Print the Inverted Analytic Balance Report through the wizard
|
||||
-
|
||||
!python {model: account.analytic.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]})
|
||||
data_dict = {}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_analytic_invert_balance',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
|
||||
@@ -77,7 +77,8 @@ class account_aged_trial_balance(osv.osv_memory):
|
||||
}
|
||||
start = stop + relativedelta(days=1)
|
||||
data['form'].update(res)
|
||||
|
||||
if data.get('form',False):
|
||||
data['ids']=[data['form'].get('chart_account_id',False)]
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'account.aged_trial_balance',
|
||||
|
||||
@@ -384,7 +384,7 @@ class account_analytic_account(osv.osv):
|
||||
'ca_to_invoice': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Uninvoiced Amount',
|
||||
help="If invoice from analytic account, the remaining amount you can invoice to the customer based on the total costs.",
|
||||
digits_compute=dp.get_precision('Account')),
|
||||
'ca_theorical': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Theorical Revenue',
|
||||
'ca_theorical': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Theoretical Revenue',
|
||||
help="Based on the costs you had on the project, what would have been the revenue if all these costs have been invoiced at the normal sale price provided by the pricelist.",
|
||||
digits_compute=dp.get_precision('Account')),
|
||||
'hours_quantity': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Hours Tot',
|
||||
@@ -410,7 +410,7 @@ class account_analytic_account(osv.osv):
|
||||
'real_margin': fields.function(_real_margin_calc, method=True, type='float', string='Real Margin',
|
||||
help="Computed using the formula: Invoiced Amount - Total Costs.",
|
||||
digits_compute=dp.get_precision('Account')),
|
||||
'theorical_margin': fields.function(_theorical_margin_calc, method=True, type='float', string='Theorical Margin',
|
||||
'theorical_margin': fields.function(_theorical_margin_calc, method=True, type='float', string='Theoretical Margin',
|
||||
help="Computed using the formula: Theorial Revenue - Total Costs",
|
||||
digits_compute=dp.get_precision('Account')),
|
||||
'real_margin_rate': fields.function(_real_margin_rate_calc, method=True, type='float', string='Real Margin Rate (%)',
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
<para style="terp_tblheader_Details_Right">Amount</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Percentage</para>
|
||||
<para style="terp_tblheader_Details_Right">Perc(%)</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
@@ -222,7 +222,7 @@
|
||||
<para style="terp_tblheader_Details_Right">Amount</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Percentage</para>
|
||||
<para style="terp_tblheader_Details_Right">Perc(%)</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
@@ -301,4 +301,4 @@
|
||||
</section>
|
||||
</pto>
|
||||
</story>
|
||||
</document>
|
||||
</document>
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
# Translation of OpenERP Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * account_anglo_saxon
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2009-11-24 12:50:50+0000\n"
|
||||
"PO-Revision-Date: 2009-11-24 12:50:50+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: account_anglo_saxon
|
||||
#: view:product.category:0
|
||||
msgid " Accounting Property"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_anglo_saxon
|
||||
#: model:ir.module.module,description:account_anglo_saxon.module_meta_information
|
||||
msgid "This module will support the Anglo-Saxons accounting methodology by \n"
|
||||
" changing the accounting logic with stock transactions. The difference between the Anglo-Saxon accounting countries \n"
|
||||
" and the Rhine or also called Continental accounting countries is the moment of taking the Cost of Goods Sold versus Cost of Sales. \n"
|
||||
" Anglo-Saxons accounting does take the cost when sales invoice is created, Continental accounting will take the cost at he moment the goods are shipped.\n"
|
||||
" This module will add this functionality by using a interim account, to store the value of shipped goods and will contra book this interim account \n"
|
||||
" when the invoice is created to transfer this amount to the debtor or creditor account."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_anglo_saxon
|
||||
#: model:ir.module.module,shortdesc:account_anglo_saxon.module_meta_information
|
||||
msgid "Stock Account"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_anglo_saxon
|
||||
#: constraint:ir.ui.view:0
|
||||
msgid "Invalid XML for View Architecture!"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_anglo_saxon
|
||||
#: field:product.category,property_account_creditor_price_difference_categ:0
|
||||
#: field:product.template,property_account_creditor_price_difference:0
|
||||
msgid "Price Difference Account"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_anglo_saxon
|
||||
#: help:product.category,property_account_creditor_price_difference_categ:0
|
||||
#: help:product.template,property_account_creditor_price_difference:0
|
||||
msgid "This account will be used to value price difference between purchase price and cost price."
|
||||
msgstr ""
|
||||
|
||||
@@ -1,27 +1,33 @@
|
||||
-
|
||||
Print the Analytic Budget Report in Normal mode
|
||||
Print the Analytic Budget Report through wizard
|
||||
-
|
||||
!python {model: account.analytic.account}: |
|
||||
import netsvc, tools, os, time
|
||||
data_dict = {'model': 'account.analytic.account', 'form': {'date_from':time.strftime("%Y-01-01"),'date_to':time.strftime('%Y-%m-%d'),'id':ref('account.analytic_root'),'context':{}}}
|
||||
(data, format) = netsvc.LocalService('report.account.analytic.account.budget').create(cr, uid, [ref('account.analytic_root')], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account_budget-analytic_budget_report.'+format), 'wb+').write(data)
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.analytic.account','active_ids': [ref('account.analytic_root')]})
|
||||
data_dict = {}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_budget_analytic',wiz_data=data_dict, context=ctx, our_module='account_budget')
|
||||
|
||||
-
|
||||
Print the Budget Report in Normal mode
|
||||
Print the Budget Report through wizard
|
||||
-
|
||||
!python {model: account.budget.post}: |
|
||||
import netsvc, tools, os, time
|
||||
data_dict = {'model': 'account.budget.post', 'form': {'date_from':time.strftime("%Y-01-01"),'date_to':time.strftime('%Y-%m-%d'),'id':ref('account_budget.account_budget_post_sales0'),'context':{}}}
|
||||
(data, format) = netsvc.LocalService('report.account.analytic.account.budget').create(cr, uid, [ref('account_budget.account_budget_post_sales0')], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account_budget-budget_report.'+format), 'wb+').write(data)
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.budget.post','active_ids': [ref('account_budget.account_budget_post_sales0')]})
|
||||
data_dict = {}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_budget_report',wiz_data=data_dict, context=ctx, our_module='account_budget')
|
||||
|
||||
-
|
||||
Print the CrossOvered Budget Report in Normal mode
|
||||
Print the CrossOvered Budget Report mode through wizard
|
||||
-
|
||||
!python {model: crossovered.budget}: |
|
||||
import netsvc, tools, os, time
|
||||
data_dict = {'model': 'account.budget.post', 'form': {'date_from':time.strftime("%Y-01-01"),'date_to':time.strftime('%Y-%m-%d'),'report':'analytic-full','id':ref('account_budget.crossovered_budget_budgetoptimistic0'),'context':{}}}
|
||||
(data, format) = netsvc.LocalService('report.crossovered.budget.report').create(cr, uid, [ref('account_budget.crossovered_budget_budgetoptimistic0')], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account_budget-crossovered_budget_report.'+format), 'wb+').write(data)
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.budget.post','active_ids': [ref('account_budget.crossovered_budget_budgetoptimistic0')]})
|
||||
data_dict = {}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_budget_crossvered_report',wiz_data=data_dict, context=ctx, our_module='account_budget')
|
||||
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
# Translation of OpenERP Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * account_coda
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2009-11-24 13:11:29+0000\n"
|
||||
"PO-Revision-Date: 2009-11-24 13:11:29+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: account_coda
|
||||
#: field:account.coda,journal_id:0
|
||||
#: wizard_field:account.coda_import,init,journal_id:0
|
||||
msgid "Bank Journal"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: constraint:ir.model:0
|
||||
msgid "The Object name must start with x_ and not contain any special character !"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: wizard_field:account.coda_import,extraction,note:0
|
||||
msgid "Log"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: wizard_button:account.coda_import,extraction,open:0
|
||||
msgid "_Open Statement"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: model:ir.module.module,shortdesc:account_coda.module_meta_information
|
||||
msgid "Account CODA"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: field:account.coda,name:0
|
||||
msgid "Coda file"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: wizard_view:account.coda_import,init:0
|
||||
msgid "Clic on 'New' to select your file :"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: model:ir.actions.wizard,name:account_coda.wizard_account_coda_import
|
||||
msgid "Import Coda File"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: constraint:ir.actions.act_window:0
|
||||
msgid "Invalid model name in the action definition."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: field:account.coda,note:0
|
||||
msgid "Import log"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: wizard_field:account.coda_import,init,def_receivable:0
|
||||
msgid "Default receivable Account"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: model:ir.module.module,description:account_coda.module_meta_information
|
||||
msgid "Module provides functionality to import\n"
|
||||
" bank statements from .csv file.\n"
|
||||
" Import coda file wizard is used to import bank statements."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: wizard_button:account.coda_import,extraction,end:0
|
||||
msgid "_Close"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: field:account.coda,statement_id:0
|
||||
msgid "Generated Bank Statement"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: view:account.coda:0
|
||||
#: model:ir.actions.act_window,name:account_coda.act_account_payment_account_bank_statement
|
||||
#: model:ir.actions.act_window,name:account_coda.action_account_coda
|
||||
msgid "Coda import"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: field:account.coda,user_id:0
|
||||
msgid "User"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: constraint:ir.ui.view:0
|
||||
msgid "Invalid XML for View Architecture!"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: model:ir.model,name:account_coda.model_account_coda
|
||||
msgid "coda for an Account"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: wizard_field:account.coda_import,init,def_payable:0
|
||||
msgid "Default Payable Account"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: model:ir.ui.menu,name:account_coda.menu_account_coda
|
||||
msgid "Coda Statements"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: model:ir.ui.menu,name:account_coda.menu_account_coda_wizard
|
||||
msgid "Import Coda Statements"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: wizard_button:account.coda_import,init,extraction:0
|
||||
msgid "_Ok"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: wizard_view:account.coda_import,extraction:0
|
||||
#: wizard_view:account.coda_import,init:0
|
||||
msgid "Import Coda Statement"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: field:account.bank.statement,coda_id:0
|
||||
msgid "Coda"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: wizard_view:account.coda_import,extraction:0
|
||||
msgid "Results :"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: wizard_field:account.coda_import,init,coda:0
|
||||
msgid "Coda File"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: field:account.coda,date:0
|
||||
msgid "Import Date"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_coda
|
||||
#: wizard_view:account.coda_import,init:0
|
||||
msgid "Select your bank journal :"
|
||||
msgstr ""
|
||||
|
||||
@@ -4,11 +4,7 @@
|
||||
|
||||
<record id="demo_message1" model="notify.message">
|
||||
<field name="name">OpenERP SA</field>
|
||||
<field name="msg">ERP & CRM Solutions....</field>
|
||||
</record>
|
||||
<record id="demo_message1" model="notify.message">
|
||||
<field name="name">Tiny sprl</field>
|
||||
<field name="msg">Be Expert with the Experts...</field>
|
||||
<field name="msg">ERP & CRM Solutions...</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -27,6 +27,10 @@
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_General_Detail_Content">
|
||||
<blockAlignment value="LEFT"/>
|
||||
@@ -41,6 +45,10 @@
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Tableau6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
@@ -237,20 +245,23 @@
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="180.0,179.0,180.0" style="Table_Invoice_General_Header">
|
||||
<blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_Invoice_General_Header">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Document</para>
|
||||
<para style="terp_tblheader_General_Centre">Description</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Invoice Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Origin</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Partner Ref.</para>
|
||||
<para style="terp_tblheader_General_Centre">Your Reference</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="179.0,179.0,180.0" style="Table_General_Detail_Content">
|
||||
<blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_General_Detail_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ o.name ]]</para>
|
||||
@@ -258,6 +269,9 @@
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ formatLang(o.date_invoice,date=True) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ o.name or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ (o.address_invoice_id and o.address_invoice_id.partner_id and o.address_invoice_id.partner_id.ref) or ' ' ]]</para>
|
||||
</td>
|
||||
@@ -493,4 +507,4 @@
|
||||
</para>
|
||||
</pto>
|
||||
</story>
|
||||
</document>
|
||||
</document>
|
||||
|
||||
@@ -27,6 +27,10 @@
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Table_General_Detail_Content">
|
||||
<blockAlignment value="LEFT"/>
|
||||
@@ -41,6 +45,10 @@
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
|
||||
<lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
|
||||
</blockTableStyle>
|
||||
<blockTableStyle id="Tableau6">
|
||||
<blockAlignment value="LEFT"/>
|
||||
@@ -241,20 +249,23 @@
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="180.0,179.0,180.0" style="Table_Invoice_General_Header">
|
||||
<blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_Invoice_General_Header">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Document</para>
|
||||
<para style="terp_tblheader_General_Centre">Description</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Invoice Date</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Origin</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_General_Centre">Partner Ref.</para>
|
||||
<para style="terp_tblheader_General_Centre">Your Reference</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="179.0,179.0,180.0" style="Table_General_Detail_Content">
|
||||
<blockTable colWidths="132.50,132.50,132.50,132.50" style="Table_General_Detail_Content">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ o.name ]]</para>
|
||||
@@ -262,6 +273,9 @@
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ formatLang(o.date_invoice,date=True) ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ o.name or '' ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9">[[ (o.address_invoice_id and o.address_invoice_id.partner_id and o.address_invoice_id.partner_id.ref) or ' ' ]]</para>
|
||||
</td>
|
||||
@@ -382,7 +396,7 @@
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<blockTable colWidths="395.0,59.0,85.0" style="Tableau3">
|
||||
<blockTable colWidths="390.0,64.0,85.0" style="Tableau3">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
@@ -390,14 +404,14 @@
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">Net Total:</para>
|
||||
<para style="terp_default_9">Net Total : </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(o.amount_untaxed, digits=get_digits(dp='Account')) ]] [[ o.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="395.0,59.0,85.0" style="Table4">
|
||||
<blockTable colWidths="390.0,64.0,85.0" style="Table4">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
@@ -405,14 +419,14 @@
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_9">Taxes:</para>
|
||||
<para style="terp_default_9">Taxes : </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(o.amount_tax, digits=get_digits(dp='Account')) ]] [[ o.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
<blockTable colWidths="395.0,59.0,85.0" style="Table6">
|
||||
<blockTable colWidths="390.0,64.0,85.0" style="Table6">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">
|
||||
@@ -420,7 +434,7 @@
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_9">Total:</para>
|
||||
<para style="terp_default_Bold_9">Total : </para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold">[[ formatLang(o.amount_total, digits=get_digits(dp='Account')) ]] [[ o.currency_id.symbol ]]</para>
|
||||
@@ -511,4 +525,4 @@
|
||||
</para>
|
||||
</pto>
|
||||
</story>
|
||||
</document>
|
||||
</document>
|
||||
|
||||
@@ -19,12 +19,14 @@
|
||||
(data, format) = netsvc.LocalService('report.account.invoice.layout').create(cr, uid, [ref('test_invoice_1')], {}, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account_invoice_layout.'+format), 'wb+').write(data)
|
||||
|
||||
-
|
||||
Print the Invoice Layout Report with Message in Normal mode
|
||||
Print the Invoice Layout Report with Message through wizard
|
||||
-
|
||||
!python {model: account.invoice}: |
|
||||
import netsvc, tools, os, time
|
||||
data_dict = {'model': 'account.invoice', 'form': {'message':ref('account_invoice_layout.demo_message1'),'id':ref('test_invoice_1'),'context':{}}}
|
||||
(data, format) = netsvc.LocalService('report.notify_account.invoice').create(cr, uid, [ref('test_invoice_1')], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'account_invoice_layout_message_report.'+format), 'wb+').write(data)
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.invoice','active_ids': [ref('test_invoice_1')]})
|
||||
data_dict = {'message':ref('account_invoice_layout.demo_message1')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_invoice_special_msg',wiz_data=data_dict, context=ctx, our_module='account_invoice_layout')
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@
|
||||
<para style="terp_default_Centre_8">[[ o.date_prefered == 'fixed' and 'Fixed date' or removeParentNode('para') ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_8">[[ get_company_currency() ]]</para>
|
||||
<para style="terp_default_Centre_8">[[ o.user_id and o.user_id.company_id and o.user_id.company_id.currency_id and o.user_id.company_id.currency_id.name or '' ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
@@ -287,4 +287,4 @@
|
||||
</para>
|
||||
</pto>
|
||||
</story>
|
||||
</document>
|
||||
</document>
|
||||
|
||||
@@ -49,8 +49,9 @@ account_move_line()
|
||||
|
||||
class account_voucher(osv.osv):
|
||||
|
||||
def _get_type(self, cr, uid, ids, context=None):
|
||||
if context is None: context = {}
|
||||
def _get_type(self, cr, uid, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
return context.get('type', False)
|
||||
|
||||
def _get_period(self, cr, uid, context=None):
|
||||
@@ -775,7 +776,7 @@ class account_voucher(osv.osv):
|
||||
'date': inv.date,
|
||||
'credit': diff > 0 and diff or 0.0,
|
||||
'debit': diff < 0 and -diff or 0.0,
|
||||
'amount_currency': company_currency <> current_currency and currency_pool.compute(cr, uid, company_currency, current_currency, diff * -1, context=context_multi_currency) or 0.0,
|
||||
'amount_currency': company_currency <> current_currency and currency_pool.compute(cr, uid, company_currency, current_currency, diff * -1, context=context_multi_currency) or 0.0,
|
||||
'currency_id': company_currency <> current_currency and current_currency or False,
|
||||
}
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
<button name="cancel_voucher" string="Cancel" type="object" states="posted" icon="terp-stock_effects-object-colorize" confirm="Are you sure to confirm this record ?"/>
|
||||
<button name="proforma_voucher" string="Validate" states="draft" icon="gtk-go-forward"/>
|
||||
<group attrs="{'invisible':[('state','!=','posted')]}">
|
||||
<button icon="terp-dolar_ok!" name="%(act_pay_voucher)d" context="{'narration':narration, 'title':'Customer Payment', 'type':'receipt', 'partner_id':partner_id, 'reference':reference, 'amount':amount}" type="action" string="Pay" attrs="{'invisible':[('pay_now','!=','pay_now')]}"/>
|
||||
<button icon="terp-dolar_ok!" name="%(act_pay_voucher)d" context="{'narration':narration, 'title':'Customer Payment', 'type':'receipt', 'partner_id':partner_id, 'reference':reference, 'amount':amount}" type="action" string="Pay" attrs="{'invisible':[('pay_now','=','pay_now')]}"/>
|
||||
</group>
|
||||
<button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
|
||||
</group>
|
||||
@@ -286,7 +286,7 @@
|
||||
<button name="cancel_voucher" string="Cancel" states="draft,proforma" icon="gtk-cancel"/>
|
||||
<button name="cancel_voucher" string="Cancel" type="object" states="posted" icon="terp-stock_effects-object-colorize" confirm="Are you sure to confirm this record ?"/>
|
||||
<group attrs="{'invisible':[('state','!=','posted')]}">
|
||||
<button icon="terp-dolar_ok!" name="%(act_pay_bills)d" context="{'narration':narration, 'title':'Bill Payment', 'type':'payment', 'partner_id': partner_id, 'reference':reference}" type="action" string="Pay Bill" attrs="{'invisible':[('pay_now','!=','pay_now')]}"/>
|
||||
<button icon="terp-dolar_ok!" name="%(act_pay_bills)d" context="{'narration':narration, 'title':'Bill Payment', 'type':'payment', 'partner_id': partner_id, 'reference':reference}" type="action" string="Pay Bill" attrs="{'invisible':[('pay_now','=','pay_now')]}"/>
|
||||
</group>
|
||||
<button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
|
||||
<button name="proforma_voucher" string="Validate" states="draft" icon="gtk-go-forward"/>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
##############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
from osv.osv import osv_pool
|
||||
from osv.osv import osv_pool, object_proxy
|
||||
from tools.translate import _
|
||||
import ir
|
||||
import pooler
|
||||
@@ -184,7 +184,7 @@ class audittrail_log_line(osv.osv):
|
||||
audittrail_log_line()
|
||||
|
||||
|
||||
class audittrail_objects_proxy(osv_pool):
|
||||
class audittrail_objects_proxy(object_proxy):
|
||||
""" Uses Object proxy for auditing changes on object of subscribed Rules"""
|
||||
|
||||
def get_value_text(self, cr, uid, field_name, values, model, context=None):
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
<field name="search_view_id" ref="view_audittrail_rule_search"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="Rules" id="menu_action_audittrail_rule_tree"
|
||||
<menuitem id="menu_action_audittrail_rule_tree"
|
||||
action="action_audittrail_rule_tree" parent="base.menu_audit" />
|
||||
<!-- AuditTrail Log form -->
|
||||
|
||||
|
||||
Regular → Executable
+4
-6
@@ -1,8 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
@@ -18,8 +17,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
__name__ = "Change signs of old holiday requests"
|
||||
|
||||
def migrate(cr, version):
|
||||
cr.execute("DELETE FROM hr_holidays WHERE number_of_days < 0")
|
||||
cr.execute("UPDATE hr_holidays SET number_of_days = -number_of_days, type ='remove'")
|
||||
from service import security
|
||||
import crypt
|
||||
|
||||
Executable
+43
@@ -0,0 +1,43 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
{
|
||||
"name" : "Base - Password Encryption",
|
||||
"version" : "1.1",
|
||||
"author" : "FS3 & OpenERP SA",
|
||||
"maintainer" : "OpenERP SA",
|
||||
"website" : "http://www.openerp.com",
|
||||
"category" : "Generic Modules/Base",
|
||||
"description": """This module replaces the cleartext password in the database with a password hash,
|
||||
preventing anyone from reading the original password.
|
||||
For your existing user base, the removal of the cleartext passwords occurs the first time
|
||||
a user logs into the database, after installing base_crypt.
|
||||
After installing this module it won't be possible to recover a forgotten password for your
|
||||
users, the only solution is for an admin to set a new password.
|
||||
|
||||
Note: installing this module does not mean you can ignore basic security measures,
|
||||
as the password is still transmitted unencrypted on the network (by the client),
|
||||
unless you are using a secure protocol such as XML-RPCS.
|
||||
""",
|
||||
"depends" : ["base"],
|
||||
"data" : [],
|
||||
"active": False,
|
||||
"installable": True,
|
||||
}
|
||||
Executable
+254
@@ -0,0 +1,254 @@
|
||||
# Notice:
|
||||
# ------
|
||||
#
|
||||
# Implements encrypting functions.
|
||||
#
|
||||
# Copyright (c) 2008, F S 3 Consulting Inc.
|
||||
#
|
||||
# Maintainer:
|
||||
# Alec Joseph Rivera (agi<at>fs3.ph)
|
||||
#
|
||||
#
|
||||
# Warning:
|
||||
# -------
|
||||
#
|
||||
# This program as such is intended to be used by professional programmers
|
||||
# who take the whole responsibility of assessing all potential consequences
|
||||
# resulting from its eventual inadequacies and bugs. End users who are
|
||||
# looking for a ready-to-use solution with commercial guarantees and
|
||||
# support are strongly adviced to contract a Free Software Service Company.
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation; either version 2 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 General
|
||||
# Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the:
|
||||
#
|
||||
# Free Software Foundation, Inc.
|
||||
# 59 Temple Place - Suite 330
|
||||
# Boston, MA 02111-1307
|
||||
# USA.
|
||||
|
||||
from random import seed, sample
|
||||
from string import letters, digits
|
||||
from osv import fields,osv
|
||||
import pooler
|
||||
from tools.translate import _
|
||||
|
||||
magic_md5 = '$1$'
|
||||
|
||||
def gen_salt( length=8, symbols=letters + digits ):
|
||||
seed()
|
||||
return ''.join( sample( symbols, length ) )
|
||||
|
||||
# The encrypt_md5 is based on Mark Johnson's md5crypt.py, which in turn is
|
||||
# based on FreeBSD src/lib/libcrypt/crypt.c (1.2) by Poul-Henning Kamp.
|
||||
# Mark's port can be found in ActiveState ASPN Python Cookbook. Kudos to
|
||||
# Poul and Mark. -agi
|
||||
#
|
||||
# Original license:
|
||||
#
|
||||
# * "THE BEER-WARE LICENSE" (Revision 42):
|
||||
# *
|
||||
# * <phk@login.dknet.dk> wrote this file. As long as you retain this
|
||||
# * notice you can do whatever you want with this stuff. If we meet some
|
||||
# * day, and you think this stuff is worth it, you can buy me a beer in
|
||||
# * return.
|
||||
# *
|
||||
# * Poul-Henning Kamp
|
||||
|
||||
import md5
|
||||
|
||||
def encrypt_md5( raw_pw, salt, magic=magic_md5 ):
|
||||
hash = md5.new( raw_pw + magic + salt )
|
||||
stretch = md5.new( raw_pw + salt + raw_pw).digest()
|
||||
|
||||
for i in range( 0, len( raw_pw ) ):
|
||||
hash.update( stretch[i % 16] )
|
||||
|
||||
i = len( raw_pw )
|
||||
|
||||
while i:
|
||||
if i & 1:
|
||||
hash.update('\x00')
|
||||
else:
|
||||
hash.update( raw_pw[0] )
|
||||
i >>= 1
|
||||
|
||||
saltedmd5 = hash.digest()
|
||||
|
||||
for i in range( 1000 ):
|
||||
hash = md5.new()
|
||||
|
||||
if i & 1:
|
||||
hash.update( raw_pw )
|
||||
else:
|
||||
hash.update( saltedmd5 )
|
||||
|
||||
if i % 3:
|
||||
hash.update( salt )
|
||||
if i % 7:
|
||||
hash.update( raw_pw )
|
||||
if i & 1:
|
||||
hash.update( saltedmd5 )
|
||||
else:
|
||||
hash.update( raw_pw )
|
||||
|
||||
saltedmd5 = hash.digest()
|
||||
|
||||
itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
|
||||
|
||||
rearranged = ''
|
||||
for a, b, c in ((0, 6, 12), (1, 7, 13), (2, 8, 14), (3, 9, 15), (4, 10, 5)):
|
||||
v = ord( saltedmd5[a] ) << 16 | ord( saltedmd5[b] ) << 8 | ord( saltedmd5[c] )
|
||||
|
||||
for i in range(4):
|
||||
rearranged += itoa64[v & 0x3f]
|
||||
v >>= 6
|
||||
|
||||
v = ord( saltedmd5[11] )
|
||||
|
||||
for i in range( 2 ):
|
||||
rearranged += itoa64[v & 0x3f]
|
||||
v >>= 6
|
||||
|
||||
return magic + salt + '$' + rearranged
|
||||
|
||||
class users(osv.osv):
|
||||
_name="res.users"
|
||||
_inherit="res.users"
|
||||
# agi - 022108
|
||||
# Add handlers for 'input_pw' field.
|
||||
|
||||
def set_pw(self, cr, uid, id, name, value, args, context):
|
||||
if not value:
|
||||
raise osv.except_osv(_('Error'), _("Please specify the password !"))
|
||||
|
||||
obj = pooler.get_pool(cr.dbname).get('res.users')
|
||||
if not hasattr(obj, "_salt_cache"):
|
||||
obj._salt_cache = {}
|
||||
|
||||
salt = obj._salt_cache[id] = gen_salt()
|
||||
encrypted = encrypt_md5(value, salt)
|
||||
cr.execute('update res_users set password=%s where id=%s',
|
||||
(encrypted.encode('utf-8'), int(id)))
|
||||
cr.commit()
|
||||
del value
|
||||
|
||||
def get_pw( self, cr, uid, ids, name, args, context ):
|
||||
cr.execute('select id, password from res_users where id in %s', (tuple(map(int, ids)),))
|
||||
stored_pws = cr.fetchall()
|
||||
res = {}
|
||||
|
||||
for id, stored_pw in stored_pws:
|
||||
res[id] = stored_pw
|
||||
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
# The column size could be smaller as it is meant to store a hash, but
|
||||
# an existing column cannot be downsized; thus we use the original
|
||||
# column size.
|
||||
'password': fields.function(get_pw, fnct_inv=set_pw, type='char',
|
||||
method=True, size=64, string='Password', invisible=True,
|
||||
store=True),
|
||||
}
|
||||
|
||||
def login(self, db, login, password):
|
||||
cr = pooler.get_db(db).cursor()
|
||||
cr.execute('select password, id from res_users where login=%s',
|
||||
(login.encode('utf-8'),))
|
||||
stored_pw = id = cr.fetchone()
|
||||
|
||||
if stored_pw:
|
||||
stored_pw = stored_pw[0]
|
||||
id = id[1]
|
||||
else:
|
||||
# Return early if there is no such login.
|
||||
return False
|
||||
|
||||
stored_pw = self.maybe_encrypt(cr, stored_pw, id)
|
||||
|
||||
# Calculate an encrypted password from the user-provided
|
||||
# password.
|
||||
obj = pooler.get_pool(db).get('res.users')
|
||||
if not hasattr(obj, "_salt_cache"):
|
||||
obj._salt_cache = {}
|
||||
salt = obj._salt_cache[id] = stored_pw[len(magic_md5):11]
|
||||
encrypted_pw = encrypt_md5(password, salt)
|
||||
|
||||
# Check if the encrypted password matches against the one in the db.
|
||||
cr.execute('select id from res_users where id=%s and password=%s and active', (int(id), encrypted_pw.encode('utf-8')))
|
||||
res = cr.fetchone()
|
||||
cr.close()
|
||||
|
||||
if res:
|
||||
return res[0]
|
||||
else:
|
||||
return False
|
||||
|
||||
def check(self, db, uid, passwd):
|
||||
# Get a chance to hash all passwords in db before using the uid_cache.
|
||||
obj = pooler.get_pool(db).get('res.users')
|
||||
if not hasattr(obj, "_salt_cache"):
|
||||
obj._salt_cache = {}
|
||||
self._uid_cache.get(db, {}).clear()
|
||||
|
||||
cached_pass = self._uid_cache.get(db, {}).get(uid)
|
||||
if (cached_pass is not None) and cached_pass == passwd:
|
||||
return True
|
||||
|
||||
cr = pooler.get_db(db).cursor()
|
||||
if uid not in obj._salt_cache:
|
||||
cr.execute('select login from res_users where id=%s', (int(uid),))
|
||||
stored_login = cr.fetchone()
|
||||
if stored_login:
|
||||
stored_login = stored_login[0]
|
||||
|
||||
if not self.login(db,stored_login,passwd):
|
||||
return False
|
||||
|
||||
salt = obj._salt_cache[uid]
|
||||
cr.execute('select count(id) from res_users where id=%s and password=%s',
|
||||
(int(uid), encrypt_md5(passwd, salt)))
|
||||
res = cr.fetchone()[0]
|
||||
cr.close()
|
||||
if not bool(res):
|
||||
raise Exception('AccessDenied')
|
||||
|
||||
if res:
|
||||
if self._uid_cache.has_key(db):
|
||||
ulist = self._uid_cache[db]
|
||||
ulist[uid] = passwd
|
||||
else:
|
||||
self._uid_cache[db] = {uid: passwd}
|
||||
return bool(res)
|
||||
|
||||
def maybe_encrypt(self, cr, pw, id):
|
||||
# If the password 'pw' is not encrypted, then encrypt all passwords
|
||||
# in the db. Returns the (possibly newly) encrypted password for 'id'.
|
||||
|
||||
if pw[0:len(magic_md5)] != magic_md5:
|
||||
cr.execute('select id, password from res_users')
|
||||
res = cr.fetchall()
|
||||
for i, p in res:
|
||||
encrypted = p
|
||||
if p[0:len(magic_md5)] != magic_md5:
|
||||
encrypted = encrypt_md5(p, gen_salt())
|
||||
cr.execute('update res_users set password=%s where id=%s',
|
||||
(encrypted.encode('utf-8'), int(i)))
|
||||
if i == id:
|
||||
encrypted_res = encrypted
|
||||
cr.commit()
|
||||
return encrypted_res
|
||||
return pw
|
||||
|
||||
users()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
# Translation of OpenERP Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * base_crypt
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 5.0.6\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2009-11-26 09:12:09+0000\n"
|
||||
"PO-Revision-Date: 2009-11-26 09:12:09+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: base_crypt
|
||||
#: model:ir.module.module,description:base_crypt.module_meta_information
|
||||
msgid "Module for password encryption."
|
||||
msgstr ""
|
||||
|
||||
#. module: base_crypt
|
||||
#: constraint:ir.ui.view:0
|
||||
msgid "Invalid XML for View Architecture!"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_crypt
|
||||
#: model:ir.module.module,shortdesc:base_crypt.module_meta_information
|
||||
msgid "Base"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_crypt
|
||||
#: field:res.users,input_pw:0
|
||||
msgid "Password"
|
||||
msgstr ""
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
# Translation of OpenERP Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * base_crypt
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 5.0.14\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2009-11-26 09:12+0000\n"
|
||||
"PO-Revision-Date: 2010-11-23 02:16+0000\n"
|
||||
"Last-Translator: Olivier Dony (OpenERP) <Unknown>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2010-12-15 05:38+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: base_crypt
|
||||
#: model:ir.module.module,description:base_crypt.module_meta_information
|
||||
msgid "Module for password encryption."
|
||||
msgstr ""
|
||||
|
||||
#. module: base_crypt
|
||||
#: constraint:ir.ui.view:0
|
||||
msgid "Invalid XML for View Architecture!"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_crypt
|
||||
#: model:ir.module.module,shortdesc:base_crypt.module_meta_information
|
||||
msgid "Base"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_crypt
|
||||
#: field:res.users,input_pw:0
|
||||
msgid "Password"
|
||||
msgstr ""
|
||||
|
||||
#~ msgid "Module for password encryption.KKKKKKKKKKKKKKKKKKK"
|
||||
#~ msgstr "Module for password encryption.KKKKKKKKKKKKKKKKKKK"
|
||||
@@ -1,57 +0,0 @@
|
||||
# Translation of OpenERP Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * base_module_doc_rst
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2009-01-28 00:45:34+0000\n"
|
||||
"PO-Revision-Date: 2009-01-28 00:45:34+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: base_module_doc_rst
|
||||
#: wizard_view:tech.guide.rst,init:0
|
||||
msgid "Technical Guide in rst format"
|
||||
msgstr "Guide Technique au format rst"
|
||||
|
||||
#. module: base_module_doc_rst
|
||||
#: wizard_field:tech.guide.rst,init,name:0
|
||||
msgid "filename"
|
||||
msgstr "Nom du Fichier"
|
||||
|
||||
#. module: base_module_doc_rst
|
||||
#: model:ir.actions.wizard,name:base_module_doc_rst.wiz_tech_guide_rst
|
||||
msgid "Create RST Technical Guide"
|
||||
msgstr "Crée le Guide Technical au format rst"
|
||||
|
||||
#. module: base_module_doc_rst
|
||||
#: wizard_view:tech.guide.rst,init:0
|
||||
msgid "Please choose a file where the Technical Guide will be written."
|
||||
msgstr "Choisissez un fichier où le Guide Technique sera créé."
|
||||
|
||||
#. module: base_module_doc_rst
|
||||
#: wizard_field:tech.guide.rst,init,rst_file:0
|
||||
msgid "file"
|
||||
msgstr "Fichier"
|
||||
|
||||
#. module: base_module_doc_rst
|
||||
#: wizard_button:tech.guide.rst,init,end:0
|
||||
msgid "Close"
|
||||
msgstr "Fermer"
|
||||
|
||||
#. module: base_module_doc_rst
|
||||
#: model:ir.module.module,shortdesc:base_module_doc_rst.module_meta_information
|
||||
msgid "Module Technical Guide in Restructured Text "
|
||||
msgstr ""
|
||||
|
||||
#. module: base_module_doc_rst
|
||||
#: wizard_view:tech.guide.rst,init:0
|
||||
msgid "Create Technical Guide in rst format"
|
||||
msgstr "Crée le Guide Technique au format rst"
|
||||
|
||||
@@ -5,3 +5,5 @@
|
||||
"access_board_note","board.note","model_board_note","base.group_user",1,1,1,1
|
||||
"access_board_board_sale_salesman","board.board.sale.salesman","model_board_board","base.group_sale_salesman",1,1,1,1
|
||||
"access_res_log_report","res.log.report","model_res_log_report","base.group_user",1,1,1,1
|
||||
"access_res_log_report_system","res.log.report system","model_res_log_report",base.group_system,1,0,0,0
|
||||
"access_res_log_report_erp_manager","res.log.report erp_manager","model_res_log_report",base.group_erp_manager,1,0,0,0
|
||||
|
||||
|
@@ -44,7 +44,7 @@
|
||||
<field name="alarm_id" string="Reminder"
|
||||
widget="selection" />
|
||||
<group colspan="2" col="4" >
|
||||
<field name="recurrency"/>
|
||||
<field name="recurrency"/>
|
||||
<field name="edit_all" attrs="{'invisible':[('recurrency','=', False)]}"
|
||||
on_change="onchange_edit_all(rrule_type,edit_all)"/>
|
||||
</group>
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
<form string="Phone Call">
|
||||
<group colspan="6" col="7">
|
||||
<field name="name" required="1"/>
|
||||
<field name="partner_phone" required="1"/>
|
||||
<field name="partner_phone"/>
|
||||
<field name="duration" widget="float_time" required="1"/>
|
||||
<button string="Schedule a Meeting" name="action_make_meeting" icon="gtk-redo" type="object"/>
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
- |
|
||||
In order to test the CRM in OpenERP,
|
||||
In order to test the CRM in OpenERP,
|
||||
I will do a customer qualification process that
|
||||
starts with a fist contact with a customer (a lead), which will be converted to a
|
||||
business opportunity and a partner.
|
||||
- |
|
||||
In order to test the flow, I create a two new users "user_crm" and
|
||||
I assign the group "salesman".
|
||||
-
|
||||
-
|
||||
!record {model: res.users, id: res_users_usercrm0}:
|
||||
company_id: base.main_company
|
||||
context_lang: en_US
|
||||
@@ -16,11 +16,11 @@
|
||||
login: user_crm
|
||||
name: user_crm
|
||||
password: user_crm
|
||||
|
||||
|
||||
- |
|
||||
I start by creating a new lead "New Customer" and I provide an address to this
|
||||
new customer, as well as an email "info@mycustomer.com".
|
||||
-
|
||||
-
|
||||
!record {model: crm.lead, id: crm_lead_newcustomer0}:
|
||||
email_from: info@mycustomer.com
|
||||
name: New Customer
|
||||
@@ -30,26 +30,26 @@
|
||||
section_id: crm.section_sales_department
|
||||
referred: False
|
||||
- |
|
||||
I check that the lead is in 'draft' state,
|
||||
-
|
||||
I check that the lead is in 'draft' state,
|
||||
-
|
||||
!assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in Draft}:
|
||||
- state == "draft"
|
||||
-
|
||||
I open lead by click on "Open" button,
|
||||
-
|
||||
-
|
||||
!python {model: crm.lead}: |
|
||||
self.case_open(cr, uid, [ref("crm_lead_newcustomer0")])
|
||||
- |
|
||||
I check that lead is now in 'open' state.
|
||||
-
|
||||
!assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in open state}:
|
||||
- state == "open"
|
||||
|
||||
- state == "open"
|
||||
|
||||
- |
|
||||
As the lead seems to be a real business opportunity, I will convert it to a
|
||||
partner
|
||||
partner
|
||||
and a business opportunity by clicking on the "Convert" button.
|
||||
-
|
||||
-
|
||||
!python {model: crm.lead}: |
|
||||
lead = self.browse(cr, uid, ref('crm_lead_newcustomer0'))
|
||||
action = self.convert_opportunity(cr, uid, [ref("crm_lead_newcustomer0")], {'active_ids': [ref("crm_lead_newcustomer0")]})
|
||||
@@ -66,21 +66,21 @@
|
||||
!python {model: crm.lead2opportunity.partner}: |
|
||||
self.make_partner(cr, uid, [ref("crm_lead2opportunity_partner_create_0")], {'active_ids': [ref("crm_lead_newcustomer0")]})
|
||||
-
|
||||
Now, I give value to this wizard field.
|
||||
Now, I give value to this wizard field.
|
||||
-
|
||||
!record {model: crm.lead2opportunity, id: crm_lead2opportunity_stonage_0}:
|
||||
!record {model: crm.lead2opportunity, id: crm_lead2opportunity_stonage_0}:
|
||||
name: Capegemini
|
||||
planned_revenue: 0.00
|
||||
probability: 0.00
|
||||
-
|
||||
Then, Click on "Create Opportunity" button of this wizard.
|
||||
-
|
||||
-
|
||||
!python {model: crm.lead2opportunity}: |
|
||||
self.action_apply(cr, uid, [ref('crm_lead2opportunity_stonage_0')], {'active_id': ref('crm_lead_newcustomer0')})
|
||||
|
||||
- |
|
||||
In order to check the opportunity is created or not, I check type.
|
||||
-
|
||||
-
|
||||
!python {model: crm.lead}: |
|
||||
lead = self.browse(cr, uid, ref("crm_lead_newcustomer0"))
|
||||
assert lead.type == 'opportunity'
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
stage_id: crm.stage_opportunity1
|
||||
categ_id: crm.categ_oppor2
|
||||
section_id: crm.section_sales_department
|
||||
|
||||
|
||||
- |
|
||||
I check that the opportunity is in 'New' state.
|
||||
-
|
||||
!assert {model: crm.lead, id: crm_opportunity_abcfuelcounits0}:
|
||||
- state == "draft"
|
||||
- |
|
||||
- |
|
||||
I open opportunity by click on "Open" button,
|
||||
-
|
||||
!python {model: crm.lead}: |
|
||||
@@ -29,7 +29,7 @@
|
||||
-
|
||||
!python {model: crm.lead}: |
|
||||
self.action_makeMeeting(cr, uid, [ref("crm_opportunity_abcfuelcounits0")])
|
||||
|
||||
|
||||
- |
|
||||
I can see that Meeting's calendar view is shown.
|
||||
then I click on the date on which I want to schedule meeting.
|
||||
@@ -49,26 +49,27 @@
|
||||
- |
|
||||
In order to schedule a phonecall to the partner
|
||||
I click on "schedule call" button and select planned date for the call.
|
||||
-
|
||||
-
|
||||
!record {model: crm.opportunity2phonecall, id: crm_opportunity2phonecall_abcfuelcounits0}:
|
||||
date: '2010-04-17 11:15:00'
|
||||
name: 'ABC FUEL CO 829264 - 10002 units'
|
||||
section_id: crm.section_sales_department
|
||||
user_id: base.user_demo
|
||||
- |
|
||||
schedule phonecall by apply (action_apply)function of opportunity2phoncall wizard
|
||||
-
|
||||
categ_id: crm.categ_phone1
|
||||
- |
|
||||
schedule phonecall by apply (action_apply)function of opportunity2phoncall wizard
|
||||
-
|
||||
!python {model: crm.opportunity2phonecall}: |
|
||||
self.action_apply(cr, uid, [ref('crm_opportunity2phonecall_abcfuelcounits0')], {'active_ids': [ref("crm_opportunity_abcfuelcounits0")]})
|
||||
- |
|
||||
I check that phonecall record is created for that opportunity.
|
||||
-
|
||||
I check that phonecall record is created for that opportunity.
|
||||
-
|
||||
!python {model: crm.phonecall}: |
|
||||
phone_obj = self.pool.get('crm.phonecall')
|
||||
ids = phone_obj.search(cr, uid, [('name', '=', 'ABC FUEL CO 829264 - 10002 units')])
|
||||
assert len(ids)
|
||||
- |
|
||||
I can see phonecall record after click on "Schedule call" wizard.
|
||||
- |
|
||||
I can see phonecall record after click on "Schedule call" wizard.
|
||||
-
|
||||
!record {model: crm.phonecall, id: crm_phonecall_abcfuelcounits0}:
|
||||
date: '2010-04-17 11:15:00'
|
||||
@@ -77,4 +78,4 @@
|
||||
partner_address_id: base.res_partner_address_1
|
||||
partner_id: base.res_partner_9
|
||||
section_id: crm.section_sales_department
|
||||
|
||||
|
||||
|
||||
@@ -1,36 +1,35 @@
|
||||
- |
|
||||
I start by creating a new phonecall.
|
||||
-
|
||||
-
|
||||
!record {model: crm.phonecall, id: crm_phonecall_interviewcall0}:
|
||||
date: '2010-04-21 18:59:00'
|
||||
name: Interview call
|
||||
section_id: crm.section_sales_department
|
||||
- |
|
||||
-
|
||||
Now , I select partner by click on "Create a Partner" button.
|
||||
|
||||
-
|
||||
-
|
||||
!record {model: crm.phonecall2partner, id: crm_phonecall2partner_1}:
|
||||
action: exist
|
||||
partner_id: base.res_partner_9
|
||||
|
||||
-
|
||||
-
|
||||
Now, click on "Continue" button of this wizard.
|
||||
-
|
||||
-
|
||||
!python {model: crm.phonecall2partner}: |
|
||||
self.make_partner(cr, uid, [ref("crm_phonecall2partner_1")], {"active_ids": [ref("crm_phonecall_interviewcall0")]})
|
||||
|
||||
self.make_partner(cr, uid, [ref("crm_phonecall2partner_1")], {"active_ids": [ref("crm_phonecall_interviewcall0")]})
|
||||
|
||||
- |
|
||||
As the success of phonecall seems to be a real business opportunity, I will convert
|
||||
it to opportunity by clicking on the "Convert to Opportunity" button.
|
||||
-
|
||||
-
|
||||
!record {model: crm.phonecall2opportunity, id: crm_phonecall2opportunity_interviewcall0}:
|
||||
name: Interview call
|
||||
partner_id: base.res_partner_9
|
||||
planned_revenue: 0.0
|
||||
probability: 0.0
|
||||
probability: 0.0
|
||||
-
|
||||
Now, I click on "Convert" button of this wizard.
|
||||
-
|
||||
Now, I click on "Convert" button of this wizard.
|
||||
-
|
||||
!python {model: crm.phonecall2opportunity}: |
|
||||
self.action_apply(cr, uid, [ref("crm_phonecall2opportunity_interviewcall0")], {"active_id": ref("crm_phonecall_interviewcall0")})
|
||||
|
||||
@@ -39,29 +38,29 @@
|
||||
-
|
||||
!assert {model: crm.phonecall, id: crm_phonecall_interviewcall0}:
|
||||
- opportunity_id != False
|
||||
|
||||
|
||||
- |
|
||||
And I check that the phonecall and the newly created business opportunity is linked
|
||||
to same partner
|
||||
-
|
||||
!python {model: crm.phonecall}: |
|
||||
!python {model: crm.phonecall}: |
|
||||
obj_phonecall = self.browse(cr, uid, ref('crm_phonecall_interviewcall0'))
|
||||
ids = self.pool.get('crm.lead').search(cr, uid, [('name', '=', obj_phonecall.opportunity_id.name)])
|
||||
obj_opp = self.pool.get('crm.lead').browse(cr, uid, ids)[0]
|
||||
assert obj_phonecall.partner_id == obj_opp.partner_id
|
||||
|
||||
|
||||
- |
|
||||
I schedule Meeting on this current phonecall by clicking on "schedule
|
||||
Meeting"
|
||||
-
|
||||
!python {model: crm.phonecall}: |
|
||||
self.action_make_meeting(cr, uid, [ref('crm_phonecall_interviewcall0')])
|
||||
|
||||
|
||||
- |
|
||||
I can see that Meeting's calendar view is shown.
|
||||
then I click on the date on which I want schedule meeting.
|
||||
I fill proper data for that meeting and save it
|
||||
-
|
||||
-
|
||||
!record {model: crm.meeting, id: crm_meeting_interviewcall0}:
|
||||
alarm_id: base_calendar.alarm3
|
||||
date: '2010-04-20 00:00:00'
|
||||
@@ -73,20 +72,21 @@
|
||||
partner_id: base.res_partner_9
|
||||
phonecall_id: 'crm_phonecall_interviewcall0'
|
||||
state: open
|
||||
|
||||
|
||||
- |
|
||||
In order to schedule other phonecall to the partner
|
||||
I click on "schedule other call" button. and plan for other call
|
||||
I can see that it will open other phonecall view with some data same as current
|
||||
phonecall.
|
||||
-
|
||||
-
|
||||
!record {model: crm.phonecall2phonecall, id: crm_phonecall2phonecall_interviewcall0}:
|
||||
date: '2010-04-21 19:49:00'
|
||||
name: Interview call
|
||||
section_id: crm.section_sales_department
|
||||
user_id: base.user_root
|
||||
categ_id: crm.categ_phone1
|
||||
- |
|
||||
I click on "Schedule" button of this wizard.
|
||||
I click on "Schedule" button of this wizard.
|
||||
-
|
||||
!python {model: crm.phonecall2phonecall}: |
|
||||
self.action_apply(cr, uid, [ref('crm_phonecall2phonecall_interviewcall0')], {'active_id': ref('crm_phonecall_interviewcall0')})
|
||||
self.action_apply(cr, uid, [ref('crm_phonecall2phonecall_interviewcall0')], {'active_id': ref('crm_phonecall_interviewcall0')})
|
||||
|
||||
@@ -73,7 +73,7 @@ class crm_merge_opportunity(osv.osv_memory):
|
||||
|
||||
for this in self.browse(cr, uid, ids, context=context):
|
||||
for opp in this.opportunity_ids:
|
||||
opp_obj.write(cr, uid, opp.id, {
|
||||
opp_obj.write(cr, uid, [opp.id], {
|
||||
'stage_id': opp.stage_id.id or current_opp.stage_id.id or False,
|
||||
'priority': opp.priority or current_opp.priority,
|
||||
'email_from': opp.email_from or current_opp.email_from,
|
||||
|
||||
@@ -85,7 +85,7 @@ class crm_opportunity2phonecall(osv.osv_memory):
|
||||
This converts Opportunity to Phonecall and opens Phonecall 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 uid: the current user's ID for security checks,
|
||||
@param ids: List of Opportunity to Phonecall IDs
|
||||
@param context: A standard dictionary for contextual values
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<para style="terp_default_9">[[ (not(o.sale_id) and o.type== 'out') and 'Error, no sale order attached to this picking !' or removeParentNode('para') ]]</para>
|
||||
|
||||
<blockTable colWidths="287.0,254.0" repeatRows="1" style="Tableau1">
|
||||
<tr>
|
||||
<td>
|
||||
@@ -226,4 +226,4 @@
|
||||
</section>
|
||||
</pto>
|
||||
</story>
|
||||
</document>
|
||||
</document>
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data noupdate="0">
|
||||
|
||||
<record model="document.directory.content.type" id="pdf">
|
||||
<field name="code">.pdf</field>
|
||||
<field name="name">PDF Report</field>
|
||||
<field name="mimetype">application/pdf</field>
|
||||
</record>
|
||||
<data noupdate="1">
|
||||
|
||||
<record model="document.storage" id="storage_default">
|
||||
<field name="name">Database storage</field>
|
||||
@@ -28,6 +22,14 @@
|
||||
<field name="ressource_id">0</field>
|
||||
|
||||
</record>
|
||||
</data>
|
||||
|
||||
<data noupdate="0">
|
||||
<record model="document.directory.content.type" id="pdf">
|
||||
<field name="code">.pdf</field>
|
||||
<field name="name">PDF Report</field>
|
||||
<field name="mimetype">application/pdf</field>
|
||||
</record>
|
||||
|
||||
<record model="document.directory" id="dir_partner_category">
|
||||
<field name="name">Partners by Category</field>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
<record id="ir_rule_readpublicdirectories0" model="ir.rule">
|
||||
<field name="model_id" ref="document.model_document_directory"/>
|
||||
<field name="domain_force">['|','|',('group_ids','in',[g.id for g in user.groups_id]), ('user_id', '=', user.id), '&', ('user_id', '=', False), ('group_ids','=',False), '|', ('company_id','=',False), ('company_id','child_of',[user.company_id.id])]</field>
|
||||
<field name="domain_force">['|','|',('group_ids','in',[g.id for g in user.groups_id]), ('user_id', '=', user.id), '&', ('user_id', '=', False), ('group_ids','=',False), '|','|', ('company_id','=',False), ('company_id','child_of',[user.company_id.id]),('company_id.child_ids','child_of',[user.company_id.id])]</field>
|
||||
<field name="name">Read public directories</field>
|
||||
<field eval="0" name="global"/>
|
||||
<field eval="[(6,0,[ref('base.group_user')])]" name="groups"/>
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<record id="ir_rule_documentmodifyowndirectories0" model="ir.rule">
|
||||
<field name="model_id" ref="document.model_document_directory"/>
|
||||
<field name="domain_force">[ '|', ('user_id', '=', user.id), '&', ('group_ids','in',[g.id for g in user.groups_id]), ('user_id','=',False), '|', ('company_id','=',False), ('company_id','child_of',[user.company_id.id])]</field>
|
||||
<field name="domain_force">[ '|', ('user_id', '=', user.id), '&', ('group_ids','in',[g.id for g in user.groups_id]), ('user_id','=',False), '|','|', ('company_id','=',False), ('company_id','child_of',[user.company_id.id]),('company_id.child_ids','child_of',[user.company_id.id])]</field>
|
||||
<field name="name">Document modify own directories</field>
|
||||
<field eval="0" name="global"/>
|
||||
<field eval="[(6,0,[ref('base.group_document_user')])]" name="groups"/>
|
||||
|
||||
@@ -25,3 +25,4 @@
|
||||
"access_report_document_file_group_system","report.document.file group system","model_report_document_file","base.group_system",1,0,0,0
|
||||
"access_report_document_wall_group_document_manager","report.document.wall document manager","model_report_document_wall","base.group_system",1,0,0,0
|
||||
"access_report_document_wall_group_system","report.document.wall group system","model_report_document_wall","base.group_system",1,0,0,0
|
||||
"access_report_document_user_knowledgeuser","report.document.user knowledgeuser","document.model_report_document_user","base.group_document_user",1,0,0,0
|
||||
|
||||
|
@@ -37,7 +37,7 @@ def get_plain_ftp(timeout=10.0):
|
||||
def get_ftp_login(cr, uid, ormobj):
|
||||
ftp = get_plain_ftp()
|
||||
user = ormobj.pool.get('res.users').read(cr, uid, uid)
|
||||
ftp.login(user.get('login',''), user.get('password',''))
|
||||
ftp.login(user.get('login',''), user.get('login',''))
|
||||
ftp.cwd("/" + cr.dbname)
|
||||
return ftp
|
||||
|
||||
@@ -62,4 +62,4 @@ def get_ftp_fulldata(ftp, fname, limit=8192):
|
||||
ftp.retrbinary('RETR %s' % fname, partial(ffp,data))
|
||||
return ''.join(data)
|
||||
|
||||
#eof
|
||||
#eof
|
||||
|
||||
@@ -51,10 +51,6 @@
|
||||
<search string="Departments">
|
||||
<field name="name"/>
|
||||
<field name="manager_id" />
|
||||
<newline />
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Manager" icon="terp-personal" domain="[]" context="{'group_by':'manager_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -402,7 +402,7 @@
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_job_filter"/>
|
||||
<field name="context">{"search_default_Current":1,"search_default_department_id": department_id}</field>
|
||||
<field name="help">JJob Positions is used to define jobs and their requirements. You can attach a survey to a job position. This survey will be used in the recruitment process to evaluate the applicants for this job position.</field>
|
||||
<field name="help">Job Positions are used to define jobs and their requirements. You can keep track of the number of employees you have per job position and how many you expect in the future. You can also attach a survey to a job position that will be used in the recruitment process to evaluate the applicants for this job position.</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Recruitment" id="base.menu_crm_case_job_req_main" parent="menu_hr_root" groups="base.group_hr_user"/>
|
||||
|
||||
@@ -8,3 +8,4 @@
|
||||
"access_hr_job_user","hr.job user","model_hr_job","base.group_hr_user",1,1,1,1
|
||||
"access_hr_res_partner_address","res.partner.address","base.model_res_partner_address","base.group_hr_manager",1,1,1,1
|
||||
"access_hr_employee_marital_status_manager","hr.employee.marital.status.manager","model_hr_employee_marital_status","base.group_hr_manager",1,1,1,1
|
||||
"access_ir_property_hr_user","ir_property hr_user","base.model_ir_property","base.group_hr_user",1,1,1,0
|
||||
|
||||
|
@@ -137,7 +137,7 @@ class hr_employee(osv.osv):
|
||||
|
||||
res = {'action': type, 'employee_id': emp['id']}
|
||||
if dt:
|
||||
res['name'] = dt
|
||||
res['name'] = dt
|
||||
id = obj_attendance.create(cr, uid, res, context=context)
|
||||
|
||||
if type != 'action':
|
||||
@@ -146,4 +146,4 @@ class hr_employee(osv.osv):
|
||||
|
||||
hr_employee()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
<xsl:template name="story">
|
||||
<spacer length="1cm" />
|
||||
<para style="terp_header_Centre" t="1">Attendance By Month</para>
|
||||
<para style="terp_header_Centre" t="1">Attendances By Month</para>
|
||||
<spacer length="1cm" />
|
||||
<blockTable>
|
||||
<xsl:attribute name="style">week</xsl:attribute>
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
-
|
||||
In order to test the PDF reports defined on HR Attendance, we will print a report of HR Attendance By Month
|
||||
Print the HR Attendance Report By Month through the wizard
|
||||
-
|
||||
!python {model: hr.employee}: |
|
||||
import netsvc, tools, os, time
|
||||
data_dict = {'model': 'hr.employee', 'form': {'month': time.gmtime()[1], 'year': time.gmtime()[0]}}
|
||||
(data, format) = netsvc.LocalService('report.hr.attendance.bymonth').create(cr, uid, [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')], data_dict, {'active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')]})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'hr_attendance-by_month_report.'+format), 'wb+').write(data)
|
||||
|
||||
import time
|
||||
ctx={}
|
||||
ctx.update({'model': 'hr.employee','active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')]})
|
||||
data_dict = {}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_hr_attendance_month',wiz_data=data_dict, context=ctx, our_module='hr_attendance')
|
||||
-
|
||||
Print HR Attendance Error Report through the wizard
|
||||
-
|
||||
In order to test the PDF reports defined on HR Attendance, we will print a report of HR Attendance Error
|
||||
-
|
||||
!python {model: hr.employee}: |
|
||||
import netsvc, tools, os, time
|
||||
data_dict = {'model': 'hr.employee', 'form': {'init_date': time.strftime('%Y-01-01'), 'end_date':time.strftime('%Y-%m-%d'), 'emp_ids': [ref('hr.employee1')], 'max_delay': 120}}
|
||||
(data, format) = netsvc.LocalService('report.hr.attendance.error').create(cr, uid, [ref('hr.employee1')], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'hr_attendance-error_report.'+format), 'wb+').write(data)
|
||||
import time
|
||||
ctx={}
|
||||
ctx.update({'model': 'hr.employee','active_ids': [ref('hr.employee1')]})
|
||||
data_dict = {'init_date': time.strftime('%Y-01-01')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_hr_attendance_error',wiz_data=data_dict, context=ctx, our_module='hr_attendance')
|
||||
|
||||
@@ -4,3 +4,4 @@
|
||||
"access_hr_resource_manager","hr.employee.resource.manager","resource.model_resource_resource","base.group_hr_manager",1,1,1,1
|
||||
"access_hr_resource_calendar_user","hr.employee.resource.calendar.user","resource.model_resource_calendar","base.group_hr_user",1,1,1,1
|
||||
"access_hr_contract_type_manager","hr.contract.type.manager","model_hr_contract_type","base.group_hr_manager",1,1,1,1
|
||||
"access_hr_contract_manager","hr.contract.manager","model_hr_contract","base.group_hr_manager",1,1,1,1
|
||||
|
||||
|
@@ -281,7 +281,7 @@ class hr_evaluation_interview(osv.osv):
|
||||
_columns = {
|
||||
'request_id': fields.many2one('survey.request','Request_id', ondelete='cascade', required=True),
|
||||
'user_to_review_id': fields.many2one('hr.employee', 'Employee to Interview'),
|
||||
'evaluation_id': fields.many2one('hr_evaluation.evaluation', 'Evaluation Type'),
|
||||
'evaluation_id': fields.many2one('hr_evaluation.evaluation', 'Evaluation Form'),
|
||||
}
|
||||
_defaults = {
|
||||
'is_evaluation': True,
|
||||
|
||||
@@ -170,7 +170,26 @@
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Appraisal">
|
||||
<field name="survey_request_ids" context="{'phase_id': phase_id}" nolabel="1" colspan="4" widget="one2many"/>
|
||||
<field name="survey_request_ids" context="{'phase_id': phase_id}" nolabel="1" colspan="4" widget="one2many">
|
||||
<form string="Interview Evaluation">
|
||||
<group col="4" colspan="4">
|
||||
<field name="survey_id"/>
|
||||
<group col="2" colspan="2">
|
||||
<button name="%(survey.action_view_survey_question_message)d" string="Interview Question" type="action" states="waiting_answer,done,cancel" icon="gtk-execute" context="{'survey_id': survey_id, 'response_id': [response], 'response_no':0, 'active' : response,'request' : True, 'object' : 'hr.evaluation.interview', 'cur_id' : active_id}" attrs="{'readonly':[('survey_id','=',False)]}"/>
|
||||
<button name="%(survey.survey_browse_response)d" string="Print Interview" type="action" states="done" icon="gtk-print" context="{'survey_id': survey_id, 'response_id' : [response], 'response_no':0,}" attrs="{'readonly':[('response','=',False)]}" />
|
||||
</group>
|
||||
<field name="date_deadline"/>
|
||||
<field name="response" readonly="1"/>
|
||||
<field name="user_to_review_id"/>
|
||||
<field name="user_id" string="Interviewer"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<separator string="State" colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<field name="state"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Internal Notes">
|
||||
<field name="note_action" colspan="4" nolabel="1"
|
||||
|
||||
@@ -1,275 +0,0 @@
|
||||
# Translation of OpenERP Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * hr_evaluation
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 6.0dev\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2009-11-25 12:18:06+0000\n"
|
||||
"PO-Revision-Date: 2009-11-25 12:18:06+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: view:hr_evaluation.type:0
|
||||
#: field:hr_evaluation.type,info:0
|
||||
msgid "Information"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: constraint:ir.model:0
|
||||
msgid "The Object name must start with x_ and not contain any special character !"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: view:hr_evaluation.evaluation:0
|
||||
msgid "Schedule next evaluation"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: view:hr_evaluation.evaluation:0
|
||||
#: field:hr_evaluation.evaluation,info_bad:0
|
||||
msgid "Bad Points"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: model:ir.actions.act_window,name:hr_evaluation.open_view_employee_evaluation_next_my_list
|
||||
msgid "My Next Evaluation"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: field:hr_evaluation.type,value_ids:0
|
||||
msgid "Values"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: view:hr_evaluation.evaluation:0
|
||||
#: field:hr_evaluation.evaluation,info_good:0
|
||||
msgid "Good Points"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: field:hr_evaluation.evaluation,state:0
|
||||
msgid "State"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: field:hr_evaluation.evaluation,score:0
|
||||
#: field:hr_evaluation.quote,score:0
|
||||
#: field:hr_evaluation.type,score:0
|
||||
#: field:hr_evaluation.type.value,score:0
|
||||
msgid "Score"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: selection:hr_evaluation.evaluation,state:0
|
||||
msgid "Draft"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: view:hr_evaluation.evaluation:0
|
||||
msgid "Informal Data"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: constraint:ir.actions.act_window:0
|
||||
msgid "Invalid model name in the action definition."
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: field:hr_evaluation.evaluation,employee_id:0
|
||||
msgid "Employee"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: view:hr_evaluation.evaluation:0
|
||||
#: field:hr_evaluation.evaluation,info_improve:0
|
||||
msgid "To Improve"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: field:hr_evaluation.quote,evaluation_id:0
|
||||
msgid "Evaluation"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: field:hr_evaluation.type.value,type_id:0
|
||||
msgid "Evaluation Type"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: view:hr_evaluation.evaluation:0
|
||||
msgid "Status"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: view:hr_evaluation.type:0
|
||||
msgid "Apply to categories"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: model:ir.module.module,description:hr_evaluation.module_meta_information
|
||||
msgid "Ability to create employees evaluation."
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: field:hr_evaluation.quote,name:0
|
||||
msgid "Quote"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: field:hr_evaluation.type,category_ids:0
|
||||
msgid "Appliable Role"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: field:hr_evaluation.evaluation,user_id:0
|
||||
msgid "Evaluation User"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: view:hr_evaluation.type:0
|
||||
msgid "Choices Results"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: field:hr_evaluation.evaluation,date:0
|
||||
msgid "Date"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: model:ir.ui.menu,name:hr_evaluation.menu_eval_hr
|
||||
#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_evaluation_form
|
||||
msgid "Evaluations"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: model:ir.ui.menu,name:hr_evaluation.menu_eval_config
|
||||
msgid "Configuration"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_evaluation_next_list
|
||||
msgid "Next Evaluations"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: constraint:ir.ui.view:0
|
||||
msgid "Invalid XML for View Architecture!"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_evaluation_type_form
|
||||
msgid "Evaluation Criterions"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_my_old_evaluation_list
|
||||
msgid "My Preceeding Evaluations"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: model:ir.ui.menu,name:hr_evaluation.menu_resp_hr
|
||||
msgid "HR Responsible"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: field:hr_evaluation.quote,value_id:0
|
||||
#: field:hr_evaluation.type.value,name:0
|
||||
msgid "Value"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: field:hr_evaluation.evaluation,name:0
|
||||
msgid "Summary"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: field:hr_evaluation.type,active:0
|
||||
msgid "Active"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: view:hr_evaluation.type:0
|
||||
msgid "Notes"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: view:hr_evaluation.evaluation:0
|
||||
#: model:ir.model,name:hr_evaluation.model_hr_evaluation_evaluation
|
||||
msgid "Employee Evaluation"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: model:ir.model,name:hr_evaluation.model_hr_evaluation_type
|
||||
msgid "Employee Evaluation Type"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: view:hr_evaluation.evaluation:0
|
||||
msgid "Quotations"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: model:ir.actions.act_window,name:hr_evaluation.open_view_employee_evaluation_next_list
|
||||
msgid "Next Employee Evaluation"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: field:hr_evaluation.quote,type_id:0
|
||||
msgid "Type"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: view:hr_evaluation.type:0
|
||||
#: field:hr_evaluation.type,name:0
|
||||
msgid "Evaluation Criterion"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: model:ir.ui.menu,name:hr_evaluation.menu_open_view_employee_evaluation_next_my_list
|
||||
msgid "My Next Evaluations"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: view:hr_evaluation.quote:0
|
||||
msgid "Evalution Quote"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: model:ir.module.module,shortdesc:hr_evaluation.module_meta_information
|
||||
msgid "Human Resources Evaluation"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: field:hr_evaluation.evaluation,quote_ids:0
|
||||
msgid "Quotes"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: view:hr_evaluation.evaluation:0
|
||||
#: selection:hr_evaluation.evaluation,state:0
|
||||
msgid "Done"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: model:ir.model,name:hr_evaluation.model_hr_evaluation_quote
|
||||
msgid "Employee Evaluation Quote"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: view:hr_evaluation.evaluation:0
|
||||
#: field:hr_evaluation.evaluation,info_employee:0
|
||||
msgid "Employee Response"
|
||||
msgstr ""
|
||||
|
||||
#. module: hr_evaluation
|
||||
#: model:ir.model,name:hr_evaluation.model_hr_evaluation_type_value
|
||||
msgid "Evaluation Type Value"
|
||||
msgstr ""
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_hr_evaluation_evaluation_user","hr_evaluation.evaluation.user","model_hr_evaluation_evaluation","base.group_hr_user",1,1,1,1
|
||||
"access_hr_evaluation_evaluation_employee","hr_evaluation.evaluation.employee","model_hr_evaluation_evaluation","base.group_user",1,0,0,0
|
||||
"access_hr_evaluation_plan_user","hr_evaluation.plan.user","model_hr_evaluation_plan","base.group_hr_user",1,1,1,1
|
||||
"access_hr_evaluation_plan_phase_user","hr_evaluation.plan.phase.user","model_hr_evaluation_plan_phase","base.group_hr_user",1,1,1,1
|
||||
"access_hr_evaluation_interview_user","hr.evaluation.interview.user","model_hr_evaluation_interview","base.group_hr_user",1,1,1,1
|
||||
|
||||
|
@@ -142,7 +142,7 @@ class hr_expense_expense(osv.osv):
|
||||
else:
|
||||
acc = property_obj.get(cr, uid, 'property_account_expense_categ', 'product.category')
|
||||
if not acc:
|
||||
raise osv.except_osv(_('Error !'), _('Please configure Default Expanse account for Product purchase, `property_account_expense_categ`'))
|
||||
raise osv.except_osv(_('Error !'), _('Please configure Default Expense account for Product purchase, `property_account_expense_categ`'))
|
||||
|
||||
lines.append((0, False, {
|
||||
'name': l.name,
|
||||
|
||||
@@ -68,10 +68,8 @@
|
||||
<blockAlignment value="LEFT"/>
|
||||
<blockValign value="TOP"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#ffffff" start="0,0" stop="0,0"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#ffffff" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#ffffff" start="2,0" stop="2,0"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
|
||||
<lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
|
||||
</blockTableStyle>
|
||||
<initialize>
|
||||
<paraStyle name="all" alignment="justify"/>
|
||||
@@ -113,7 +111,7 @@
|
||||
<story>
|
||||
<pto>
|
||||
<pto_header>
|
||||
<blockTable colWidths="49.0,204.0,45.0,80.0,53.0,91.0" style="Table_hr_expense_line_header">
|
||||
<blockTable colWidths="60.0,200.0,50.0,70.0,70.0,85.0" style="Table_hr_expense_line_header">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Date</para>
|
||||
@@ -122,7 +120,7 @@
|
||||
<para style="terp_tblheader_Details">Name</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Ref.</para>
|
||||
<para style="terp_tblheader_Details">Ref.</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Unit Price</para>
|
||||
@@ -131,7 +129,7 @@
|
||||
<para style="terp_tblheader_Details_Right">Qty</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Total Price</para>
|
||||
<para style="terp_tblheader_Details_Right">Price</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
@@ -176,7 +174,7 @@
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
<blockTable colWidths="49.0,204.0,45.0,80.0,53.0,91.0" style="Table_hr_expense_line_header">
|
||||
<blockTable colWidths="60.0,200.0,50.0,70.0,70.0,85.0" style="Table_hr_expense_line_header">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details">Date</para>
|
||||
@@ -185,7 +183,7 @@
|
||||
<para style="terp_tblheader_Details">Name</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Centre">Ref.</para>
|
||||
<para style="terp_tblheader_Details">Ref.</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Unit Price</para>
|
||||
@@ -194,7 +192,7 @@
|
||||
<para style="terp_tblheader_Details_Right">Qty</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Total Price</para>
|
||||
<para style="terp_tblheader_Details_Right">Price</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
@@ -203,7 +201,7 @@
|
||||
</para>
|
||||
<section>
|
||||
<para style="terp_default_8">[[ repeatIn(o.line_ids,'line') ]]</para>
|
||||
<blockTable colWidths="49.0,204.0,46.0,79.0,53.0,92.0" style="Table_expense_line">
|
||||
<blockTable colWidths="60.0,200.0,50.0,70.0,70.0,85.0" style="Table_expense_line">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_9">[[ formatLang(line.date_value,date=True) ]]</para>
|
||||
@@ -256,7 +254,7 @@
|
||||
</tr>
|
||||
</blockTable>
|
||||
</section>
|
||||
<blockTable colWidths="57.0,171.0,171.0,32.0,92.0" style="Table_Final_total">
|
||||
<blockTable colWidths="365.0,70.0,100.0" style="Table_Final_total">
|
||||
<tr>
|
||||
<td>
|
||||
<para style="terp_default_8">
|
||||
@@ -264,17 +262,7 @@
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_8">
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">Total:</para>
|
||||
<para style="terp_tblheader_Details">Total:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_tblheader_Details_Right">[[ formatLang(o.amount) ]] [[ o.currency_id.symbol ]]</para>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_hr_expense_expense_user","hr.expense.expense.user","model_hr_expense_expense","base.group_hr_user",1,1,1,1
|
||||
"access_hr_expense_expense_employee","hr.expense.expense.employee","model_hr_expense_expense","base.group_user",1,1,1,1
|
||||
"access_hr_expense_line_user","hr.expense.line.user","model_hr_expense_line","base.group_hr_user",1,1,1,1
|
||||
"access_hr_expense_report_manager","hr.expense.report.manager","model_hr_expense_report","base.group_hr_manager",1,1,1,1
|
||||
"access_product_product_hr_expense_user","product.product.hr.expense.user","product.model_product_product","base.group_hr_user",1,1,1,1
|
||||
|
||||
|
@@ -10,52 +10,16 @@
|
||||
parent="base.menu_hr_dasboard"
|
||||
sequence="4"/>
|
||||
|
||||
<record model="ir.ui.view" id="view_holiday_allocation_leave_tree">
|
||||
<field name="name">hr.holidays.allocation.leave.tree</field>
|
||||
<field name="model">hr.holidays</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Leaves" >
|
||||
<field name="name"/>
|
||||
<field name="date_from"/>
|
||||
<field name="date_to"/>
|
||||
<field name="holiday_status_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_view_holiday_status_board" model="ir.actions.act_window">
|
||||
<field name="name">My Leaves</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('state','in',('confirm', 'validate')),('user_id','=',uid)]</field>
|
||||
<field name="view_id" ref="view_holiday_allocation_leave_tree"/>
|
||||
</record>
|
||||
|
||||
<record id="board_hr_holidays_form" model="ir.ui.view">
|
||||
<field name="name">board.hr.holidays.form</field>
|
||||
<field name="model">board.board</field>
|
||||
<field name="inherit_id" ref="hr.board_hr_form"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/hpaned/child1" position="inside">
|
||||
<action colspan="4" height="220" name="%(action_view_holiday_status_board)d" string="My Leaves"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Need to merge in above view -->
|
||||
|
||||
<record id="action_hr_holidays_leaves_by_month" model="ir.actions.act_window">
|
||||
<field name="name">Leaves by Month</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">available.holidays.report</field>
|
||||
<record model="ir.actions.act_window" id="action_hr_holidays_leaves_by_month">
|
||||
<field name="name">My Leaves</field>
|
||||
<field name="res_model">hr.holidays.status</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
<field name="domain">[('user_id','=',uid)]</field>
|
||||
<field name="context">{'group_by':['holiday_status_id'],'group_by_no_leaf':1}</field>
|
||||
<field name="view_id" ref="hr_holidays.view_hr_available_holidays_report_graph"/>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" eval="False"/>
|
||||
<field name="context">{}</field>
|
||||
<field name="domain">[]</field>
|
||||
</record>
|
||||
<record id="board_hr_holidays_leave_by_month_form" model="ir.ui.view">
|
||||
<field name="name">board.hr.holidays.leave.month.form</field>
|
||||
@@ -64,7 +28,7 @@
|
||||
<field name="inherit_id" ref="hr.board_hr_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/hpaned/child2" position="inside">
|
||||
<action colspan="4" height="220" name="%(action_hr_holidays_leaves_by_month)d" string="Leaves By Month" />
|
||||
<action colspan="4" height="220" name="%(action_hr_holidays_leaves_by_month)d" string="Leaves" />
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -3,53 +3,33 @@
|
||||
<data>
|
||||
|
||||
<record id="action_view_holiday_status_manager_board" model="ir.actions.act_window">
|
||||
<field name="name">All Employee Leaves</field>
|
||||
<field name="name">Leaves To Validate</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('state','in',('confirm', 'validate'))]</field>
|
||||
<field name="domain">[('state','in',('confirm', 'validate', 'validate1'))]</field>
|
||||
<field name="view_id" ref="hr_holidays.view_holiday_allocation_tree"/>
|
||||
</record>
|
||||
|
||||
<record id="action_hr_holidays_remaining_leaves_empoloyee_all" model="ir.actions.act_window">
|
||||
<field name="name">Remaining Leaves by User</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">hr.holidays.remaining.leaves.user</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
<field name="view_id" ref="hr_holidays.view_hr_holidays_remaining_leaves_user_graph"/>
|
||||
</record>
|
||||
|
||||
<record id="board_hr_holidays_manager_form" model="ir.ui.view">
|
||||
<field name="name">board.hr.holidays.manager.form</field>
|
||||
<field name="model">board.board</field>
|
||||
<field name="inherit_id" ref="hr.board_hr_manager_form"/>
|
||||
<field name="inherit_id" ref="hr.board_hr_manager_form"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/hpaned/child1" position="inside">
|
||||
<action colspan="4" height="220" name="%(action_view_holiday_status_manager_board)d" string="All Employee Leaves"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="board_hr_holidays_manager_remaining_form" model="ir.ui.view">
|
||||
<field name="name">board.hr.holidays.manager.remaining.form</field>
|
||||
<field name="model">board.board</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="hr.board_hr_manager_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/hpaned/child2" position="inside">
|
||||
<action colspan="4" height="220" name="%(action_hr_holidays_remaining_leaves_empoloyee_all)d" string="Remaining Leave by Type and User" />
|
||||
</xpath>
|
||||
<xpath expr="/form/hpaned/child1" position="inside">
|
||||
<action colspan="4" height="220" name="%(action_view_holiday_status_manager_board)d" string="All Employee Leaves"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
action="hr.open_board_hr_manager"
|
||||
icon="terp-graph"
|
||||
id="base.menu_hr_manager"
|
||||
parent="base.menu_hr_dasboard"
|
||||
groups = "base.group_hr_manager"
|
||||
sequence="5"/>
|
||||
sequence="5"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
+102
-262
@@ -21,7 +21,6 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
import datetime
|
||||
from itertools import groupby
|
||||
from operator import itemgetter
|
||||
@@ -35,37 +34,11 @@ class hr_holidays_status(osv.osv):
|
||||
_name = "hr.holidays.status"
|
||||
_description = "Leave Type"
|
||||
|
||||
def get_days_cat(self, cr, uid, ids, category_id, return_false, context=None):
|
||||
|
||||
cr.execute("""SELECT id, type, number_of_days, holiday_status_id FROM hr_holidays WHERE category_id = %s AND state='validate' AND holiday_status_id in %s""",
|
||||
[category_id, tuple(ids)])
|
||||
result = sorted(cr.dictfetchall(), key=lambda x: x['holiday_status_id'])
|
||||
|
||||
grouped_lines = dict((k, [v for v in itr]) for k, itr in groupby(result, itemgetter('holiday_status_id')))
|
||||
|
||||
res = {}
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
res[record.id] = {}
|
||||
max_leaves = leaves_taken = 0
|
||||
if not return_false:
|
||||
if record.id in grouped_lines:
|
||||
leaves_taken = -sum([item['number_of_days'] for item in grouped_lines[record.id] if item['type'] == 'remove'])
|
||||
max_leaves = sum([item['number_of_days'] for item in grouped_lines[record.id] if item['type'] == 'add'])
|
||||
|
||||
res[record.id]['max_leaves'] = max_leaves
|
||||
res[record.id]['leaves_taken'] = leaves_taken
|
||||
res[record.id]['remaining_leaves'] = max_leaves - leaves_taken
|
||||
|
||||
return res
|
||||
|
||||
def get_days(self, cr, uid, ids, employee_id, return_false, context=None):
|
||||
|
||||
cr.execute("""SELECT id, type, number_of_days, holiday_status_id FROM hr_holidays WHERE employee_id = %s AND state='validate' AND holiday_status_id in %s""",
|
||||
[employee_id, tuple(ids)])
|
||||
result = sorted(cr.dictfetchall(), key=lambda x: x['holiday_status_id'])
|
||||
|
||||
grouped_lines = dict((k, [v for v in itr]) for k, itr in groupby(result, itemgetter('holiday_status_id')))
|
||||
|
||||
res = {}
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
res[record.id] = {}
|
||||
@@ -74,18 +47,15 @@ class hr_holidays_status(osv.osv):
|
||||
if record.id in grouped_lines:
|
||||
leaves_taken = -sum([item['number_of_days'] for item in grouped_lines[record.id] if item['type'] == 'remove'])
|
||||
max_leaves = sum([item['number_of_days'] for item in grouped_lines[record.id] if item['type'] == 'add'])
|
||||
|
||||
res[record.id]['max_leaves'] = max_leaves
|
||||
res[record.id]['leaves_taken'] = leaves_taken
|
||||
res[record.id]['remaining_leaves'] = max_leaves - leaves_taken
|
||||
|
||||
return res
|
||||
|
||||
def _user_left_days(self, cr, uid, ids, name, args, context=None):
|
||||
return_false = False
|
||||
employee_id = False
|
||||
res = {}
|
||||
|
||||
if context and context.has_key('employee_id'):
|
||||
if not context['employee_id']:
|
||||
return_false = True
|
||||
@@ -102,14 +72,13 @@ class hr_holidays_status(osv.osv):
|
||||
res = dict.fromkeys(ids, {'leaves_taken': 0, 'remaining_leaves': 0, 'max_leaves': 0})
|
||||
return res
|
||||
|
||||
# To do: we can add remaining_leaves_category field to display remaining leaves for particular type
|
||||
_columns = {
|
||||
'name': fields.char('Leave Type', size=64, required=True, translate=True),
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Meeting Category', domain="[('object_id.model', '=', 'crm.meeting')]", help='If you link this type of leave with a category in the CRM, it will synchronize each leave asked with a case in this category, to display it in the company shared calendar for example.'),
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Meeting', domain="[('object_id.model', '=', 'crm.meeting')]", help='If you set a meeting type, OpenERP will create a meeting in the calendar once a leave is validated.'),
|
||||
'color_name': fields.selection([('red', 'Red'),('blue','Blue'), ('lightgreen', 'Light Green'), ('lightblue','Light Blue'), ('lightyellow', 'Light Yellow'), ('magenta', 'Magenta'),('lightcyan', 'Light Cyan'),('black', 'Black'),('lightpink', 'Light Pink'),('brown', 'Brown'),('violet', 'Violet'),('lightcoral', 'Light Coral'),('lightsalmon', 'Light Salmon'),('lavender', 'Lavender'),('wheat', 'Wheat'),('ivory', 'Ivory')],'Color in Report', required=True, help='This color will be used in the leaves summary located in Reporting\Leaves by Departement'),
|
||||
'limit': fields.boolean('Allow to Override Limit', help='If you tick this checkbox, the system will allow, for this section, the employees to take more leaves than the available ones.'),
|
||||
'active': fields.boolean('Active', help="If the active field is set to false, it will allow you to hide the leave type without removing it."),
|
||||
'max_leaves': fields.function(_user_left_days, method=True, string='Maximum Leaves Allowed', help='This value is given by the sum of all holidays requests with a positive value.', multi='user_left_days'),
|
||||
'max_leaves': fields.function(_user_left_days, method=True, string='Maximum Allowed', help='This value is given by the sum of all holidays requests with a positive value.', multi='user_left_days'),
|
||||
'leaves_taken': fields.function(_user_left_days, method=True, string='Leaves Already Taken', help='This value is given by the sum of all holidays requests with a negative value.', multi='user_left_days'),
|
||||
'remaining_leaves': fields.function(_user_left_days, method=True, string='Remaining Leaves', help='Maximum Leaves Allowed - Leaves Already Taken', multi='user_left_days'),
|
||||
'double_validation': fields.boolean('Apply Double Validation', help="If its True then its Allocation/Request have to be validated by second validator")
|
||||
@@ -118,7 +87,6 @@ class hr_holidays_status(osv.osv):
|
||||
'color_name': 'red',
|
||||
'active': True,
|
||||
}
|
||||
|
||||
hr_holidays_status()
|
||||
|
||||
class hr_holidays(osv.osv):
|
||||
@@ -132,12 +100,23 @@ class hr_holidays(osv.osv):
|
||||
return ids[0]
|
||||
return False
|
||||
|
||||
def _compute_number_of_days(self, cr, uid, ids, name, args, context=None):
|
||||
result = {}
|
||||
for hol in self.browse(cr, uid, ids, context=context):
|
||||
if hol.type=='remove':
|
||||
result[hol.id] = -hol.number_of_days_temp
|
||||
else:
|
||||
result[hol.id] = hol.number_of_days_temp
|
||||
return result
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Description', required=True, size=64),
|
||||
'state': fields.selection([('draft', 'Draft'), ('confirm', 'Waiting Approval'), ('refuse', 'Refused'), ('validate1', 'Waiting Second Approval'), ('validate', 'Approved'), ('cancel', 'Cancelled')], 'State', readonly=True, help='When the holiday request is created the state is \'Draft\'.\n It is confirmed by the user and request is sent to admin, the state is \'Waiting Approval\'.\
|
||||
'state': fields.selection([('draft', 'Draft'), ('confirm', 'Waiting Approval'), ('refuse', 'Refused'),
|
||||
('validate1', 'Waiting Second Approval'), ('validate', 'Approved'), ('cancel', 'Cancelled')],
|
||||
'State', readonly=True, help='When the holiday request is created the state is \'Draft\'.\n It is confirmed by the user and request is sent to admin, the state is \'Waiting Approval\'.\
|
||||
If the admin accepts it, the state is \'Approved\'. If it is refused, the state is \'Refused\'.'),
|
||||
'user_id':fields.related('employee_id', 'user_id', type='many2one', relation='res.users', string='User', store=True),
|
||||
'date_from': fields.datetime('Start Date', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'user_id':fields.many2one('res.users', 'User', states={'draft':[('readonly',False)]}, select=True, readonly=True),
|
||||
'date_to': fields.datetime('End Date', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'holiday_status_id': fields.many2one("hr.holidays.status", "Leave Type", required=True,readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'employee_id': fields.many2one('hr.employee', "Employee", select=True, invisible=False, readonly=True, states={'draft':[('readonly',False)]}, help='Leave Manager can let this field empty if this leave request/allocation is for every employee'),
|
||||
@@ -145,27 +124,29 @@ class hr_holidays(osv.osv):
|
||||
#'notes': fields.text('Notes',readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'manager_id': fields.many2one('hr.employee', 'First Approval', invisible=False, readonly=True, help='This area is automaticly filled by the user who validate the leave'),
|
||||
'notes': fields.text('Reasons',readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'number_of_days': fields.float('Number of Days', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'number_of_days_temp': fields.float('Number of Days', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'case_id': fields.many2one('crm.meeting', 'Case'),
|
||||
'number_of_days': fields.function(_compute_number_of_days, method=True, string='Number of Days', store=True),
|
||||
'case_id': fields.many2one('crm.meeting', 'Meeting'),
|
||||
'type': fields.selection([('remove','Leave Request'),('add','Allocation Request')], 'Request Type', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Choose 'Leave Request' if someone wants to take an off-day. \nChoose 'Allocation Request' if you want to increase the number of leaves available for someone"),
|
||||
'allocation_type': fields.selection([('employee','Employee Request'),('company','Company Allocation')], 'Allocation Type', required=True, readonly=True, states={'draft':[('readonly',False)]}, help='This field is only for informative purposes, to depict if the leave request/allocation comes from an employee or from the company'),
|
||||
'parent_id': fields.many2one('hr.holidays', 'Parent'),
|
||||
'linked_request_ids': fields.one2many('hr.holidays', 'parent_id', 'Linked Requests',),
|
||||
'department_id':fields.related('employee_id', 'department_id', string='Department', type='many2one', relation='hr.department', readonly=True, store=True),
|
||||
'category_id': fields.many2one('hr.employee.category', "Category", help='Category Of employee'),
|
||||
'category_id': fields.many2one('hr.employee.category', "Category", help='Category of Employee'),
|
||||
'holiday_type': fields.selection([('employee','By Employee'),('category','By Employee Category')], 'Allocation Type', help='By Employee: Allocation/Request for individual Employee, By Employee Category: Allocation/Request for group of employees in category', required=True),
|
||||
'manager_id2': fields.many2one('hr.employee', 'Second Approval', readonly=True, help='This area is automaticly filled by the user who validate the leave with second level (If Leave type need second validation)')
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'employee_id': _employee_get,
|
||||
'state': 'draft',
|
||||
'type': 'remove',
|
||||
'allocation_type': 'employee',
|
||||
'user_id': lambda obj, cr, uid, context: uid,
|
||||
'holiday_type': 'employee'
|
||||
}
|
||||
_sql_constraints = [
|
||||
('type_value', "CHECK( (holiday_type='employee' AND employee_id IS NOT NULL) or (holiday_type='category' AND category_id IS NOT NULL))", "You have to select an employee or a category"),
|
||||
('date_check', "CHECK ( number_of_days_temp > 0 )", "The number of days must be greater than 0 !"),
|
||||
('date_check2', "CHECK ( (type='add') OR (date_from < date_to))", "The start date must be before the end date !")
|
||||
]
|
||||
|
||||
def _create_resource_leave(self, cr, uid, vals, context=None):
|
||||
'''This method will create entry in resource calendar leave object at the time of holidays validated '''
|
||||
@@ -178,28 +159,6 @@ class hr_holidays(osv.osv):
|
||||
leave_ids = obj_res_leave.search(cr, uid, [('holiday_id', 'in', ids)], context=context)
|
||||
return obj_res_leave.unlink(cr, uid, leave_ids)
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
if 'holiday_type' in vals:
|
||||
if vals['holiday_type'] == 'employee':
|
||||
vals.update({'category_id': False})
|
||||
else:
|
||||
vals.update({'employee_id': False})
|
||||
if context.has_key('type'):
|
||||
vals['type'] = context['type']
|
||||
if context.has_key('allocation_type'):
|
||||
vals['allocation_type'] = context['allocation_type']
|
||||
return super(hr_holidays, self).create(cr, uid, vals, context=context)
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
if 'holiday_type' in vals:
|
||||
if vals['holiday_type'] == 'employee':
|
||||
vals.update({'category_id': False})
|
||||
else:
|
||||
vals.update({'employee_id': False})
|
||||
return super(hr_holidays, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
def onchange_type(self, cr, uid, ids, holiday_type):
|
||||
result = {}
|
||||
if holiday_type == 'employee':
|
||||
@@ -207,9 +166,10 @@ class hr_holidays(osv.osv):
|
||||
if ids_employee:
|
||||
result['value'] = {
|
||||
'employee_id': ids_employee[0]
|
||||
}
|
||||
}
|
||||
return result
|
||||
|
||||
# TODO: can be improved using resource calendar method
|
||||
def _get_number_of_days(self, date_from, date_to):
|
||||
"""Returns a float equals to the timedelta between two dates given as string."""
|
||||
|
||||
@@ -220,35 +180,10 @@ class hr_holidays(osv.osv):
|
||||
diff_day = timedelta.days + float(timedelta.seconds) / 86400
|
||||
return diff_day
|
||||
|
||||
def _update_user_holidays(self, cr, uid, ids):
|
||||
obj_crm_meeting = self.pool.get('crm.meeting')
|
||||
for record in self.browse(cr, uid, ids):
|
||||
if record.state=='validate':
|
||||
if record.case_id:
|
||||
obj_crm_meeting.unlink(cr, uid, [record.case_id.id])
|
||||
if record.linked_request_ids:
|
||||
list_ids = [ lr.id for lr in record.linked_request_ids]
|
||||
self.holidays_cancel(cr, uid, list_ids)
|
||||
self.unlink(cr, uid, list_ids)
|
||||
return True
|
||||
|
||||
def _check_date(self, cr, uid, ids, context=None):
|
||||
for rec in self.read(cr, uid, ids, ['number_of_days_temp', 'date_from','date_to', 'type']):
|
||||
if rec['number_of_days_temp'] < 0:
|
||||
return False
|
||||
if rec['type'] == 'add':
|
||||
continue
|
||||
date_from = time.strptime(rec['date_from'], '%Y-%m-%d %H:%M:%S')
|
||||
date_to = time.strptime(rec['date_to'], '%Y-%m-%d %H:%M:%S')
|
||||
if date_from > date_to:
|
||||
return False
|
||||
return True
|
||||
|
||||
_constraints = [(_check_date, 'Start date should not be larger than end date!\nNumber of Days should be greater than 1!', ['number_of_days_temp'])]
|
||||
|
||||
def unlink(self, cr, uid, ids, context=None):
|
||||
self._update_user_holidays(cr, uid, ids)
|
||||
self._remove_resouce_leave(cr, uid, ids, context=context)
|
||||
for rec in self.browse(cr, uid, ids, context=context):
|
||||
if rec.state<>'draft':
|
||||
raise osv.except_osv(_('Warning!'),_('You cannot delete a leave which is not in draft state !'))
|
||||
return super(hr_holidays, self).unlink(cr, uid, ids, context)
|
||||
|
||||
def onchange_date_from(self, cr, uid, ids, date_to, date_from):
|
||||
@@ -264,209 +199,115 @@ class hr_holidays(osv.osv):
|
||||
}
|
||||
return result
|
||||
|
||||
def onchange_date_to(self, cr, uid, ids, date_from, date_to):
|
||||
return self.onchange_date_from(cr, uid, ids, date_to, date_from)
|
||||
|
||||
def onchange_sec_id(self, cr, uid, ids, status, context=None):
|
||||
warning = {}
|
||||
if status:
|
||||
brows_obj = self.pool.get('hr.holidays.status').browse(cr, uid, [status], context=context)[0]
|
||||
brows_obj = self.pool.get('hr.holidays.status').browse(cr, uid, status, context=context)
|
||||
if brows_obj.categ_id and brows_obj.categ_id.section_id and not brows_obj.categ_id.section_id.allow_unlink:
|
||||
warning = {
|
||||
'title': "Warning for ",
|
||||
'message': "You won\'t be able to cancel this leave request because the CRM Sales Team of the leave type disallows."
|
||||
}
|
||||
}
|
||||
return {'warning': warning}
|
||||
|
||||
def set_to_draft(self, cr, uid, ids, *args):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
self.write(cr, uid, ids, {
|
||||
'state': 'draft',
|
||||
'manager_id': False,
|
||||
'number_of_days': 0,
|
||||
})
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for id in ids:
|
||||
wf_service.trg_create(uid, 'hr.holidays', id, cr)
|
||||
return True
|
||||
|
||||
def holidays_validate2(self, cr, uid, ids, *args):
|
||||
obj_emp = self.pool.get('hr.employee')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
vals = {'state':'validate1'}
|
||||
self.check_holidays(cr, uid, ids)
|
||||
ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)])
|
||||
if ids2:
|
||||
vals['manager_id'] = ids2[0]
|
||||
else:
|
||||
raise osv.except_osv(_('Warning !'),_('No user related to the selected employee.'))
|
||||
# Second Time Validate all the leave requests of the category
|
||||
for leave_id in self._get_category_leave_ids(cr, uid, ids):
|
||||
wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'second_validate', cr)
|
||||
return self.write(cr, uid, ids, vals)
|
||||
|
||||
def holidays_validate(self, cr, uid, ids, *args):
|
||||
obj_emp = self.pool.get('hr.employee')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
data_holiday = self.browse(cr, uid, ids)
|
||||
self.check_holidays(cr, uid, ids)
|
||||
vals = {'state':'validate'}
|
||||
obj_emp = self.pool.get('hr.employee')
|
||||
ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)])
|
||||
if ids2:
|
||||
if data_holiday[0].state == 'validate1':
|
||||
vals['manager_id2'] = ids2[0]
|
||||
else:
|
||||
vals['manager_id'] = ids2[0]
|
||||
else:
|
||||
raise osv.except_osv(_('Warning !'), _('No user related to the selected employee.'))
|
||||
self.write(cr, uid, ids, vals)
|
||||
manager = ids2 and ids2[0] or False
|
||||
return self.write(cr, uid, ids, {'state':'validate1', 'manager_id': manager})
|
||||
|
||||
def holidays_validate2(self, cr, uid, ids, *args):
|
||||
self.check_holidays(cr, uid, ids)
|
||||
obj_emp = self.pool.get('hr.employee')
|
||||
ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)])
|
||||
manager = ids2 and ids2[0] or False
|
||||
self.write(cr, uid, ids, {'state':'validate', 'manager_id2': manager})
|
||||
data_holiday = self.browse(cr, uid, ids)
|
||||
for record in data_holiday:
|
||||
if record.holiday_type == 'employee' and record.type == 'remove':
|
||||
vals = {
|
||||
'name': record.name,
|
||||
'date_from': record.date_from,
|
||||
'date_to': record.date_to,
|
||||
'calendar_id': record.employee_id.calendar_id.id,
|
||||
'company_id': record.employee_id.company_id.id,
|
||||
'resource_id': record.employee_id.resource_id.id,
|
||||
'holiday_id': record.id
|
||||
}
|
||||
self._create_resource_leave(cr, uid, vals)
|
||||
elif record.holiday_type == 'category':
|
||||
# Create leave/allocation request for employees in the category
|
||||
emp_ids = obj_emp.search(cr, uid, [('category_ids', '=', record.category_id.id)])
|
||||
leave_ids = []
|
||||
for emp in obj_emp.browse(cr, uid, emp_ids):
|
||||
vals = {
|
||||
'name': record.name,
|
||||
'type': record.type,
|
||||
'holiday_type': 'employee',
|
||||
'holiday_status_id': record.holiday_status_id.id,
|
||||
'date_from': record.date_from,
|
||||
'date_to': record.date_to,
|
||||
'notes': record.notes,
|
||||
'number_of_days_temp': record.number_of_days_temp,
|
||||
'parent_id': record.id,
|
||||
'employee_id': emp.id
|
||||
}
|
||||
leave_ids.append(self.create(cr, uid, vals, context=None))
|
||||
# Confirm and validate all the leave requests of the category
|
||||
for leave_id in leave_ids:
|
||||
wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'confirm', cr)
|
||||
wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'validate', cr)
|
||||
return True
|
||||
|
||||
def holidays_confirm(self, cr, uid, ids, *args):
|
||||
obj_hr_holiday_status = self.pool.get('hr.holidays.status')
|
||||
for record in self.browse(cr, uid, ids):
|
||||
user_id = False
|
||||
leave_asked = record.number_of_days_temp
|
||||
if record.holiday_type == 'employee' and record.type == 'remove':
|
||||
if record.employee_id and not record.holiday_status_id.limit:
|
||||
leaves_rest = obj_hr_holiday_status.get_days( cr, uid, [record.holiday_status_id.id], record.employee_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
|
||||
if leaves_rest < leave_asked:
|
||||
raise osv.except_osv(_('Warning!'),_('You cannot validate leaves for employee %s while there are too few remaining leave days.') % (record.employee_id.name))
|
||||
nb = -(record.number_of_days_temp)
|
||||
elif record.holiday_type == 'category' and record.type == 'remove':
|
||||
if record.category_id and not record.holiday_status_id.limit:
|
||||
leaves_rest = obj_hr_holiday_status.get_days_cat( cr, uid, [record.holiday_status_id.id], record.category_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
|
||||
if leaves_rest < leave_asked:
|
||||
raise osv.except_osv(_('Warning!'),_('You cannot validate leaves for category %s while there are too few remaining leave days.') % (record.category_id.name))
|
||||
nb = -(record.number_of_days_temp)
|
||||
else:
|
||||
nb = record.number_of_days_temp
|
||||
|
||||
if record.holiday_type == 'employee' and record.employee_id:
|
||||
user_id = record.employee_id.user_id and record.employee_id.user_id.id or uid
|
||||
|
||||
self.write(cr, uid, [record.id], {'state':'confirm', 'number_of_days': nb, 'user_id': user_id})
|
||||
return True
|
||||
|
||||
def holidays_refuse(self, cr, uid, ids, *args):
|
||||
obj_emp = self.pool.get('hr.employee')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
vals = {'state': 'refuse'}
|
||||
ids2 = obj_emp.search(cr, uid, [('user_id','=', uid)])
|
||||
if ids2:
|
||||
vals['manager_id'] = ids2[0]
|
||||
# Refuse all the leave requests of the category
|
||||
for leave_id in self._get_category_leave_ids(cr, uid, ids):
|
||||
wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'refuse', cr)
|
||||
self.write(cr, uid, ids, vals)
|
||||
return True
|
||||
|
||||
def holidays_cancel(self, cr, uid, ids, *args):
|
||||
self._update_user_holidays(cr, uid, ids)
|
||||
self.write(cr, uid, ids, {'state': 'cancel'})
|
||||
self._remove_resouce_leave(cr, uid, ids)
|
||||
return True
|
||||
|
||||
def holidays_draft(self, cr, uid, ids, *args):
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for leave_id in self._get_category_leave_ids(cr, uid, ids):
|
||||
wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'draft', cr)
|
||||
return self.write(cr, uid, ids, {'state': 'draft'})
|
||||
|
||||
def check_holidays(self, cr, uid, ids):
|
||||
holi_status_obj = self.pool.get('hr.holidays.status')
|
||||
emp_obj = self.pool.get('hr.employee')
|
||||
meeting_obj = self.pool.get('crm.meeting')
|
||||
for record in self.browse(cr, uid, ids):
|
||||
if not record.number_of_days:
|
||||
raise osv.except_osv(_('Warning!'), _('Wrong leave definition.'))
|
||||
if record.holiday_type=='employee' and record.employee_id:
|
||||
leave_asked = record.number_of_days
|
||||
if leave_asked < 0.00:
|
||||
if not record.holiday_status_id.limit:
|
||||
leaves_rest = holi_status_obj.get_days(cr, uid, [record.holiday_status_id.id], record.employee_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
|
||||
if leaves_rest < -(leave_asked):
|
||||
raise osv.except_osv(_('Warning!'),_('You Cannot Validate leaves while available leaves are less than asked leaves.'))
|
||||
elif record.holiday_type == 'category' and record.category_id:
|
||||
leave_asked = record.number_of_days
|
||||
if leave_asked < 0.00:
|
||||
if not record.holiday_status_id.limit:
|
||||
leaves_rest = holi_status_obj.get_days_cat(cr, uid, [record.holiday_status_id.id], record.category_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
|
||||
if leaves_rest < -(leave_asked):
|
||||
raise osv.except_osv(_('Warning!'),_('You Cannot Validate leaves while available leaves are less than asked leaves.'))
|
||||
else:# This condition will never meet!!
|
||||
holiday_ids = []
|
||||
vals = {
|
||||
'name': record.name,
|
||||
'holiday_status_id': record.holiday_status_id.id,
|
||||
'state': 'draft',
|
||||
'date_from': record.date_from,
|
||||
'date_to': record.date_to,
|
||||
'notes': record.notes,
|
||||
'number_of_days': record.number_of_days,
|
||||
'number_of_days_temp': record.number_of_days_temp,
|
||||
'type': record.type,
|
||||
'allocation_type': record.allocation_type,
|
||||
'parent_id': record.id,
|
||||
}
|
||||
employee_ids = emp_obj.search(cr, uid, [])
|
||||
for employee in employee_ids:
|
||||
vals['employee_id'] = employee
|
||||
user_id = emp_obj.search(cr, uid, [('user_id','=',uid)])
|
||||
if user_id:
|
||||
vals['user_id'] = user_id[0]
|
||||
holiday_ids.append(self.create(cr, uid, vals, context=None))
|
||||
self.holidays_confirm(cr, uid, holiday_ids)
|
||||
self.holidays_validate(cr, uid, holiday_ids)
|
||||
|
||||
if record.holiday_status_id.categ_id and record.date_from and record.date_to and record.employee_id:
|
||||
diff_day = self._get_number_of_days(record.date_from, record.date_to)
|
||||
meeting_obj = self.pool.get('crm.meeting')
|
||||
vals = {
|
||||
'name': record.name,
|
||||
'categ_id': record.holiday_status_id.categ_id.id,
|
||||
'duration': (diff_day) * 8,
|
||||
'duration': record.number_of_days_temp * 8,
|
||||
'note': record.notes,
|
||||
'user_id': record.user_id.id,
|
||||
'date': record.date_from,
|
||||
'end_date': record.date_to,
|
||||
'date_deadline': record.date_to,
|
||||
}
|
||||
case_id = meeting_obj.create(cr, uid, vals)
|
||||
self.write(cr, uid, ids, {'case_id': case_id})
|
||||
elif record.holiday_type == 'category':
|
||||
emp_ids = obj_emp.search(cr, uid, [('category_ids', 'child_of', [record.category_id.id])])
|
||||
leave_ids = []
|
||||
for emp in obj_emp.browse(cr, uid, emp_ids):
|
||||
vals = {
|
||||
'name': record.name,
|
||||
'type': record.type,
|
||||
'holiday_type': 'employee',
|
||||
'holiday_status_id': record.holiday_status_id.id,
|
||||
'date_from': record.date_from,
|
||||
'date_to': record.date_to,
|
||||
'notes': record.notes,
|
||||
'number_of_days_temp': record.number_of_days_temp,
|
||||
'parent_id': record.id,
|
||||
'employee_id': emp.id
|
||||
}
|
||||
leave_ids.append(self.create(cr, uid, vals, context=None))
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for leave_id in leave_ids:
|
||||
wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'confirm', cr)
|
||||
wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'validate', cr)
|
||||
wf_service.trg_validate(uid, 'hr.holidays', leave_id, 'second_validate', cr)
|
||||
return True
|
||||
|
||||
def holidays_confirm(self, cr, uid, ids, *args):
|
||||
self.check_holidays(cr, uid, ids)
|
||||
return self.write(cr, uid, ids, {'state':'confirm'})
|
||||
|
||||
def holidays_refuse(self, cr, uid, ids, *args):
|
||||
obj_emp = self.pool.get('hr.employee')
|
||||
ids2 = obj_emp.search(cr, uid, [('user_id', '=', uid)])
|
||||
manager = ids2 and ids2[0] or False
|
||||
self.write(cr, uid, ids, {'state': 'refuse', 'manager_id2': manager})
|
||||
self.holidays_cancel(cr, uid, ids)
|
||||
return True
|
||||
|
||||
def holidays_cancel(self, cr, uid, ids, *args):
|
||||
obj_crm_meeting = self.pool.get('crm.meeting')
|
||||
for record in self.browse(cr, uid, ids):
|
||||
# Delete the meeting
|
||||
if record.case_id:
|
||||
obj_crm_meeting.unlink(cr, uid, [record.case_id.id])
|
||||
|
||||
# If a category that created several holidays, cancel all related
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
for id in record.linked_request_ids or []:
|
||||
wf_service.trg_validate(uid, 'hr.holidays', id, 'cancel', cr)
|
||||
|
||||
return True
|
||||
|
||||
def check_holidays(self, cr, uid, ids):
|
||||
holi_status_obj = self.pool.get('hr.holidays.status')
|
||||
for record in self.browse(cr, uid, ids):
|
||||
if record.holiday_type == 'employee' and record.type == 'remove':
|
||||
if record.employee_id and not record.holiday_status_id.limit:
|
||||
leaves_rest = holi_status_obj.get_days( cr, uid, [record.holiday_status_id.id], record.employee_id.id, False)[record.holiday_status_id.id]['remaining_leaves']
|
||||
if leaves_rest < record.number_of_days_temp:
|
||||
raise osv.except_osv(_('Warning!'),_('You cannot validate leaves for employee %s: too few remaining days (%s).') % (record.employee_id.name, leaves_rest))
|
||||
return True
|
||||
hr_holidays()
|
||||
|
||||
class resource_calendar_leaves(osv.osv):
|
||||
@@ -478,4 +319,3 @@ class resource_calendar_leaves(osv.osv):
|
||||
|
||||
resource_calendar_leaves()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<field name="type">calendar</field>
|
||||
<field name="arch" type="xml">
|
||||
<calendar string="Leave Request" color="name" date_start="date_from" date_stop="date_to">
|
||||
<field name="holiday_status_id"/>
|
||||
<field name="holiday_status_id"/>
|
||||
</calendar>
|
||||
</field>
|
||||
</record>
|
||||
@@ -70,8 +70,8 @@
|
||||
<form string="Leave Request">
|
||||
<group col="8" colspan="4">
|
||||
<field name="name" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}" />
|
||||
<field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" width="130" groups="base.group_hr_manager"/>
|
||||
<group attrs="{'invisible':[('holiday_type','=','employee')]}">
|
||||
<field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" width="130" groups="base.group_hr_manager" string="Leave Type"/>
|
||||
<group attrs="{'invisible':[('holiday_type','=','employee')]}">
|
||||
<field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'readonly':[('state','!=','draft')]}"/>
|
||||
</group>
|
||||
<group attrs="{'invisible':[('holiday_type','=','category')]}">
|
||||
@@ -83,7 +83,7 @@
|
||||
<field name="holiday_status_id" on_change="onchange_sec_id(holiday_status_id)" context="{'employee_id':employee_id}" />
|
||||
<field name="department_id"/>
|
||||
<field name="date_from" on_change="onchange_date_from(date_to, date_from)" required="1"/>
|
||||
<field name="date_to" on_change="onchange_date_to(date_from, date_to)" required="1"/>
|
||||
<field name="date_to" on_change="onchange_date_from(date_to, date_from)" required="1"/>
|
||||
<field name="number_of_days_temp"/>
|
||||
<newline/>
|
||||
<field name="manager_id"/>
|
||||
@@ -93,12 +93,11 @@
|
||||
<newline/>
|
||||
<field name="state" colspan="2"/>
|
||||
<group colspan="2" col="6">
|
||||
<button string="Cancel" name="cancel" states="validate,refuse" type="workflow" icon="gtk-cancel" groups="base.group_hr_manager"/>
|
||||
<button string="Refuse" name="refuse" states="confirm,validate1" type="workflow" icon="gtk-no" groups="base.group_hr_manager"/>
|
||||
<button string="Refuse" name="refuse" states="confirm,validate,validate1" type="workflow" icon="gtk-no" groups="base.group_hr_manager"/>
|
||||
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes" groups="base.group_hr_user,base.group_hr_manager"/>
|
||||
<button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply" groups="base.group_hr_manager"/>
|
||||
<button string="Approved" name="second_validate" states="validate1" type="workflow" icon="gtk-apply" groups="base.group_hr_manager"/>
|
||||
<button string="Set to Draft" name="set_to_draft" states="cancel" type="object" icon="gtk-convert" groups="base.group_hr_manager"/>
|
||||
<button string="Set to Draft" name="set_to_draft" states="refuse" type="object" icon="gtk-convert" groups="base.group_hr_manager"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
@@ -115,7 +114,7 @@
|
||||
<form string="Allocation Request">
|
||||
<group col="8" colspan="4">
|
||||
<field name="name" />
|
||||
<field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" string="Allocation Type" groups="base.group_extended"/>
|
||||
<field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" string="Allocation Type" groups="base.group_hr_manager"/>
|
||||
<group attrs="{'invisible':[('holiday_type','=','category')]}">
|
||||
<field name="employee_id" attrs="{'required':[('holiday_type','=','employee')]}"/>
|
||||
</group>
|
||||
@@ -136,8 +135,7 @@
|
||||
<newline/>
|
||||
<field name="state" colspan="2"/>
|
||||
<group colspan="2" col="6">
|
||||
<button string="Cancel" name="cancel" states="validate,refuse" type="workflow" icon="gtk-cancel" groups="base.group_hr_manager"/>
|
||||
<button string="Refuse" name="refuse" states="confirm,validate1" type="workflow" icon="gtk-no" groups="base.group_hr_manager"/>
|
||||
<button string="Refuse" name="refuse" states="confirm,validate,validate1" type="workflow" icon="gtk-no" groups="base.group_hr_manager"/>
|
||||
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes" groups="base.group_hr_user,base.group_hr_manager"/>
|
||||
<button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply" groups="base.group_hr_manager"/>
|
||||
<button string="Approved" name="second_validate" states="validate1" type="workflow" icon="gtk-apply" groups="base.group_hr_manager"/>
|
||||
@@ -154,7 +152,7 @@
|
||||
<field name="model">hr.holidays</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="red:state in ('refuse');blue:state in (' draft');black:state in ('confirm','validate','validate1');gray:state in ('cancel') " string="Leaves" >
|
||||
<tree colors="red:state in ('refuse');blue:state in ('draft');black:state in ('confirm','validate','validate1')" string="Leaves" >
|
||||
<field name="employee_id"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="holiday_status_id"/>
|
||||
@@ -181,7 +179,7 @@
|
||||
<field name="holiday_status_id" />
|
||||
<field name="type"/>
|
||||
<field name="date_from" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
|
||||
<field name="date_to" on_change="onchange_date_to(date_from, date_to)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
|
||||
<field name="date_to" on_change="onchange_date_from(date_to, date_from)" attrs="{'readonly':[('type','=','add')], 'required':[('type','=','remove')]}"/>
|
||||
<field name="number_of_days_temp"/>
|
||||
<notebook colspan="4">
|
||||
<page string="General">
|
||||
@@ -190,10 +188,9 @@
|
||||
<newline/>
|
||||
<field name="state" colspan="2"/>
|
||||
<group colspan="2">
|
||||
<button string="Cancel" name="cancel" states="validate,refuse,validate1" type="workflow" icon="gtk-cancel"/>
|
||||
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes"/>
|
||||
<button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply"/>
|
||||
<button string="Refuse" name="refuse" states="confirm" type="workflow" icon="gtk-no"/>
|
||||
<button string="Refuse" name="refuse" states="confirm,validate,draft" type="workflow" icon="gtk-no"/>
|
||||
<button string="Set to Draft" name="set_to_draft" states="cancel" type="object" icon="gtk-convert"/>
|
||||
</group>
|
||||
</page>
|
||||
@@ -203,12 +200,12 @@
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_holiday_simple">
|
||||
<field name="name">hr.holidays.reprot_tree</field>
|
||||
<field name="name">hr.holidays.report_tree</field>
|
||||
<field name="model">hr.holidays</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="priority">20</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="red:state in ('refuse');blue:state in (' draft');black:state in ('confirm','validate','validate1');gray:state in ('cancel')" string="Leaves Summary">
|
||||
<tree colors="red:state in ('refuse');blue:state in (' draft');black:state in ('confirm','validate','validate1')" string="Leaves Summary">
|
||||
<field name="employee_id"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="type"/>
|
||||
@@ -220,11 +217,9 @@
|
||||
<field name="manager_id" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="state"/>
|
||||
<button string="Cancel" name="cancel" states="validate,refuse,validate1" type="workflow" icon="gtk-cancel" groups="base.group_hr_manager"/>
|
||||
<button string="Confirm" name="confirm" states="draft" type="workflow" icon="gtk-yes" groups="base.group_hr_user,base.group_hr_manager"/>
|
||||
<button string="Approve" name="validate" states="confirm" type="workflow" icon="gtk-apply" groups="base.group_hr_manager"/>
|
||||
<button string="Refuse" name="refuse" states="confirm" type="workflow" icon="gtk-no" groups="base.group_hr_manager"/>
|
||||
<button string="Set to Draft" name="set_to_draft" states="cancel" type="object" icon="gtk-convert" groups="base.group_hr_manager"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -235,7 +230,7 @@
|
||||
<field name="model">hr.holidays</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree colors="red:state in ('refuse');blue:state in (' draft');black:state in ('confirm','validate','validate1');gray:state in ('cancel')">
|
||||
<tree colors="red:state in ('refuse');blue:state in (' draft');black:state in ('confirm','validate','validate1')">
|
||||
<field name="employee_id"/>
|
||||
<field name="department_id" invisible="not context.get('set_visible',False)"/>
|
||||
<field name="holiday_status_id"/>
|
||||
@@ -299,7 +294,7 @@
|
||||
<field name="name">Allocation Requests</field>
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="context">{"search_default_my_leaves": 1,'type':'add',"search_default_department_id": department_id}</field>
|
||||
<field name="context">{"search_default_my_leaves": 1,'default_type':'add',"search_default_department_id": department_id}</field>
|
||||
<field name="domain">[('type','=','add')]</field>
|
||||
<field name="view_id" ref="allocation_leave_new"/>
|
||||
<field name="search_view_id" ref="view_hr_holidays_filter"/>
|
||||
@@ -328,6 +323,7 @@
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" eval="view_holiday_simple"/>
|
||||
<field name="context">{'search_default_my_leaves': 1, 'search_default_group_type': 1}</field>
|
||||
<field name="domain">[('holiday_type','=','employee')]</field>
|
||||
<field name="search_view_id" ref="view_hr_holidays_filter"/>
|
||||
</record>
|
||||
|
||||
@@ -347,10 +343,6 @@
|
||||
<search string="Search Leave Type">
|
||||
<field name="name"/>
|
||||
<field name="categ_id" widget="selection"/>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Meeting Category" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'categ_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -366,22 +358,19 @@
|
||||
<field name="color_name"/>
|
||||
<field name="categ_id" widget="selection" groups="base.group_extended"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Details">
|
||||
<group name="selection" col="4" colspan="4">
|
||||
<group colspan="2">
|
||||
<separator string="Validation" />
|
||||
<newline/>
|
||||
<field name="active" />
|
||||
<newline/>
|
||||
<field name="double_validation"/>
|
||||
<newline/>
|
||||
<field name="limit"/>
|
||||
</group>
|
||||
<group name="second" colspan="2"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
<notebook colspan="4">
|
||||
<page string="Details">
|
||||
<group colspan="2" col="2" name="selection">
|
||||
<separator string="Validation" colspan="2"/>
|
||||
<field name="double_validation"/>
|
||||
<field name="limit"/>
|
||||
</group>
|
||||
<group name="second" colspan="2" col="2">
|
||||
<separator string="Misc" colspan="2"/>
|
||||
<field name="active" />
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -393,21 +382,22 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Leave Type">
|
||||
<field name="name"/>
|
||||
<field name="max_leaves"/>
|
||||
<field name="leaves_taken"/>
|
||||
<field name="remaining_leaves"/>
|
||||
<field name="limit" />
|
||||
<field name="categ_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_hr_holidays_status_search" model="ir.ui.view">
|
||||
<record id="view_hr_holidays_status_search" model="ir.ui.view">
|
||||
<field name="name">hr.holidays.status.search</field>
|
||||
<field name="model">hr.holidays.status</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Leave Type">
|
||||
<field name="name"/>
|
||||
<field name="categ_id" widget="selection"/>
|
||||
<field name="name"/>
|
||||
<field name="categ_id" widget="selection"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -448,7 +438,7 @@
|
||||
context="{'search_default_employee_id': [active_id]}"
|
||||
res_model="hr.holidays"
|
||||
src_model="hr.employee"
|
||||
view_id ="edit_holiday_new"
|
||||
view_id ="view_holiday"
|
||||
id="act_hr_employee_holiday_request"/>
|
||||
|
||||
</data>
|
||||
|
||||
@@ -43,17 +43,9 @@
|
||||
<field name="wkf_id" ref="wkf_holidays" />
|
||||
<field name="name">refuse</field>
|
||||
<field name="kind">function</field>
|
||||
<field name="action">holidays_refuse()</field>
|
||||
|
||||
</record>
|
||||
|
||||
<record model="workflow.activity" id="act_cancel">
|
||||
<field name="wkf_id" ref="wkf_holidays" />
|
||||
<field name="name">cancel</field>
|
||||
<field name="flow_stop">True</field>
|
||||
<field name="kind">stopall</field>
|
||||
<field name="action">holidays_cancel()</field>
|
||||
<field name="join_mode">XOR</field>
|
||||
<field name="action">holidays_refuse()</field>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
@@ -70,7 +62,7 @@
|
||||
<field name="act_from" ref="act_confirm" />
|
||||
<field name="act_to" ref="act_validate" />
|
||||
<field name="signal">validate</field>
|
||||
<field name="condition">(holiday_status_id.double_validation == False)</field>
|
||||
<field name="condition">True</field>
|
||||
</record>
|
||||
|
||||
<record model="workflow.transition" id="t3">
|
||||
@@ -81,25 +73,14 @@
|
||||
|
||||
<record model="workflow.transition" id="t4">
|
||||
<field name="act_from" ref="act_validate" />
|
||||
<field name="act_to" ref="act_cancel" />
|
||||
<field name="signal">cancel</field>
|
||||
</record>
|
||||
|
||||
<record model="workflow.transition" id="t5">
|
||||
<field name="act_from" ref="act_refuse" />
|
||||
<field name="act_to" ref="act_cancel" />
|
||||
<field name="signal">cancel</field>
|
||||
</record>
|
||||
|
||||
<record model="workflow.transition" id="t7">
|
||||
<field name="act_from" ref="act_cancel" />
|
||||
<field name="act_to" ref="act_draft" />
|
||||
<field name="signal">set_to_draft</field>
|
||||
<field name="act_to" ref="act_refuse" />
|
||||
<field name="signal">refuse</field>
|
||||
</record>
|
||||
|
||||
<record model="workflow.transition" id="t8">
|
||||
<field name="act_from" ref="act_validate1" />
|
||||
<field name="act_to" ref="act_validate" />
|
||||
<field name="act_from" ref="act_validate" />
|
||||
<field name="act_to" ref="act_validate1" />
|
||||
<field name="group_id" ref="base.group_hr_user"/>
|
||||
<field name="signal">second_validate</field>
|
||||
</record>
|
||||
|
||||
@@ -110,10 +91,10 @@
|
||||
</record>
|
||||
|
||||
<record model="workflow.transition" id="t11">
|
||||
<field name="act_from" ref="act_confirm" />
|
||||
<field name="act_from" ref="act_validate" />
|
||||
<field name="act_to" ref="act_validate1" />
|
||||
<field name="condition">(holiday_status_id.double_validation == True)</field>
|
||||
<field name="signal">validate</field>
|
||||
<field name="condition">not holiday_status_id.double_validation</field>
|
||||
<field name="signal" eval="False"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
||||
@@ -1,35 +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/>.
|
||||
#
|
||||
##############################################################################
|
||||
__name__ = "Convert the Holidays Per User limits into positive leave request"
|
||||
|
||||
def migrate(cr, version):
|
||||
# cr.execute("""SELECT id, employee_id, holiday_status, max_leaves, notes, create_uid
|
||||
# FROM hr_holidays_per_user;""")
|
||||
# for record in cr.fetchall():
|
||||
# cr.execute("""INSERT INTO hr_holidays
|
||||
# (employee_id, type, allocation_type, name, holiday_status_id,
|
||||
# state, number_of_days, notes, manager_id) VALUES
|
||||
# (%s, 'add', 'company', 'imported holiday_per_user', %s,
|
||||
# 'validated', %s, %s, %s) """, (record[1],record[2],record[3],record[4],record[5]))
|
||||
return {}
|
||||
|
||||
|
||||
|
||||
@@ -19,71 +19,3 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
import tools
|
||||
|
||||
class available_holidays_report(osv.osv):
|
||||
_name = "available.holidays.report"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'date': fields.date('Date', readonly=True),
|
||||
'year': fields.char('Year', size=4, readonly=True),
|
||||
'day': fields.char('Day', size=15, readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
|
||||
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
|
||||
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
|
||||
'employee_id': fields.many2one ('hr.employee', "Employee's Name", readonly=True),
|
||||
'category_id': fields.many2one('hr.employee.category', "Category's Name", readonly=True),
|
||||
'holiday_status_id': fields.many2one('hr.holidays.status', 'Leave Type', readonly=True),
|
||||
'max_leave': fields.float('Allocated Leaves', readonly=True),
|
||||
'taken_leaves': fields.float('Taken Leaves', readonly=True),
|
||||
'remaining_leave': fields.float('Remaining Leaves', readonly=True),
|
||||
'department_id': fields.many2one('hr.department', 'Department', readonly=True),
|
||||
'user_id': fields.many2one('res.users', 'User', readonly=True),
|
||||
'state': fields.selection([('draft', 'Draft'),
|
||||
('confirm', 'Waiting Validation'),
|
||||
('refuse', 'Refused'),
|
||||
('validate', 'Validated'),
|
||||
('cancel', 'Cancelled')]
|
||||
,'State', readonly=True),
|
||||
}
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'available_holidays_report')
|
||||
cr.execute("""
|
||||
CREATE or REPLACE view available_holidays_report as (
|
||||
SELECT
|
||||
min(h.id) as id,
|
||||
date_trunc('day',h.create_date) as date,
|
||||
to_char(s.create_date, 'YYYY') as year,
|
||||
to_char(s.create_date, 'MM') as month,
|
||||
to_char(s.create_date, 'YYYY-MM-DD') as day,
|
||||
h.employee_id as employee_id,
|
||||
h.category_id as category_id,
|
||||
h.user_id as user_id,
|
||||
h.department_id,
|
||||
h.state as state,
|
||||
h.holiday_status_id as holiday_status_id,
|
||||
sum(number_of_days) as remaining_leave,
|
||||
(select sum(number_of_days_temp) from hr_holidays
|
||||
where type='remove'
|
||||
and employee_id=h.employee_id
|
||||
and holiday_status_id=h.holiday_status_id
|
||||
and state='validate') as taken_leaves,
|
||||
(select sum(number_of_days_temp) from hr_holidays
|
||||
where type='add'
|
||||
and employee_id=h.employee_id
|
||||
and holiday_status_id=h.holiday_status_id
|
||||
and state='validate') as max_leave
|
||||
FROM hr_holidays h
|
||||
LEFT JOIN hr_holidays_status s on (s.id = h.holiday_status_id)
|
||||
WHERE h.state='validate'
|
||||
and s.active <> 'f'
|
||||
GROUP BY h.holiday_status_id, h.employee_id,
|
||||
date_trunc('day',h.create_date),to_char(s.create_date, 'YYYY'),
|
||||
to_char(s.create_date, 'MM'), to_char(s.create_date, 'YYYY-MM-DD'), h.user_id,h.state, h.category_id, h.department_id
|
||||
|
||||
)""")
|
||||
|
||||
available_holidays_report()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -1,117 +1,24 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<data>
|
||||
|
||||
<!-- available holidays report -->
|
||||
|
||||
<record id="view_hr_available_holidays_report_tree" model="ir.ui.view">
|
||||
<field name="name">available.holidays.report.tree</field>
|
||||
<field name="model">available.holidays.report</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Available Holidays">
|
||||
<field name="employee_id" invisible="1"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="category_id" invisible="1"/>
|
||||
<field name="holiday_status_id" invisible="1"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="year" invisible="1"/>
|
||||
<field name="date" invisible="1"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="max_leave" sum="Allocated Leaves"/>
|
||||
<field name="taken_leaves" sum="Taken Leaves"/>
|
||||
<field name="remaining_leave" sum="Remaining Leaves"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_hr_available_holidays_report_graph" model="ir.ui.view">
|
||||
<field name="name">available.holidays.report.graph</field>
|
||||
<field name="model">available.holidays.report</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Available Holidays" type="bar">
|
||||
<field name="holiday_status_id"/>
|
||||
<field name="taken_leaves" string="Taken Leaves" operator="+"/>
|
||||
<field name="max_leave" string="Allocated Leaves" operator="+"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_hr_available_holidays_report_search" model="ir.ui.view">
|
||||
<field name="name">available.holidays.report.search</field>
|
||||
<field name="model">available.holidays.report</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Leaves">
|
||||
<group>
|
||||
<filter icon="terp-go-year" string=" Year " domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>=',time.strftime('%%Y-01-01'))]" help="Available Leaves of current year"/>
|
||||
<filter icon="terp-go-month" string=" Month " name="month"
|
||||
domain="[('date','<=',(datetime.date.today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('date','>=',(datetime.date.today()-relativedelta(day=1)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Available Leaves of current month"/>
|
||||
<filter icon="terp-go-month" string=" Month-1 " separator="1"
|
||||
domain="[('date','<=', (datetime.date.today() - relativedelta(day=31, months=1)).strftime('%%Y-%%m-%%d')),('date','>=',(datetime.date.today() - relativedelta(day=1,months=1)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Available Leaves of last month"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Validated" icon="terp-camera_test" domain="[('state','=','validate')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="employee_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended Filters..." colspan="10" col="12">
|
||||
<field name="holiday_status_id" widget="selection"/>
|
||||
<field name="department_id" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter icon="terp-personal" string="Employee"
|
||||
name="user" context="{'group_by':'employee_id'}"
|
||||
help="Leaves by employee"/>
|
||||
<filter string="Validation User" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Department" icon="terp-personal+" context="{'group_by':'department_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-stock_symbol-selection" string="Category" context="{'group_by':'category_id'}"
|
||||
help="Leaves by category"/>
|
||||
<filter string="Type" icon="terp-stock_symbol-selection" context="{'group_by':'holiday_status_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_hr_available_holidays_report" model="ir.actions.act_window">
|
||||
<field name="name">Leaves Analysis</field>
|
||||
<field name="res_model">available.holidays.report</field>
|
||||
<record model="ir.actions.act_window" id="action_hr_available_holidays_report">
|
||||
<field name="res_model">hr.holidays</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="context">{'search_default_month':1,'search_default_user':1,'group_by':[], "search_default_user_id": uid, 'group_by_no_leaf':1}</field>
|
||||
<field name="view_id" ref="view_hr_available_holidays_report_search"/>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" eval="view_holiday_simple"/>
|
||||
<field name="context">{'search_default_group_employee': 1, 'search_default_group_type': 1}</field>
|
||||
<field name="domain">[('holiday_type','=','employee')]</field>
|
||||
<field name="search_view_id" ref="view_hr_holidays_filter"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window.view" id="action_hr_available_holidays_report_tree">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="view_hr_available_holidays_report_tree"/>
|
||||
<field name="act_window_id" ref="action_hr_available_holidays_report"/>
|
||||
</record>
|
||||
<menuitem
|
||||
name="Leaves Analysis"
|
||||
id="menu_hr_available_holidays_report_tree"
|
||||
action="action_hr_available_holidays_report"
|
||||
parent="menu_hr_reporting_holidays"/>
|
||||
|
||||
<record model="ir.actions.act_window.view" id="action_hr_available_holidays_report_graph">
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="view_mode">graph</field>
|
||||
<field name="view_id" ref="view_hr_available_holidays_report_graph"/>
|
||||
<field name="act_window_id" ref="action_hr_available_holidays_report"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="Leaves Analysis" id="menu_hr_available_holidays_report_tree" action="action_hr_available_holidays_report" parent="menu_hr_reporting_holidays"/>
|
||||
|
||||
</data>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
||||
@@ -244,7 +244,6 @@
|
||||
<td>
|
||||
<para>
|
||||
<xsl:attribute name="style">digits</xsl:attribute>
|
||||
<xsl:value-of select="attribute::id"/>
|
||||
</para>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
@@ -5,4 +5,3 @@
|
||||
"access_hr_holydays_status_employee","hr.holidays.status employee","model_hr_holidays_status","base.group_user",1,0,0,0
|
||||
"access_hr_holidays_remain_user","hr.holidays.ramain.user","model_hr_holidays_remaining_leaves_user","base.group_hr_user",1,1,1,1
|
||||
"access_resource_calendar_leaves_manager","resource_calendar_leaves_manager","resource.model_resource_calendar_leaves","base.group_hr_manager",1,1,1,1
|
||||
"access_available_holidays_report_user","hr.available.holidays.report.user","model_available_holidays_report","base.group_hr_user",1,1,1,1
|
||||
|
||||
|
@@ -1,14 +1,22 @@
|
||||
-
|
||||
In order to test the PDF reports defined on a HR Holidays, we will print HR Holidays
|
||||
Print the HR Holidays(Summary Department) Report through the wizard
|
||||
-
|
||||
!python {model: hr.holidays}: |
|
||||
import netsvc, tools, os, time
|
||||
data_dict = {'model': 'ir.ui.menu', 'form': {'date_from': time.strftime('%Y-%m-01'), 'depts' : [ref('hr.dep_sales')],'holiday_type' : 'Validated' }}
|
||||
(data, format) = netsvc.LocalService('report.holidays.summary').create(cr, uid, [], data_dict, {'active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')]})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'hr_holidays-dept_summary_report.'+format), 'wb+').write(data)
|
||||
|
||||
data_dict = {'model': 'hr.employee', 'form': {'date_from': time.strftime('%Y-%m-01'), 'depts' : [ref('hr.dep_sales')],'holiday_type' : 'Validated','emp':[ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')] }}
|
||||
(data, format) = netsvc.LocalService('report.holidays.summary').create(cr, uid, [], data_dict, {'active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')]})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'hr_holidays-employee_summary_report.'+format), 'wb+').write(data)
|
||||
import time
|
||||
ctx={}
|
||||
ctx.update({'model': 'hr.department','active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')]})
|
||||
data_dict = {'date_from': time.strftime('%Y-%m-01'), 'depts' : [(6,0,[ref('hr.dep_sales')])],'holiday_type' : 'Validated'}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_hr_holidays_summary_dept',wiz_data=data_dict, context=ctx, our_module='hr_holidays')
|
||||
|
||||
-
|
||||
Print the HR Holidays(Summary Employee) Report through the wizard
|
||||
-
|
||||
!python {model: hr.holidays}: |
|
||||
import time
|
||||
ctx={}
|
||||
ctx.update({'model': 'hr.employee','active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')]})
|
||||
data_dict = {'date_from': time.strftime('%Y-%m-01'), 'emp' : [(6,0,[ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')])],'holiday_type' : 'Validated'}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_hr_holidays_summary_employee',wiz_data=data_dict, context=ctx, our_module='hr_holidays')
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
I allocate leave request for employee "Phil Graves".
|
||||
-
|
||||
!record {model: hr.holidays, id: hr_holidays_allocateleaveforuser0}:
|
||||
allocation_type: employee
|
||||
employee_id: 'hr_employee_philgraves0'
|
||||
holiday_status_id: hr_holidays_status_sick0
|
||||
name: Sick Leaves for Phil Graves
|
||||
@@ -64,7 +63,6 @@
|
||||
I connect as "test_holiday_user1", and create a new leave request for employee "Phil Graves".
|
||||
-
|
||||
!record {model: hr.holidays, id: hr_holidays_iwanttoleaveforgotohospital0}:
|
||||
allocation_type: employee
|
||||
date_from: '2010-05-20 11:48:00'
|
||||
date_to: '2010-05-21 11:48:00'
|
||||
employee_id: 'hr_employee_philgraves0'
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
'test/payslip.yml',
|
||||
'test/payment_advice.yml',
|
||||
'test/payroll_register.yml',
|
||||
# 'test/hr_payroll_report.yml',
|
||||
# 'test/hr_payroll_report.yml',
|
||||
],
|
||||
'demo_xml': [
|
||||
'hr_payroll_demo.xml'
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
name="salary.structure"
|
||||
rml="hr_payroll/report/report_emp_salary_structure.rml"
|
||||
menu = "True"
|
||||
string="Salary Structure" />
|
||||
string="Salary Structure" groups="base.group_hr_manager"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -32,9 +32,6 @@
|
||||
<separator string="Description" colspan="2"/>
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
<page string="Contracts" groups="base.group_extended">
|
||||
<field name="contracts_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
@@ -109,120 +106,6 @@
|
||||
<field name="medic_exam" select="1" string="Medical Examination"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Contracts" groups="base.group_extended">
|
||||
<field colspan="4" mode="form,tree" name="contract_ids" nolabel="1">
|
||||
<tree string="Contracts">
|
||||
<field name="name"/>
|
||||
<field name="job_id"/>
|
||||
<field name="date_start"/>
|
||||
<field name="date_end"/>
|
||||
<field name="working_hours"/>
|
||||
<field name="wage_type_id"/>
|
||||
<field name="wage"/>
|
||||
</tree>
|
||||
<form string="Contracts">
|
||||
<group colspan="4" col="6">
|
||||
<field name="name" select="1"/>
|
||||
<field name="job_id"/>
|
||||
<newline/>
|
||||
<field name="wage"/>
|
||||
<field name="wage_type_id" widget="selection"/>
|
||||
<field name="type_id" widget="selection"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Contract Details">
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Duration"/>
|
||||
<field name="date_start" select="1"/>
|
||||
<field name="date_end" select="1"/>
|
||||
<field name="working_hours"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Advantages"/>
|
||||
<field name="struct_id" select="1"/>
|
||||
<field name="advantages_gross"/>
|
||||
<field name="advantages_net"/>
|
||||
<field name="advantages" nolabel="1" colspan="2"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Work Permit">
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Passport"/>
|
||||
<field name="passport_id" domain="[('employee_id','=',parent.id)]"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Valid for"/>
|
||||
<field name="visa_no" attrs="{'required': [('passport_id','!=',False), ]}"/>
|
||||
<field name="permit_no" attrs="{'required': [('passport_id','!=',False), ]}"/>
|
||||
<field name="visa_expire" attrs="{'required': [('passport_id','!=',False), ]}"/>
|
||||
</group>
|
||||
</page>
|
||||
<separator colspan="4" string="Notes"/>
|
||||
<field colspan="4" name="notes" nolabel="1"/>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
</xpath>
|
||||
<xpath expr="/form/notebook/page[@string='Notes']" position="before">
|
||||
<page string="Salary Structure" groups="base.group_extended">
|
||||
<group col="10" colspan="4">
|
||||
<separator string="Salary Computation" colspan="10"/>
|
||||
<field name="basic"/>
|
||||
<field name="advantages_gross"/>
|
||||
<field name="gross"/>
|
||||
<field name="advantages_net"/>
|
||||
<field name="net"/>
|
||||
</group>
|
||||
<separator string="Employee specific allowances and deductions" colspan="4"/>
|
||||
<field name="line_ids" nolabel="1" colspan="4" string="Salary Structure">
|
||||
<tree string="Salary Structure" editable="bottom">
|
||||
<field name="category_id" on_change="onchange_category(category_id)"/>
|
||||
<field name="sequence" groups="base.group_extended"/>
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="type"/>
|
||||
<field name="amount_type"/>
|
||||
<field name="amount" on_change="onchange_amount(amount, amount_type)"/>
|
||||
</tree>
|
||||
<form string="Payslip Line">
|
||||
<group col="6" colspan="4">
|
||||
<field name="name" colspan="4" select="1"/>
|
||||
<field name="code" select="1"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="4" string="Calculations"/>
|
||||
<field name="category_id" on_change="onchange_category(category_id)"/>
|
||||
<field name="type"/>
|
||||
<field name="amount_type"/>
|
||||
<field name="amount" on_change="onchange_amount(amount, amount_type)" attrs="{'readonly':[('amount_type','=','func')]}"/>
|
||||
<field name="sequence" groups="base.group_extended"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="4" string="Company contribution"/>
|
||||
<field name="company_contrib"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Function">
|
||||
<field name="line_ids" colspan="4" nolabel="1" attrs="{'readonly':[('amount_type','!=','func')]}">
|
||||
<tree string="Function Arguments" editable="bottom">
|
||||
<field name="name"/>
|
||||
<field name="sequence" groups="base.group_extended"/>
|
||||
<field name="from_val"/>
|
||||
<field name="to_val"/>
|
||||
<field name="amount_type"/>
|
||||
<field name="value"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Description">
|
||||
<separator colspan="4" string="Description"/>
|
||||
<field name="note" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</page>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
@@ -391,23 +274,23 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//group[@name='selection']" position="replace">
|
||||
<group colspan="2">
|
||||
<separator string="Validation" colspan="2"/>
|
||||
<newline/>
|
||||
<field name="active" />
|
||||
<newline/>
|
||||
<field name="double_validation"/>
|
||||
<newline/>
|
||||
<field name="limit"/>
|
||||
</group>
|
||||
<group colspan="2">
|
||||
<separator colspan="2" string="Payroll Configurtion"/><newline/>
|
||||
<field name="type"/><newline/>
|
||||
<field name="head_id"/><newline/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection" select="2"/><newline/>
|
||||
<field name="code" readonly="True"/>
|
||||
</group>
|
||||
</xpath>
|
||||
<group colspan="2">
|
||||
<separator string="Validation" colspan="2"/>
|
||||
<newline/>
|
||||
<field name="active" />
|
||||
<newline/>
|
||||
<field name="double_validation"/>
|
||||
<newline/>
|
||||
<field name="limit"/>
|
||||
</group>
|
||||
<group colspan="2">
|
||||
<separator colspan="2" string="Payroll Configurtion"/><newline/>
|
||||
<field name="type"/><newline/>
|
||||
<field name="head_id"/><newline/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection" select="2"/><newline/>
|
||||
<field name="code" readonly="True"/>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- End Holiday Status -->
|
||||
@@ -1051,7 +934,7 @@
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_contibution_register_form" model="ir.actions.act_window">
|
||||
<field name="name">Contibution Register</field>
|
||||
<field name="name">Contribution Register</field>
|
||||
<field name="res_model">hr.contibution.register</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="hr_contibution_register_tree"/>
|
||||
@@ -1077,13 +960,17 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<!-- Shortcuts -->
|
||||
<act_window name="Payslips"
|
||||
domain="[('employee_id', '=', active_id)]"
|
||||
res_model="hr.payslip"
|
||||
src_model="hr.employee"
|
||||
view_id ="view_hr_payslip_tree"
|
||||
id="act_hr_employee_payslip_list"/>
|
||||
id="act_hr_employee_payslip_list"
|
||||
groups="base.group_hr_manager"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
-
|
||||
In order to test the PDF reports defined on HR Payroll, we will print Employees' Salary Structure
|
||||
-
|
||||
-
|
||||
!python {model: hr.employee}: |
|
||||
import netsvc, tools, os
|
||||
(data, format) = netsvc.LocalService('report.salary.structure').create(cr, uid, [ref('hr_payroll.hr_employee_bonamy0')], {}, {})
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
-
|
||||
Print HR Payslip
|
||||
-
|
||||
-
|
||||
!python {model: hr.payslip}: |
|
||||
import netsvc, tools, os
|
||||
(data, format) = netsvc.LocalService('report.payslip.pdf').create(cr, uid, [ref('hr_payroll.hr_payslip_salaryslipofbonamyforjune0')], {}, {})
|
||||
@@ -17,23 +17,25 @@
|
||||
file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-payslip_report.'+format), 'wb+').write(data)
|
||||
|
||||
-
|
||||
Print HR Employee Salary Details
|
||||
Print Employee Salary Statement through wizard
|
||||
-
|
||||
!python {model: hr.payslip}: |
|
||||
import netsvc, tools, os, time
|
||||
emp_ids = [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')]
|
||||
data_dict = {'model': 'ir.ui.menu', 'form': {'fiscalyear_id': ref('account.data_fiscalyear'), 'employee_ids': emp_ids, 'ids':emp_ids }}
|
||||
(data, format) = netsvc.LocalService('report.employees.salary').create(cr, uid, [], data_dict, {'active_ids': emp_ids})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-employee_salary_detail_report.'+format), 'wb+').write(data)
|
||||
-
|
||||
Print HR Employee Salary Details Annual basis
|
||||
-
|
||||
!python {model: hr.payslip}: |
|
||||
import netsvc, tools, os, time
|
||||
emp_ids = [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')]
|
||||
data_dict = {'model': 'hr.payslip', 'form': {'fiscalyear_id': ref('account.data_fiscalyear'), 'salary_on': 'current_month', 'employee_ids': emp_ids, 'ids':emp_ids}}
|
||||
(data, format) = netsvc.LocalService('report.year.salary').create(cr, uid, [], data_dict,{'active_ids': emp_ids} )
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'hr_payroll-employee_yearly_salary_detail_report.'+format), 'wb+').write(data)
|
||||
import time
|
||||
ctx={}
|
||||
ctx.update({'model': 'hr.employee','active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')]})
|
||||
data_dict = {'employee_ids': [(6,0,[ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')])], 'date_from': time.strftime('%Y-01-01'), 'date_to': time.strftime('%Y-%m-%d')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_hr_payroll_employees_detail',wiz_data=data_dict, context=ctx, our_module='hr_payroll')
|
||||
|
||||
-
|
||||
Print Salary Register through wizard
|
||||
-
|
||||
!python {model: hr.payslip}: |
|
||||
import time
|
||||
ctx={}
|
||||
ctx.update({'model': 'hr.payslip','active_ids': [ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')]})
|
||||
data_dict = {'employee_ids': [(6,0,[ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3'),ref('hr_payroll.hr_employee_bonamy0')])], 'date_from': time.strftime('%Y-01-01'), 'date_to': time.strftime('%Y-%m-%d')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_hr_payroll_year_salary',wiz_data=data_dict, context=ctx, our_module='hr_payroll')
|
||||
|
||||
|
||||
|
||||
@@ -59,10 +59,10 @@ class hr_payroll_employees_detail(osv.osv_memory):
|
||||
if context is None:
|
||||
context = {}
|
||||
datas = {'ids': context.get('active_ids', [])}
|
||||
|
||||
res = self.read(cr, uid, ids, ['employee_ids', 'date_from', 'date_to'], context=context)
|
||||
res = res and res[0] or {}
|
||||
datas['form'] = res
|
||||
datas['ids'] = res.get('employee_ids',[])
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'employees.salary',
|
||||
@@ -71,4 +71,4 @@ class hr_payroll_employees_detail(osv.osv_memory):
|
||||
|
||||
hr_payroll_employees_detail()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -64,6 +64,7 @@ class hr_payroll_year_salary(osv.osv_memory):
|
||||
res = self.read(cr, uid, ids, ['employee_ids', 'date_from', 'date_to', 'salary_on'], context=context)
|
||||
res = res and res[0] or {}
|
||||
datas['form'] = res
|
||||
datas['ids'] = res.get('employee_ids',[])
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'year.salary',
|
||||
@@ -72,4 +73,4 @@ class hr_payroll_year_salary(osv.osv_memory):
|
||||
|
||||
hr_payroll_year_salary()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -64,7 +64,7 @@ class hr_employee(osv.osv):
|
||||
method=True,
|
||||
domain="[('type', '=', 'liquidity')]",
|
||||
view_load=True,
|
||||
help="Select Bank Account from where Salary Expanse will be Paid"),
|
||||
help="Select Bank Account from where Salary Expense will be Paid"),
|
||||
'salary_account':fields.property(
|
||||
'account.account',
|
||||
type='many2one',
|
||||
@@ -73,7 +73,7 @@ class hr_employee(osv.osv):
|
||||
method=True,
|
||||
domain="[('type', '=', 'other')]",
|
||||
view_load=True,
|
||||
help="Expanse account when Salary Expanse will be recorded"),
|
||||
help="Expense account when Salary Expense will be recorded"),
|
||||
'employee_account':fields.property(
|
||||
'account.account',
|
||||
type='many2one',
|
||||
@@ -99,7 +99,7 @@ class payroll_register(osv.osv):
|
||||
_description = 'Payroll Register'
|
||||
|
||||
_columns = {
|
||||
'journal_id': fields.many2one('account.journal', 'Expanse Journal'),
|
||||
'journal_id': fields.many2one('account.journal', 'Expense Journal'),
|
||||
'bank_journal_id': fields.many2one('account.journal', 'Bank Journal'),
|
||||
'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')], help="Keep empty to use the period of the validation(Payslip) date."),
|
||||
}
|
||||
@@ -213,7 +213,7 @@ class hr_payslip(osv.osv):
|
||||
_description = 'Pay Slip'
|
||||
|
||||
_columns = {
|
||||
'journal_id': fields.many2one('account.journal', 'Expanse Journal'),
|
||||
'journal_id': fields.many2one('account.journal', 'Expense Journal'),
|
||||
'bank_journal_id': fields.many2one('account.journal', 'Bank Journal'),
|
||||
'move_ids':fields.one2many('hr.payslip.account.move', 'slip_id', 'Accounting vouchers'),
|
||||
'move_line_ids':fields.many2many('account.move.line', 'payslip_lines_rel', 'slip_id', 'line_id', 'Accounting Lines', readonly=True),
|
||||
@@ -256,6 +256,10 @@ class hr_payslip(osv.osv):
|
||||
period_pool = self.pool.get('account.period')
|
||||
|
||||
for slip in self.browse(cr, uid, ids, context=context):
|
||||
if not slip.bank_journal_id or not slip.journal_id:
|
||||
# Call super method to process sheet if journal_id or bank_journal_id are not specified.
|
||||
super(hr_payslip, self).process_sheet(cr, uid, [slip.id], context=context)
|
||||
continue
|
||||
line_ids = []
|
||||
partner = False
|
||||
partner_id = False
|
||||
@@ -332,7 +336,7 @@ class hr_payslip(osv.osv):
|
||||
name = '[%s]-%s' % (slip.number, line.name)
|
||||
invoice_pool.pay_and_reconcile(cr, uid, invids, amount, acc_id, period_id, journal_id, False, period_id, False, context, name)
|
||||
other_pay -= amount
|
||||
#TODO: link this account entries to the Payment Lines also Expanse Entries to Account Lines
|
||||
#TODO: link this account entries to the Payment Lines also Expense Entries to Account Lines
|
||||
l_ids = movel_pool.search(cr, uid, [('name','=',name)], context=context)
|
||||
line_ids += l_ids
|
||||
|
||||
@@ -411,6 +415,10 @@ class hr_payslip(osv.osv):
|
||||
payslip_pool = self.pool.get('hr.payslip.line')
|
||||
|
||||
for slip in self.browse(cr, uid, ids, context=context):
|
||||
if not slip.journal_id:
|
||||
# Call super method to verify sheet if journal_id is not specified.
|
||||
super(hr_payslip, self).verify_sheet(cr, uid, [slip.id], context=context)
|
||||
continue
|
||||
total_deduct = 0.0
|
||||
|
||||
line_ids = []
|
||||
|
||||
@@ -2,40 +2,6 @@
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="hr_hr_employee_view_form2_inherit_2" model="ir.ui.view">
|
||||
<field name="name">hr.hr.employee.view.form2.inherit_1</field>
|
||||
<field name="model">hr.employee</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="hr_contract.hr_hr_employee_view_form2"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/notebook/page[@string='Salary Structure']" position="after">
|
||||
<page string="Accounting">
|
||||
<field name="property_bank_account" required="1"/>
|
||||
<field name="salary_account" required="1"/>
|
||||
<field name="employee_account" required="1"/>
|
||||
<field name="analytic_account"/>
|
||||
<field name="slip_ids" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="hr_hr_employee_view_form2_inherit_1" model="ir.ui.view">
|
||||
<field name="name">hr.hr.employee.view.form2.inherit</field>
|
||||
<field name="model">hr.employee</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="hr_contract.hr_hr_employee_view_form2"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/notebook/page[@string='Salary Structure']/field[@name='line_ids']/tree/field[@name='amount']" position="after">
|
||||
<field name="account_id"/>
|
||||
<field name="analytic_account_id"/>
|
||||
</xpath>
|
||||
<xpath expr="/form/notebook/page[@string='Salary Structure']/field[@name='line_ids']/form/group/field[@name='code']" position="after">
|
||||
<field name="account_id"/>
|
||||
<field name="analytic_account_id"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_holiday_status_inherit_form1">
|
||||
<field name="name">hr.holidays.status.inherit1</field>
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<field name="view_id" ref="crm_case_tree_view_job"/>
|
||||
<field name="context">{"search_default_user_id":uid, 'search_default_current': 1,"search_default_department_id": department_id}</field>
|
||||
<field name="search_view_id" ref="view_crm_case_jobs_filter"/>
|
||||
<field name="help">From this menu you can track applicants in the recruitment process and manage all operations: meetings, interviews, phone calls, etc. If you setup the email gateway, applicants and their attached CV are created automatically when an email is sent to jobs@yourcompany.com. If you install the document management modules, all documents (CV and motivation letters) are indexed automatically, so that you can easily search through their content.</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window.view" id="action_hr_sec_tree_view_act_job">
|
||||
|
||||
@@ -23,11 +23,12 @@
|
||||
# Stage
|
||||
# ------------------------------------------------------
|
||||
<record id="hr_job_stage_act" model="ir.actions.act_window">
|
||||
<field name="name">Applicant Stages</field>
|
||||
<field name="name">Recruitment / Applicants Stages</field>
|
||||
<field name="res_model">hr.recruitment.stage</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="domain">[]</field>
|
||||
<field name="context">{}</field>
|
||||
<field name="help">Define here your stages of the recruitment process, for example: qualification call, first interview, second interview, refused, hired.</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
<xsl:template name="story">
|
||||
<spacer length="1cm" />
|
||||
<para style="title" t="1">Timesheet</para>
|
||||
<para style="title" t="1">Timesheet by Employee</para>
|
||||
<spacer length="1cm" />
|
||||
<para style="employee"><xsl:value-of select="/report/employee" /></para>
|
||||
<spacer length="1cm" />
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_hr_analytic_timesheet","hr.analytic.timesheet","model_hr_analytic_timesheet","base.group_hr_user",1,1,1,1
|
||||
"access_hr_account_analytic_line","account.account.analytic.line","account.model_account_analytic_line","base.group_hr_user",1,1,1,1
|
||||
"access_hr_account_analytic_line_employee","account.account.analytic.line employee","account.model_account_analytic_line","base.group_user",1,0,0,0
|
||||
"access_account_analytic_journal","account.account.analytic.journal","account.model_account_analytic_journal","base.group_hr_user",1,1,1,1
|
||||
"access_product_product_user","product.product user","product.model_product_product","base.group_hr_user",1,1,1,1
|
||||
"access_product_template_hr_timesheet","product.template.hr.timesheet","product.model_product_template","base.group_hr_user",1,1,1,1
|
||||
|
||||
|
@@ -1,23 +1,21 @@
|
||||
-
|
||||
In order to test the PDF reports defined on Employee, we will print Timesheet of a User
|
||||
Print the HR Timesheet By Employee report through the wizard
|
||||
-
|
||||
!python {model: hr.employee}: |
|
||||
import netsvc, tools, os, time
|
||||
month = time.gmtime()[1]
|
||||
year = time.gmtime()[0]
|
||||
data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'employee_id' : ref('hr.employee1') }}
|
||||
(data, format) = netsvc.LocalService('report.hr.analytical.timesheet').create(cr, uid, [], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet-user_report.'+format), 'wb+').write(data)
|
||||
ctx={}
|
||||
ctx.update({'model': 'hr.employee','active_ids': []})
|
||||
data_dict = {'month': time.gmtime()[1], 'year': time.gmtime()[0], 'employee_id' : ref('hr.employee1')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_hr_timesheet_my',wiz_data=data_dict, context=ctx, our_module='hr_timesheet')
|
||||
|
||||
-
|
||||
In order to test the PDF reports defined on Employee, we will print Timesheet of Users
|
||||
Print the HR Timesheet By Employee report through the wizard
|
||||
-
|
||||
!python {model: hr.employee}: |
|
||||
import netsvc, tools, os, time
|
||||
month = time.gmtime()[1]
|
||||
year = time.gmtime()[0]
|
||||
data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'employee_ids' : [ref('hr.employee1')] }}
|
||||
(data, format) = netsvc.LocalService('report.hr.analytical.timesheet_users').create(cr, uid, [], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet-users_report.'+format), 'wb+').write(data)
|
||||
ctx={}
|
||||
ctx.update({'model': 'hr.employee','active_ids': []})
|
||||
data_dict = {'month': time.gmtime()[1], 'year': time.gmtime()[0], 'employee_ids' : [(6,0,[ref('hr.employee1'),ref('hr.employee2'),ref('hr.employee3')])]}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_hr_timesheet_users',wiz_data=data_dict, context=ctx, our_module='hr_timesheet')
|
||||
@@ -26,7 +26,7 @@
|
||||
<form string="Sign In/Out By Project">
|
||||
<group colspan="4" >
|
||||
<separator string="Sign in" colspan="4"/>
|
||||
<field name="name" readonly="True" />
|
||||
<field name="name" readonly="True" />
|
||||
<field name="state" readonly="True" />
|
||||
<field name="server_date"/>
|
||||
<label string="(local time on the server side)" colspan="2"/>
|
||||
@@ -64,7 +64,7 @@
|
||||
<field name="date_start"/>
|
||||
<field name="server_date"/>
|
||||
<separator string="Work done in the last period" colspan="4" />
|
||||
<field name="account_id" colspan="2" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="account_id" colspan="2"/>
|
||||
<field name="info" colspan="2"/>
|
||||
<field name="date"/>
|
||||
<label string="(Keep empty for current_time)" colspan="2"/>
|
||||
|
||||
@@ -84,13 +84,12 @@
|
||||
<field name="type">search</field>
|
||||
<field name="inherit_id" ref="account.view_account_analytic_line_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<filter name="others" position="after">
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date" position="before">
|
||||
<filter name="to_invoice" string="To Invoice" context="{'to_invoice': 1}" domain="[('invoice_id','=',False),('to_invoice','<>',False)]" icon="terp-dolar"/>
|
||||
</filter>
|
||||
<separator orientation="vertical"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_account_analytic_line_tree_inherit" model="ir.ui.view">
|
||||
<field name="name">account.analytic.line.tree.to_invoice</field>
|
||||
|
||||
@@ -217,91 +217,3 @@ class report_timesheet_invoice(osv.osv):
|
||||
""")
|
||||
report_timesheet_invoice()
|
||||
|
||||
class report_random_timsheet(osv.osv):
|
||||
_name = "report.random.timesheet"
|
||||
_description = "Random Timesheet Report"
|
||||
_auto = False
|
||||
|
||||
_columns = {
|
||||
'analytic_account_id': fields.many2one('account.analytic.account','Analytic Account', readonly=True),
|
||||
'name': fields.char('Description', size=64, readonly=True),
|
||||
'quantity': fields.float('Quantity', readonly=True),
|
||||
'date': fields.date('Date', readonly=True),
|
||||
'user_id': fields.many2one('res.users', 'User', readonly=True)
|
||||
}
|
||||
_order = "date desc"
|
||||
|
||||
def __init__(self, pool, cr):
|
||||
super(report_random_timsheet, self).__init__(pool, cr)
|
||||
self.called = False
|
||||
|
||||
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
|
||||
""" To call the init() method timely
|
||||
"""
|
||||
if not self.called:
|
||||
self.init(cr, user)
|
||||
self.called = True # To make sure that init doesn't get called multiple times
|
||||
|
||||
res = super(report_random_timsheet, self).fields_view_get(cr, user, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
|
||||
return res
|
||||
|
||||
def init(self, cr, uid=1):
|
||||
drop_view_if_exists(cr, 'report_random_timesheet')
|
||||
|
||||
cr.execute("""create or replace view report_random_timesheet as (
|
||||
|
||||
select
|
||||
line.id as id, line.account_id as analytic_account_id, line.name as name,
|
||||
line.unit_amount as quantity, line.date as date, line.user_id as user_id
|
||||
from
|
||||
account_analytic_line line, hr_department dept,hr_employee dept_user
|
||||
where
|
||||
(dept.id = dept_user.department_id AND dept_user.id=line.user_id AND line.user_id is not null)
|
||||
AND (dept.manager_id = """ + str(uid) + """ )
|
||||
AND (line.date <= CURRENT_DATE AND line.date > (CURRENT_DATE-3))
|
||||
LIMIT 10
|
||||
)
|
||||
""" )
|
||||
|
||||
report_random_timsheet()
|
||||
|
||||
class random_timesheet_lines(osv.osv):
|
||||
_name = "random.timesheet.lines"
|
||||
_description = "Random Timesheet Lines"
|
||||
_auto = False
|
||||
|
||||
_columns = {
|
||||
'date': fields.date('Date', readonly=True),
|
||||
'name': fields.char('Description', size=64, readonly=True),
|
||||
'user_id': fields.many2one('res.users', 'User', readonly=True),
|
||||
'quantity': fields.float('Quantity', readonly=True),
|
||||
'product_id': fields.many2one('product.product', 'Product', readonly=True),
|
||||
'analytic_account_id': fields.many2one('account.analytic.account','Analytic Account', readonly=True),
|
||||
'uom_id': fields.many2one('product.uom', 'UoM', readonly=True),
|
||||
'amount': fields.float('Amount', readonly=True),
|
||||
'to_invoice': fields.many2one('hr_timesheet_invoice.factor', 'Invoicing', readonly=True),
|
||||
'general_account_id': fields.many2one('account.account', 'General Account', readonly=True)
|
||||
}
|
||||
|
||||
_order = "date desc"
|
||||
|
||||
def init(self, cr):
|
||||
drop_view_if_exists(cr, 'random_timesheet_lines')
|
||||
|
||||
cr.execute("""create or replace view random_timesheet_lines as (
|
||||
select
|
||||
line.id as id, line.date as date, line.name as name, line.unit_amount as quantity,
|
||||
line.product_id as product_id, line.account_id as analytic_account_id,
|
||||
line.product_uom_id as uom_id, line.amount as amount, line.to_invoice as to_invoice,
|
||||
line.general_account_id as general_account_id, line.user_id as user_id
|
||||
from
|
||||
account_analytic_line line
|
||||
where
|
||||
(line.date <= CURRENT_DATE AND line.date > (CURRENT_DATE-15))
|
||||
)
|
||||
""" )
|
||||
|
||||
random_timesheet_lines()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -425,85 +425,5 @@
|
||||
src_model="res.users"/>
|
||||
|
||||
|
||||
<!-- Random Timesheet -->
|
||||
|
||||
<record model="ir.ui.view" id="view_random_timesheet_tree">
|
||||
<field name="name">report.random.timesheet.tree</field>
|
||||
<field name="model">report.random.timesheet</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Random Timesheets">
|
||||
<field name="analytic_account_id" select="1" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="quantity" select="2" />
|
||||
<field name="date" select="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_random_timesheet_board">
|
||||
<field name="name">Random Timesheet</field>
|
||||
<field name="res_model">report.random.timesheet</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_random_timesheet_tree"/>
|
||||
</record>
|
||||
|
||||
<!-- Random Timesheet Lines of random activities -->
|
||||
|
||||
<record id="view_random_timesheet_lines_search" model="ir.ui.view">
|
||||
<field name="name">random.timesheet.lines.search</field>
|
||||
<field name="model">random.timesheet.lines</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Timesheet Lines">
|
||||
<group col='15' colspan='4'>
|
||||
<filter icon="terp-check" string="Current" domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="user_id" widget="selection"/>
|
||||
<field name="product_id" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Analytic Account" icon="terp-folder-violet" domain="[]" context="{'group_by':'analytic_account_id'}"/>
|
||||
<filter string="General Account" icon="terp-folder-orange" domain="[]" context="{'group_by':'general_account_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_random_timesheet_lines_tree">
|
||||
<field name="name">random.timesheet.lines.tree</field>
|
||||
<field name="model">random.timesheet.lines</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Random Timesheets Lines">
|
||||
<field name="date" select="1"/>
|
||||
<field name="user_id"/>
|
||||
<field name="name" select="1"/>
|
||||
<field name="quantity" />
|
||||
<field name="product_id" select="1"/>
|
||||
<field name="analytic_account_id" select="1" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="uom_id" />
|
||||
<field name="amount" />
|
||||
<field name="to_invoice" select="1"/>
|
||||
<field name="general_account_id" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_random_timesheet_lines_board">
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="name">Working Hours</field>
|
||||
<field name="res_model">random.timesheet.lines</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{'search_default_user_id':uid }</field>
|
||||
<field name="view_id" ref="view_random_timesheet_lines_tree"/>
|
||||
<field name="search_view_id" ref="view_random_timesheet_lines_search"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
"access_report_timesheet_account","report_timesheet.account","model_report_timesheet_account","base.group_hr_manager",1,1,1,1
|
||||
"access_report_timesheet_account_date","report_timesheet.account.date","model_report_timesheet_account_date","base.group_hr_manager",1,1,1,1
|
||||
"access_report_timesheet_invoice","report_timesheet.invoice","model_report_timesheet_invoice","base.group_hr_manager",1,1,1,1
|
||||
"access_report_random_timesheet","report_random_timesheet","model_report_random_timesheet","base.group_hr_manager",1,1,1,1
|
||||
"access_report_random_timesheet_lines","random_timesheet_lines","model_random_timesheet_lines","base.group_hr_manager",1,1,1,1
|
||||
"access_report_analytic_account_close_manager","report.analytic.account.close.manager","model_report_analytic_account_close","base.group_hr_manager",1,1,1,1
|
||||
"access_report_account_analytic_line_to_invoice_manager","report.account.analytic.line.to.invoice.manager","model_report_account_analytic_line_to_invoice","base.group_hr_manager",1,1,1,1
|
||||
"access_account_invoice_hr_user","account.invoice.hr.user","account.model_account_invoice","base.group_hr_user",1,1,1,1
|
||||
|
||||
|
@@ -7,14 +7,14 @@
|
||||
(data, format) = netsvc.LocalService('report.account.analytic.profit').create(cr, uid, [], data_dict, {})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet_invoice-account_analytic_profit_report.'+format), 'wb+').write(data)
|
||||
|
||||
-
|
||||
In order to test the PDF reports defined on HR Cost Ledger, we will print report of HR Cost Ledger
|
||||
Print the HR Cost Ledger report through the wizard
|
||||
-
|
||||
!python {model: account.analytic.account}: |
|
||||
import netsvc, tools, os, time
|
||||
ctx={}
|
||||
acc_ids = [ref('account.analytic_absences'),ref('account.analytic_internal'),ref('account.analytic_sednacom'),ref('account.analytic_thymbra'),ref('account.analytic_partners_camp_to_camp')]
|
||||
data_dict = {'model': 'ir.ui.menu', 'form': {'date1': time.strftime('%Y-01-01'), 'date2': time.strftime('%Y-%m-%d')}}
|
||||
(data, format) = netsvc.LocalService('report.hr.timesheet.invoice.account.analytic.account.cost_ledger').create(cr, uid, acc_ids, data_dict, {'active_ids': acc_ids})
|
||||
if tools.config['test_report_directory']:
|
||||
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet_invoice-cost_ledger_report.'+format), 'wb+').write(data)
|
||||
ctx.update({'model': 'ir.ui.menu','active_ids': acc_ids})
|
||||
data_dict = {'date1': time.strftime('%Y-01-01'), 'date2': time.strftime('%Y-%m-%d')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_hr_timesheet_invoice_cost_ledger',wiz_data=data_dict, context=ctx, our_module='hr_timesheet_invoice')
|
||||
|
||||
@@ -237,27 +237,23 @@ class hr_timesheet_sheet(osv.osv):
|
||||
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_to,}, context=context)
|
||||
return True
|
||||
|
||||
def sign_in(self, cr, uid, ids, context=None):
|
||||
def sign(self, cr, uid, ids, typ, context=None):
|
||||
emp_obj = self.pool.get('hr.employee')
|
||||
sheet = self.browse(cr, uid, ids, context=context)[0]
|
||||
if context is None:
|
||||
context = {}
|
||||
if not self.browse(cr, uid, ids, context=context)[0].date_current == time.strftime('%Y-%m-%d'):
|
||||
if not sheet.date_current == time.strftime('%Y-%m-%d'):
|
||||
raise osv.except_osv(_('Error !'), _('You can not sign in from an other date than today'))
|
||||
emp_ids = emp_obj.search(cr, uid, [('user_id', '=', uid)], context=context)
|
||||
emp_id = sheet.employee_id.id
|
||||
context['sheet_id']=ids[0]
|
||||
emp_obj.attendance_action_change(cr, uid, emp_ids, type='sign_in', context=context,)
|
||||
emp_obj.attendance_action_change(cr, uid, [emp_id], type=typ, context=context,)
|
||||
return True
|
||||
|
||||
def sign_in(self, cr, uid, ids, context=None):
|
||||
return self.sign(cr,uid,ids,'sign_in',context=None)
|
||||
|
||||
def sign_out(self, cr, uid, ids, context=None):
|
||||
emp_obj = self.pool.get('hr.employee')
|
||||
if context is None:
|
||||
context = {}
|
||||
if not self.browse(cr, uid, ids, context=context)[0].date_current == time.strftime('%Y-%m-%d'):
|
||||
raise osv.except_osv(_('Error !'), _('You can not sign out from an other date than today'))
|
||||
emp_ids = emp_obj.search(cr, uid, [('user_id', '=', uid)])
|
||||
context['sheet_id']=ids[0]
|
||||
emp_obj.attendance_action_change(cr, uid, emp_ids, type='sign_out', context=context,)
|
||||
return True
|
||||
return self.sign(cr,uid,ids,'sign_out',context=None)
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Description', size=64, select=1,
|
||||
|
||||
@@ -178,7 +178,7 @@
|
||||
</record>
|
||||
|
||||
<menuitem action="act_hr_timesheet_sheet_form" id="menu_act_hr_timesheet_sheet_form" parent="hr_attendance.menu_hr_time_tracking"
|
||||
sequence="2"/>
|
||||
sequence="2" groups="base.group_hr_user,base.group_hr_manager"/>
|
||||
|
||||
<!--
|
||||
Company inheritancy
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_hr_timesheet_sheet_sheet_user","hr_timesheet_sheet.sheet.user","model_hr_timesheet_sheet_sheet","base.group_hr_user",1,1,1,1
|
||||
"access_hr_timesheet_sheet_sheet_system_user","hr_timesheet_sheet.sheet.system.user","model_hr_timesheet_sheet_sheet","base.group_user",1,0,0,0
|
||||
"access_hr_timesheet_sheet_sheet_user","hr_timesheet_sheet.sheet.user","model_hr_timesheet_sheet_sheet","base.group_user",1,1,1,1
|
||||
"access_hr_timesheet_sheet_sheet_system_employee","hr_timesheet_sheet.sheet.system.employee","model_hr_timesheet_sheet_sheet","base.group_user",1,0,0,0
|
||||
"access_hr_timesheet_sheet_sheet_day","hr_timesheet_sheet.sheet.day","model_hr_timesheet_sheet_sheet_day","base.group_hr_user",1,1,1,1
|
||||
"access_hr_timesheet_sheet_sheet_account","hr_timesheet_sheet.sheet.account","model_hr_timesheet_sheet_sheet_account","base.group_hr_user",1,1,1,1
|
||||
"access_hr_timesheet_report","hr.timesheet.report","model_hr_timesheet_report","base.group_hr_manager",1,1,1,1
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user