Bunch of fixes and small improvements on modules: account_statement_base_completion, account_statement_completion_voucher, account_statement_ext, account_advanced_reconcile, account_statement_base_import

[IMP] Set a default account on a new bank statement line when manual entry
  [ADD] basic security rules on profile and completion rules
  [ADD] account_statement_completion_voucher to better adapt the views of bank statement
  [FIX] Call to the completion button
  [FIX] Auto-launch completion after import
  [FIX] inherit view
  [merge] [FIX] account_advanced_reconcile: improved view readability with less larger column
  [FIX] account_advanced_reconcile: improved view readability with less larger column
  [FIX] count of reconciliations was incorrect for partial reconciliations
(lp:c2c-financial-addons/6.1 rev 70)
This commit is contained in:
Guewen Baconnier @ Camptocamp
2012-06-27 09:58:32 +02:00
parent 57c0a63f6a
commit 77441f2bf9
14 changed files with 122 additions and 13 deletions

View File

@@ -263,11 +263,11 @@ class easy_reconcile_advanced(AbstractModel):
lines_by_id = dict([(l['id'], l) for l in credit_lines + debit_lines])
for reconcile_group_ids in reconcile_groups:
group_lines = [lines_by_id[lid] for lid in reconcile_group_ids]
reconciled, partial = self._reconcile_lines(
reconciled, full = self._reconcile_lines(
cr, uid, rec, group_lines, allow_partial=True, context=context)
if reconciled and partial:
if reconciled and full:
reconciled_ids += reconcile_group_ids
elif partial:
elif reconciled:
partial_reconciled_ids += reconcile_group_ids
return reconciled_ids, partial_reconciled_ids

View File

@@ -8,9 +8,11 @@
<field name="inherit_id" ref="account_easy_reconcile.account_easy_reconcile_form"/>
<field name="arch" type="xml">
<page name="information" position="inside">
<separator colspan="4" string="Advanced. Partner and Ref"/>
<label string="Match multiple debit vs multiple credit entries. Allow partial reconcilation.
<group colspan="2" col="2">
<separator colspan="4" string="Advanced. Partner and Ref"/>
<label string="Match multiple debit vs multiple credit entries. Allow partial reconcilation.
The lines should have the partner, the credit entry ref. is matched vs the debit entry ref. or name." colspan="4"/>
</group>
</page>
</field>
</record>

View File

@@ -59,6 +59,7 @@
'statement_view.xml',
'partner_view.xml',
'data.xml',
'security/ir.model.access.csv',
],
'demo_xml': [],
'test': [],

View File

@@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_account_bank_st_cmpl_user,account.statement.completion.rule,model_account_statement_completion_rule,account.group_account_user,1,0,0,0
access_account_bank_st_cmpl_manager,account.statement.completion.rule,model_account_statement_completion_rule,account.group_account_manager,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_account_bank_st_cmpl_user account.statement.completion.rule model_account_statement_completion_rule account.group_account_user 1 0 0 0
3 access_account_bank_st_cmpl_manager account.statement.completion.rule model_account_statement_completion_rule account.group_account_manager 1 1 1 1

View File

@@ -10,9 +10,6 @@
<field name="type">form</field>
<field name="arch" type="xml">
<data>
<xpath expr="/form/notebook/page/field[@name='line_ids']/tree/field[@name='sequence']" position="before">
<field name="already_completed" />
</xpath>
<xpath expr="/form/notebook/page/field[@name='line_ids']/form/field[@name='sequence']" position="after">
<separator colspan="4" string="Importation related infos"/>
<field name="label" />
@@ -36,6 +33,19 @@
</data>
</field>
</record>
<record id="bank_statement_view_form2" model="ir.ui.view">
<field name="name">account_bank_statement_import_base.bank_statement.auto_cmpl</field>
<field name="model">account.bank.statement</field>
<field name="inherit_id" ref="account.view_bank_statement_form" />
<field name="type">form</field>
<field name="arch" type="xml">
<data>
<xpath expr="/form/notebook/page/field[@name='line_ids']/tree/field[@name='amount']" position="after">
<field name="already_completed" />
</xpath>
</data>
</field>
</record>
<record id="statement_rules_view_form" model="ir.ui.view">
<field name="name">account.statement.profil.view</field>

View File

