[MERGE]: Merge with lp:openobject-addons

bzr revid: rpa@tinyerp.com-20100419091626-vovtoh7uqka2e4iy
This commit is contained in:
rpa (Open ERP) 2010-04-19 14:46:26 +05:30
commit ad93fc9bd9
4085 changed files with 14294 additions and 13639 deletions

View File

@ -54,8 +54,20 @@ module named account_voucherss
'wizard/account_move_line_reconcile_select_view.xml',
'wizard/account_move_journal_view.xml',
'account_wizard.xml',
'wizard/account_open_closed_fiscalyear_view.xml',
'wizard/account_move_line_unreconcile_select_view.xml',
'wizard/account_vat_view.xml',
'wizard/account_print_journal_view.xml',
'wizard/account_general_journal_view.xml',
'wizard/account_central_journal_view.xml',
'wizard/account_subscription_generate_view.xml',
'wizard/account_fiscalyear_close_view.xml',
'wizard/account_state_open_view.xml',
'wizard/account_journal_select_view.xml',
'wizard/account_change_currency_view.xml',
'wizard/account_validate_move_view.xml',
'wizard/account_statement_from_invoice_view.xml',
'wizard/account_pay_invoice_view.xml',
'project/wizard/project_account_analytic_line_view.xml',
'account_view.xml',
'account_end_fy.xml',

View File

@ -27,6 +27,26 @@ from tools.misc import currency
from tools.translate import _
class account_bank_statement(osv.osv):
def button_import_invoice(self, cr, uid, ids, context=None):
mod_obj = self.pool.get('ir.model.data')
if context is None:
context = {}
model_data_ids = mod_obj.search(cr,uid,[('model','=','ir.ui.view'),('name','=','view_account_statement_from_invoice')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
context.update({'statement_id': ids[0]})
return {
'name': _('Import Invoice'),
'context': context,
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'account.statement.from.invoice',
'views': [(resource_id,'form')],
'type': 'ir.actions.act_window',
'target': 'new',
'nodestroy': True
}
def _default_journal_id(self, cr, uid, context={}):
if context.get('journal_id', False):
return context['journal_id']
@ -352,7 +372,16 @@ class account_bank_statement(osv.osv):
raise osv.except_osv(_('Invalid action !'), _('Cannot delete bank statement which are already confirmed !'))
osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
return True
def copy(self, cr, uid, id, default=None, context=None):
if default is None:
default = {}
if context is None:
context = {}
default = default.copy()
default['move_line_ids'] = []
return super(account_bank_statement, self).copy(cr, uid, id, default, context)
account_bank_statement()

View File

@ -54,13 +54,13 @@
<page string="Line">
<field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, {'company_id': parent.company_id})"/>
<field name="uos_id"/>
<field name="quantity" select="1"/>
<field name="price_unit" select="1"/>
<field name="quantity"/>
<field name="price_unit"/>
<field name="discount"/>
<field colspan="4" name="name" select="1"/>
<field colspan="4" name="origin" select="1"/>
<field colspan="4" name="name"/>
<field colspan="4" name="origin" groups="base.group_extended"/>
<field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]" name="account_id" on_change="onchange_account_id(parent.fiscal_position,account_id)" groups="base.group_user"/>
<field domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id)]" name="account_analytic_id" groups="base.group_user"/>
<field domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id)]" name="account_analytic_id" groups="base.group_user,base.group_extended"/>
<newline/>
<field name="price_subtotal"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
@ -94,11 +94,11 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Manual Invoice Taxes">
<field name="name" select="1"/>
<field name="name"/>
<field name="sequence"/>
<field name="account_id" select="1" groups="base.group_user"/>
<field name="manual" select="1"/>
<field name="amount" select="1"/>
<field name="account_id" groups="base.group_user"/>
<field name="manual"/>
<field name="amount"/>
<field name="base" readonly="0"/>
<separator colspan="4" string="Tax codes"/>
<field name="base_code_id"/>
@ -115,7 +115,7 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree colors="blue:state in ('draft');black:state not in ('draft')" string="Invoice">
<field name="date_invoice" select="1"/>
<field name="date_invoice"/>
<field name="number"/>
<field name="partner_id" groups="base.group_user"/>
<field name="name"/>
@ -142,14 +142,16 @@
<field name="arch" type="xml">
<form string="Supplier invoice">
<group col="6" colspan="4">
<field domain="[('type', '=', 'purchase')]" name="journal_id" select="2"/>
<field name="type" readonly="1" select="2"/>
<field name="number" select="1" readonly="1"/>
<field name="partner_id" domain="[('supplier','=', 1)]" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank,company_id)" select="1" context="{'default_customer': 0}"/>
<field domain="[('type', '=', 'purchase')]" name="journal_id"/>
<field name="number" readonly="1"/>
<field name="type" invisible="1"/>
<field name="currency_id" domain="[('company_id','=', company_id)]" on_change="onchange_currency_id(currency_id, company_id)"/>
<newline/>
<field name="partner_id" domain="[('supplier','=', 1)]" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank,company_id)" context="{'default_customer': 0}"/>
<field domain="[('partner_id','=',partner_id)]" name="address_invoice_id"/>
<field name="currency_id" domain="[('company_id','=', company_id)]" on_change="onchange_currency_id(currency_id, company_id)" select="2"/>
<field name="date_invoice" select="1"/>
<field name="fiscal_position" groups="base.group_extended" widget="selection"/>
<newline/>
<field name="date_invoice"/>
<field name="period_id" groups="base.group_user"/>
<group colspan="2" col="1" groups="base.group_user">
<label align="0.0" string="(keep empty to use the current period)"/>
@ -158,9 +160,9 @@
<notebook colspan="4">
<page string="Invoice">
<field domain="[('type','&lt;&gt;','view'), ('company_id', '=', company_id),('journal_id','=',journal_id)]" name="account_id" groups="base.group_user"/>
<field name="reference_type" nolabel="1" select="2" size="0"/>
<field name="reference" nolabel="1" select="1"/>
<field name="date_due" select="1"/>
<field name="reference_type" nolabel="1" size="0"/>
<field name="reference" nolabel="1"/>
<field name="date_due"/>
<field name="check_total" required="2"/>
<field colspan="4" default_get="{'check_total': check_total, 'invoice_line': invoice_line, 'address_invoice_id': address_invoice_id, 'partner_id': partner_id, 'price_type': 'price_type' in dir() and price_type or False}" name="invoice_line" nolabel="1">
<tree string="Invoice lines">
@ -195,32 +197,31 @@
<field name="amount_tax"/>
<field name="reconciled"/>
<field name="amount_total"/>
<field name="state" select="2"/>
<field name="state"/>
<field name="residual"/>
<group col="3" colspan="4">
<button name="invoice_open" states="draft,proforma2" string="Validate" icon="gtk-apply"/>
<button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel"/>
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="gtk-convert"/>
<button name='%(wizard_paid_open)d' type='action' string='Re-Open' states='paid' icon="gtk-convert"/>
<button name="%(action_account_state_open)d" type='action' string='Re-Open' states='paid' icon="gtk-convert"/>
</group>
</group>
</page>
<page string="Other Info">
<field domain="[('partner_id', '=', partner_id)]" name="partner_bank" on_change="onchange_partner_bank(partner_bank)" select="2"/>
<field domain="[('partner_id', '=', partner_id)]" name="partner_bank" on_change="onchange_partner_bank(partner_bank)"/>
<field name="company_id" on_change="onchange_company_id(company_id,partner_id,type,invoice_line,currency_id)" widget="selection" groups="base.group_multi_company"/>
<field name="fiscal_position" groups="base.group_extended" widget="selection"/>
<newline/>
<field name="payment_term" widget="selection"/>
<field name="name" select="2"/>
<field name="name"/>
<newline/>
<field name="origin" select="2"/>
<field colspan="4" domain="[('partner_id','=',partner_id)]" name="address_contact_id"/>
<field name="origin" groups="base.group_extended"/>
<field colspan="4" domain="[('partner_id','=',partner_id)]" name="address_contact_id" groups="base.group_extended"/>
<field name="move_id"/>
<separator colspan="4" string="Additional Information"/>
<field colspan="4" name="comment" nolabel="1"/>
</page>
<page string="Payments">
<page string="Payments" groups="base.group_extended">
<field name="payment_ids" colspan="4" nolabel="1" >
<tree string="Payments">
<field name="date"/>
@ -247,13 +248,17 @@
<field name="arch" type="xml">
<form string="Invoice">
<group colspan="4" col="6">
<field name="journal_id" select="2" groups="base.group_user"/>
<field name="type" readonly="1" select="2"/>
<field name="number" select="1"/>
<field name="partner_id" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank,company_id)" select="1" groups="base.group_user"/>
<field name="journal_id" groups="base.group_user"/>
<field name="number"/>
<field name="type" invisible="1"/>
<field name="currency_id" domain="[('company_id','=', company_id)]" on_change="onchange_currency_id(currency_id, company_id)"/>
<newline/>
<field name="partner_id" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank,company_id)" groups="base.group_user"/>
<field domain="[('partner_id','=',partner_id)]" name="address_invoice_id"/>
<field name="currency_id" domain="[('company_id','=', company_id)]" on_change="onchange_currency_id(currency_id, company_id)" select="2"/>
<field name="date_invoice" select="1"/>
<field name="fiscal_position" groups="base.group_extended" widget="selection"/>
<newline/>
<field name="date_invoice"/>
<field name="period_id" groups="base.group_user"/>
<group colspan="2" col="1" groups="base.group_user">
<label align="0.0" string="(keep empty to use the current period)"/>
@ -262,7 +267,7 @@
<notebook colspan="4">
<page string="Invoice">
<field domain="[('type','&lt;&gt;','view'), ('company_id', '=', company_id),('journal_id','=',journal_id)]" name="account_id" groups="base.group_user"/>
<field name="name" select="2"/>
<field name="name"/>
<field name="payment_term" widget="selection"/>
<field colspan="4" name="invoice_line" nolabel="1" widget="one2many_list"/>
<group col="1" colspan="2">
@ -283,27 +288,28 @@
<field name="amount_tax"/>
<field name="reconciled"/>
<field name="amount_total"/>
<field name="state" select="2"/>
<field name="state"/>
<field name="residual"/>
<group col="3" colspan="4" groups="base.group_user">
<button name="invoice_proforma2" states="draft" string="PRO-FORMA" icon="gtk-print"/>
<button name="invoice_open" states="draft,proforma2" string="Create" icon="gtk-execute"/>
<button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel"/>
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="gtk-convert"/>
<button name='%(wizard_paid_open)d' type='action' string='Re-Open' states='paid' icon="gtk-convert"/>
<button name='%(action_account_state_open)d' type='action' string='Re-Open' states='paid' icon="gtk-convert"/>
</group>
</group>
</page>
<page string="Other Info">
<field name="company_id" on_change="onchange_company_id(company_id,partner_id,type,invoice_line,currency_id)" widget="selection" groups="base.group_multi_company"/>
<field name="fiscal_position" groups="base.group_extended,base.group_user" widget="selection"/>
<newline/>
<field name="date_due"/>
<field name="user_id"/>
<newline/>
<field domain="[('partner_id.ref_companies', 'in', [company_id])]" name="partner_bank" select="2"/>
<field name="origin" select="2"/>
<field colspan="4" domain="[('partner_id','=',partner_id)]" name="address_contact_id"/>
<field domain="[('partner_id.ref_companies', 'in', [company_id])]" name="partner_bank"
groups="base.group_extended"/>
<field name="origin"/>
<field colspan="4" domain="[('partner_id','=',partner_id)]" name="address_contact_id"
groups="base.group_extended"/>
<field name="move_id" groups="base.group_user"/>
<separator colspan="4" string="Additionnal Information"/>
<field colspan="4" name="comment" nolabel="1"/>
@ -340,9 +346,7 @@
<separator orientation="vertical"/>
<field name="number"/>
<field name="partner_id"/>
<field name="user_id">
<filter string="My Invoices" icon="terp-account" domain="[('user_id','=',uid)]"/>
</field>
<field name="user_id" default="uid"/>
<field name="origin"/>
<field name="amount_total"/>
</group>

View File

@ -24,25 +24,33 @@
<report id="account_move_line_list" model="account.tax.code" name="account.tax.code.entries" rml="account/report/account_tax_code.rml" string="All Entries"/>
<report auto="False" id="account_vat_declaration" menu="False" model="account.tax.code" name="account.vat.declaration" rml="account/report/tax_report.rml" string="Taxes Report"/>
<report
auto="False"
id="account_vat_declaration"
menu="False"
model="account.tax.code"
name="account.vat.declaration"
rml="account/report/tax_report.rml"
string="Taxes Report"/>
<menuitem
id="menu_tax_report"
name="Taxes"
parent="account.menu_finance_generic_reporting" sequence="3"/>
<wizard
<!-- <wizard
id="wizard_vat_declaration"
menu="False"
model="account.tax.code"
name="account.vat.declaration"
string="Print Taxes Report"/>
<menuitem
string="Print Taxes Report"/> -->
<!-- <menuitem
icon="STOCK_PRINT"
action="wizard_vat_declaration"
id="menu_wizard_vat_declaration"
parent="menu_tax_report"
type="wizard"/>
type="wizard"/> -->
<record id="action_tax_code_tree" model="ir.actions.act_window">
@ -66,6 +74,7 @@
rml="account/report/compare_account_balance.rml"
auto="False"
menu="False"/>
<report id="account_account_balance_landscape"
string="Account balance"
model="account.account"

View File

