[IMP] account: misc UX improvements

Allow to configure the bank statement import mode from kanban
    When doing a manual journal entry, don't show the maturity date
    Removing Issued total, using credit instead (less code, more
    useful to have due amounts, instead of overdue)
    Creating a bank, set a name 'BofA Current' and an
    account number (that way, the account.account is based
    on name)
    Settings Wizard & menus: better sentences
    Statement CSV Import: installed by default (it
    does not add any menu)
    remove use_in_payment: complex field, only
    used for a default value
    Small code cleanup
[IMP] sale: moving order date to secondary tab (strange on a quotation)
This commit is contained in:
Fabien Pinckaers
2017-04-08 16:52:05 +02:00
parent a76ed8f2f3
commit 525d094ef6
17 changed files with 40 additions and 85 deletions
+1 -1
View File
@@ -242,7 +242,7 @@ class AccountJournal(models.Model):
# Bank journals fields
bank_account_id = fields.Many2one('res.partner.bank', string="Bank Account", ondelete='restrict', copy=False)
bank_statements_source = fields.Selection([('no_feeds', 'No Feeds'),('manual', 'Record Manually')], string='Bank Feeds', default='no_feeds')
bank_statements_source = fields.Selection([('undefined', 'Undefined Yet'),('manual', 'Record Manually')], string='Bank Feeds', default='undefined')
bank_acc_number = fields.Char(related='bank_account_id.acc_number')
bank_id = fields.Many2one('res.bank', related='bank_account_id.bank_id')
@@ -219,7 +219,7 @@ class account_journal(models.Model):
ctx.update({'default_type': 'in_refund', 'type': 'in_refund'})
view_id = self.env.ref('account.invoice_supplier_form').id
else:
ctx.update({'default_journal_id': self.id})
ctx.update({'default_journal_id': self.id, 'view_no_maturity': True})
view_id = self.env.ref('account.view_move_form').id
model = 'account.move'
return {
-12
View File
@@ -316,17 +316,6 @@ class ResPartner(models.Model):
domain += overdue_domain
return domain
@api.multi
def _compute_issued_total(self):
""" Returns the issued total as will be displayed on partner view """
today = fields.Date.context_today(self)
for partner in self:
domain = partner.get_followup_lines_domain(today, overdue_only=True)
issued_total = 0
for aml in self.env['account.move.line'].search(domain):
issued_total += aml.amount_residual
partner.issued_total = issued_total
@api.one
def _compute_has_unreconciled_entries(self):
# Avoid useless work if has_unreconciled_entries is not relevant for this partner
@@ -387,7 +376,6 @@ class ResPartner(models.Model):
contracts_count = fields.Integer(compute='_journal_item_count', string="Contracts", type='integer')
journal_item_count = fields.Integer(compute='_journal_item_count', string="Journal Items", type="integer")
issued_total = fields.Monetary(compute='_compute_issued_total', string="Journal Items")
property_account_payable_id = fields.Many2one('account.account', company_dependent=True,
string="Account Payable", oldname="property_account_payable",
domain="[('internal_type', '=', 'payable'), ('deprecated', '=', False)]",
@@ -19,8 +19,13 @@
<div class="row">
<t t-if="(journal_type == 'bank' || journal_type == 'cash')" t-call="JournalBodyBankCash"/>
<t t-if="journal_type == 'sale' || journal_type == 'purchase'" t-call="JournalBodySalePurchase"/>
<div t-if="journal_type == 'general' || journal_type == 'situation'" class="row">
</div>
<t t-if="journal_type == 'general' || journal_type == 'situation'">
<div class="col-xs-6 o_kanban_primary_left">
<button type="object" name="open_action" context="{'action_name': 'action_move_journal_line', 'view_no_maturity': 1}" class="btn btn-primary btn-sm">
<span>Journal Entries</span>
</button>
</div>
</t>
</div>
<t t-if="journal_type == 'bank' || journal_type == 'cash' || journal_type == 'sale' || journal_type == 'purchase'" t-call="JournalBodyGraph"/>
</div><div class="container o_kanban_card_manage_pane o_invisible">
@@ -166,10 +171,10 @@
<span>View</span>
</div>
<div>
<a type="object" name="open_action" context="{'action_name': 'action_move_journal_line'}">Journal Entries</a>
<a type="object" name="open_action" context="{'action_name': 'action_move_journal_line', 'view_no_maturity': 1}">Journal Entries</a>
</div>
<div>
<a type="object" name="open_action" context="{'action_name': 'action_move_journal_line', 'search_default_toreview': 1}">Entries to Review</a>
<a type="object" name="open_action" context="{'action_name': 'action_move_journal_line', 'search_default_toreview': 1, 'view_no_maturity': 1}">Entries to Review</a>
</div>
<div>
<a type="object" name="open_action" context="{'action_name': 'action_account_moves_all_a'}" groups="base.group_no_one">Journal Items</a>
@@ -214,11 +219,11 @@
<button type="object" name="action_open_reconcile" class="btn btn-primary btn-sm"> Reconcile <t t-esc="dashboard.number_to_reconcile"/> Items</button>
</t>
<t t-if="journal_type == 'bank'">
<div name="bank_journal_default_cta" t-if="! dashboard.bank_statements_source">
<div name="bank_journal_default_cta" t-if="dashboard.bank_statements_source == 'undefined'">
<button t-if="dashboard.number_to_reconcile == 0" type="object" name="create_bank_statement" class="btn btn-primary btn-sm">New Statement</button>
<a t-if="dashboard.number_to_reconcile > 0" type="object" name="create_bank_statement" class="oe_inline">New Statement</a>
</div>
<div name="bank_journal_cta" t-if="dashboard.bank_statements_source">
<div name="bank_journal_cta" t-if="dashboard.bank_statements_source != 'undefined'">
<button t-if="dashboard.bank_statements_source == 'manual' &amp;&amp; dashboard.number_to_reconcile == 0" type="object" name="create_bank_statement" class="btn btn-primary btn-sm">New Statement</button>
<a t-if="dashboard.bank_statements_source == 'manual' &amp;&amp; dashboard.number_to_reconcile > 0" type="object" name="create_bank_statement" class="oe_inline">New Statement</a>
</div>
+17 -14
View File
@@ -311,15 +311,19 @@
<sheet>
<field name="type" invisible="1"/>
<div class="oe_title">
<label for="bank_acc_number" required="1" class="oe_edit_only"/>
<h1><field name="bank_acc_number" required="1"/></h1>
<label for="name" class="oe_edit_only" string="Bank Account Name"/>
<h1><field name="name"/></h1>
</div>
<group col="4">
<field name="bank_id"/>
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
<field name="currency_id" options="{'no_create': True}" groups="base.group_multi_currency"/>
<field name="inbound_payment_method_ids" widget="many2many_checkboxes"/>
<field name="outbound_payment_method_ids" widget="many2many_checkboxes"/>
<group>
<group>
<field name="bank_acc_number"/>
<field name="bank_id"/>
</group><group>
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
<field name="currency_id" options="{'no_create': True}" groups="base.group_multi_currency"/>
<field name="inbound_payment_method_ids" widget="many2many_checkboxes"/>
<field name="outbound_payment_method_ids" widget="many2many_checkboxes"/>
</group>
</group>
</sheet>
</form>
@@ -1275,17 +1279,16 @@
string="Reconciled entries">
</button>
</div>
<label for="name" class="oe_edit_only" attrs="{'invisible':[('name','=','/')]}"/>
<h1>
<field name="name" readonly="True" attrs="{'invisible':[('name','=','/')]}"/>
</h1>
<group>
<group>
<field name="journal_id" options="{'no_open': True, 'no_create': True}"/>
<field name="date"/>
<field name="ref"/>
</group>
<group>
<field name="ref" required="1"/>
<field name="journal_id" options="{'no_open': True, 'no_create': True}"/>
<field name="company_id" required="1" groups="base.group_multi_company"/>
<field name="amount" invisible="1"/>
<field name="currency_id" invisible="1"/>
@@ -1306,7 +1309,7 @@
<field name="currency_id" options="{'no_create': True}" groups="base.group_multi_currency"/>
<field name="debit" sum="Total Debit"/>
<field name="credit" sum="Total Credit"/>
<field name="date_maturity" required="0"/>
<field name="date_maturity" required="0" invisible="context.get('view_no_maturity', False)"/>
</tree>
</field>
<field name="narration" colspan="4" placeholder="Add an internal note..." nolabel="1" height="50"/>
@@ -1355,7 +1358,7 @@
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_move_tree"/>
<field name="search_view_id" ref="view_account_move_filter"/>
<field name="context">{'search_default_misc_filter':1}</field>
<field name="context">{'search_default_misc_filter':1, 'view_no_maturity': True}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a journal entry.
@@ -2012,6 +2015,6 @@
<field name="tag">manual_reconciliation_view</field>
</record>
<menuitem id="menu_action_manual_reconciliation" name="Manual Payments &amp; Invoices Matching" parent="menu_finance_entries" action="action_manual_reconciliation" sequence="25"/>
<menuitem id="menu_action_manual_reconciliation" parent="menu_finance_entries" action="action_manual_reconciliation" sequence="25"/>
</data>
</odoo>
-2
View File
@@ -163,12 +163,10 @@
<group>
<group string="Sale" name="acc_sale">
<field name="property_payment_term_id" widget="selection"/>
<field name="credit" groups="base.group_no_one"/>
<field name="trust"/>
</group>
<group string="Purchase" name="acc_purchase">
<field name="property_supplier_payment_term_id" widget="selection"/>
<field name="debit" groups="base.group_no_one"/>
<field name="currency_id" invisible="1"/>
</group>
<group string="Fiscal Information" name="fiscal_information">
+3 -6
View File
@@ -99,7 +99,7 @@
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane"/>
<div class="o_setting_right_pane">
<label string="Currency"/>
<label string="Main Currency"/>
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." groups="base.group_multi_company"/>
<div class="text-muted">
Main currency of your company
@@ -107,10 +107,7 @@
<div class="content-group">
<div class="row mt16">
<label for="currency_id" class="col-md-3 o_light_label"/>
<field name="currency_id"/>
</div>
<div>
<button name="%(base.action_currency_form)d" icon="fa-arrow-right" type="action" string="Activate Other Currencies" class="btn-link"/>
<field name="currency_id" options="{'no_create_edit': True, 'no_open': True}"/>
</div>
</div>
</div>
@@ -126,7 +123,7 @@
</div>
<div class="content-group" attrs="{'invisible': [('group_multi_currency', '=', False)]}">
<div class="mt16">
<button name="%(base.action_currency_form_company)d" icon="fa-arrow-right" type="action" string="Currencies" class="btn-link"/>
<button name="%(base.action_currency_form)d" icon="fa-arrow-right" type="action" string="Activate Currencies" class="btn-link"/>
</div>
</div>
</div>
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="tax_adjustments_form" model="ir.actions.act_window">
<field name="name">Make Manual Tax Adjustments</field>
<field name="name">Tax Adjustment</field>
<field name="res_model">tax.adjustments.wizard</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
@@ -3,7 +3,7 @@
'name': 'Account Bank Statement Import',
'category': 'Accounting',
'version': '1.0',
'depends': ['account'],
'depends': ['account_accountant'],
'description': """Generic Wizard to Import Bank Statements. Includes the import of files in .OFX format""",
'data': [
'account_bank_statement_import_view.xml',
@@ -3,7 +3,7 @@
<data noupdate="1">
<record id="account_payment_method_check" model="account.payment.method">
<field name="name">Check</field>
<field name="name">Checks</field>
<field name="code">check_printing</field>
<field name="payment_type">outbound</field>
</record>
-1
View File
@@ -12,7 +12,6 @@
'data/payment_acquirer_data.xml',
'views/payment_views.xml',
'views/account_payment_views.xml',
'views/account_journal_views.xml',
'views/payment_templates.xml',
'views/res_partner_views.xml',
'security/ir.model.access.csv',
-1
View File
@@ -3,4 +3,3 @@
import payment_acquirer
import res_partner
import account_payment
import account_journal
-10
View File
@@ -1,10 +0,0 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class AccountJournal(models.Model):
_inherit = "account.journal"
use_in_payment = fields.Boolean("Use in payment", help="Display this bank account on messages in payment process.")
@@ -1,15 +0,0 @@
<?xml version="1.0"?>
<odoo>
<record id="account_bank_journal_view_form" model="ir.ui.view">
<field name="name">account.bank.journal.inherit.payment</field>
<field name="model">account.journal</field>
<field name="inherit_id" ref="account.view_account_bank_journal_form"/>
<field name="arch" type="xml">
<xpath expr='//field[@name="bank_id"]' position="after">
<field name="use_in_payment"/>
</xpath>
</field>
</record>
</odoo>
+1 -1
View File
@@ -21,7 +21,7 @@ class TransferPaymentAcquirer(models.Model):
def _format_transfer_data(self):
company_id = self.env.user.company_id.id
# filter only bank accounts marked as visible
journals = self.env['account.journal'].search([('type', '=', 'bank'), ('use_in_payment', '=', True), ('company_id', '=', company_id)])
journals = self.env['account.journal'].search([('type', '=', 'bank'), ('company_id', '=', company_id)])
accounts = journals.mapped('bank_account_id').name_get()
bank_title = _('Bank Accounts') if len(accounts) > 1 else _('Bank Account')
bank_accounts = ''.join(['<ul>'] + ['<li>%s</li>' % name for id, name in accounts] + ['</ul>'])
+1 -1
View File
@@ -190,7 +190,6 @@
<field name="partner_shipping_id" groups="sale.group_delivery_invoice_address" context="{'default_type':'delivery'}"/>
</group>
<group>
<field name="date_order" attrs="{'invisible': [('state', 'in', ['sale', 'done', 'cancel'])]}"/>
<field name="validity_date" attrs="{'invisible': [('state', 'in', ['sale', 'done'])]}"/>
<field name="confirmation_date" attrs="{'invisible': [('state', 'in', ['draft', 'sent', 'cancel'])]}"/>
<field name="pricelist_id" groups="product.group_sale_pricelist"/>
@@ -347,6 +346,7 @@
groups="analytic.group_analytic_accounting"/>
</group>
<group name="sale_pay" string="Invoicing">
<field name="date_order" attrs="{'invisible': [('state', 'in', ['sale', 'done', 'cancel'])]}"/>
<field name="fiscal_position_id" options="{'no_create': True}"/>
<field name="invoice_status"
attrs="{'invisible': [('state', 'not in', ('sale','done'))]}"/>
+2 -11
View File
@@ -135,16 +135,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_currency_search"/>
<field name="context">{'active_test': False, 'search_default_active': 1}</field>
</record>
<record id="action_currency_form_company" model="ir.actions.act_window">
<field name="name">Currencies</field>
<field name="res_model">res.currency</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_currency_search"/>
<field name="context">{'active_test': False, 'search_default_active': 1}</field>
<field name="context">{'active_test': False, 'search_default_inactive': 1, 'search_default_active': 1}</field>
</record>
<!-- We override the view res_company here because the action wasn't defined before -->
@@ -156,7 +147,7 @@
<xpath expr="//field[@id='company_currency']" position="after">
<label for="id"/>
<p class="text-muted">
Activate <a href="" type="action" name="%(base.action_currency_form_company)d">here</a> a new currency before creating a new company.
<a href="" type="action" name="%(base.action_currency_form)d">Activate more currencies</a>.
</p>
</xpath>
</field>