[MERGE] trunk

bzr revid: tfr@openerp.com-20111226090745-o0hk7gjllsriulrs
This commit is contained in:
tfr@openerp.com 2011-12-26 10:07:45 +01:00
commit b59fea4e68
5361 changed files with 1017387 additions and 847543 deletions

View File

@ -169,7 +169,7 @@ class account_account_type(osv.osv):
_columns = {
'name': fields.char('Account Type', size=64, required=True, translate=True),
'code': fields.char('Code', size=32, required=True),
'code': fields.char('Code', size=32, required=True, select=True),
'close_method': fields.selection([('none', 'None'), ('balance', 'Balance'), ('detail', 'Detail'), ('unreconciled', 'Unreconciled')], 'Deferral Method', required=True, help="""Set here the method that will be used to generate the end of year journal entries for all the accounts of this type.
'None' means that nothing will be done.
@ -456,6 +456,7 @@ class account_account(osv.osv):
'user_type': fields.many2one('account.account.type', 'Account Type', required=True,
help="Account Type is used for information purpose, to generate "
"country-specific legal reports, and set the rules to close a fiscal year and generate opening entries."),
'financial_report_ids': fields.many2many('account.financial.report', 'account_account_financial_report', 'account_id', 'report_line_id', 'Financial Reports'),
'parent_id': fields.many2one('account.account', 'Parent', ondelete='cascade', domain=[('type','=','view')]),
'child_parent_ids': fields.one2many('account.account','parent_id','Children'),
'child_consol_ids': fields.many2many('account.account', 'account_account_consol_rel', 'child_id', 'parent_id', 'Consolidated Children'),
@ -2458,6 +2459,7 @@ class account_account_template(osv.osv):
'user_type': fields.many2one('account.account.type', 'Account Type', required=True,
help="These types are defined according to your country. The type contains more information "\
"about the account and its specificities."),
'financial_report_ids': fields.many2many('account.financial.report', 'account_template_financial_report', 'account_template_id', 'report_line_id', 'Financial Reports'),
'reconcile': fields.boolean('Allow Reconciliation', help="Check this option if you want the user to reconcile entries in this account."),
'shortcut': fields.char('Shortcut', size=12),
'note': fields.text('Note'),
@ -2522,7 +2524,7 @@ class account_account_template(osv.osv):
#deactivate the parent_store functionnality on account_account for rapidity purpose
ctx = context.copy()
ctx.update({'defer_parent_store_computation': True})
children_acc_template = self.search(cr, uid, ['|', ('chart_template_id','=', [chart_template_id]),'&',('parent_id','child_of', [template.account_root_id.id]),('chart_template_id','=', False), ('nocreate','!=',True)], order='id')
children_acc_template = self.search(cr, uid, ['|', ('chart_template_id','=', chart_template_id),'&',('parent_id','child_of', [template.account_root_id.id]),('chart_template_id','=', False), ('nocreate','!=',True)], order='id')
for account_template in self.browse(cr, uid, children_acc_template, context=context):
# skip the root of COA if it's not the main one
if (template.account_root_id.id == account_template.id) and template.parent_id:
@ -2544,6 +2546,7 @@ class account_account_template(osv.osv):
'reconcile': account_template.reconcile,
'shortcut': account_template.shortcut,
'note': account_template.note,
'financial_report_ids': account_template.financial_report_ids and [(6,0,[x.id for x in account_template.financial_report_ids])] or False,
'parent_id': account_template.parent_id and ((account_template.parent_id.id in acc_template_ref) and acc_template_ref[account_template.parent_id.id]) or False,
'tax_ids': [(6,0,tax_ids)],
'company_id': company_id,
@ -3419,7 +3422,15 @@ class wizard_multi_charts_accounts(osv.osv_memory):
# Create Bank journals
self._create_bank_journals_from_o2m(cr, uid, obj_wizard, company_id, acc_template_ref, context=context)
return True
action = {
'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'board.board',
'view_id': self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'board_account_form')[1],
'menu_id': self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'menu_finance')[1]
}
return action
def _prepare_bank_journal(self, cr, uid, line, current_num, default_account_id, company_id, context=None):
'''

View File

@ -128,7 +128,7 @@ class account_bank_statement(osv.osv):
_description = "Bank Statement"
_columns = {
'name': fields.char('Name', size=64, required=True, states={'draft': [('readonly', False)]}, readonly=True, help='if you give the Name other then /, its created Accounting Entries Move will be with same name as statement name. This allows the statement entries to have the same references than the statement itself'), # readonly for account_cash_statement
'date': fields.date('Date', required=True, states={'confirm': [('readonly', True)]}),
'date': fields.date('Date', required=True, states={'confirm': [('readonly', True)]}, select=True),
'journal_id': fields.many2one('account.journal', 'Journal', required=True,
readonly=True, states={'draft':[('readonly',False)]}),
'period_id': fields.many2one('account.period', 'Period', required=True,
@ -308,7 +308,7 @@ class account_bank_statement(osv.osv):
def balance_check(self, cr, uid, st_id, journal_type='bank', context=None):
st = self.browse(cr, uid, st_id, context=context)
if not (abs((st.balance_end or 0.0) - st.balance_end_real) < 0.0001):
if not ((abs((st.balance_end or 0.0) - st.balance_end_real) < 0.0001) or (abs((st.balance_end or 0.0) - st.balance_end_cash) < 0.0001)):
raise osv.except_osv(_('Error !'),
_('The statement balance is incorrect !\nThe expected balance (%.2f) is different than the computed one. (%.2f)') % (st.balance_end_real, st.balance_end))
return True
@ -358,7 +358,10 @@ class account_bank_statement(osv.osv):
st_line_number = self.get_next_st_line_number(cr, uid, st_number, st_line, context)
self.create_move_from_st_line(cr, uid, st_line.id, company_currency_id, st_line_number, context)
self.write(cr, uid, [st.id], {'name': st_number}, context=context)
self.write(cr, uid, [st.id], {
'name': st_number,
'balance_end_real': st.balance_end
}, context=context)
self.log(cr, uid, st.id, _('Statement %s is confirmed, journal items are created.') % (st_number,))
return self.write(cr, uid, ids, {'state':'confirm'}, context=context)
@ -471,7 +474,7 @@ class account_bank_statement_line(osv.osv):
'Moves'),
'ref': fields.char('Reference', size=32),
'note': fields.text('Notes'),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of bank statement lines."),
'sequence': fields.integer('Sequence', select=True, help="Gives the sequence order when displaying a list of bank statement lines."),
'company_id': fields.related('statement_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
}
_defaults = {

View File

@ -261,7 +261,7 @@ class account_invoice(osv.osv):
'partner_bank_id': fields.many2one('res.partner.bank', 'Bank Account',
help='Bank Account Number, Company bank account if Invoice is customer or supplier refund, otherwise Partner bank account number.', readonly=True, states={'draft':[('readonly',False)]}),
'move_lines':fields.function(_get_lines, type='many2many', relation='account.move.line', string='Entry Lines'),
'residual': fields.function(_amount_residual, digits_compute=dp.get_precision('Account'), string='Residual',
'residual': fields.function(_amount_residual, digits_compute=dp.get_precision('Account'), string='To Pay',
store={
'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line','move_id'], 50),
'account.invoice.tax': (_get_invoice_tax, None, 50),

View File

@ -120,7 +120,7 @@
<field name="number"/>
<field name="partner_id" groups="base.group_user"/>
<field name="reference" invisible="1"/>
<field name="name"/>
<field name="name" invisible="1"/>
<field name="journal_id" invisible="1"/>
<field name="period_id" invisible="1" groups="account.group_account_user"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
@ -269,15 +269,13 @@
<newline/>
<field name="date_invoice"/>
<field name="period_id" domain="[('state', '=', 'draft')]" groups="account.group_account_user" widget="selection"/>
<group colspan="2" col="1" groups="account.group_account_user">
<label align="0.0" string="(keep empty to use the current period)"/>
</group>
<field name="payment_term" widget="selection"/>
<newline/>
<field domain="[('company_id', '=', company_id),('type','=', 'receivable')]" name="account_id" groups="account.group_account_user"/>
<field name="name" groups="base.group_extended"/>
</group>
<notebook colspan="4">
<page string="Invoice">
<field domain="[('company_id', '=', company_id),('type','=', 'receivable')]" name="account_id" groups="account.group_account_user"/>
<field name="name"/>
<field name="payment_term" widget="selection"/>
<field colspan="4" name="invoice_line" nolabel="1" widget="one2many_list" context="{'type': type}"/>
<group col="1" colspan="2">
<field name="tax_line" nolabel="1">

View File

@ -581,14 +581,14 @@ class account_move_line(osv.osv):
lines = self.browse(cr, uid, ids, context=context)
for l in lines:
if l.account_id.type == 'view':
return False
raise osv.except_osv(_('Error :'), _('You can not create move line on view account %s %s') % (l.account_id.code, l.account_id.name))
return True
def _check_no_closed(self, cr, uid, ids, context=None):
lines = self.browse(cr, uid, ids, context=context)
for l in lines:
if l.account_id.type == 'closed':
return False
raise osv.except_osv(_('Error :'), _('You can not create move line on closed account %s %s') % (l.account_id.code, l.account_id.name))
return True
def _check_company_id(self, cr, uid, ids, context=None):
@ -1249,6 +1249,8 @@ class account_move_line(osv.osv):
if len(period_candidate_ids) != 1:
raise osv.except_osv(_('Encoding error'), _('No period found or period given is ambigous.'))
context['period_id'] = period_candidate_ids[0][0]
if not context.get('journal_id', False) and context.get('search_default_journal_id', False):
context['journal_id'] = context.get('search_default_journal_id')
self._update_journal_check(cr, uid, context['journal_id'], context['period_id'], context)
move_id = vals.get('move_id', False)
journal = journal_obj.browse(cr, uid, context['journal_id'], context=context)

View File

@ -303,6 +303,9 @@
<tree string="Unrealized Gains and losses">
<field name="code"/>
<field name="name"/>
<field name="parent_id" invisible="1"/>
<field name="user_type" invisible="1"/>
<field name="type" invisible="1"/>
<field name="currency_id"/>
<field name="exchange_rate"/>
<field name="foreign_balance"/>
@ -474,7 +477,7 @@
<separator string="Company" colspan="4"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="user_id" groups="base.group_extended"/>
<field name="currency"/>
<field name="currency" groups="base.group_extended"/>
</group>
<group colspan="2" col="2" groups="base.group_extended">
<separator string="Validations" colspan="4"/>

View File

@ -1,5 +1,5 @@
<openerp>
<data>
<data noupdate="1">
<!-- Types -->
<record model="account.account.type" id="account_type_income_view1">
<field name="name">Income View</field>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@
<field name="arch" type="xml">
<tree toolbar="1" colors="red:state=='pending';grey:state in ('cancelled','close');blue:type=='view'" string="Analytic Accounts">
<field name="complete_name"/>
<field name="code"/>
<field name="code" groups="base.group_extended"/>
<field name="quantity"/>
<field name="date"/>
<field name="user_id" invisible="1"/>
@ -59,7 +59,7 @@
<field name="arch" type="xml">
<tree colors="red:state=='pending';grey:state in ('close','cancelled');blue:type=='view'" string="Analytic account" toolbar="1">
<field name="name"/>
<field name="code"/>
<field name="code" groups="base.group_extended"/>
<field name="quantity"/>
<field name="debit"/>
<field name="credit"/>
@ -82,8 +82,8 @@
<field name="arch" type="xml">
<form string="Analytic account">
<group colspan="4" col="6">
<field name="name" select="1" colspan="4"/>
<field name="code" select="1"/>
<field name="name" colspan="4"/>
<field name="code" groups="base.group_extended"/>
<field name="parent_id" on_change="on_change_parent(parent_id)" groups="base.group_extended"/>
<field name="company_id" on_change="on_change_company(company_id)" select="2" widget="selection" groups="base.group_multi_company" attrs="{'required': [('type','&lt;&gt;','view')]}"/>
<field name="type" select="2"/>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<document filename="Analytic Balance.pdf">
<template pageSize="(595.0,842.0)" title="Analytic Balance" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<template title="Analytic Balance" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="31.0" y1="30.0" width="531" height="779"/>
</pageTemplate>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<document filename="test.pdf">
<template pageSize="(595.0,842.0)" title="Analytic Journal" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
<template title="Analytic Journal" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="28.0" y1="28.0" width="539" height="786"/>
</pageTemplate>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<document filename="Cost Ledger.pdf">
<template pageSize="(595.0,842.0)" title="Cost Ledger" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<template title="Cost Ledger" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="28.0" y1="30.0" width="539" height="785"/>
</pageTemplate>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<document filename="test.pdf">
<template pageSize="(595.0,842.0)" title="Inverted Analytic Balance" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
<template title="Inverted Analytic Balance" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="28.0" y1="28.0" width="539" height="786"/>
</pageTemplate>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<document filename="Cost Ledger.pdf">
<template pageSize="(595.0,842.0)" title="Cost Ledger" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<template title="Cost Ledger" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="30.0" y1="29.0" width="534" height="783"/>
</pageTemplate>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<document filename="Account Balance.pdf">
<template pageSize="(595.0,842.0)" title="Account Balance" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<template title="Account Balance" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="35.0" y1="35.0" width="525" height="772"/>
</pageTemplate>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<document filename="Centralized Journal.pdf">
<template pageSize="(595.0,842.0)" title="Centralized Journal" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<template title="Centralized Journal" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="28.0" y1="42.0" width="539" height="758"/>
</pageTemplate>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<document filename="Financial Report.pdf">
<template pageSize="(595.0,842.0)" title="Financial Report" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
<template title="Financial Report" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="28.0" y1="28.0" width="539" height="786"/>
</pageTemplate>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<document filename="General Journal.pdf">
<template pageSize="(596.0,842.0)" title="General Journal" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<template title="General Journal" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="28.0" y1="42.0" width="540" height="758"/>
</pageTemplate>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<document filename="General Ledger.pdf">
<template pageSize="(595.0,842.0)" title="General Ledger" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<template title="General Ledger" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="28.0" y1="28.0" width="539" height="772"/>
</pageTemplate>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<document filename="Journal.pdf">
<template pageSize="(595.0,842.0)" title="Journal" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<template title="Journal" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
</pageTemplate>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<document filename="Partner Balance.pdf">
<template pageSize="(595.0,842.0)" title="Partner Balance" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<template title="Partner Balance" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
</pageTemplate>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<document filename="Partner Ledger.pdf">
<template pageSize="(595.0,842.0)" title="Partner Ledger" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<template title="Partner Ledger" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="28.0" y1="28.0" width="539" height="772"/>
</pageTemplate>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<document filename="Partner Ledger.pdf">
<template pageSize="(595.0,842.0)" title="Partner Ledger" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<template title="Partner Ledger" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="28.0" y1="28.0" width="539" height="772"/>
</pageTemplate>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<document filename="Invoices.pdf">
<template pageSize="(595.0,842.0)" title="Invoices" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<template title="Invoices" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="34.0" y1="28.0" width="530" height="786"/>
</pageTemplate>

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<document filename="Overdue Payments.pdf">
<template pageSize="(595.0,842.0)" title="Overdue Payments" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
<template title="Overdue Payments" author="OpenERP S.A. (sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="42.0" y1="28.0" width="511" height="786"/>
</pageTemplate>
@ -219,7 +219,7 @@
<para style="terp_default_Right_9">[[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang((line['date_maturity'] &lt; time.strftime('%Y-%m-%d'))) and formatLang(line['debit'] - line['credit'], currency_obj=company.currency_id) ]</para>
<para style="terp_default_Right_9">[[ time.strftime('%Y-%m-%d') > formatLang((line['date_maturity'])) and formatLang(line['debit'] - line['credit']) ]] [[ company.currency_id.symbol ]] </para>
</td>
<td>
<para style="terp_default_Centre_9">[[ line['blocked'] and 'X' or '' ]]</para>

View File

@ -247,7 +247,7 @@ class report_account_sales(osv.osv):
_description = "Report of the Sales by Account"
_auto = False
_columns = {
'name': fields.char('Year', size=64, required=False, readonly=True),
'name': fields.char('Year', size=64, required=False, readonly=True, select=True),
'period_id': fields.many2one('account.period', 'Force Period', readonly=True),
'product_id': fields.many2one('product.product', 'Product', readonly=True),
'quantity': fields.float('Quantity', readonly=True),
@ -257,7 +257,7 @@ class report_account_sales(osv.osv):
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')], 'Month', readonly=True),
}
_order = 'name desc,amount_total desc'
_order = 'name desc'
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_account_sales')

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<document filename="Taxes.pdf">
<template pageSize="(595.0,842.0)" title="Taxes" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<template title="Taxes" author="OpenERP S.A.(sales@openerp.com)" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="42.0" y1="62.0" width="511" height="728"/>
</pageTemplate>

View File

@ -43,7 +43,7 @@
!python {model: account.account}: |
ctx={}
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False, 'account_report_id': ref('account_financial_report_balancesheet0')}
data_dict = {'chart_account_id':ref('account.chart0'), 'account_report_id': ref('account_financial_report_balancesheet0')}
from tools import test_reports
test_reports.try_report_action(cr, uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account')
-
@ -138,7 +138,7 @@
!python {model: account.account}: |
ctx={}
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False,'target_move': 'all', 'account_report_id': ref('account_financial_report_balancesheet0')}
data_dict = {'chart_account_id':ref('account.chart0'), 'target_move': 'all', 'account_report_id': ref('account_financial_report_balancesheet0')}
from tools import test_reports
test_reports.try_report_action(cr, uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account')
-

View File

@ -56,18 +56,18 @@ class account_change_currency(osv.osv_memory):
if invoice.company_id.currency_id.id == invoice.currency_id.id:
new_price = line.price_unit * rate
if new_price <= 0:
raise osv.except_osv(_('Error'), _('New currency is not confirured properly !'))
raise osv.except_osv(_('Error'), _('New currency is not configured properly !'))
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
if old_rate <= 0:
raise osv.except_osv(_('Error'), _('Currnt currency is not confirured properly !'))
raise osv.except_osv(_('Error'), _('Current currency is not configured properly !'))
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
if old_rate <= 0:
raise osv.except_osv(_('Error'), _('Current currency is not confirured properly !'))
raise osv.except_osv(_('Error'), _('Current currency is not configured properly !'))
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}, context=context)

View File

@ -62,6 +62,8 @@ class account_invoice_refund(osv.osv_memory):
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
journal_obj = self.pool.get('account.journal')
user_obj = self.pool.get('res.users')
# remove the entry with key 'form_view_ref', otherwise fields_view_get crashes
context.pop('form_view_ref', None)
res = super(account_invoice_refund,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
type = context.get('type', 'out_invoice')
company_id = user_obj.browse(cr, uid, uid, context=context).company_id.id

View File

@ -20,6 +20,7 @@
##############################################################################
from osv import fields, osv
from tools.translate import _
class account_period_close(osv.osv_memory):
"""
@ -39,11 +40,16 @@ class account_period_close(osv.osv_memory):
@param ids: account period closes ID or list of IDs
"""
period_pool = self.pool.get('account.period')
account_move_obj = self.pool.get('account.move')
mode = 'done'
for form in self.read(cr, uid, ids, context=context):
if form['sure']:
for id in context['active_ids']:
account_move_ids = account_move_obj.search(cr, uid, [('period_id', '=', id), ('state', '=', "draft")], context=context)
if account_move_ids:
raise osv.except_osv(_('Invalid action !'), _('In order to close a period, you must first post related journal entries.'))
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))

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -32,13 +32,11 @@
help="Analytic Accounts with a past deadline in one month." />
<separator orientation="vertical"/>
<field name="name" select="1"/>
<field name="code" select="1"/>
<field name="partner_id" select="1">
<field name="name" filter_domain="['|', ('name','ilike',self),('code','ilike',self)]" string="Contract"/>
<field name="partner_id">
<filter string="A contract in OpenERP is an analytic account having a partner set on it." name="has_partner" domain="[('partner_id', '!=', False)]" icon="terp-partner" />
</field>
<field name="user_id">
<filter string="My Accounts" domain="[('user_id','=',uid)]" icon="terp-personal" name="my_accounts" />
<filter string="No Account Manager" domain="[('user_id', '=', False)]" icon="terp-personal-" />
</field>
@ -64,7 +62,7 @@
<field name="res_model">account.analytic.account</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
<field name="context">{'search_default_has_partner':1, 'search_default_my_accounts':1, 'search_default_draft':1, 'search_default_pending':1, 'search_default_open':1, 'search_default_renew':1}</field>
<field name="context">{'search_default_has_partner':1, 'search_default_user_id':uid, 'search_default_draft':1, 'search_default_pending':1, 'search_default_open':1, 'search_default_renew':1}</field>
<field name="domain">[('type','=','normal')]</field>
<field name="search_view_id" ref="view_account_analytic_account_overdue_search"/>
<field name="help">You will find here the contracts to be renewed because the deadline is passed or the working hours are higher than the allocated hours. OpenERP automatically sets these analytic accounts to the pending state, in order to raise a warning during the timesheets recording. Salesmen should review all pending accounts and reopen or close the according to the negotiation with the customer.</field>
@ -76,7 +74,7 @@
<field name="res_model">account.analytic.account</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
<field name="context">{'search_default_has_partner':1, 'search_default_my_accounts':1, 'search_default_draft':1, 'search_default_pending':1, 'search_default_open':1}</field>
<field name="context">{'search_default_has_partner':1, 'search_default_user_id':uid, 'search_default_draft':1, 'search_default_pending':1, 'search_default_open':1}</field>
<field name="domain">[('type','=','normal')]</field>
<field name="search_view_id" ref="view_account_analytic_account_overdue_search"/>
</record>

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