@ -17,7 +17,7 @@
<field name="date_start"/>
<field name="date_stop"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="end_journal_period_id"/>
<field name="end_journal_period_id" groups="base.group_extended"/>
<separator colspan="4" string="Periods"/>
<field colspan="4" name="period_ids" nolabel="1" widget="one2many_list">
<form string="Period">
@ -122,16 +122,16 @@
<field name="name" select="1" colspan="4"/>
<field name="code" select="1"/>
<field name="parent_id"/>
<field name="company_id" select="2" widget="selection" groups="base.group_multi_company"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="user_type" select="1"/>
</group>
<notebook colspan="4">
<page string="General Information">
<newline/>
<field name="currency_id" select="2"/>
<field name="currency_mode" select="2"/>
<field name="currency_id"/>
<field name="currency_mode"/>
<field name="reconcile"/>
<field name="active" select="2"/>
<field name="active"/>
<field name="check_history"/>
<field name="type" select="1"/>
<newline/>
@ -338,10 +338,11 @@
<field name="date" select="1"/>
<field name="journal_id" on_change="onchange_journal_id(journal_id)" select="1"/>
<field name="currency"/>
<field name="period_id" select="2"/>
<field name="period_id"/>
<group colspan="2" col="3">
<button name="%(wizard_populate_statement_from_inv)d"
string="Import Invoice" type="action" attrs="{'invisible':[('state','=','confirm')]}" icon="gtk-open"/>
<!-- <button name="%(action_view_account_statement_from_invoice)d"-->
<!-- string="Import Invoice" type="action" attrs="{'invisible':[('state','=','confirm')]}" icon="gtk-open"/>-->
<button name="button_import_invoice" string="Import Invoice" attrs="{'invisible':[('state','=','confirm')]}" type="object" icon="gtk-apply"/>
</group>
<newline/>
<field name="balance_start"/>
@ -381,7 +382,7 @@
</page>
</notebook>
<group col="7" colspan="4">
<field name="state" select="2"/>
<field name="state"/>
<field name="balance_end"/>
<button name="button_dummy" states="draft" string="Compute" icon="gtk-execute"/>
<button name="button_confirm" states="draft" string="Confirm" type="object" icon="gtk-apply"/>
@ -598,14 +599,14 @@
<field name="name" select="1"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="description" select="1"/>
<field name="active" select="2"/>
<field name="active"/>
<field name="tax_group" select="1"/>
<field name="type"/>
</group>
<notebook colspan="4">
<page string="Tax Definition">
<field name="applicable_type"/>
<field name="amount" select="2" attrs="{'readonly':[('type','=','none'),('type','=','code')]}"/>
<field name="amount" attrs="{'readonly':[('type','=','none'),('type','=','code')]}"/>
<field groups="base.group_extended" name="include_base_amount"/>
<field groups="base.group_extended" name="domain"/>
<newline/>
@ -652,23 +653,7 @@
</record>
<menuitem action="action_tax_form" id="menu_action_tax_form" parent="next_id_27"/>
<!--
Entries Journal lines
-->
<wizard id="action_move_journal_line_form_select" menu="False" model="account.move.line" name="account.move.journal.select" string="Standard entry"/>
<record id="ir_open_journal_period" model="ir.values">
<field name="key2">tree_but_open</field>
<field name="model">account.journal.period</field>
<field name="name">Open Journal</field>
<field eval="'ir.actions.wizard,%d'%action_move_journal_line_form_select" name="value"/>
<field eval="True" name="object"/>
</record>
<!-- <wizard id="action_move_journal_line_form" menu="False" model="account.move.line" name="account.move.journal" string="Entries by Line"/>
<!-- <wizard id="action_move_journal_line_form" menu="False" model="account.move.line" name="account.move.journal" string="Entries by Line"/>
<menuitem icon="STOCK_JUSTIFY_FILL" action="action_move_journal_line_form" id="menu_action_move_journal_line_form" parent="account.menu_finance_entries" type="wizard" sequence="5"/>
-->
<!--
@ -716,23 +701,23 @@
<separator colspan="4" string="General Information"/>
<field name="name" select="1"/>
<field name="date" select="1"/>
<field name="ref" select="2"/>
<field name="invoice" select="2"/>
<field name="ref"/>
<field name="invoice"/>
<field name="account_id" select="1" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<field name="partner_id" select="1" on_change="onchange_partner_id(False,partner_id,account_id,debit,credit,date)"/>
<field name="debit" select="2"/>
<field name="credit" select="2"/>
<field name="debit"/>
<field name="credit"/>
<field name="company_id" required="1" groups="base.group_multi_company"/>
<separator colspan="4" string="Optional Information"/>
<field name="currency_id"/>
<field name="amount_currency"/>
<field name="quantity" select="2"/>
<field name="quantity"/>
<field name="move_id" required="False"/>
<newline/>
<field name="statement_id" select="2"/>
<field name="blocked" select="2"/>
<field name="statement_id"/>
<field name="blocked"/>
<field name="date_maturity"/>
<field name="date_created"/>
<newline/>
@ -743,11 +728,11 @@
<field name="analytic_account_id"/>
<separator colspan="4" string="State"/>
<field name="journal_id" select="2"/>
<field name="journal_id"/>
<field name="period_id"/>
<field name="reconcile_id"/>
<field name="reconcile_partial_id"/>
<field name="state" select="2"/>
<field name="state"/>
</page>
<page string="Analytic Lines">
<field colspan="4" name="analytic_lines" nolabel="1" context="{'default_general_account_id':account_id, 'default_name': name, 'default_date':date, 'amount': (debit or 0.0)-(credit or 0.0)}"/>
@ -769,14 +754,14 @@
<page string="Information">
<separator colspan="4" string="General Information"/>
<field name="name" select="1"/>
<field name="date" select="2"/>
<field name="date"/>
<field name="journal_id" readonly="False" select="1"/>
<field name="period_id" readonly="False" select="2"/>
<field name="period_id" readonly="False"/>
<field name="account_id" select="1" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<field name="partner_id" select="2" on_change="onchange_partner_id(False,partner_id,account_id,debit,credit,date)"/>
<field name="partner_id" on_change="onchange_partner_id(False,partner_id,account_id,debit,credit,date)"/>
<newline/>
<field name="debit" select="2"/>
<field name="credit" select="2"/>
<field name="debit"/>
<field name="credit"/>
<separator colspan="4" string="Optional Information"/>
<field name="currency_id"/>
@ -795,7 +780,7 @@
<newline/>
<field name="reconcile_id"/>
<field name="reconcile_partial_id"/>
<field name="state" select="2"/>
<field name="state"/>
</page>
<page string="Analytic Lines">
<field colspan="4" name="analytic_lines" nolabel="1"/>
@ -876,13 +861,13 @@
<form string="Account Entry">
<group colspan="4" col="6">
<field name="name" select="1" readonly="True"/>
<field name="period_id" select="2"/>
<field name="period_id"/>
<field name="journal_id" select="1"/>
<field name="company_id" required="1" groups="base.group_multi_company"/>
<field name="date" select="1"/>
<field name="ref" select="1"/>
<field name="to_check" select="2"/>
<field name="type" select="2" groups="base.group_extended"/>
<field name="to_check"/>
<field name="type" groups="base.group_extended"/>
</group>
<field name="partner_id" invisible="1" select="1"/>
<field name="amount" invisible="1" select="1"/>
@ -932,7 +917,7 @@
</tree>
</field>
<separator colspan="4" string="Narration"/>
<field name="narration" select="2" colspan="4" nolabel="1"/>
<field name="narration" colspan="4" nolabel="1"/>
<separator colspan="4" string="State"/>
<field name="state" select="1"/>
<group col="2" colspan="2">
@ -1056,7 +1041,7 @@
</page>
</notebook>
<group col="7" colspan="4">
<field name="state" select="2"/>
<field name="state"/>
<field name="balance_end"/>
<button name="button_dummy" states="draft" string="Compute" icon="gtk-execute"/>
<button name="button_confirm" states="draft" string="Confirm" type="object" icon="gtk-apply"/>
@ -1330,7 +1315,7 @@
<separator colspan="4" string="Subscription Periods"/>
<field name="date_start" select="1"/>
<field name="period_total" select="2"/>
<field name="period_total"/>
<field name="period_nbr"/>
<field name="period_type"/>
@ -1343,7 +1328,7 @@
<field colspan="4" name="lines_id" widget="one2many_list" nolabel="1"/>
<separator colspan="4" string="State"/>
<field name="state" select="2"/>
<field name="state"/>
<group col="1" colspan="2">
<button name="state_draft" states="done" string="Set to Draft" type="object" icon="gtk-convert" />
</group>
@ -1500,6 +1485,7 @@
<!-- register configuration wizard -->
<record id="config_fiscalyear" model="ir.actions.todo">
<field name="action_id" ref="action_account_config_wizard_form"/>
<field name="restart">onskip</field>
</record>
<record id="view_account_addtmpl_wizard_form" model="ir.ui.view">
@ -1549,7 +1535,7 @@
<field name="type" select="1"/>
<field name="user_type" select="1"/>
<field name="currency_id" select="2"/>
<field name="currency_id"/>
<field name="reconcile"/>
<field name="tax_ids" colspan="4"/>
</page>
@ -1642,13 +1628,13 @@
<newline/>
<field name="chart_template_id" select="1"/>
<field name="tax_group" select="1"/>
<field name="type" select="2"/>
<field name="type_tax_use" select="2"/>
<field name="type"/>
<field name="type_tax_use"/>
</group>
<notebook colspan="4">
<page string="Tax Definition">
<field name="applicable_type"/>
<field name="amount" select="2" attrs="{'readonly':[('type','=','none'),('type','=','code')]}"/>
<field name="amount" attrs="{'readonly':[('type','=','none'),('type','=','code')]}"/>
<field groups="base.group_extended" name="include_base_amount"/>
<field groups="base.group_extended" name="domain"/>
<newline/>

View File

