[MERGE] branch trunk-v62_config_account-uco (new config wizard for accounting)

bzr revid: rco@openerp.com-20120328074146-8bfa90nkus9bxbaf
This commit is contained in:
Raphael Collet 2012-03-28 09:41:46 +02:00
commit 532f125232
9 changed files with 477 additions and 18 deletions

View File

@ -37,4 +37,6 @@ import ir_sequence
import company
import res_currency
import edi
import res_config
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -123,6 +123,7 @@ module named account_voucher.
'ir_sequence_view.xml',
'company_view.xml',
'board_account_view.xml',
'res_config_view.xml',
"edi/invoice_action_data.xml",
"account_bank_view.xml",
"account_pre_install.yml"

View File

@ -122,7 +122,7 @@
<field name="reference" invisible="1"/>
<field name="name" invisible="1"/>
<field name="journal_id" invisible="1"/>
<field name="period_id" invisible="1" groups="account.group_account_user"/>
<field name="period_id" invisible="1" groups="base.group_dates_periods"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="user_id"/>
<field name="date_due"/>
@ -157,7 +157,7 @@
<field name="fiscal_position" groups="base.group_extended" widget="selection"/>
<newline/>
<field name="date_invoice"/>
<field name="period_id" domain="[('state', '=', 'draft')]" groups="account.group_account_user" widget="selection"/>
<field name="period_id" domain="[('state', '=', 'draft')]" groups="base.group_dates_periods" 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>
@ -267,7 +267,7 @@
<field name="fiscal_position" groups="base.group_extended" widget="selection" options='{"quick_create": false}'/>
<newline/>
<field name="date_invoice"/>
<field name="period_id" domain="[('state', '=', 'draft')]" groups="account.group_account_user" widget="selection"/>
<field name="period_id" domain="[('state', '=', 'draft')]" groups="base.group_dates_periods" widget="selection"/>
<field name="payment_term" widget="selection"/>
<newline/>
<field domain="[('company_id', '=', company_id),('type','=', 'receivable')]" name="account_id" groups="account.group_account_user"/>
@ -306,7 +306,7 @@
<button name="action_cancel_draft" states="cancel" string="Reset to Draft" type="object" icon="terp-stock_effects-object-colorize"/>
<button name='%(action_account_state_open)d' type='action' string='Re-Open' groups="account.group_account_invoice" attrs="{'invisible':['|', ('state','&lt;&gt;','paid'), ('reconciled', '=', True)]}" icon="gtk-convert" help="This button only appears when the state of the invoice is 'paid' (showing that it has been fully reconciled) and auto-computed boolean 'reconciled' is False (depicting that it's not the case anymore). In other words, the invoice has been dereconciled and it does not fit anymore the 'paid' state. You should press this button to re-open it and let it continue its normal process after having resolved the eventual exceptions it may have created."/>
<button name="%(action_account_invoice_refund)d" type='action' string='Refund' states='open,paid' icon="gtk-execute"/>
<button name="invoice_proforma2" states="draft" string="PRO-FORMA" icon="terp-gtk-media-pause" groups="account.group_account_user"/>
<button name="invoice_proforma2" states="draft" string="PRO-FORMA" icon="terp-gtk-media-pause" groups="base.group_proforma_invoices"/>
<button name="invoice_open" states="draft,proforma2" string="Validate" icon="gtk-go-forward"/>
<button name="%(account_invoices)d" string="Print Invoice" type="action" icon="gtk-print" states="open,paid,proforma,sale,proforma2"/>
</group>
@ -355,7 +355,7 @@
<search string="Search Invoice">
<group>
<filter name="draft" icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Invoices"/>
<filter name="proforma" icon="terp-gtk-media-pause" string="Proforma" domain="[('state','=','proforma2')]" help="Proforma Invoices"/>
<filter name="proforma" icon="terp-gtk-media-pause" string="Proforma" domain="[('state','=','proforma2')]" help="Proforma Invoices" groups="base.group_proforma_invoices"/>
<filter name="invoices" icon="terp-dolar" string="Invoices" domain="[('state','not in',['draft','cancel'])]" help="Proforma/Open/Paid Invoices"/>
<separator orientation="vertical"/>
<filter name="unpaid" icon="terp-dolar_ok!" string="Unpaid" domain="[('state','=','open')]" help="Unpaid Invoices"/>
@ -371,7 +371,7 @@
<newline/>
<group>
<field name="journal_id" widget="selection"/>
<field name="period_id" string="Period"/>
<field name="period_id" string="Period" groups="base.group_dates_periods"/>
</group>
<newline/>
<group expand="0" string="Group By...">