@@ -200,7 +200,7 @@ class AccountStatementProfil(Model):
)
# If user ask to launch completion at end of import, do it !
if prof.launch_import_completion:
self.button_auto_completion(cursor, uid, statement_id, context)
statement_obj.button_auto_completion(cursor, uid, [statement_id], context)
# Write the needed log infos on profile
self.write_logs_after_import(cursor, uid, prof.id, statement_id,

View File

@@ -27,7 +27,7 @@
<record id="bank_statement_view_form" model="ir.ui.view">
<field name="name">account_bank_statement.bank_statement.view_form</field>
<field name="model">account.bank.statement</field>
<field name="inherit_id" ref="account.view_bank_statement_form" />
<field name="inherit_id" ref="account_statement_base_completion.bank_statement_view_form" />
<field name="type">form</field>
<field eval="20" name="priority"/>
<field name="arch" type="xml">

View File

@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Joel Grand-Guillaume
# Copyright 2011-2012 Camptocamp SA
#
# 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/>.
#
##############################################################################

View File

@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Joel Grand-Guillaume
# Copyright 2011-2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{'name': "Bank statement extension with voucher",
'version': '1.0',
'author': 'Camptocamp',
'maintainer': 'Camptocamp',
'category': 'Finance',
'complexity': 'normal', #easy, normal, expert
'depends': ['account_statement_base_completion','account_voucher'],
'description': """
This module is only needed when using account_statement_base_completion with voucher in order adapt the view correctly.
""",
'website': 'http://www.camptocamp.com',
'init_xml': [],
'update_xml': [
"statement_view.xml",
],
'demo_xml': [],
'test': [],
'installable': True,
'images': [],
'auto_install': True,
'license': 'AGPL-3',
'active': False,
}

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Override what we have in account_statement_base_completion to replace the one in the voucher -->
<record id="account_statement_base_completion.bank_statement_view_form2" model="ir.ui.view">
<field name="name">account_bank_statement_import_base.bank_statement.auto_cmpl</field>
<field name="model">account.bank.statement</field>
<field name="inherit_id" ref="account_voucher.view_bank_statement_tree_voucher" />
<field name="type">form</field>
<field name="arch" type="xml">
<data>
<xpath expr="/form/notebook/page/field[@name='line_ids']/tree/field[@name='voucher_id']" position="after">
<field name="already_completed" />
</xpath>
</data>
</field>
</record>
</data>
</openerp>

View File

@@ -72,6 +72,7 @@
'statement_view.xml',
'report/bank_statement_webkit_header.xml',
'report.xml',
'security/ir.model.access.csv',
],
'demo_xml': [],
'test': [],

View File

@@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_account_bank_st_profile_user,account.statement.profil,model_account_statement_profil,account.group_account_user,1,0,0,0
access_account_bank_st_profile_manager,account.statement.profil,model_account_statement_profil,account.group_account_manager,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_account_bank_st_profile_user account.statement.profil model_account_statement_profil account.group_account_user 1 0 0 0
3 access_account_bank_st_profile_manager account.statement.profil model_account_statement_profil account.group_account_manager 1 1 1 1

View File

@@ -515,6 +515,9 @@ class AccountBankSatementLine(Model):
periods = self.pool.get('account.period').find(cursor, user, dt=date)
return periods and periods[0] or False
def _get_default_account(self, cursor, user, context=None):
return self.get_values_for_line(cursor, user, context = context)['account_id']
_columns = {
# Set them as required + 64 char instead of 32
'ref': fields.char('Reference', size=64, required=True),
@@ -522,6 +525,7 @@ class AccountBankSatementLine(Model):
}
_defaults = {
'period_id': _get_period,
'account_id': _get_default_account,
}
def get_values_for_line(self, cr, uid, profile_id = False, partner_id = False, line_type = False, amount = False, context = None):

View File

@@ -139,12 +139,11 @@
<!-- Add a new group before the first one with name, profil and date -->
<xpath expr="/form/group[@col='7']" position="before">
<group col="8" colspan="4">
<field name="id" select="1" readonly="1"/>
<field name="name" select="1"/>
<field name="profile_id" select="1" required="1" on_change="onchange_imp_config_id(profile_id)" widget="selection"/>
<field name="date" select="1" on_change="onchange_date(date, company_id)"/>
<field name="name" select="1"/>
</group>
<separator string="Details" colspan="4"/>
<separator string="Profile Details" colspan="4"/>
</xpath>
<!-- Make balance visible or not depending on profil -->
<xpath expr="/form/group/field[@name='balance_start']" position="replace">