@ -16,42 +16,22 @@
<wizard id="wizard_invoice_pay" model="account.invoice" name="account.invoice.pay" string="Pay invoice" groups="base.group_user"/>
<!-- wizard id="wizard_invoice_pay" model="account.invoice" name="account.invoice.pay" string="Pay invoice" groups="base.group_user"/-->
<!-- close year, period, journal -->
<wizard id="wizard_fiscalyear_close" menu="False" model="account.fiscalyear" name="account.fiscalyear.close" string="Generate Fiscal Year Opening Entries"/>
<menuitem
action="wizard_fiscalyear_close"
id="menu_wizard_fy_close"
parent="menu_account_end_year_treatments"
type="wizard"
sequence="1"/>
<!-- <wizard id="wizard_fiscalyear_close" menu="False" model="account.fiscalyear" name="account.fiscalyear.close" string="Generate Fiscal Year Opening Entries"/>-->
<!---->
<!-- <menuitem-->
<!-- action="wizard_fiscalyear_close"-->
<!-- id="menu_wizard_fy_close"-->
<!-- parent="menu_account_end_year_treatments"-->
<!-- type="wizard"-->
<!-- sequence="1"/>-->
<!-- <wizard id="wizard_fiscalyear_close_state" menu="False" model="account.fiscalyear" name="account.fiscalyear.close.state" string="Close a Fiscal Year"/>
<menuitem action="wizard_fiscalyear_close_state" id="menu_wizard_fy_close_state" parent="menu_account_end_year_treatments" type="wizard"/>
-->
<wizard
id="wizard_open_closed_fiscalyear"
menu="False"
model="account.fiscalyear"
name="account.open_closed_fiscalyear"
string="Cancel Opening Entries"/>
<menuitem
action="wizard_open_closed_fiscalyear"
id="menu_wizard_open_closed_fy"
sequence="2"
parent="account.menu_account_end_year_treatments" type="wizard"/>
<!-- period close
<wizard id="wizard_period_close" model="account.period" name="account.period.close" string="Close a Period"/>
<wizard id="action_account_period_close" model="account.period" name="account.period.close" string="Close a Period"/>
-->
<!-- automatic reconcile -->
<wizard id="wizard_automatic_reconcile" menu="False" model="account.account" name="account.automatic.reconcile" string="Automatic reconciliation"/>
<menuitem id="next_id_20" name="Reconciliation" parent="menu_finance_periodical_processing"/>
@ -59,12 +39,12 @@
<!-- Import entry in statement -->
<wizard
string="Import invoices"
model="account.bank.statement"
name="populate_statement_from_inv"
menu="False"
id="wizard_populate_statement_from_inv"/>
<!-- <wizard-->
<!-- string="Import invoices"-->
<!-- model="account.bank.statement"-->
<!-- name="populate_statement_from_inv"-->
<!-- menu="False"-->
<!-- id="wizard_populate_statement_from_inv"/>-->
<!-- manual reconcile -->
<wizard id="wizard_reconcile" model="account.move.line" name="account.move.line.reconcile" string="Reconcile Entries"/>
@ -110,10 +90,10 @@
<!-- account.move validate -->
<wizard id="wizard_validate_account_moves" menu="False" model="account.move" name="account.move.validate" string="Validate Ledger Postings"/>
<!-- <wizard id="wizard_validate_account_moves" menu="False" model="account.move" name="account.move.validate" string="Validate Ledger Postings"/>
<menuitem action="wizard_validate_account_moves" id="menu_validate_account_moves" parent="account.menu_finance_periodical_processing" type="wizard"/>
<wizard id="wizard_validate_account_moves_line" menu="True" model="account.move.line" name="account.move_line.validate" string="Validate Ledger Postings"/>
<wizard id="wizard_validate_account_moves_line" menu="True" model="account.move.line" name="account.move_line.validate" string="Validate Ledger Postings"/>-->
<!-- Use Models -->
<wizard string="Create Entries From Models" model="account.model" name="account_use_models" menu="False" id="wizard_account_use_model"/>
@ -122,7 +102,7 @@
<wizard string="Create Entries From Models" model="account.move.line" name="account_use_models" menu="True" id="wizard_line_account_use_model"/>
<!-- account.invoice -->
<wizard string="Open State" model="account.invoice" name="account.wizard_paid_open" menu="False" id="wizard_paid_open" groups="base.group_user"/>
<!-- <wizard string="Open State" model="account.invoice" name="account.wizard_paid_open" menu="False" id="wizard_paid_open" groups="base.group_user"/> -->
<!-- generic report wizard -->
<wizard id="wizard_account_balance_report" menu="False" model="account.account" name="account.account.balance.report" string="Account Balance"/>
@ -131,15 +111,15 @@
<wizard id="wizard_general_ledger" menu="False" model="account.account" name="account.general.ledger.report" string="General Ledger"/>
<menuitem icon="STOCK_PRINT" action="wizard_general_ledger" id="menu_general_ledger" parent="account.menu_generic_report" type="wizard"/>
<wizard id="wizard_print_journal" menu="False" model="account.journal.period" name="account.print.journal.report" string="Print Journal" />
<!-- <wizard id="wizard_print_journal" menu="False" model="account.journal.period" name="account.print.journal.report" string="Print Journal" />
<menuitem icon="STOCK_PRINT" action="wizard_print_journal" id="menu_print_journal" parent="account.menu_generic_report" type="wizard" />
<wizard id="wizard_central_journal" menu="False" model="account.journal.period" name="account.central.journal.report" string="Print Central Journal" />
<menuitem icon="STOCK_PRINT" action="wizard_central_journal" id="menu_central_journal" parent="account.menu_generic_report" type="wizard" />
<wizard id="wizard_general_journal" menu="False" model="account.journal.period" name="account.general.journal.report" string="Print General Journal" />
<menuitem icon="STOCK_PRINT" action="wizard_general_journal" id="menu_general_journal" parent="account.menu_generic_report" type="wizard" />
<menuitem icon="STOCK_PRINT" action="wizard_general_journal" id="menu_general_journal" parent="account.menu_generic_report" type="wizard" />-->
<wizard id="wizard_invoice_currency_change" model="account.invoice" name="account.invoice.currency_change" string="Change Currency" groups="base.group_user"/>
<!-- <wizard id="wizard_invoice_currency_change" model="account.invoice" name="account.invoice.currency_change" string="Change Currency" groups="base.group_user"/>-->
</data>
</openerp>

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:01+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:05+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-12-17 23:18+0000\n"
"Last-Translator: Sianna <Unknown>\n"
"PO-Revision-Date: 2010-04-17 18:26+0000\n"
"Last-Translator: Boris <boris.t.ivanov@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:01+0000\n"
"X-Launchpad-Export-Date: 2010-04-19 03:45+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@ -55,7 +55,7 @@ msgstr "Актив"
#. module: account
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
msgstr "Невалидно име на модел при задаването на действие."
#. module: account
#: help:account.journal,currency:0
@ -257,7 +257,7 @@ msgstr "Данъци за доставчици"
#. module: account
#: view:account.move:0
msgid "Total Debit"
msgstr ""
msgstr "Общ дебит"
#. module: account
#: rml:account.tax.code.entries:0
@ -370,7 +370,7 @@ msgstr "Аналитична сметка"
#: field:account.tax,child_depend:0
#: field:account.tax.template,child_depend:0
msgid "Tax on Children"
msgstr ""
msgstr "Данък върху подчинени"
#. module: account
#: rml:account.central.journal:0
@ -387,7 +387,7 @@ msgstr "Описание на фактура"
#. module: account
#: constraint:account.analytic.account:0
msgid "Error! You can not create recursive analytic accounts."
msgstr ""
msgstr "Грешка! Не можете да създадете рекурсивни аналитични сметки."
#. module: account
#: field:account.bank.statement.reconcile,total_entry:0
@ -398,7 +398,7 @@ msgstr "Общо записи"
#: field:account.fiscal.position.account,account_src_id:0
#: field:account.fiscal.position.account.template,account_src_id:0
msgid "Account Source"
msgstr ""
msgstr "Счетоводен източник"
#. module: account
#: field:account.journal,update_posted:0
@ -537,7 +537,7 @@ msgstr ""
#: model:ir.actions.act_window,name:account.action_account_tax_template_form
#: model:ir.ui.menu,name:account.menu_action_account_tax_template_form
msgid "Tax Templates"
msgstr ""
msgstr "Шаблони на данъци"
#. module: account
#: field:account.invoice,reconciled:0
@ -552,13 +552,13 @@ msgstr "Отложен метод"
#. module: account
#: field:account.tax.template,include_base_amount:0
msgid "Include in Base Amount"
msgstr ""
msgstr "Включване в основната сума"
#. module: account
#: field:account.tax,ref_base_code_id:0
#: field:account.tax.template,ref_base_code_id:0
msgid "Refund Base Code"
msgstr ""
msgstr "Базов код на обезщетение"
#. module: account
#: view:account.invoice.line:0
@ -591,7 +591,7 @@ msgstr "account.tax"
#. module: account
#: rml:account.central.journal:0
msgid "Printing Date"
msgstr ""
msgstr "Дата на отпечатване"
#. module: account
#: rml:account.general.ledger:0

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:01+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:05+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2009-12-31 12:45+0000\n"
"PO-Revision-Date: 2010-04-18 09:39+0000\n"
"Last-Translator: Albert Cervera i Areny - http://www.NaN-tic.com <albert@nan-"
"tic.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:01+0000\n"
"X-Launchpad-Export-Date: 2010-04-19 03:46+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@ -41,7 +41,7 @@ msgstr "Codificació assentaments"
#. module: account
#: model:ir.actions.todo,note:account.config_wizard_account_base_setup_form
msgid "Specify The Message for the Overdue Payment Report."
msgstr ""
msgstr "Especifiquel el missage per als pagaments fora de termini."
#. module: account
#: model:process.transition,name:account.process_transition_confirmstatementfromdraft0
@ -326,7 +326,7 @@ msgstr "Origen"
#. module: account
#: rml:account.analytic.account.journal:0
msgid "Move Name"
msgstr ""
msgstr "Nom de l'assentament"
#. module: account
#: xsl:account.transfer:0
@ -436,7 +436,7 @@ msgstr "Negatiu"
#. module: account
#: rml:account.partner.balance:0
msgid "(Account/Partner) Name"
msgstr ""
msgstr "(Compte/Empresa) Nom"
#. module: account
#: selection:account.move,type:0
@ -482,7 +482,7 @@ msgstr "Conciliació bancària"
#. module: account
#: rml:account.invoice:0
msgid "Disc.(%)"
msgstr ""
msgstr "Desc.(%)"
#. module: account
#: rml:account.general.ledger:0
@ -1160,7 +1160,7 @@ msgstr "Preu un."
#. module: account
#: rml:account.analytic.account.journal:0
msgid "Period from :"
msgstr ""
msgstr "Període des de:"
#. module: account
#: model:ir.model,name:account.model_wizard_multi_charts_accounts
@ -1353,7 +1353,7 @@ msgstr "Homòleg centralitzat"
#. module: account
#: view:wizard.company.setup:0
msgid "Message"
msgstr ""
msgstr "Missatge"
#. module: account
#: model:process.node,note:account.process_node_supplierpaymentorder0
@ -1516,7 +1516,7 @@ msgstr "Tanca estats"
#. module: account
#: model:ir.model,name:account.model_wizard_company_setup
msgid "wizard.company.setup"
msgstr ""
msgstr "wizard.company.setup"
#. module: account
#: model:ir.actions.act_window,name:account.action_account_analytic_account_line_extended_form
@ -1854,7 +1854,7 @@ msgstr "Compte director"
#. module: account
#: rml:account.analytic.account.journal:0
msgid "to :"
msgstr ""
msgstr "a:"
#. module: account
#: wizard_field:account.move.line.reconcile,init_full,debit:0
@ -2186,7 +2186,7 @@ msgstr "Assentament analític"
#. module: account
#: view:res.company:0 field:res.company,overdue_msg:0
msgid "Overdue Payments Message"
msgstr ""
msgstr "Missatge de pagaments fora de termini"
#. module: account
#: model:ir.actions.act_window,name:account.action_tax_code_tree
@ -2488,7 +2488,7 @@ msgstr "Obre diari"
#. module: account
#: rml:account.analytic.account.journal:0
msgid "KI"
msgstr ""
msgstr "KI"
#. module: account
#: model:ir.actions.wizard,name:account.action_account_analytic_line
@ -2681,7 +2681,7 @@ msgstr "Patrimoni"
#. module: account
#: field:wizard.company.setup,overdue_msg:0
msgid "Overdue Payment Message"
msgstr ""
msgstr "Missage dels pagaments fora de termini"
#. module: account
#: model:ir.model,name:account.model_account_tax_code_template
@ -2743,7 +2743,7 @@ msgstr "-"
#. module: account
#: rml:account.analytic.account.journal:0
msgid "asgfas"
msgstr ""
msgstr "asgfas"
#. module: account
#: model:ir.actions.act_window,name:account.action_account_analytic_account_tree2
@ -3898,7 +3898,7 @@ msgstr ""
#: model:ir.actions.act_window,name:account.action_wizard_company_setup_form
#: view:wizard.company.setup:0
msgid "Overdue Payment Report Message"
msgstr ""
msgstr "Missatge de l'informe dels pagaments fora de termini"
#. module: account
#: selection:account.tax,tax_group:0

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-04-10 03:49+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:05+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:01+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:05+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
"PO-Revision-Date: 2010-04-02 07:16+0000\n"
"PO-Revision-Date: 2010-04-16 09:47+0000\n"
"Last-Translator: Ferdinand @ ChriCar <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-04-03 03:54+0000\n"
"X-Launchpad-Export-Date: 2010-04-18 03:49+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account
@ -731,7 +731,7 @@ msgstr "Gesamtschulden eines Kunden"
#. module: account
#: view:account.move.line:0
msgid "St."
msgstr "Steuer"
msgstr "Beleg"
#. module: account
#: model:ir.actions.act_window,name:account.action_tax_code_line_open
@ -983,7 +983,7 @@ msgstr "Standard Debitoren Konto"
#: model:ir.actions.act_window,name:account.action_bank_statement_tree
#: model:ir.ui.menu,name:account.menu_bank_statement_tree
msgid "Entries by Statements"
msgstr "Buchen Bankauszug"
msgstr "Buchungen Beleg"
#. module: account
#: model:process.transition,name:account.process_transition_analyticinvoice0
@ -1776,7 +1776,7 @@ msgstr "Aufwandskonto für Periode"
#: model:ir.actions.act_window,name:account.action_bank_statement_tree2
#: model:ir.ui.menu,name:account.menu_bank_statement_tree2
msgid "New Statement"
msgstr "Neuer Bankauszug"
msgstr "neuer Beleg"
#. module: account
#: wizard_field:account.analytic.account.chart,init,from_date:0
@ -2367,7 +2367,7 @@ msgstr "Steuerart"
#. module: account
#: model:process.transition,name:account.process_transition_statemententries0
msgid "Statement Entries"
msgstr "Bankauszug Erfassung"
msgstr "Beleg Erfassen"
#. module: account
#: field:account.analytic.line,user_id:0
@ -2509,7 +2509,7 @@ msgstr "Gültig ab"
#: model:process.node,name:account.process_node_bankstatement0
#: model:process.node,name:account.process_node_supplierbankstatement0
msgid "Bank Statement"
msgstr "Bankauszug"
msgstr "Bank beleg"
#. module: account
#: wizard_view:account.invoice.pay,addendum:0
@ -2964,7 +2964,7 @@ msgstr "Entwurf Lieferanten Gutschriften"
#. module: account
#: model:process.node,name:account.process_node_accountingstatemententries0
msgid "Accounting Statement"
msgstr "Bankauszug"
msgstr "Buchungsbeleg"
#. module: account
#: rml:account.overdue:0
@ -3933,7 +3933,7 @@ msgstr ""
#. module: account
#: model:process.node,note:account.process_node_manually0
msgid "Encode manually the statement"
msgstr "Bankauszug manuell erfassen"
msgstr "manuelle Belegerfassung"
#. module: account
#: model:ir.actions.act_window,name:account.action_account_journal_form
@ -4096,7 +4096,7 @@ msgstr "Belegnummer"
#: view:account.bank.statement:0
#: field:account.bank.statement,line_ids:0
msgid "Statement lines"
msgstr "Buchungszeilen"
msgstr "Belegzeilen"
#. module: account
#: field:account.move.line,amount_taxed:0
@ -4445,7 +4445,7 @@ msgstr "Abbrechen Buchen Jahreseröffnung"
#. module: account
#: model:process.transition,name:account.process_transition_invoicemanually0
msgid "Manually statement"
msgstr "Manuelle Ausgabe"
msgstr "Manueller Beleg"
#. module: account
#: field:account.payment.term.line,days2:0
@ -4659,7 +4659,7 @@ msgstr ""
#: field:account.bank.statement.line,statement_id:0
#: field:account.move.line,statement_id:0
msgid "Statement"
msgstr "Bankkontoauszug"
msgstr "Beleg"
#. module: account
#: model:ir.actions.act_window,name:account.action_move_line_form_encode_by_move
@ -4736,7 +4736,7 @@ msgstr ""
#. module: account
#: model:process.node,name:account.process_node_draftstatement0
msgid "Draft statement"
msgstr "Entwurf Bankauszug"
msgstr "Beleg Entwurf"
#. module: account
#: field:account.analytic.journal,name:0
@ -4841,7 +4841,7 @@ msgstr "Abgebrochen"
#: model:ir.actions.act_window,name:account.action_bank_statement_draft_tree
#: model:ir.ui.menu,name:account.menu_bank_statement_draft_tree
msgid "Draft statements"
msgstr "Buchen Bankauszug Entwurf"
msgstr "Beleg Entwurf"
#. module: account
#: wizard_field:populate_statement_from_inv,init,date:0
@ -5309,7 +5309,7 @@ msgstr "Anzeige Zahlungen"
#. module: account
#: model:process.node,note:account.process_node_accountingstatemententries0
msgid "Accounting entries at statement's confirmation"
msgstr "Buchungen nach Bestätigung Bankauszug"
msgstr "Buchungen nach Bestätigung Beleg"
#. module: account
#: wizard_view:account_use_models,create:0
@ -5392,7 +5392,7 @@ msgstr "Teilbuchung"
#. module: account
#: help:account.move.line,statement_id:0
msgid "The bank statement used for bank reconciliation"
msgstr "Bankauszug für Ausbuchen offener Posten (Debitoren/Kreditoren)"
msgstr ""
#. module: account
#: view:account.fiscalyear:0
@ -6017,12 +6017,12 @@ msgstr "Positionen Summen & Salden"
#. module: account
#: model:process.process,name:account.process_process_statementprocess0
msgid "Statement Process"
msgstr "Ausgabe Prozessansicht"
msgstr "Beleg Prozess"
#. module: account
#: model:ir.model,name:account.model_account_bank_statement_reconcile
msgid "Statement reconcile"
msgstr "Offene Posten Buchungen Bankauszug"
msgstr "Beleg OP-Ausgleich"
#. module: account
#: wizard_field:account.fiscalyear.close,init,sure:0

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:02+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:06+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-04-12 03:53+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:07+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:04+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:04+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:02+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:06+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:03+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:07+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:02+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:06+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:02+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:06+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:02+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:06+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:02+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:06+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:03+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:07+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:02+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:06+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:02+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:06+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:02+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:06+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:02+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:06+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:02+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:06+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:03+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:07+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:02+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:06+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:03+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:07+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:03+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:07+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:02+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:06+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:04+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:03+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:07+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-04-12 03:53+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:07+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:03+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:07+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:04+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:03+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:07+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-04-04 03:52+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:07+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:03+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:07+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:03+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:07+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:03+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:07+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:01+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:05+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:03+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:07+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:04+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:04+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:04+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:04+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:04+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:04+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:04+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:04+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:04+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2010-03-30 04:04+0000\n"
"X-Launchpad-Export-Date: 2010-04-17 04:08+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: account

View File

@ -443,8 +443,9 @@ class account_invoice(osv.osv):
return {'value': {}}
def onchange_company_id(self, cr, uid, ids, company_id, part_id, type, invoice_line, currency_id):
val={}
dom={}
val = {}
dom = {}
obj_journal = self.pool.get('account.journal')
if company_id and part_id and type:
acc_id = False
partner_obj = self.pool.get('res.partner').browse(cr,uid,part_id)
@ -488,13 +489,20 @@ class account_invoice(osv.osv):
_('invoice line account company is not match with invoice company.'))
else:
continue
if company_id:
val['journal_id']=False
journal_ids=self.pool.get('account.journal').search(cr,uid,[('company_id','=',company_id)])
dom={'journal_id': [('id','in',journal_ids)]}
if company_id and type:
if type in ('out_invoice', 'out_refund'):
journal_type = 'sale'
else:
journal_type = 'purchase'
journal_ids = obj_journal.search(cr, uid, [('company_id','=',company_id), ('type', '=', journal_type)])
if journal_ids:
val['journal_id'] = journal_ids[0]
else:
raise osv.except_osv(_('Configration Error !'),
_('Can not find account journal for this company in invoice, Please Create journal.'))
dom = {'journal_id': [('id', 'in', journal_ids)]}
else:
journal_ids=self.pool.get('account.journal').search(cr,uid,[])
dom={'journal_id': [('id','in',journal_ids)]}
journal_ids = obj_journal.search(cr, uid, [])
if currency_id and company_id:
currency = self.pool.get('res.currency').browse(cr, uid, currency_id)
@ -644,6 +652,7 @@ class account_invoice(osv.osv):
def compute_invoice_totals(self, cr, uid, inv, company_currency, ref, invoice_move_lines):
total = 0
total_currency = 0
cur_obj = self.pool.get('res.currency')
for i in invoice_move_lines:
if inv.currency_id.id != company_currency:
i['currency_id'] = inv.currency_id.id

View File