View File

@ -2505,15 +2505,6 @@ action = pool.get('res.config').next(cr, uid, [], context)
<field name="name">New Company Financial Setting</field>
</record>
<record id="menu_act_ir_actions_bleble" model="ir.ui.menu">
<field name="name">New Company Financial Setting</field>
<field eval="1" name="sequence"/>
<field name="parent_id" ref="account.menu_finance_accounting"/>
<field name="icon">STOCK_EXECUTE</field>
<field name="action" ref="ir_actions_server_action_wizard_multi_chart"/>
</record>
<record id="account_account_graph" model="ir.ui.view">
<field name="name">account.account.graph</field>
<field name="model">account.account</field>

View File

@ -0,0 +1,325 @@
# -*- 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 logging
import time
import datetime
from dateutil.relativedelta import relativedelta
from operator import itemgetter
from os.path import join as opj
from tools.translate import _
from osv import fields, osv
import netsvc
import tools
class account_configuration(osv.osv_memory):
_name = 'account.installer'
_inherit = 'res.config.settings'
__logger = logging.getLogger(_name)
def _get_charts(self, cr, uid, context=None):
modules = self.pool.get('ir.module.module')
# Looking for the module with the 'Account Charts' category
category_name, category_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base', 'module_category_localization_account_charts')
ids = modules.search(cr, uid, [('category_id', '=', category_id)], context=context)
charts = list(
sorted(((m.name, m.shortdesc)
for m in modules.browse(cr, uid, ids, context=context)),
key=itemgetter(1)))
charts.insert(0, ('configurable', 'Generic Chart Of Accounts'))
return charts
_columns = {
'company_id': fields.many2one('res.company', 'Company',help="Your company."),
'currency_id': fields.related('company_id', 'currency_id', type='many2one', relation='res.currency', string='Currency', store=True, help="Currency of your company."),
'charts': fields.selection(_get_charts, 'Chart of Accounts',
required=True,
help="Installs localized accounting charts to match as closely as "
"possible the accounting needs of your company based on your "
"country."),
'date_start': fields.date('Start Date', required=True),
'date_stop': fields.date('End Date', required=True),
'period': fields.selection([('month', 'Monthly'), ('3months','3 Monthly')], 'Periods', required=True),
'has_default_company' : fields.boolean('Has Default Company', readonly=True),
'chart_template_id': fields.many2one('account.chart.template', 'Chart Template'),
'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal Year'),
'default_paypal_account': fields.char("Your Paypal Account", size=128, help="Paypal username (usually email) for receiving online payments.", default_model='res.company'),
'company_footer': fields.char("Footer of Reports", size=128, readonly=True, help="Footer of reports based on your bank accounts."),
'sale_journal_id': fields.many2one('account.journal','Sale Journal'),
'customer_invoice_sequence_prefix': fields.related('sale_journal_id', 'sequence_id', 'prefix', type='char', relation='ir.sequence', string='Invoice Sequence'),
'customer_invoice_sequence_next': fields.related('sale_journal_id', 'sequence_id', 'number_next', type='integer', relation='ir.sequence', string='Invoice Sequence Next Number'),
'sale_refund_journal_id': fields.many2one('account.journal','Sale Refund Journal'),
'customer_refund_sequence_prefix': fields.related('sale_refund_journal_id', 'sequence_id', 'prefix', type='char', relation='ir.sequence', string='Refund Sequence'),
'customer_refund_sequence_next': fields.related('sale_refund_journal_id', 'sequence_id', 'number_next', type='integer', relation='ir.sequence', string='Refund Sequence Next Number'),
'purchase_journal_id': fields.many2one('account.journal','Purchase Journal'),
'supplier_invoice_sequence_prefix': fields.related('purchase_journal_id', 'sequence_id', 'prefix', type='char', relation='ir.sequence', string='Supplier Invoice Sequence'),
'supplier_invoice_sequence_next': fields.related('purchase_journal_id', 'sequence_id', 'number_next', type='integer', relation='ir.sequence', string='Supplier Invoice Sequence Next Number'),
'purchase_refund_journal_id': fields.many2one('account.journal','Purchase Refund Journal'),
'supplier_refund_sequence_prefix': fields.related('purchase_refund_journal_id', 'sequence_id', 'prefix', type='char', relation='ir.sequence', string='Supplier Refund Sequence'),
'supplier_refund_sequence_next': fields.related('purchase_refund_journal_id', 'sequence_id', 'number_next', type='integer', relation='ir.sequence', string='Supplier Refund Sequence Next Number'),
'module_account_check_writing': fields.boolean('Support check writings',
help=""" This allows you to check writing and printing.
It installs the account_check_writing module."""),
'module_account_accountant': fields.boolean('Accountant Features',
help="""This allows you to access all the accounting features like the journal items and the chart of accounts.
It installs the account_accountant module."""),
'module_account_asset': fields.boolean('Assets Management',
help="""This allows you to manages the assets owned by a company or an individual. It will keep track of depreciation's occurred on
those assets. And it allows to create Move's of the depreciation lines.
It installs the account_asset module."""),
'module_account_budget': fields.boolean('Budgets Management',
help="""This allows accountants to manage analytic and crossovered budgets.
Once the Master Budgets and the Budgets are defined (in Accounting/Budgets/),
the Project Managers can set the planned amount on each Analytic Account.
It installs the account_budget module."""),
'module_account_payment': fields.boolean('Supplier Payment Orders',
help="""This allows you to create and manage your payment orders, with purposes to
* serve as base for an easy plug-in of various automated payment mechanisms.
* provide a more efficient way to manage invoice payment.
It installs the account_payment module."""),
'module_account_voucher': fields.boolean('Manage Customer Payments',
help="""This includes all the basic requirements of Voucher Entries for Bank, Cash, Sales, Purchase, Expanse, Contra, etc.
It installs the account_voucher module."""),
'module_account_followup': fields.boolean('Customer Follow-Ups',
help="""This allows to automate letters for unpaid invoices, with multi-level recalls.
It installs the account_followup module."""),
'module_account_analytic_plans': fields.boolean('Support Multiple Analytic Plans',
help="""This allows to use several analytic plans, according to the general journal.
It installs the account_analytic_plans module."""),
'module_account_analytic_default': fields.boolean('Rules for Analytic Assignation',
help="""Set default values for your analytic accounts
Allows to automatically select analytic accounts based on criterias:
* Product
* Partner
* User
* Company
* Date.
It installs the account_analytic_default module."""),
'module_account_invoice_layout': fields.boolean('Allow notes and subtotals',
help="""This provides some features to improve the layout of the invoices.
It gives you the possibility to:
* order all the lines of an invoice
* add titles, comment lines, sub total lines
* draw horizontal lines and put page breaks.
It installs the account_invoice_layout module."""),
'group_analytic_account_for_sales': fields.boolean('Analytic Accounting for Sales', group='base.group_user', implied_group='base.group_analytic_account_for_sales',
help="Allows you to set analytic account for sale order. It assigns 'Analytic Accounting for Sales' group to all employees."),
'group_analytic_account_for_purchase': fields.boolean('Analytic Accounting for Purchase', group='base.group_user', implied_group='base.group_analytic_account_for_purchase',
help="Allows you to set analytic account for purchase order. It assigns 'Analytic Accounting for Purchase' group to all employees."),
'group_dates_periods': fields.boolean('Allow dates/periods', group='base.group_user', implied_group='base.group_dates_periods',
help="Allows you to keep the period same as your invoice date when you validate the invoice."\
"It will add the group 'Allow dates and periods' for all users."),
'group_proforma_invoices': fields.boolean('Allow Pro-forma Invoices', group='base.group_user', implied_group='base.group_proforma_invoices',
help="Allows you to put invoice in pro-forma state. It assigns 'Allow Pro-forma Invoices' group to all employees."),
'multi_charts_id':fields.many2one('wizard.multi.charts.accounts', 'Multi charts accounts'),
'taxes_id':fields.many2one('account.tax.template', 'Default Sale Tax', domain="[('type_tax_use','=','sale')]"),
'supplier_taxes_id':fields.many2one('account.tax.template', 'Default Purchase Tax', domain="[('type_tax_use','=','purchase')]"),
'sale_tax_rate': fields.float('Sales Tax(%)'),
'purchase_tax_rate': fields.float('Purchase Tax(%)'),
'complete_tax_set': fields.boolean('Complete Set of Taxes'),
}
def _default_company(self, cr, uid, context=None):
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
return user.company_id and user.company_id.id or False
def _default_has_default_company(self, cr, uid, context=None):
count = self.pool.get('res.company').search_count(cr, uid, [], context=context)
return bool(count == 1)
_defaults = {
'date_start': lambda *a: time.strftime('%Y-01-01'),
'date_stop': lambda *a: time.strftime('%Y-12-31'),
'period': 'month',
'company_id': _default_company,
'has_default_company': _default_has_default_company,
'charts': 'configurable',
}
def _check_default_tax(self, cr, uid, context=None):
ir_values_obj = self.pool.get('ir.values')
taxes = {}
for tax in ir_values_obj.get(cr, uid, 'default', False, ['product.template']):
if tax[1] == 'taxes_id':
taxes.update({'taxes_id': tax[2]})
if tax[1] == 'supplier_taxes_id':
taxes.update({'supplier_taxes_id': tax[2]})
return taxes
def set_tax_defaults(self, cr, uid, ids, context=None):
ir_values_obj = self.pool.get('ir.values')
res = {}
wizard = self.browse(cr, uid, ids)[0]
if wizard.taxes_id.id:
ir_values_obj.set_default(cr, uid, 'product.template', 'taxes_id', wizard.taxes_id.id )
if wizard.supplier_taxes_id.id:
ir_values_obj.set_default(cr, uid, 'product.template', 'supplier_taxes_id', wizard.supplier_taxes_id.id )
return res
def default_get(self, cr, uid, fields_list, context=None):
ir_values_obj = self.pool.get('ir.values')
chart_template_obj = self.pool.get('account.chart.template')
fiscalyear_obj = self.pool.get('account.fiscalyear')
journal_obj = self.pool.get('account.journal')
res = super(account_configuration, self).default_get(cr, uid, fields_list, context=context)
taxes = self._check_default_tax(cr, uid, context)
chart_template_ids = chart_template_obj.search(cr, uid, [('visible', '=', True)], context=context)
fiscalyear_ids = fiscalyear_obj.search(cr, uid, [('date_start','=',time.strftime('%Y-01-01')),('date_stop','=',time.strftime('%Y-12-31'))])
cmp_id = self.pool.get('ir.model.data').get_object(cr, uid, 'base', 'main_company').id
company_data = self.pool.get('res.company').browse(cr, uid, cmp_id)
res.update({'company_footer': company_data.rml_footer2})
journal_ids = journal_obj.search(cr, uid, [('company_id', '=', res.get('company_id'))])
if journal_ids:
for journal in journal_obj.browse(cr, uid, journal_ids, context=context):
if journal.type == 'sale':
res.update({'sale_journal_id': journal.id})
if journal.type == 'sale_refund':
res.update({'sale_refund_journal_id': journal.id})
if journal.type == 'purchase':
res.update({'purchase_journal_id': journal.id})
if journal.type == 'purchase_refund':
res.update({'purchase_refund_journal_id': journal.id})
if chart_template_ids:
res.update({'chart_template_id': chart_template_ids[0]})
data = chart_template_obj.browse(cr, uid, chart_template_ids[0], context=context)
res.update({'complete_tax_set': data.complete_tax_set})
supplier_taxes_id = ir_values_obj.get_default(cr, uid, 'product.template', 'supplier_taxes_id')
res.update({'supplier_taxes_id': supplier_taxes_id})
taxes_id = ir_values_obj.get_default(cr, uid, 'product.template', 'taxes_id')
res.update({'taxes_id': taxes_id})
if fiscalyear_ids:
res.update({'fiscalyear_id': fiscalyear_ids[0]})
if taxes:
if chart_template_ids:
sale_tax_id = taxes.get('taxes_id')
res.update({'taxes_id': isinstance(sale_tax_id,list) and sale_tax_id[0] or sale_tax_id})
purchase_tax_id = taxes.get('supplier_taxes_id')
res.update({'supplier_taxes_id': isinstance(purchase_tax_id,list) and purchase_tax_id[0] or purchase_tax_id})
else:
res.update({'sale_tax_rate': 15.0, 'purchase_tax_rate': 15.0})
return res
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
ir_values_obj = self.pool.get('ir.values')
res = super(account_configuration, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar, submenu)
cmp_select = []
# display in the widget selection only the companies that haven't been configured yet
unconfigured_cmp = self.get_unconfigured_cmp(cr, uid, context=context)
for field in res['fields']:
if field == 'company_id':
res['fields'][field]['domain'] = [('id','in',unconfigured_cmp)]
res['fields'][field]['selection'] = [('', '')]
if unconfigured_cmp:
cmp_select = [(line.id, line.name) for line in self.pool.get('res.company').browse(cr, uid, unconfigured_cmp)]
res['fields'][field]['selection'] = cmp_select
return res
def get_unconfigured_cmp(self, cr, uid, context=None):
""" get the list of companies that have not been configured yet
but don't care about the demo chart of accounts """
cmp_select = []
company_ids = self.pool.get('res.company').search(cr, uid, [], context=context)
cr.execute("SELECT company_id FROM account_account WHERE active = 't' AND account_account.parent_id IS NULL AND name != %s", ("Chart For Automated Tests",))
configured_cmp = [r[0] for r in cr.fetchall()]
return list(set(company_ids)-set(configured_cmp))
def check_unconfigured_cmp(self, cr, uid, context=None):
""" check if there are still unconfigured companies """
if not self.get_unconfigured_cmp(cr, uid, context=context):
raise osv.except_osv(_('No unconfigured company !'), _("There are currently no company without chart of account. The wizard will therefore not be executed."))
def on_change_start_date(self, cr, uid, id, start_date=False):
if start_date:
start_date = datetime.datetime.strptime(start_date, "%Y-%m-%d")
end_date = (start_date + relativedelta(months=12)) - relativedelta(days=1)
return {'value': {'date_stop': end_date.strftime('%Y-%m-%d')}}
return {}
def on_change_company_id(self, cr, uid, id, company_id=False):
company_obj = self.pool.get('res.company')
currency_id = company_obj.browse(cr, uid, company_id).currency_id
return {'value': {'currency_id': currency_id.id}}
def install_chartofaccounts(self, cr, uid, ids, context=None):
ir_module = self.pool.get('ir.module.module')
multi_chart_obj = self.pool.get('wizard.multi.charts.accounts')
chart_template_obj = self.pool.get('account.chart.template')
tax_templ_obj = self.pool.get('account.tax.template')
if context is None:
context = {}
for res in self.read(cr, uid, ids, context=context):
chart = res.get('charts')
if chart == 'configurable':
#load generic chart of account
fp = tools.file_open(opj('account', 'configurable_account_chart.xml'))
tools.convert_xml_import(cr, 'account', fp, {}, 'init', True, None)
fp.close()
elif chart.startswith('l10n_'):
mod_ids = ir_module.search(cr, uid, [('name','=',chart)])
if mod_ids and ir_module.browse(cr, uid, mod_ids[0], context).state == 'uninstalled':
ir_module.button_immediate_install(cr, uid, mod_ids, context)
chart_template_ids = chart_template_obj.search(cr, uid, [('visible', '=', True)], context=context)
complete_tax_set = chart_template_obj.browse(cr, uid, chart_template_ids[0]).complete_tax_set
if not complete_tax_set:
code_digits = multi_chart_obj.onchange_chart_template_id(cr, uid, [], chart_template_ids[0], context=context)['value']['code_digits']
object_id = multi_chart_obj.create(cr, uid, {'code_digits': code_digits , 'sale_tax_rate': res.get('sale_tax_rate'), 'purchase_tax_rate': res.get('purchase_tax_rate')}, context=context)
multi_chart_obj.execute(cr, uid, [object_id], context=context)
def configure_fiscalyear(self, cr, uid, ids, context=None):
if context is None:
context = {}
fy_obj = self.pool.get('account.fiscalyear')
for res in self.read(cr, uid, ids, context=context):
if 'date_start' in res and 'date_stop' in res:
f_ids = fy_obj.search(cr, uid, [('date_start', '<=', res['date_start']), ('date_stop', '>=', res['date_stop']), ('company_id', '=', res['company_id'][0])], context=context)
if not f_ids:
name = code = res['date_start'][:4]
if int(name) != int(res['date_stop'][:4]):
name = res['date_start'][:4] +'-'+ res['date_stop'][:4]
code = res['date_start'][2:4] +'-'+ res['date_stop'][2:4]
vals = {
'name': name,
'code': code,
'date_start': res['date_start'],
'date_stop': res['date_stop'],
'company_id': res['company_id'][0]
}
fiscal_id = fy_obj.create(cr, uid, vals, context=context)
if res['period'] == 'month':
fy_obj.create_period(cr, uid, [fiscal_id])
elif res['period'] == '3months':
fy_obj.create_period3(cr, uid, [fiscal_id])
account_configuration()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_account_config" model="ir.ui.view">
<field name="name">Accounting Application</field>
<field name="model">account.installer</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Accounting Applications">
<field name="chart_template_id" invisible="1"/>
<group col="4" colspan="4" string="Warning" attrs="{'invisible': [('chart_template_id','!=',False)]}">
<label string="You have no chart of accounts or taxes defined for this company. Select a chart of account to proceed." colspan="4"/>
<field name="charts"/>
<button name="install_chartofaccounts" string="Install Chart of Account" icon="gtk-execute" type="object"/>
</group>
<field name="fiscalyear_id" invisible="1"/>
<group col="4" colspan="4" string="Warning" attrs="{'invisible': [('fiscalyear_id','!=',False)]}">
<field name="has_default_company" invisible="1" />
<field name="date_start" on_change="on_change_start_date(date_start)"/>
<field name="date_stop"/>
<field name="period" colspan="4"/>
<newline/>
<group col="4" colspan="4">
<label string="You have no fiscal year/period open for this date."/>
<button name="configure_fiscalyear" string="Configure Fiscalyear" icon="gtk-execute" type="object"/>
</group>
</group>
<field name="company_id" widget="selection" readonly="1" on_change="on_change_company_id(company_id)" attrs="{'invisible': [('has_default_company', '=', True)]} " />
<separator string="Accounting Configuration" colspan="4"/>
<group col="4" colspan="4">
<field name ="complete_tax_set" invisible="1"/>
<field name ="multi_charts_id" invisible="1"/>
<newline/>
<group col="2" colspan="2">
<field name="taxes_id" attrs="{'invisible': [('complete_tax_set', '!=', True)]}"/>
<field name="sale_tax_rate" attrs="{'invisible': [('complete_tax_set', '=', True)]}"/>
<field name="module_account_accountant"/>
<field name="module_account_asset"/>
<field name="group_dates_periods"/>
</group>
<group col="2" colspan="2">
<field name="supplier_taxes_id" attrs="{'invisible': [('complete_tax_set', '!=', True)]}"/>
<field name="purchase_tax_rate" attrs="{'invisible': [('complete_tax_set', '=', True)]}"/>
<field name="currency_id" widget="selection"/>
<field name="module_account_budget"/>
</group>
</group>
<group col="2" colspan="2">
<separator string="Customer Invoices" colspan="2"/>
<group col="4" colspan="2">
<field name="sale_journal_id" invisible="1"/>
<field name="customer_invoice_sequence_prefix"/>
<field name="customer_invoice_sequence_next" nolabel="1"/>
</group>
<group col="4" colspan="2">
<field name="sale_refund_journal_id" invisible="1"/>
<field name="customer_refund_sequence_prefix"/>
<field name="customer_refund_sequence_next" nolabel="1"/>
</group>
<field name="module_account_invoice_layout"/>
<newline/>
<field name="module_account_voucher"/>
<newline/>
<field name="module_account_followup"/>
<newline/>
<field name="group_proforma_invoices"/>
</group>
<group col="2" colspan="2">
<separator string="Supplier Invoices" colspan="2"/>
<group col="4" colspan="2">
<field name="purchase_journal_id" invisible="1"/>
<field name="supplier_invoice_sequence_prefix"/>
<field name="supplier_invoice_sequence_next" nolabel="1" colspan="1"/>
</group>
<newline/>
<group col="4" colspan="2">
<field name="purchase_refund_journal_id" invisible="1"/>
<field name="supplier_refund_sequence_prefix"/>
<field name="supplier_refund_sequence_next" nolabel="1"/>
</group>
<field name="module_account_payment"/>
</group>
<group col="2" colspan="2">
<separator string="Electronic Payments" colspan="2"/>
<field name="default_paypal_account"/>
</group>
<group col="2" colspan="2">
<separator string="Bank &amp; Cash" colspan="2"/>
<field name="company_footer" nolabel="1" colspan="2"/>
<newline/>
<label string="Setup your bank accounts: "/>
<button name="%(action_bank_tree)d" string="Setup Your Bank Accounts" icon="gtk-execute" type="action"/>
<newline/>
<field name="module_account_check_writing"/>
</group>
<group col="2" colspan="2">
<separator string="Analytic Accounting" colspan="2"/>
<field name="group_analytic_account_for_sales"/>
<newline/>
<field name="group_analytic_account_for_purchase"/>
<newline/>
<field name="module_account_analytic_plans"/>
<newline/>
<field name="module_account_analytic_default"/>
</group>
</form>
</field>
</record>
<record id="action_account_config" model="ir.actions.act_window">
<field name="name">Configure Accounting Application</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.installer</field>
<field name="view_id" ref="view_account_config"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
</record>
<menuitem id="menu_account_config" name="Accounting" parent="base.menu_config" sequence="2" action="action_account_config"/>
</data>
</openerp>