@ -71,7 +71,7 @@
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<notebook>
<page string="Accounting" position="inside">
<page string="Accounting" position="inside">
<group col="2" colspan="2">
<separator string="Customer Accounting Properties" colspan="2"/>
<field name="property_account_receivable"/>
@ -84,23 +84,23 @@
</group>
<group col="2" colspan="2">
<separator string="Customer Credit" colspan="2"/>
<field name="credit" select="2"/>
<field name="credit_limit" select="2"/>
<field name="credit"/>
<field name="credit_limit" groups="base.group_extended"/>
</group>
<group col="2" colspan="2">
<separator string="Supplier Debit" colspan="2"/>
<field name="debit" select="2"/>
<field name="debit"/>
</group>
<field colspan="4" context="{'address': address}" name="bank_ids" nolabel="1" select="2">
<field colspan="4" context="{'address': address}" name="bank_ids" nolabel="1">
<form string="Bank account">
<field name="state" select="2"/>
<field name="state"/>
<newline/>
<field name="acc_number" select="1"/>
<newline/>
<field name="bank"/>
<newline/>
<field name="sequence"/>
<field colspan="4" name="name" select="2"/>
<field colspan="4" name="name"/>
<separator colspan="4" string="Bank account owner"/>
<field colspan="4" name="owner_name"/>
<field colspan="4" name="street"/>

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,19 +15,19 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from report import report_sxw
#
# Use period and Journal for selection or resources
#
class journal_print(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
def __init__(self, cr, uid, name, context={}):
super(journal_print, self).__init__(cr, uid, name, context=context)
self.localcontext.update( {
'time': time,
@ -37,11 +37,13 @@ class journal_print(report_sxw.rml_parse):
})
def lines(self, period_id, journal_id, sort_selection='date', *args):
if type(period_id)==type([]):
obj_jperiod = self.pool.get('account.journal.period')
obj_mline = self.pool.get('account.move.line')
if type(period_id) == type([]):
ids_final = []
for journal in journal_id:
for period in period_id:
ids_journal_period = self.pool.get('account.journal.period').search(self.cr,self.uid, [('journal_id','=',journal),('period_id','=',period)])
ids_journal_period = obj_jperiod.search(self.cr, self.uid, [('journal_id','=',journal), ('period_id','=',period)])
if ids_journal_period:
self.cr.execute('update account_journal_period set state=%s where journal_id=%s and period_id=%s and state=%s', ('printed',journal,period,'draft'))
self.cr.commit()
@ -50,14 +52,14 @@ class journal_print(report_sxw.rml_parse):
ids_final.append(ids)
line_ids = []
for line_id in ids_final:
a = self.pool.get('account.move.line').browse(self.cr, self.uid, line_id )
a = obj_mline.browse(self.cr, self.uid, line_id)
line_ids.append(a)
return line_ids
self.cr.execute('update account_journal_period set state=%s where journal_id=%s and period_id=%s and state=%s', ('printed',journal_id,period_id,'draft'))
self.cr.commit()
self.cr.execute('select id from account_move_line where period_id=%s and journal_id=%s and state<>\'draft\' order by date,id', (period_id, journal_id))
ids = map(lambda x: x[0], self.cr.fetchall())
return self.pool.get('account.move.line').browse(self.cr, self.uid, ids )
return obj_mline.browse(self.cr, self.uid, ids)
def _sum_debit(self, period_id, journal_id):
self.cr.execute('select sum(debit) from account_move_line where period_id=%s and journal_id=%s and state<>\'draft\'', (period_id, journal_id))
@ -66,8 +68,9 @@ class journal_print(report_sxw.rml_parse):
def _sum_credit(self, period_id, journal_id):
self.cr.execute('select sum(credit) from account_move_line where period_id=%s and journal_id=%s and state<>\'draft\'', (period_id, journal_id))
return self.cr.fetchone()[0] or 0.0
report_sxw.report_sxw('report.account.journal.period.print', 'account.journal.period', 'addons/account/report/account_journal.rml', parser=journal_print,header=False)
report_sxw.report_sxw('report.account.journal.period.print.wiz', 'account.journal.period', 'addons/account/report/wizard_account_journal.rml', parser=journal_print,header=False)
report_sxw.report_sxw('report.account.journal.period.print', 'account.journal.period', 'addons/account/report/account_journal.rml', parser=journal_print, header=False)
report_sxw.report_sxw('report.account.journal.period.print.wiz', 'account.journal.period', 'addons/account/report/wizard_account_journal.rml', parser=journal_print, header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -59,8 +59,8 @@ class journal_print(report_sxw.rml_parse):
def _sum_credit(self, period_id, journal_id):
self.cr.execute('select sum(credit) from account_move_line where period_id=%s and journal_id=%s and state<>\'draft\'', (period_id, journal_id))
return self.cr.fetchone()[0] or 0.0
report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/central_journal.rml',parser=journal_print, header=False)
report_sxw.report_sxw('report.account.central.journal.wiz', 'account.journal.period', 'addons/account/report/wizard_central_journal.rml',parser=journal_print, header=False)
report_sxw.report_sxw('report.account.central.journal', 'account.journal.period', 'addons/account/report/central_journal.rml', parser=journal_print, header=False)
report_sxw.report_sxw('report.account.central.journal.wiz', 'account.journal.period', 'addons/account/report/wizard_central_journal.rml', parser=journal_print, header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -122,8 +122,8 @@ class journal_print(report_sxw.rml_parse):
return 0.0
self.cr.execute('select sum(credit) from account_move_line where period_id =ANY(%s) and journal_id =ANY(%s) and state<>\'draft\'',(self.period_ids,self.journal_ids,))
return self.cr.fetchone()[0] or 0.0
report_sxw.report_sxw('report.account.general.journal', 'account.journal.period', 'addons/account/report/general_journal.rml',parser=journal_print)
report_sxw.report_sxw('report.account.general.journal.wiz', 'account.journal.period', 'addons/account/report/wizard_general_journal.rml',parser=journal_print, header=False)
report_sxw.report_sxw('report.account.general.journal', 'account.journal.period', 'addons/account/report/general_journal.rml', parser=journal_print)
report_sxw.report_sxw('report.account.general.journal.wiz', 'account.journal.period', 'addons/account/report/wizard_general_journal.rml', parser=journal_print, header=False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -20,16 +20,15 @@
##############################################################################
import time
import pooler
import rml_parse
import copy
import rml_parse
from report import report_sxw
import pdb
import re
class tax_report(rml_parse.rml_parse):
_name = 'report.account.vat.declaration'
def __init__(self, cr, uid, name, context):
def __init__(self, cr, uid, name, context={}):
print "tax______init", name, context
super(tax_report, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
@ -42,19 +41,19 @@ class tax_report(rml_parse.rml_parse):
})
def _get_lines(self, based_on,period_list,company_id=False, parent=False, level=0):
res = self._get_codes(based_on,company_id,parent,level,period_list)
def _get_lines(self, based_on, period_list, company_id=False, parent=False, level=0, context={}):
res = self._get_codes(based_on, company_id, parent, level, period_list, context=context)
if period_list[0][2] :
res = self._add_codes(based_on,res,period_list)
if period_list:
res = self._add_codes(based_on, res, period_list, context=context)
else :
self.cr.execute ("select id from account_fiscalyear")
fy = self.cr.fetchall()
self.cr.execute ("select id from account_period where fiscalyear_id = %s",(fy[0][0],))
periods = self.cr.fetchall()
for p in periods :
period_list[0][2].append(p[0])
res = self._add_codes(based_on,res,period_list)
period_list.append(p[0])
res = self._add_codes(based_on, res, period_list, context=context)
i = 0
top_result = []
@ -71,7 +70,7 @@ class tax_report(rml_parse.rml_parse):
}
top_result.append(res_dict)
res_general = self._get_general(res[i][1].id,period_list,company_id,based_on)
res_general = self._get_general(res[i][1].id, period_list, company_id, based_on, context=context)
ind_general = 0
while ind_general < len(res_general) :
res_general[ind_general]['type'] = 2
@ -84,11 +83,12 @@ class tax_report(rml_parse.rml_parse):
return top_result
#return array_result
def _get_period(self, period_id):
return self.pool.get('account.period').browse(self.cr, self.uid, period_id).name
def _get_period(self, period_id, context={}):
return self.pool.get('account.period').browse(self.cr, self.uid, period_id, context=context).name
def _get_general(self, tax_code_id,period_list ,company_id, based_on):
def _get_general(self, tax_code_id,period_list ,company_id, based_on, context={}):
res=[]
obj_account = self.pool.get('account.account')
if based_on == 'payments':
self.cr.execute('SELECT SUM(line.tax_amount) AS tax_amount, \
SUM(line.debit) AS debit, \
@ -110,8 +110,8 @@ class tax_report(rml_parse.rml_parse):
AND line.period_id =ANY(%s) \
AND ((invoice.state = %s) \
OR (invoice.id IS NULL)) \
GROUP BY account.id,account.name,account.code', ('draft',tax_code_id,
company_id, period_list[0][2],'paid',))
GROUP BY account.id,account.name,account.code', ('draft', tax_code_id,
company_id, period_list, 'paid',))
else :
self.cr.execute('SELECT SUM(line.tax_amount) AS tax_amount, \
@ -129,52 +129,54 @@ class tax_report(rml_parse.rml_parse):
AND account.company_id = %s \
AND line.period_id =ANY(%s)\
AND account.active \
GROUP BY account.id,account.name,account.code', ('draft',tax_code_id,
company_id,period_list[0][2],))
GROUP BY account.id,account.name,account.code', ('draft', tax_code_id,
company_id, period_list,))
res = self.cr.dictfetchall()
#AND line.period_id IN ('+ period_sql_list +') \
i = 0
while i<len(res):
res[i]['account'] = self.pool.get('account.account').browse(self.cr, self.uid, res[i]['account_id'])
res[i]['account'] = obj_account.browse(self.cr, self.uid, res[i]['account_id'], context=context)
i+=1
return res
def _get_codes(self,based_on, company_id, parent=False, level=0,period_list=[]):
tc = self.pool.get('account.tax.code')
ids = tc.search(self.cr, self.uid, [('parent_id','=',parent),('company_id','=',company_id)])
def _get_codes(self, based_on, company_id, parent=False, level=0, period_list=[], context={}):
obj_tc = self.pool.get('account.tax.code')
ids = obj_tc.search(self.cr, self.uid, [('parent_id','=',parent),('company_id','=',company_id)], context=context)
res = []
for code in tc.browse(self.cr, self.uid, ids, {'based_on': based_on}):
res.append(('.'*2*level,code))
for code in obj_tc.browse(self.cr, self.uid, ids, {'based_on': based_on}):
res.append(('.'*2*level, code))
res += self._get_codes(based_on, company_id, code.id, level+1)
res += self._get_codes(based_on, company_id, code.id, level+1, context=context)
return res
def _add_codes(self,based_on, account_list=[],period_list=[]):
def _add_codes(self, based_on, account_list=[], period_list=[], context={}):
res = []
obj_tc = self.pool.get('account.tax.code')
for account in account_list:
tc = self.pool.get('account.tax.code')
ids = tc.search(self.cr, self.uid, [('id','=',account[1].id)])
ids = obj_tc.search(self.cr, self.uid, [('id','=', account[1].id)], context=context)
sum_tax_add = 0
for period_ind in period_list[0][2]:
for code in tc.browse(self.cr, self.uid, ids, {'period_id':period_ind,'based_on': based_on}):
for period_ind in period_list:
for code in obj_tc.browse(self.cr, self.uid, ids, {'period_id':period_ind,'based_on': based_on}):
sum_tax_add = sum_tax_add + code.sum_period
code.sum_period = sum_tax_add
res.append((account[0],code))
res.append((account[0], code))
return res
def _get_company(self, form):
return pooler.get_pool(self.cr.dbname).get('res.company').browse(self.cr, self.uid, form['company_id']).name
def _get_company(self, form, context={}):
obj_company = self.pool.get('res.company')
return obj_company.browse(self.cr, self.uid, form['company_id'], context=context).name
def _get_currency(self, form):
return pooler.get_pool(self.cr.dbname).get('res.company').browse(self.cr, self.uid, form['company_id']).currency_id.name
def _get_currency(self, form, context={}):
obj_company = self.pool.get('res.company')
return obj_company.browse(self.cr, self.uid, form['company_id'], context=context).currency_id.name
def sort_result(self,accounts):
def sort_result(self, accounts, context={}):
# On boucle sur notre rapport
result_accounts = []
ind=0
@ -191,7 +193,7 @@ class tax_report(rml_parse.rml_parse):
bcl_rup_ind = ind - 1
while (bcl_current_level >= int(accounts[bcl_rup_ind]['level']) and bcl_rup_ind >= 0 ):
tot_elem = copy.copy(accounts[bcl_rup_ind])
tot_elem = copy.copy(accounts[bcl_rup_ind], context=context)
res_tot = { 'code' : accounts[bcl_rup_ind]['code'],
'name' : '',
'debit' : 0,
@ -218,6 +220,6 @@ class tax_report(rml_parse.rml_parse):
report_sxw.report_sxw('report.account.vat.declaration', 'account.tax.code',
'addons/account/report/tax_report.rml', parser=tax_report, header=False)
'addons/account/report/tax_report.rml', parser=tax_report, header=True)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -8,7 +8,7 @@
<field name="inherit_id" ref="base.sequence_view"/>
<field name="arch" type="xml">
<page position="after">
<page string="Fiscal Years">
<page string="Fiscal Years" groups="base.group_extended">
<field name="fiscal_ids" nolabel="1" colspan="4">
<tree string="Fiscal Year Sequences" editable="bottom">
<field name="fiscalyear_id"/>

View File

@ -25,9 +25,9 @@ import account_move_line_unreconcile_select
import wizard_reconcile
import wizard_unreconcile
import account_invoice_refund
import wizard_pay_invoice
import account_pay_invoice
import account_move_journal
import wizard_journal_select
import account_journal_select
import account_move_bank_reconcile
import account_subscription_generate
import wizard_aged_trial_balance
@ -36,27 +36,27 @@ import wizard_third_party_ledger
import wizard_account_balance_report
import wizard_partner_balance_report
import account_period_close
import wizard_fiscalyear_close
import account_fiscalyear_close
import account_fiscalyear_close_state
import wizard_open_closed_fiscalyear
import account_vat
import account_open_closed_fiscalyear
import wizard_vat
import wizard_compare_account_balance_report
import wizard_invoice_state
import wizard_account_duplicate
import account_chart
import wizard_move_line_select
import wizard_validate_account_move
import account_validate_account_move
import wizard_use_model
import wizard_state_open
import account_state_open
import wizard_statement_from_invoice
import wizard_print_journal
import wizard_central_journal
import wizard_general_journal
import wizard_change_currency
import account_statement_from_invoice
import account_print_journal
import account_central_journal
import account_general_journal
import account_change_currency
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,62 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import osv, fields
from tools.translate import _
class account_central_journal(osv.osv_memory):
_name = 'account.central.journal'
_description = 'Account Central Journal'
_columns = {
'journal_id': fields.many2many('account.journal', 'account_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
'period_id': fields.many2many('account.period', 'account_period_rel', 'account_id', 'period_id', 'Periods', required=True),
}
def check_data(self, cr, uid, ids, context={}):
obj_jperiod = self.pool.get('account.journal.period')
datas = {}
datas['ids'] = []
datas['model'] = 'account.journal.period'
datas['form'] = self.read(cr, uid, ids)[0]
period_id = datas['form']['period_id']
journal_id = datas['form']['journal_id']
if type(period_id)==type([]):
ids_final = []
for journal in journal_id:
for period in period_id:
ids_journal_period = obj_jperiod.search(cr,uid, [('journal_id','=',journal),('period_id','=',period)], context=context)
if ids_journal_period:
ids_final.append(ids_journal_period)
if not ids_final:
raise osv.except_osv(_('No Data Available'), _('No records found for your selection!'))
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.central.journal',
'datas': datas,
}
account_central_journal()
#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_central_journal" model="ir.ui.view">
<field name="name">Account central Journal</field>
<field name="model">account.central.journal</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Print Central Journal">
<group col="4" colspan="6">
<field name="journal_id"/>
<field name="period_id"/>
</group>
<separator colspan="4"/>
<group col="2" colspan="4">
<button special="cancel" string="Cancel" icon='gtk-cancel'/>
<button name="check_data" string="Print" colspan="1" type="object" icon="gtk-ok"/>
</group>
</form>
</field>
</record>
<record id="action_account_central_journal" model="ir.actions.act_window">
<field name="name">Account Central Journal</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.central.journal</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<menuitem
name="Print Central Journal"
parent="account.menu_generic_report"
action="action_account_central_journal"
id="menu_account_central_journal"
icon="STOCK_PRINT"/>
</data>
</openerp>

View File

@ -0,0 +1,74 @@
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import osv, fields
from tools.translate import _
class account_change_currency(osv.osv_memory):
_name = 'account.change.currency'
_description = 'Change Currency'
_columns = {
'currency_id': fields.many2one('res.currency', 'New Currency', required=True),
}
def view_init(self, cr , uid , fields_list, context=None):
obj_inv = self.pool.get('account.invoice')
if context is None:
context = {}
state = obj_inv.browse(cr, uid, context['active_id']).state
if obj_inv.browse(cr, uid, context['active_id']).state != 'draft':
raise osv.except_osv(_('Error'), _('You can not change currency for Open Invoice !'))
pass
def change_currency(self, cr, uid, ids, context=None):
obj_inv = self.pool.get('account.invoice')
obj_inv_line = self.pool.get('account.invoice.line')
obj_currency = self.pool.get('res.currency')
if context is None:
context = {}
data = self.read(cr, uid, ids)[0]
new_currency = data['currency_id']
for invoice in obj_inv.browse(cr, uid, context['active_ids'], context=context):
if invoice.currency_id.id == new_currency:
continue
for line in invoice.invoice_line:
rate = obj_currency.browse(cr, uid, new_currency).rate
new_price = 0
if invoice.company_id.currency_id.id == invoice.currency_id.id:
new_price = line.price_unit * rate
if invoice.company_id.currency_id.id != invoice.currency_id.id and invoice.company_id.currency_id.id == new_currency:
old_rate = invoice.currency_id.rate
new_price = line.price_unit / old_rate
if invoice.company_id.currency_id.id != invoice.currency_id.id and invoice.company_id.currency_id.id != new_currency:
old_rate = invoice.currency_id.rate
new_price = (line.price_unit / old_rate ) * rate
obj_inv_line.write(cr, uid, [line.id], {'price_unit' : new_price})
obj_inv.write(cr, uid, [invoice.id], {'currency_id' : new_currency})
return {}
account_change_currency()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_change_currency" model="ir.ui.view">
<field name="name">Change Currency</field>
<field name="model">account.change.currency</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Invoice Currency">
<field name="currency_id"/>
<separator colspan="4"/>
<group colspan="2" col="4">
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="change_currency" string="Change Currency" type="object" icon="gtk-go-forward"/>
</group>
</form>
</field>
</record>
<record id="action_account_change_currency" model="ir.actions.act_window">
<field name="name">Change Currency</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.change.currency</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="view_account_change_currency"/>
<field name="context">{'record_id' : active_id}</field>
<field name="target">new</field>
</record>
<record model="ir.values" id="account_change_currency">
<field name="model_id" ref="account.model_account_invoice" />
<field name="object" eval="1" />
<field name="name">Change Currency</field>
<field name="key2">client_action_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_account_change_currency'))"/>
<field name="key">action</field>
<field name="model">account.invoice</field>
</record>
</data>
</openerp>

View File

@ -21,7 +21,6 @@
from osv import fields, osv
from tools.translate import _
import tools
class account_chart(osv.osv_memory):
"""

View File

@ -0,0 +1,228 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
from tools.translate import _
import tools
class account_fiscalyear_close(osv.osv_memory):
"""
Closes Account Fiscalyear and Generate Opening entries for New Fiscalyear
"""
_name = "account.fiscalyear.close"
_description = "Fiscalyear Close"
_columns = {
'fy_id': fields.many2one('account.fiscalyear', \
'Fiscal Year to close', required=True),
'fy2_id': fields.many2one('account.fiscalyear', \
'New Fiscal Year', required=True),
'journal_id': fields.many2one('account.journal', \
'Opening Entries Journal', required=True),
'period_id': fields.many2one('account.period', \
'Opening Entries Period', required=True),
'report_name': fields.char('Name of new entries',size=64, required=True),
'sure': fields.boolean('Check this box'),
}
_defaults = {
'report_name':'End of Fiscal Year Entry',
}
def data_save(self, cr, uid, ids, context=None):
"""
This function close account fiscalyear and create entries in new fiscalyear
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of Account fiscalyear close states IDs
"""
obj_acc_period = self.pool.get('account.period')
obj_acc_fiscalyear = self.pool.get('account.fiscalyear')
obj_acc_journal = self.pool.get('account.journal')
obj_acc_move_line = self.pool.get('account.move.line')
obj_acc_account = self.pool.get('account.account')
obj_acc_journal_period = self.pool.get('account.journal.period')
data = self.read(cr, uid, ids, context=context)
if context is None:
context = {}
if not data[0]['sure']:
raise osv.except_osv(_('UserError'), _('Closing of fiscal year cancelled, please check the box !'))
fy_id = data[0]['fy_id']
period_ids = obj_acc_period.search(cr, uid, [('fiscalyear_id', '=', fy_id)])
periods_fy2 = obj_acc_period.search(cr, uid, [('fiscalyear_id', '=', data[0]['fy2_id'])])
period = obj_acc_period.browse(cr, uid, data[0]['period_id'], context=context)
new_fyear = obj_acc_fiscalyear.browse(cr, uid, data[0]['fy2_id'], context=context)
old_fyear = obj_acc_fiscalyear.browse(cr, uid, data[0]['fy_id'], context=context)
new_journal = data[0]['journal_id']
new_journal = obj_acc_journal.browse(cr, uid, new_journal, context=context)
if not new_journal.default_credit_account_id or not new_journal.default_debit_account_id:
raise osv.except_osv(_('UserError'),
_('The journal must have default credit and debit account'))
if not new_journal.centralisation:
raise osv.except_osv(_('UserError'),
_('The journal must have centralised counterpart'))
move_ids = obj_acc_move_line.search(cr, uid, [
('journal_id','=',new_journal.id),('period_id.fiscalyear_id','=',new_fyear.id)])
if move_ids:
raise osv.except_osv(_('UserError'),
_('The opening journal must not have any entry in the new fiscal year !'))
query = "SELECT id FROM account_fiscalyear WHERE date_stop < '" + str(new_fyear.date_start) + "'"
cr.execute(query)
result = cr.dictfetchall()
fy_ids = ','.join([str(x['id']) for x in result])
query_line = obj_acc_move_line._query_get(cr, uid,
obj='account_move_line', context={'fiscalyear': fy_ids})
cr.execute('select id from account_account WHERE active')
ids = map(lambda x: x[0], cr.fetchall())
for account in obj_acc_account.browse(cr, uid, ids,
context={'fiscalyear': fy_id}):
accnt_type_data = account.user_type
if not accnt_type_data:
continue
if accnt_type_data.close_method=='none' or account.type == 'view':
continue
if accnt_type_data.close_method=='balance':
if abs(account.balance)>0.0001:
obj_acc_move_line.create(cr, uid, {
'debit': account.balance>0 and account.balance,
'credit': account.balance<0 and -account.balance,
'name': data[0]['report_name'],
'date': period.date_start,
'journal_id': new_journal.id,
'period_id': period.id,
'account_id': account.id
}, {'journal_id': new_journal.id, 'period_id':period.id})
if accnt_type_data.close_method == 'unreconciled':
offset = 0
limit = 100
while True:
cr.execute('SELECT id, name, quantity, debit, credit, account_id, ref, ' \
'amount_currency, currency_id, blocked, partner_id, ' \
'date_maturity, date_created ' \
'FROM account_move_line ' \
'WHERE account_id = %s ' \
'AND ' + query_line + ' ' \
'AND reconcile_id is NULL ' \
'ORDER BY id ' \
'LIMIT %s OFFSET %s', (account.id, limit, offset))
result = cr.dictfetchall()
if not result:
break
for move in result:
move.pop('id')
move.update({
'date': period.date_start,
'journal_id': new_journal.id,
'period_id': period.id,
})
obj_acc_move_line.create(cr, uid, move, {
'journal_id': new_journal.id,
'period_id': period.id,
})
offset += limit
#We have also to consider all move_lines that were reconciled
#on another fiscal year, and report them too
offset = 0
limit = 100
while True:
#TODO: this query could be improved in order to work if there is more than 2 open FY
# a.period_id IN ('+fy2_period_set+') is the problematic clause
cr.execute('SELECT b.id, b.name, b.quantity, b.debit, b.credit, b.account_id, b.ref, ' \
'b.amount_currency, b.currency_id, b.blocked, b.partner_id, ' \
'b.date_maturity, b.date_created ' \
'FROM account_move_line a, account_move_line b ' \
'WHERE b.account_id = %s ' \
'AND b.reconcile_id is NOT NULL ' \
'AND a.reconcile_id = b.reconcile_id ' \
'AND b.period_id =ANY(%s)'\
'AND a.period_id =ANY(%s)' \
'ORDER BY id ' \
'LIMIT %s OFFSET %s', (account.id,period_ids,periods_fy2,limit, offset))
result = cr.dictfetchall()
if not result:
break
for move in result:
move.pop('id')
move.update({
'date': period.date_start,
'journal_id': new_journal.id,
'period_id': period.id,
})
obj_acc_move_line.create(cr, uid, move, {
'journal_id': new_journal.id,
'period_id': period.id,
})
offset += limit
if accnt_type_data.close_method=='detail':
offset = 0
limit = 100
while True:
cr.execute('SELECT id, name, quantity, debit, credit, account_id, ref, ' \
'amount_currency, currency_id, blocked, partner_id, ' \
'date_maturity, date_created ' \
'FROM account_move_line ' \
'WHERE account_id = %s ' \
'AND ' + query_line + ' ' \
'ORDER BY id ' \
'LIMIT %s OFFSET %s', (account.id, limit, offset))
result = cr.dictfetchall()
if not result:
break
for move in result:
move.pop('id')
move.update({
'date': period.date_start,
'journal_id': new_journal.id,
'period_id': period.id,
})
obj_acc_move_line.create(cr, uid, move)
offset += limit
ids = obj_acc_move_line.search(cr, uid, [('journal_id','=',new_journal.id),
('period_id.fiscalyear_id','=',new_fyear.id)])
context['fy_closing'] = True
if ids:
obj_acc_move_line.reconcile(cr, uid, ids, context=context)
new_period = data[0]['period_id']
ids = obj_acc_journal_period.search(cr, uid, [('journal_id','=',new_journal.id),('period_id','=',new_period)])
if not ids:
ids = [obj_acc_journal_period.create(cr, uid, {
'name': (new_journal.name or '')+':'+(period.code or ''),
'journal_id': new_journal.id,
'period_id': period.id
})]
cr.execute('UPDATE account_fiscalyear ' \
'SET end_journal_period_id = %s ' \
'WHERE id = %s', (ids[0], old_fyear.id))
return {}
account_fiscalyear_close()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_fiscalyear_close" model="ir.ui.view">
<field name="name">account.fiscalyear.close.form</field>
<field name="model">account.fiscalyear.close</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Generate Fiscal Year Opening Entries Close a Fiscal Year with new entries">
<group colspan="4" >
<field name="fy_id" domain = "[('state','=','draft')]"/>
<field name="fy2_id" domain = "[('state','=','draft')]"/>
<field name="journal_id" />
<field name="period_id" domain ="[('fiscalyear_id','=',fy2_id)]" />
</group>
<group colspan="4" >
<field name="report_name" />
</group>
<group colspan="4" >
<separator string="Are you sure you want to create entries?" colspan="4"/>
<field name="sure"/>
</group>
<separator string="" colspan="4" />
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-execute" string="Create" name="data_save" type="object"/>
</group>
</form>
</field>
</record>
<record id="action_account_fiscalyear_close" model="ir.actions.act_window">
<field name="name">Generate Fiscal Year Opening Entries</field>
<field name="res_model">account.fiscalyear.close</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_account_fiscalyear_close"/>
<field name="target">new</field>
</record>
<menuitem action="action_account_fiscalyear_close"
id="menu_wizard_fy_close"
parent="menu_account_end_year_treatments" />
</data>
</openerp>

View File

@ -0,0 +1,60 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import osv, fields
from tools.translate import _
class account_general_journal(osv.osv_memory):
_name = 'account.general.journal'
_description = 'Account General Journal'
_columns = {
'journal_id': fields.many2many('account.journal', 'account_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
'period_id': fields.many2many('account.period', 'account_period_rel', 'account_id', 'period_id', 'Periods', required=True),
}
def check_data(self, cr, uid, ids, context={}):
obj_jperiod = self.pool.get('account.journal.period')
datas = {}
datas['ids'] = []
datas['model'] = 'account.journal.period'
datas['form'] = self.read(cr, uid, ids)[0]
period_id = datas['form']['period_id']
journal_id = datas['form']['journal_id']
if type(period_id)==type([]):
ids_final = []
for journal in journal_id:
for period in period_id:
ids_journal_period = obj_jperiod.search(cr,uid, [('journal_id','=',journal),('period_id','=',period)], context=context)
if ids_journal_period:
ids_final.append(ids_journal_period)
if not ids_final:
raise osv.except_osv(_('No Data Available'), _('No records found for your selection!'))
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.general.journal',
'datas': datas,
}
account_general_journal()
#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_general_journal" model="ir.ui.view">
<field name="name">Account Genral Journal</field>
<field name="model">account.general.journal</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Print General Journal">
<group col="4" colspan="6">
<field name="journal_id"/>
<field name="period_id"/>
</group>
<separator colspan="4"/>
<group col="2" colspan="4">
<button special="cancel" string="Cancel" icon='gtk-cancel'/>
<button name="check_data" string="Print" colspan="1" type="object" icon="gtk-ok"/>
</group>
</form>
</field>
</record>
<record id="action_account_general_journal" model="ir.actions.act_window">
<field name="name">Account General Journal</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.general.journal</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<menuitem
name="Print General Journal"
parent="account.menu_generic_report"
action="action_account_general_journal"
id="menu_account_general_journal"
icon="STOCK_PRINT"/>
</data>
</openerp>

View File

@ -18,13 +18,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
from tools.translate import _
import tools
import netsvc
class account_invoice_refund(osv.osv_memory):
"""Refunds invoice."""

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,37 +15,37 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import wizard
import pooler
from osv import fields, osv
def _action_open_window(self, cr, uid, data, context):
mod_obj = pooler.get_pool(cr.dbname).get('ir.model.data')
act_obj = pooler.get_pool(cr.dbname).get('ir.actions.act_window')
class account_journal_select(osv.osv_memory):
"""
Account Journal Select
"""
_name = "account.journal.select"
_description = "Account Journal Select"
result = mod_obj._get_id(cr, uid, 'account', 'action_move_line_select')
id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
result = act_obj.read(cr, uid, [id])[0]
def action_open_window(self, cr, uid, ids, context=None):
mod_obj = self.pool.get('ir.model.data')
act_obj = self.pool.get('ir.actions.act_window')
if context is None:
context = {}
cr.execute('select journal_id,period_id from account_journal_period where id=%s', (data['id'],))
journal_id,period_id = cr.fetchone()
result = mod_obj._get_id(cr, uid, 'account', 'action_move_line_select')
id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
result = act_obj.read(cr, uid, [id])[0]
cr.execute('select journal_id, period_id from account_journal_period where id=%s', (context['active_id'],))
journal_id, period_id = cr.fetchone()
result['domain'] = str([('journal_id', '=', journal_id), ('period_id', '=', period_id)])
result['context'] = str({'journal_id': journal_id, 'period_id': period_id})
return result
result['domain'] = str([('journal_id', '=', journal_id), ('period_id', '=', period_id)])
result['context'] = str({'journal_id': journal_id, 'period_id': period_id})
return result
class wiz_journal(wizard.interface):
states = {
'init': {
'actions': [],
'result': {'type': 'action', 'action': _action_open_window, 'state':'end'}
}
}
wiz_journal('account.move.journal.select')
account_journal_select()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="open_journal_button_view" model="ir.ui.view">
<field name="name">Open Journal Button</field>
<field name="model">account.journal.select</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Journal Select">
<label string="Are you sure you want to open Journal Entries!" colspan="4"/>
<separator string="" colspan="4" />
<group colspan="4" col="6">
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-open" string="Open Entries" name="action_open_window" type="object"/>
</group>
</form>
</field>
</record>
<record id="action_open_journal_button" model="ir.actions.act_window">
<field name="name">Open Journal</field>
<field name="res_model">account.journal.select</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="open_journal_button_view"/>
<field name="target">new</field>
</record>
<record id="ir_open_journal_period" model="ir.values">
<field name="key2">tree_but_open</field>
<field name="model">account.journal.period</field>
<field name="name">Open Journal</field>
<field eval="'ir.actions.act_window,%d'%action_open_journal_button" name="value"/>
<field eval="True" name="object"/>
</record>
</data>
</openerp>

View File

@ -18,11 +18,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
from tools.translate import _
import tools
class account_move_line_reconcile_select(osv.osv_memory):
_name = "account.move.line.reconcile.select"
@ -41,17 +38,16 @@ class account_move_line_reconcile_select(osv.osv_memory):
@return: dictionary of Open account move line window for reconcile on given account id
"""
for data in self.read(cr, uid, ids,context=context):
return {
'domain': "[('account_id','=',%d),('reconcile_id','=',False),('state','<>','draft')]" % data['account_id'],
'name': _('Reconciliation'),
'view_type': 'form',
'view_mode': 'tree,form',
'view_id': False,
'res_model': 'account.move.line',
'type': 'ir.actions.act_window'
}
data = self.read(cr, uid, ids, context=context)[0]
return {
'domain': "[('account_id','=',%d),('reconcile_id','=',False),('state','<>','draft')]" % data['account_id'],
'name': _('Reconciliation'),
'view_type': 'form',
'view_mode': 'tree,form',
'view_id': False,
'res_model': 'account.move.line',
'type': 'ir.actions.act_window'
}
account_move_line_reconcile_select()