View File

@ -16,6 +16,23 @@
<field name="implied_ids" eval="[(4, ref('group_account_user'))]"/>
</record>
<record id="base.group_analytic_account_for_sales" model="res.groups">
<field name="name">Analytic Accounting for Sales</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="base.group_analytic_account_for_purchase" model="res.groups">
<field name="name">Analytic Accounting for Purchase</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="base.group_dates_periods" model="res.groups">
<field name="name">Dates and Periods</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="base.group_proforma_invoices" model="res.groups">
<field name="name">Pro-forma Invoices</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="account_move_comp_rule" model="ir.rule">
<field name="name">Account Entry</field>
<field ref="model_account_move" name="model_id"/>

View File

@ -366,7 +366,7 @@
<field name="date_planned" widget="date"/>
<field name="price_unit"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="account_analytic_id" colspan="4" groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]" />
<field name="account_analytic_id" colspan="4" groups="base.group_analytic_account_for_purchase" domain="[('parent_id','!=',False)]" />
<group colspan="4" col="4" groups="purchase.group_taxes_on_order_line">
<separator colspan="4" string="Taxes"/>
<field colspan="4" nolabel="1" name="taxes_id"
@ -429,7 +429,7 @@
<field name="date_planned" widget="date" readonly="1"/>
<field name="price_unit"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="account_analytic_id" colspan="4" groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]"/>
<field name="account_analytic_id" colspan="4" groups="base.group_analytic_account_for_purchase" domain="[('parent_id','!=',False)]"/>
<group colspan="4" col="4" groups="base.group_extended">
<separator colspan="4" string="Taxes"/>
<field colspan="4" nolabel="1" name="taxes_id"

View File

@ -120,7 +120,7 @@
<field domain="[('partner_id','=',partner_id)]" name="partner_invoice_id" groups="sale.group_delivery_invoice_address" options='{"quick_create": false}'/>
<field domain="[('partner_id','=',partner_id)]" name="partner_shipping_id" groups="sale.group_delivery_invoice_address" options='{"quick_create": false}'/>
<field domain="[('type','=','sale')]" name="pricelist_id" groups="product.group_sale_pricelist" on_change="onchange_pricelist_id(pricelist_id,order_line)"/>
<field name="project_id" context="{'partner_id':partner_id, 'contact_id':partner_order_id, 'pricelist_id':pricelist_id, 'default_name':name}" groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]"/>
<field name="project_id" context="{'partner_id':partner_id, 'contact_id':partner_order_id, 'pricelist_id':pricelist_id, 'default_name':name}" groups="base.group_analytic_account_for_sales" domain="[('parent_id','!=',False)]"/>
<newline/>
<field colspan="4" name="order_line" nolabel="1" widget="one2many_list">
<form string="Sales Order Lines">