View File

@ -15,7 +15,7 @@
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel" />
<button icon="gtk-open"
string="Open for reconciliation" name="action_open_window"
string="Open for Reconciliation" name="action_open_window"
type="object" />
</group>
</form>
@ -23,7 +23,7 @@
</record>
<record id="action_account_reconcile_select" model="ir.actions.act_window">
<field name="name">Reconcile entries</field>
<field name="name">Reconcile Entries</field>
<field name="res_model">account.move.line.reconcile.select</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>

View File

@ -30,20 +30,19 @@ class account_move_line_unreconcile_select(osv.osv_memory):
_description = "Unreconciliation"
_columns ={
'account_id': fields.many2one('account.account','Account',required=True),
}
def action_open_window(self, cr, uid, ids, context={}):
for data in self.read(cr, uid, ids):
return {
'domain': "[('account_id','=',%d),('reconcile_id','<>',False),('state','<>','draft')]" % data['account_id'],
'name': 'Unreconciliation',
'view_type': 'form',
'view_mode': 'tree,form',
'view_id': False,
'res_model': 'account.move.line',
'type': 'ir.actions.act_window'
}
data = self.read(cr, uid, ids, context=context)[0]
return {
'domain': "[('account_id','=',%d),('reconcile_id','<>',False),('state','<>','draft')]" % data['account_id'],
'name': 'Unreconciliation',
'view_type': 'form',
'view_mode': 'tree,form',
'view_id': False,
'res_model': 'account.move.line',
'type': 'ir.actions.act_window'
}
account_move_line_unreconcile_select()

View File

@ -15,7 +15,7 @@
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel" />
<button icon="gtk-open"
string="Open for Unreconciliation" name="action_open_window"
string="Open For Unreconciliation" name="action_open_window"
type="object" />
</group>
</form>
@ -23,7 +23,7 @@
</record>
<record id="action_account_unreconcile_select" model="ir.actions.act_window">
<field name="name">Unreconcile entries</field>
<field name="name">Unreconcile Entries</field>
<field name="res_model">account.move.line.unreconcile.select</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>

View File

@ -0,0 +1,55 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
from tools.translate import _
class account_open_closed_fiscalyear(osv.osv_memory):
_name = "account.open.closed.fiscalyear"
_description = "Choose Fiscal Year"
_columns = {
'fyear_id': fields.many2one('account.fiscalyear', \
'Fiscal Year to Open', required=True, help='Select Fiscal Year which you want to remove entries for its End of year entries journal'),
}
def remove_entries(self, cr, uid, ids, context={}):
data = self.read(cr, uid, ids, [])[0]
data_fyear = self.pool.get('account.fiscalyear').browse(cr, uid, data['fyear_id'])
if not data_fyear.end_journal_period_id:
raise osv.except_osv(_('Error'), _('No journal for ending writing has been defined for the fiscal year'))
period_journal = data_fyear.end_journal_period_id
ids_move = self.pool.get('account.move').search(cr,uid,[('journal_id','=',period_journal.journal_id.id),('period_id','=',period_journal.period_id.id)])
if ids_move:
cr.execute('delete from account_move where id =ANY(%s)',(ids_move,))
#cr.execute('UPDATE account_journal_period ' \
# 'SET state = %s ' \
# 'WHERE period_id IN (SELECT id FROM account_period WHERE fiscalyear_id = %s)',
# ('draft',data_fyear))
#cr.execute('UPDATE account_period SET state = %s ' \
# 'WHERE fiscalyear_id = %s', ('draft',data_fyear))
#cr.execute('UPDATE account_fiscalyear ' \
# 'SET state = %s, end_journal_period_id = null '\
# 'WHERE id = %s', ('draft',data_fyear))
return {}
account_open_closed_fiscalyear()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_open_closed_fiscalyear" model="ir.ui.view">
<field name="name">account.open.closed.fiscalyear.form</field>
<field name="model">account.open.closed.fiscalyear</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Choose Fiscal Year ">
<group colspan="4" >
<field name="fyear_id" domain = "[('state','=','draft')]"/>
</group>
<separator string="" colspan="4" />
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-open" string="Open" name="remove_entries" type="object"/>
</group>
</form>
</field>
</record>
<record id="action_account_open_closed_fiscalyear" model="ir.actions.act_window">
<field name="name">Cancel Opening Entries</field>
<field name="res_model">account.open.closed.fiscalyear</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_account_open_closed_fiscalyear"/>
<field name="target">new</field>
</record>
<menuitem action="action_account_open_closed_fiscalyear"
id="menu_wizard_open_closed_fy" sequence="2"
parent="account.menu_account_end_year_treatments" />
</data>
</openerp>

View File

@ -0,0 +1,191 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from osv import fields, osv
from tools.translate import _
import decimal_precision as dp
class account_invoice_pay_writeoff(osv.osv_memory):
"""
Opens the write off amount pay form.
"""
_name = "account.invoice.pay.writeoff"
_description = "Pay Invoice "
_columns = {
'writeoff_acc_id': fields.many2one('account.account', 'Write-Off account', required=True),
'writeoff_journal_id': fields.many2one('account.journal', 'Write-Off journal', required=True),
'comment': fields.char('Comment', size=64, required=True),
'analytic_id': fields.many2one('account.analytic.account','Analytic Account'),
}
_defaults = {
'comment': 'Write-Off',
}
def pay_and_reconcile_writeoff(self, cr, uid, ids, context=None):
data = self.read(cr, uid, ids,context=context)[0]
context.update({'write_off':data})
self.pool.get('account.invoice.pay').pay_and_reconcile(cr, uid, ids, context=context)
return {}
account_invoice_pay_writeoff()
class account_invoice_pay(osv.osv_memory):
"""
Generate pay invoice wizard, user can make partial or full payment for invoice.
"""
_name = "account.invoice.pay"
_description = "Pay Invoice "
_columns = {
'amount': fields.float('Amount paid', required=True, digits_compute = dp.get_precision('Account')),
'name': fields.char('Entry Name', size=64, required=True),
'date': fields.date('Date payment', required=True),
'journal_id': fields.many2one('account.journal', 'Journal/Payment Mode', required=True),
'period_id': fields.many2one('account.period', 'Period', required=True),
}
def view_init(self, cr, uid, ids, context=None):
invoice = self.pool.get('account.invoice').browse(cr, uid, context['active_id'], context=context)
if invoice.state in ['draft', 'proforma2', 'cancel']:
raise osv.except_osv(_('Error !'), _('Can not pay draft/proforma/cancel invoice.'))
pass
def _get_period(self, cr, uid, context=None):
ids = self.pool.get('account.period').find(cr, uid, context=context)
period_id = False
if len(ids):
period_id = ids[0]
return period_id
def _get_amount(self, cr, uid, context=None):
return self.pool.get('account.invoice').browse(cr, uid, context['active_id'], context=context).residual
_defaults = {
'date': lambda *a: time.strftime('%Y-%m-%d'),
'period_id': _get_period,
'amount': _get_amount,
}
def wo_check(self, cr, uid, ids, context=None):
cur_obj = self.pool.get('res.currency')
mod_obj = self.pool.get('ir.model.data')
if context is None:
context = {}
data = self.read(cr, uid, ids,context=context)[0]
invoice = self.pool.get('account.invoice').browse(cr, uid, context['active_id'], context)
journal = self.pool.get('account.journal').browse(cr, uid, data['journal_id'], context)
# Here we need that:
# The invoice total amount in company's currency <> paid amount in company currency
# (according to the correct day rate, invoicing rate and payment rate are may be different)
# => Ask to a write-off of the difference. This could happen even if both amount are equal,
# because if the currency rate
# Get the amount in company currency for the invoice (according to move lines)
inv_amount_company_currency = 0
for aml in invoice.move_id.line_id:
if aml.account_id.id == invoice.account_id.id or aml.account_id.type in ('receivable', 'payable'):
inv_amount_company_currency += aml.debit
inv_amount_company_currency -= aml.credit
inv_amount_company_currency = abs(inv_amount_company_currency)
# Get the current amount paid in company currency
if journal.currency and invoice.company_id.currency_id.id<>journal.currency.id:
ctx = {'date':data['date']}
amount_paid = cur_obj.compute(cr, uid, journal.currency.id, invoice.company_id.currency_id.id, data['amount'], round=True, context=ctx)
else:
amount_paid = data['amount']
# Get the old payment if there are some
if invoice.payment_ids:
debit=credit=0.0
for payment in invoice.payment_ids:
debit+=payment.debit
credit+=payment.credit
amount_paid+=abs(debit-credit)
# Test if there is a difference according to currency rouding setting
if self.pool.get('res.currency').is_zero(cr, uid, invoice.company_id.currency_id,
(amount_paid - inv_amount_company_currency)):
return self.pay_and_reconcile(cr, uid, ids, context=context)
else:
model_data_ids = mod_obj.search(cr, uid,[('model','=','ir.ui.view'),('name','=','view_account_invoice_pay_writeoff')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
return {
'name': _('Information addendum'),
'context': context,
'view_type': 'form',
'view_mode': 'form',
'res_model': 'account.invoice.pay.writeoff',
'views': [(resource_id,'form')],
'type': 'ir.actions.act_window',
'target': 'new',
}
def pay_and_reconcile(self, cr, uid, ids, context=None):
cur_obj = self.pool.get('res.currency')
if context is None:
context = {}
data = self.read(cr, uid, ids,context=context)[0]
writeoff_account_id = False
writeoff_journal_id = False
comment = False
if 'write_off' in context and context['write_off'] :
writeoff_account_id = context['write_off']['writeoff_acc_id']
writeoff_journal_id = context['write_off']['writeoff_journal_id']
comment = context['write_off']['comment']
amount = data['amount']
invoice = self.pool.get('account.invoice').browse(cr, uid, context['active_id'], context)
journal = self.pool.get('account.journal').browse(cr, uid, data['journal_id'], context)
# Compute the amount in company's currency, with the journal currency (which is equal to payment currency)
# when it is needed : If payment currency (according to selected journal.currency) is <> from company currency
if journal.currency and invoice.company_id.currency_id.id<>journal.currency.id:
ctx = {'date':data['date']}
amount = cur_obj.compute(cr, uid, journal.currency.id, invoice.company_id.currency_id.id, amount, context=ctx)
currency_id = journal.currency.id
# Put the paid amount in currency, and the currency, in the context if currency is different from company's currency
context.update({'amount_currency':data['amount'],'currency_id':currency_id})
if invoice.company_id.currency_id.id<>invoice.currency_id.id:
ctx = {'date':data['date']}
amount = cur_obj.compute(cr, uid, invoice.currency_id.id, invoice.company_id.currency_id.id, amount, context=ctx)
currency_id = invoice.currency_id.id
# Put the paid amount in currency, and the currency, in the context if currency is different from company's currency
context.update({'amount_currency':data['amount'],'currency_id':currency_id})
# Take the choosen date
if comment:
context.update({'date_p':data['date'],'comment':comment})
else:
context.update({'date_p':data['date'],'comment':False})
acc_id = journal.default_credit_account_id and journal.default_credit_account_id.id
if not acc_id:
raise osv.except_osv(_('Error !'), _('Your journal must have a default credit and debit account.'))
self.pool.get('account.invoice').pay_and_reconcile(cr, uid, [context['active_id']],
amount, acc_id, data['period_id'], data['journal_id'], writeoff_account_id,
data['period_id'], writeoff_journal_id, context, data['name'])
return {}
account_invoice_pay()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_invoice_pay" model="ir.ui.view">
<field name="name">account.invoice.pay.form</field>
<field name="model">account.invoice.pay</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Pay invoice">
<group colspan="4" >
<field name="amount"/>
<newline/>
<field name="name"/>
<field name="date"/>
<field name="journal_id"/>
<field name="period_id"/>
</group>
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-execute" string="Partial Payment" name="pay_and_reconcile" type="object"/>
<button icon="gtk-execute" string="Full Payment" name="wo_check" type="object"/>
</group>
</form>
</field>
</record>
<act_window name="Pay Invoice"
res_model="account.invoice.pay"
src_model="account.invoice"
view_mode="form"
target="new"
key2="client_action_multi"
id="action_view_account_invoice_pay"/>
<record id="view_account_invoice_pay_writeoff" model="ir.ui.view">
<field name="name">account.invoice.pay.writeoff.form</field>
<field name="model">account.invoice.pay.writeoff</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Information addendum">
<group colspan="4" >
<separator string="Write-Off Move" colspan="4"/>
<field name="writeoff_journal_id"/>
<field name="writeoff_acc_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<field name="comment"/>
<separator string="Analytic" colspan="4"/>
<field name="analytic_id"/>
</group>
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-execute" string="Pay and reconcile" name="pay_and_reconcile_writeoff" type="object"/>
</group>
</form>
</field>
</record>
</data>
</openerp>

View File

@ -21,7 +21,6 @@
from osv import fields, osv
from tools.translate import _
import tools
class account_period_close(osv.osv_memory):
"""
@ -30,7 +29,7 @@ class account_period_close(osv.osv_memory):
_name = "account.period.close"
_description = "period close"
_columns = {
'sure': fields.boolean('Check this box', required=False),
'sure': fields.boolean('Check this box'),
}
def data_save(self, cr, uid, ids, context={}):
@ -47,8 +46,8 @@ class account_period_close(osv.osv_memory):
for id in context['active_ids']:
cr.execute('update account_journal_period set state=%s where period_id=%s', (mode, id))
cr.execute('update account_period set state=%s where id=%s', (mode, id))
return {}
return {}
account_period_close()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,66 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import osv, fields
from tools.translate import _
class account_print_journal(osv.osv_memory):
_name = 'account.print.journal'
_description = 'Account Print Journal'
_columns = {
'journal_id': fields.many2many('account.journal', 'account_journal_rel', 'account_id', 'journal_id', 'Journals', required=True),
'period_id': fields.many2many('account.period', 'account_period_rel', 'account_id', 'period_id', 'Periods', required=True),
'sort_selection': fields.selection([('date','By date'),
('ref','Reference Number'),],
'Entries Sorted By', required=True),
}
_defaults = {
'sort_selection': lambda *a: 'date',
}
def check_data(self, cr, uid, ids, context={}):
obj_jperiod = self.pool.get('account.journal.period')
datas = {}
datas['ids'] = []
datas['model'] = 'account.journal.period'
datas['form'] = self.read(cr, uid, ids)[0]
period_id = datas['form']['period_id']
journal_id = datas['form']['journal_id']
if type(period_id)==type([]):
ids_final = []
for journal in journal_id:
for period in period_id:
ids_journal_period = obj_jperiod.search(cr,uid, [('journal_id','=',journal),('period_id','=',period)], context=context)
if ids_journal_period:
ids_final.append(ids_journal_period)
if not ids_final:
raise osv.except_osv(_('No Data Available'), _('No records found for your selection!'))
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.journal.period.print',
'datas': datas,
}
account_print_journal()
#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_print_journal" model="ir.ui.view">
<field name="name">Account Print Journal</field>
<field name="model">account.print.journal</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Print Journal">
<group col="4" colspan="6">
<field name="journal_id"/>
<field name="period_id"/>
<newline/>
<field name="sort_selection"/>
</group>
<separator colspan="4"/>
<group col="2" colspan="4">
<button special="cancel" string="Cancel" icon='gtk-cancel'/>
<button name="check_data" string="Print" colspan="1" type="object" icon="gtk-ok"/>
</group>
</form>
</field>
</record>
<record id="action_account_print_journal" model="ir.actions.act_window">
<field name="name">Account Print Journal</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.print.journal</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<menuitem
name="Print Journal"
parent="account.menu_generic_report"
action="action_account_print_journal"
id="menu_account_print_journal"
icon="STOCK_PRINT"/>
</data>
</openerp>

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,11 +15,30 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import osv, fields
import project_issue_report
import netsvc
from tools.translate import _
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
class account_state_open(osv.osv_memory):
_name = 'account.state.open'
_description = 'Account State Open'
def change_inv_state(self, cr, uid, ids, context=None):
obj_invoice = self.pool.get('account.invoice')
if context is None:
context = {}
if 'active_ids' in context:
data_inv = obj_invoice.browse(cr, uid, context['active_ids'][0], context=context)
if data_inv.reconciled:
raise osv.except_osv(_('Warning'), _('Invoice is already reconciled'))
wf_service = netsvc.LocalService("workflow")
res = wf_service.trg_validate(uid, 'account.invoice', context['active_ids'][0], 'open_test', cr)
return {}
account_state_open()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_state_open" model="ir.ui.view">
<field name="name">Account State Open</field>
<field name="model">account.state.open</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Open Invoice">
<label string="Are you sure you want to open this invoice ?"/>
<newline/>
<label string="(Invoice should be unreconciled if you want to open it)"/>
<separator colspan="4"/>
<group colspan="2" col="4">
<button special="cancel" string="No" icon="gtk-no"/>
<button name="change_inv_state" string="Yes" type="object" icon="gtk-yes"/>
</group>
</form>
</field>
</record>
<record id="action_account_state_open" model="ir.actions.act_window">
<field name="name">Account State Open</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.state.open</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="view_account_state_open"/>
<field name="context">{'record_id' : active_id}</field>
<field name="target">new</field>
</record>
</data>
</openerp>

View File

@ -0,0 +1,163 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import time
from osv import fields, osv
from tools.translate import _
class account_statement_from_invoice_lines(osv.osv_memory):
"""
Generate Entries by Statement from Invoices
"""
_name = "account.statement.from.invoice.lines"
_description = "Entries by Statement from Invoices"
_columns = {
'line_ids': fields.many2many('account.move.line', 'account_move_line_relation', 'move_id', 'line_id', 'Invoices'),
}
def populate_statement(self, cr, uid, ids, context=None):
line_obj = self.pool.get('account.move.line')
statement_obj = self.pool.get('account.bank.statement')
statement_line_obj = self.pool.get('account.bank.statement.line')
currency_obj = self.pool.get('res.currency')
statement_reconcile_obj = self.pool.get('account.bank.statement.reconcile')
data = self.read(cr, uid, ids,context=context)[0]
line_ids = data['line_ids']
line_date = time.strftime('%Y-%m-%d')
if not line_ids:
return {}
statement_id = 'statement_id' in context and context['statement_id']
statement = statement_obj.browse(cr, uid, statement_id, context=context)
# for each selected move lines
for line in line_obj.browse(cr, uid, line_ids, context=context):
ctx = context.copy()
# take the date for computation of currency => use payment date
# if line.date_maturity:
# ctx['date'] = line.date_maturity
# else:
ctx['date'] = line_date
amount = 0.0
if line.amount_currency:
amount = currency_obj.compute(cr, uid, line.currency_id.id,
statement.currency.id, line.amount_currency, context=ctx)
else:
if line.debit > 0:
amount=line.debit
elif line.credit > 0:
amount=-line.credit
reconcile_id = statement_reconcile_obj.create(cr, uid, {
'line_ids': [(6, 0, [line.id])]
}, context=context)
if line.journal_id.type == 'sale':
type = 'customer'
elif line.journal_id.type == 'purchase':
type = 'supplier'
else:
type = 'general'
statement_line_obj.create(cr, uid, {
'name': line.name or '?',
'amount': amount,
'type': type,
'partner_id': line.partner_id.id,
'account_id': line.account_id.id,
'statement_id': statement_id,
'ref': line.ref,
'reconcile_id': reconcile_id,
'date': time.strftime('%Y-%m-%d'), #time.strftime('%Y-%m-%d'), #line.date_maturity or,
}, context=context)
return {}
account_statement_from_invoice_lines()
class account_statement_from_invoice(osv.osv_memory):
"""
Generate Entries by Statement from Invoices
"""
_name = "account.statement.from.invoice"
_description = "Entries by Statement from Invoices"
_columns = {
'date': fields.date('Date payment',required=True),
'journal_ids': fields.many2many('account.journal','account_journal_relation','account_id','journal_id','Journal'),
'line_ids': fields.many2many('account.move.line','account_move_line_relation','move_id','line_id','Invoices'),
}
_defaults = {
'date':lambda *a: time.strftime('%Y-%m-%d'),
}
def search_invoices(self, cr, uid, ids, context=None):
line_obj = self.pool.get('account.move.line')
statement_obj = self.pool.get('account.bank.statement')
journal_obj = self.pool.get('account.journal')
mod_obj = self.pool.get('ir.model.data')
statement_id = 'statement_id' in context and context['statement_id']
data = self.read(cr, uid, ids,context=context)[0]
statement = statement_obj.browse(cr, uid, statement_id, context=context)
args_move_line = []
repeated_move_line_ids = []
# Creating a group that is unique for importing move lines(move lines, once imported into statement lines, should not appear again)
for st_line in statement.line_ids:
args_move_line = []
args_move_line.append(('name','=', st_line.name))
args_move_line.append(('ref','=',st_line.ref))
if st_line.partner_id:
args_move_line.append(('partner_id','=',st_line.partner_id.id))
args_move_line.append(('account_id','=',st_line.account_id.id))
move_line_id = line_obj.search(cr, uid, args_move_line,context=context)
if move_line_id:
repeated_move_line_ids += move_line_id
journal_ids = data['journal_ids']
if journal_ids == []:
journal_ids = journal_obj.search(cr, uid, [('type', 'in', ('sale','cash','purchase'))], context=context)
args = [
('reconcile_id', '=', False),
('journal_id', 'in', journal_ids),
('account_id.reconcile', '=', True)]
if repeated_move_line_ids:
args.append(('id','not in',repeated_move_line_ids))
line_ids = line_obj.search(cr, uid, args,
#order='date DESC, id DESC', #doesn't work
context=context)
model_data_ids = mod_obj.search(cr,uid,[('model','=','ir.ui.view'),('name','=','view_account_statement_from_invoice_lines')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
return {
'domain': "[('id','in', ["+','.join([str(x) for x in line_ids])+"])]",
'name': _('Import Entries'),
'context': context,
'view_type': 'form',
'view_mode': 'form',
'res_model': 'account.statement.from.invoice.lines',
'views': [(resource_id,'form')],
'type': 'ir.actions.act_window',
'target': 'new',
}
account_statement_from_invoice()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_statement_from_invoice" model="ir.ui.view">
<field name="name">account.statement.from.invoice.form</field>
<field name="model">account.statement.from.invoice</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Import Invoices in Statement">
<group colspan="4" >
<field name="date"/>
<newline/>
<field name="journal_ids" domain="[('type','in',['sale','purchase','cash'])]"/>
</group>
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-execute" string="Go" name="search_invoices" type="object"/>
</group>
</form>
</field>
</record>
<record id="action_view_account_statement_from_invoice" model="ir.actions.act_window">
<field name="name">Import Invoices in Statement</field>
<field name="res_model">account.statement.from.invoice</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_account_statement_from_invoice"/>
<field name="target">new</field>
</record>
<record id="view_account_statement_from_invoice_lines" model="ir.ui.view">
<field name="name">account.statement.from.invoice.lines.form</field>
<field name="model">account.statement.from.invoice.lines</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Import Entries">
<group colspan="4" >
<field name="line_ids" />
</group>
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-execute" string="Ok" name="populate_statement" type="object"/>
</group>
</form>
</field>
</record>
<record id="action_view_account_statement_from_invoice_lines" model="ir.actions.act_window">
<field name="name">Import Entries</field>
<field name="res_model">account.statement.from.invoice.lines</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_account_statement_from_invoice_lines"/>
<field name="target">new</field>
</record>
</data>
</openerp>

View File

@ -0,0 +1,67 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
from tools.translate import _
class validate_account_move(osv.osv_memory):
_name = "validate.account.move"
_description = "Validate Account Move"
_columns = {
'journal_id': fields.many2one('account.journal', 'Journal', required=True),
'period_id': fields.many2one('account.period', 'Period', required=True, domain=[('state','<>','done')]),
}
def validate_move(self, cr, uid, ids, context=None):
obj_move = self.pool.get('account.move')
if context is None:
context = {}
data = self.read(cr, uid, ids)[0]
ids_move = obj_move.search(cr, uid, [('state','=','draft'),('journal_id','=',data['journal_id']),('period_id','=',data['period_id'])])
if not ids_move:
raise osv.except_osv(_('Warning'), _('Specified Journal does not have any account move entries in draft state for this period'))
obj_move.button_validate(cr, uid, ids_move, context)
return {}
validate_account_move()
class validate_account_move_lines(osv.osv_memory):
_name = "validate.account.move.lines"
_description = "Validate Account Move Lines"
def validate_move_lines(self, cr, uid, ids, context=None):
obj_move_line = self.pool.get('account.move.line')
obj_move = self.pool.get('account.move')
move_ids = []
if context is None:
context = {}
data_line = obj_move_line.browse(cr, uid, context['active_ids'], context)
for line in data_line:
if line.move_id.state=='draft':
move_ids.append(line.move_id.id)
move_ids = list(set(move_ids))
if not move_ids:
raise osv.except_osv(_('Warning'), _('Selected Entry Lines does not have any account move enties in draft state'))
obj_move.button_validate(cr, uid, move_ids, context)
return {}
validate_account_move_lines()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--Account Moves-->
<record id="validate_account_move_view" model="ir.ui.view">
<field name="name">Validate Account Move</field>
<field name="model">validate.account.move</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Validate Account Entries">
<separator string="Select Period and Journal for Validation" colspan="4"/>
<field name="journal_id"/>
<newline/>
<field name="period_id"/>
<separator string="Information" colspan="4"/>
<label string="All draft account entries in this journal and period will be validated. It means you won't be able to modify their accouting fields." colspan="4"/>
<group colspan="4" col="6">
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-open" string="Validate" name="validate_move" type="object"/>
</group>
</form>
</field>
</record>
<record id="action_validate_account_move" model="ir.actions.act_window">
<field name="name">Open Journal</field>
<field name="res_model">validate.account.move</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="validate_account_move_view"/>
<field name="target">new</field>
</record>
<menuitem
name="Validate Ledger Postings"
parent="account.menu_finance_periodical_processing"
action="action_validate_account_move"
id="menu_validate_account_moves"
/>
<!--Account Move lines-->
<record id="validate_account_move_line_view" model="ir.ui.view">
<field name="name">Validate Ledger Postings</field>
<field name="model">validate.account.move.lines</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Validate Moves">
<separator string="Validate Ledger Postings" colspan="4"/>
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
<button name="validate_move_lines" string="Validate" type="object" icon="gtk-go-forward" default_focus="1"/>
</form>
</field>
</record>
<record id="action_validate_account_move_line" model="ir.actions.act_window">
<field name="name">Validate Ledger Postings</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">validate.account.move.lines</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="validate_account_move_line_view"/>
<field name="context">{'record_id' : active_id}</field>
<field name="target">new</field>
</record>
<record model="ir.values" id="event_registration_values">
<field name="model_id" ref="account.model_account_move_line" />
<field name="object" eval="1" />
<field name="name">Validate Ledger Postings</field>
<field name="key2">client_action_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_validate_account_move_line'))" />
<field name="key">action</field>
<field name="model">account.move.line</field>
</record>
</data>
</openerp>

View File

@ -0,0 +1,64 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import osv, fields
class account_vat_declaration(osv.osv_memory):
_name = 'account.vat.declaration'
_description = 'Account Vat Declaration'
_columns = {
'based_on': fields.selection([('invoices','Invoices'),
('payments','Payments'),],
'Based On', required=True),
'company_id': fields.many2one('res.company', 'Company', required=True),
'periods': fields.many2many('account.period', 'vat_period_rel', 'vat_id', 'period_id', 'Periods', help="All periods if empty"),
}
def _get_company(self, cr, uid, ids, context={}):
user_obj = self.pool.get('res.users')
company_obj = self.pool.get('res.company')
user = user_obj.browse(cr, uid, uid, context=context)
if user.company_id:
return user.company_id.id
else:
return company_obj.search(cr, uid, [('parent_id', '=', False)])[0]
_defaults = {
'based_on': lambda *a: 'invoices',
'company_id': _get_company
}
def create_vat(self, cr, uid, ids, context={}):
if context is None:
context = {}
datas = {'ids': context.get('active_ids', [])}
datas['model'] = 'account.tax.code'
datas['form'] = self.read(cr, uid, ids)[0]
return {
'type': 'ir.actions.report.xml',
'report_name': 'account.vat.declaration',
'datas': datas,
}
account_vat_declaration()
#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<menuitem
id="menu_tax_report"
name="Taxes"
parent="account.menu_finance_generic_reporting" sequence="3"/>
<record id="view_account_vat_declaration" model="ir.ui.view">
<field name="name">Account Vat Declaration</field>
<field name="model">account.vat.declaration</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Select Period">
<field name="company_id"/>
<newline/>
<field name="based_on"/>
<newline/>
<field name="periods"/>
<group col="2" colspan="4">
<button icon='gtk-cancel' special="cancel" string="Cancel" />
<button name="create_vat" string="Print VAT Decl." colspan="1" type="object" icon="gtk-ok"/>
</group>
</form>
</field>
</record>
<record id="action_account_vat_declaration" model="ir.actions.act_window">
<field name="name">Account Vat Declaration</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.vat.declaration</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<menuitem
name="Print Taxes Report"
parent="menu_tax_report"
action="action_account_vat_declaration"
id="menu_account_vat_declaration"
icon="STOCK_PRINT"/>
</data>
</openerp>

View File

@ -1,72 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import wizard
import pooler
from tools.translate import _
form = '''<?xml version="1.0"?>
<form string="Print Central Journal">
<field name="journal_id"/>
<field name="period_id"/>
</form>'''
fields = {
'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'required': True},
'period_id': {'string': 'Period', 'type': 'many2many', 'relation': 'account.period', 'required': True},
}
def _check_data(self, cr, uid, data, *args):
period_id = data['form']['period_id'][0][2]
journal_id=data['form']['journal_id'][0][2]
if type(period_id)==type([]):
ids_final = []
for journal in journal_id:
for period in period_id:
ids_journal_period = pooler.get_pool(cr.dbname).get('account.journal.period').search(cr,uid, [('journal_id','=',journal),('period_id','=',period)])
if ids_journal_period:
ids_final.append(ids_journal_period)
if not ids_final:
raise wizard.except_wizard(_('No Data Available'), _('No records found for your selection!'))
return data['form']
class wizard_print_journal(wizard.interface):
states = {
'init': {
'actions': [],
'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel', 'gtk-cancel'), ('print', 'Print', 'gtk-ok'))},
},
'print': {
'actions': [_check_data],
'result': {'type':'print', 'report':'account.central.journal.wiz', 'state':'end'},
},
}
wizard_print_journal('account.central.journal.report')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,106 +0,0 @@
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import wizard
import pooler
class wizard_change_currency(wizard.interface):
'''
OpenERP Wizard
'''
form = '''<?xml version="1.0"?>
<form string="Invoice Currency">
<field name="currency_id"/>
</form>'''
message = '''<?xml version="1.0"?>
<form string="Invoice Currency">
<label string="You can not change currency for Open Invoice !"/>
</form>'''
fields = {
'currency_id': {'string': 'New Currency', 'type': 'many2one', 'relation': 'res.currency', 'required':True},
}
def _get_defaults(self, cr, user, data, context):
#TODO : initlize required data
return data['form']
def _change_currency(self, cr, uid, data, context):
pool = pooler.get_pool(cr.dbname)
inv_obj = pool.get('account.invoice')
inv_line_obj = pool.get('account.invoice.line')
curr_obj = pool.get('res.currency')
invoice_ids = data['ids']
new_currency = data['form']['currency_id']
for invoice in inv_obj.browse(cr, uid, invoice_ids, context=context):
if invoice.currency_id.id == new_currency:
continue
for line in invoice.invoice_line:
rate = curr_obj.browse(cr, uid, new_currency).rate
new_price = 0
if invoice.company_id.currency_id.id == invoice.currency_id.id:
new_price = line.price_unit * rate
if invoice.company_id.currency_id.id != invoice.currency_id.id and invoice.company_id.currency_id.id == new_currency:
old_rate = invoice.currency_id.rate
new_price = line.price_unit / old_rate
if invoice.company_id.currency_id.id != invoice.currency_id.id and invoice.company_id.currency_id.id != new_currency:
old_rate = invoice.currency_id.rate
new_price = (line.price_unit / old_rate ) * rate
inv_line_obj.write(cr, uid, [line.id], {'price_unit':new_price})
inv_obj.write(cr, uid, [invoice.id], {'currency_id':new_currency})
return {}
def _check_what_next(self, cr, uid, data, context):
pool = pooler.get_pool(cr.dbname)
inv_obj = pool.get('account.invoice')
if inv_obj.browse(cr, uid, data['id']).state != 'draft':
return 'message'
return 'change'
states = {
'init': {
'actions': [],
'result': {'type': 'choice', 'next_state': _check_what_next},
},
'change': {
'actions': [],
'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel', 'gtk-cancel'), ('next', 'Change Currency', 'gtk-go-forward'))},
},
'next': {
'actions': [_change_currency],
'result': {'type': 'state', 'state': 'end'},
},
'message': {
'actions': [],
'result': {'type': 'form', 'arch': message, 'fields': {}, 'state': [('end', 'Ok', 'gtk-cancel')]},
},
}
wizard_change_currency('account.invoice.currency_change')

View File

@ -1,228 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import wizard
import osv
import pooler
from tools.translate import _
_transaction_form = '''<?xml version="1.0"?>
<form string="Close Fiscal Year with new entries">
<field name="fy_id"/>
<field name="fy2_id"/>
<field name="journal_id"/>
<field name="period_id"/>
<field name="report_name" colspan="4"/>
<separator string="Are you sure you want to create entries?" colspan="4"/>
<field name="sure"/>
</form>'''
_transaction_fields = {
'fy_id': {'string':'Fiscal Year to close', 'type':'many2one', 'relation': 'account.fiscalyear','required':True, 'domain':[('state','=','draft')]},
'journal_id': {'string':'Opening Entries Journal', 'type':'many2one', 'relation': 'account.journal','required':True},
'period_id': {'string':'Opening Entries Period', 'type':'many2one', 'relation': 'account.period','required':True, 'domain':"[('fiscalyear_id','=',fy2_id)]"},
'fy2_id': {'string':'New Fiscal Year', 'type':'many2one', 'relation': 'account.fiscalyear', 'domain':[('state','=','draft')], 'required':True},
'report_name': {'string':'Name of new entries', 'type':'char', 'size': 64, 'required':True},
'sure': {'string':'Check this box', 'type':'boolean'},
}
def _data_load(self, cr, uid, data, context):
data['form']['report_name'] = _('End of Fiscal Year Entry')
return data['form']
def _data_save(self, cr, uid, data, context):
if not data['form']['sure']:
raise wizard.except_wizard(_('UserError'), _('Closing of fiscal year cancelled, please check the box !'))
pool = pooler.get_pool(cr.dbname)
fy_id = data['form']['fy_id']
period_ids = pool.get('account.period').search(cr, uid, [('fiscalyear_id', '=', fy_id)])
periods_fy2 = pool.get('account.period').search(cr, uid, [('fiscalyear_id', '=', data['form']['fy2_id'])])
period = pool.get('account.period').browse(cr, uid, data['form']['period_id'], context=context)
new_fyear = pool.get('account.fiscalyear').browse(cr, uid, data['form']['fy2_id'], context=context)
old_fyear = pool.get('account.fiscalyear').browse(cr, uid, data['form']['fy_id'], context=context)
new_journal = data['form']['journal_id']
new_journal = pool.get('account.journal').browse(cr, uid, new_journal, context=context)
if not new_journal.default_credit_account_id or not new_journal.default_debit_account_id:
raise wizard.except_wizard(_('UserError'),
_('The journal must have default credit and debit account'))
if not new_journal.centralisation:
raise wizard.except_wizard(_('UserError'),
_('The journal must have centralised counterpart'))
move_ids = pool.get('account.move.line').search(cr, uid, [
('journal_id','=',new_journal.id),('period_id.fiscalyear_id','=',new_fyear.id)])
if move_ids:
raise wizard.except_wizard(_('UserError'),
_('The opening journal must not have any entry in the new fiscal year !'))
query = "SELECT id FROM account_fiscalyear WHERE date_stop < '" + str(new_fyear.date_start) + "'"
cr.execute(query)
result = cr.dictfetchall()
fy_ids = ','.join([str(x['id']) for x in result])
query_line = pool.get('account.move.line')._query_get(cr, uid,
obj='account_move_line', context={'fiscalyear': fy_ids})
cr.execute('select id from account_account WHERE active')
ids = map(lambda x: x[0], cr.fetchall())
for account in pool.get('account.account').browse(cr, uid, ids,
context={'fiscalyear': fy_id}):
accnt_type_data = account.user_type
if not accnt_type_data:
continue
if accnt_type_data.close_method=='none' or account.type == 'view':
continue
if accnt_type_data.close_method=='balance':
if abs(account.balance)>0.0001:
pool.get('account.move.line').create(cr, uid, {
'debit': account.balance>0 and account.balance,
'credit': account.balance<0 and -account.balance,
'name': data['form']['report_name'],
'date': period.date_start,
'journal_id': new_journal.id,
'period_id': period.id,
'account_id': account.id
}, {'journal_id': new_journal.id, 'period_id':period.id})
if accnt_type_data.close_method == 'unreconciled':
offset = 0
limit = 100
while True:
cr.execute('SELECT id, name, quantity, debit, credit, account_id, ref, ' \
'amount_currency, currency_id, blocked, partner_id, ' \
'date_maturity, date_created ' \
'FROM account_move_line ' \
'WHERE account_id = %s ' \
'AND ' + query_line + ' ' \
'AND reconcile_id is NULL ' \
'ORDER BY id ' \
'LIMIT %s OFFSET %s', (account.id, limit, offset))
result = cr.dictfetchall()
if not result:
break
for move in result:
move.pop('id')
move.update({
'date': period.date_start,
'journal_id': new_journal.id,
'period_id': period.id,
})
pool.get('account.move.line').create(cr, uid, move, {
'journal_id': new_journal.id,
'period_id': period.id,
})
offset += limit
#We have also to consider all move_lines that were reconciled
#on another fiscal year, and report them too
offset = 0
limit = 100
while True:
#TODO: this query could be improved in order to work if there is more than 2 open FY
# a.period_id IN ('+fy2_period_set+') is the problematic clause
cr.execute('SELECT b.id, b.name, b.quantity, b.debit, b.credit, b.account_id, b.ref, ' \
'b.amount_currency, b.currency_id, b.blocked, b.partner_id, ' \
'b.date_maturity, b.date_created ' \
'FROM account_move_line a, account_move_line b ' \
'WHERE b.account_id = %s ' \
'AND b.reconcile_id is NOT NULL ' \
'AND a.reconcile_id = b.reconcile_id ' \
'AND b.period_id =ANY(%s)'\
'AND a.period_id =ANY(%s)' \
'ORDER BY id ' \
'LIMIT %s OFFSET %s', (account.id,period_ids,periods_fy2,limit, offset))
result = cr.dictfetchall()
if not result:
break
for move in result:
move.pop('id')
move.update({
'date': period.date_start,
'journal_id': new_journal.id,
'period_id': period.id,
})
pool.get('account.move.line').create(cr, uid, move, {
'journal_id': new_journal.id,
'period_id': period.id,
})
offset += limit
if accnt_type_data.close_method=='detail':
offset = 0
limit = 100
while True:
cr.execute('SELECT id, name, quantity, debit, credit, account_id, ref, ' \
'amount_currency, currency_id, blocked, partner_id, ' \
'date_maturity, date_created ' \
'FROM account_move_line ' \
'WHERE account_id = %s ' \
'AND ' + query_line + ' ' \
'ORDER BY id ' \
'LIMIT %s OFFSET %s', (account.id, limit, offset))
result = cr.dictfetchall()
if not result:
break
for move in result:
move.pop('id')
move.update({
'date': period.date_start,
'journal_id': new_journal.id,
'period_id': period.id,
})
pool.get('account.move.line').create(cr, uid, move)
offset += limit
ids = pool.get('account.move.line').search(cr, uid, [('journal_id','=',new_journal.id),
('period_id.fiscalyear_id','=',new_fyear.id)])
context['fy_closing'] = True
if ids:
pool.get('account.move.line').reconcile(cr, uid, ids, context=context)
new_period = data['form']['period_id']
ids = pool.get('account.journal.period').search(cr, uid, [('journal_id','=',new_journal.id),('period_id','=',new_period)])
if not ids:
ids = [pool.get('account.journal.period').create(cr, uid, {
'name': (new_journal.name or '')+':'+(period.code or ''),
'journal_id': new_journal.id,
'period_id': period.id
})]
cr.execute('UPDATE account_fiscalyear ' \
'SET end_journal_period_id = %s ' \
'WHERE id = %s', (ids[0], old_fyear.id))
return {}
class wiz_journal_close(wizard.interface):
states = {
'init': {
'actions': [_data_load],
'result': {'type': 'form', 'arch':_transaction_form, 'fields':_transaction_fields, 'state':[('end','Cancel', 'gtk-cancel'),('close','Create', 'gtk-ok')]}
},
'close': {
'actions': [_data_save],
'result': {'type': 'state', 'state':'end'}
}
}
wiz_journal_close('account.fiscalyear.close')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,70 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import wizard
import pooler
from tools.translate import _
form = '''<?xml version="1.0"?>
<form string="Print General Journal">
<field name="journal_id"/>
<field name="period_id"/>
</form>'''
fields = {
'journal_id': {'string': 'Journal', 'type': 'many2many', 'relation': 'account.journal', 'required': True},
'period_id': {'string': 'Period', 'type': 'many2many', 'relation': 'account.period', 'required': True},
}
def _check_data(self, cr, uid, data, *args):
period_id = data['form']['period_id'][0][2]
journal_id=data['form']['journal_id'][0][2]
if type(period_id)==type([]):
ids_final = []
for journal in journal_id:
for period in period_id:
ids_journal_period = pooler.get_pool(cr.dbname).get('account.journal.period').search(cr,uid, [('journal_id','=',journal),('period_id','=',period)])
if ids_journal_period:
ids_final.append(ids_journal_period)
if not ids_final:
raise wizard.except_wizard(_('No Data Available'), _('No records found for your selection!'))
return data['form']
class wizard_print_journal(wizard.interface):
states = {
'init': {
'actions': [],
'result': {'type': 'form', 'arch': form, 'fields': fields, 'state': (('end', 'Cancel', 'gtk-cancel'), ('print', 'Print', 'gtk-ok'))},
},
'print': {
'actions': [_check_data],
'result': {'type':'print', 'report':'account.general.journal.wiz', 'state':'end'},
},
}
wizard_print_journal('account.general.journal.report')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,81 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import wizard
import netsvc
import pooler
from osv import fields, osv
from tools.translate import _
form = """<?xml version="1.0"?>
<form string="Choose Fiscal Year">
<field name="fyear_id" domain="[('state','=','draft')]"/>
</form>
"""
fields = {
'fyear_id': {'string': 'Fiscal Year to Open', 'type': 'many2one', 'relation': 'account.fiscalyear', 'required': True},
}
def _remove_entries(self, cr, uid, data, context):
pool = pooler.get_pool(cr.dbname)
data_fyear = pool.get('account.fiscalyear').browse(cr,uid,data['form']['fyear_id'])
if not data_fyear.end_journal_period_id:
raise wizard.except_wizard(_('Error'), _('No journal for ending writing has been defined for the fiscal year'))
period_journal = data_fyear.end_journal_period_id
ids_move = pool.get('account.move').search(cr,uid,[('journal_id','=',period_journal.journal_id.id),('period_id','=',period_journal.period_id.id)])
if ids_move:
cr.execute('delete from account_move where id =ANY(%s)',(ids_move,))
#cr.execute('UPDATE account_journal_period ' \
# 'SET state = %s ' \
# 'WHERE period_id IN (SELECT id FROM account_period WHERE fiscalyear_id = %s)',
# ('draft',data_fyear))
#cr.execute('UPDATE account_period SET state = %s ' \
# 'WHERE fiscalyear_id = %s', ('draft',data_fyear))
#cr.execute('UPDATE account_fiscalyear ' \
# 'SET state = %s, end_journal_period_id = null '\
# 'WHERE id = %s', ('draft',data_fyear))
return {}
class open_closed_fiscal(wizard.interface):
states = {
'init' : {
'actions' : [],
'result': {
'type': 'form',
'arch': form,
'fields': fields,
'state':[('end','Cancel', 'gtk-cancel'),('open','Open', 'gtk-ok')]
}
},
'open': {
'actions': [],
'result': {
'type':'action',
'action':_remove_entries,
'state':'end'
},
},
}
open_closed_fiscal("account.open_closed_fiscalyear")
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

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