[IMP] account: usability of account.move form view

- moved company_id in other info tab
- currency_id is shown near journal_id
- invoice:
-- ref renamed to 'customer reference' and move to other info tab
-- payment_reference hidden if state is draft
-- Fixed bug in l10n_in where xpath did not find removed element
- vendor bill: auto-complete only shown in edit mode

was task:2209497

closes odoo/odoo#48913

X-original-commit: 170635c901914cfe8f33fdbe8d498cbd5f54054e
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
This commit is contained in:
Benjamin Frantzen (bfr)
2020-04-02 18:48:39 +00:00
parent 56a8ea9422
commit d1bbf11af2
4 changed files with 45 additions and 36 deletions
+3 -2
View File
@@ -1319,8 +1319,9 @@ class AccountJournal(models.Model):
def name_get(self):
res = []
for journal in self:
currency = journal.currency_id or journal.company_id.currency_id
name = "%s (%s)" % (journal.name, currency.name)
name = journal.name
if journal.currency_id and journal.currency_id != journal.company_id.currency_id:
name = "%s (%s)" % (name, journal.currency_id.name)
res += [(journal.id, name)]
return res
+35 -32
View File
@@ -608,18 +608,21 @@
'show_address': 1, 'default_is_company': True, 'show_vat': True}"
options='{"always_reload": True, "no_quick_create": True}'
attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))]}"/>
<div class="o_td_label">
<label for="ref"
attrs="{'invisible':[('move_type', 'in', ('in_invoice', 'in_receipt', 'in_refund'))]}" />
<label for="ref" string="Bill Reference"
attrs="{'invisible':[('move_type', 'not in', ('in_invoice', 'in_receipt', 'in_refund'))]}" />
</div>
<field name="ref" nolabel="1"/>
<field name="invoice_vendor_bill_id"
<label for="ref" string="Bill Reference"
attrs="{'invisible':[('move_type', 'not in', ('in_invoice', 'in_receipt', 'in_refund'))]}" />
<field name="ref" nolabel="1" attrs="{'invisible':[('move_type', 'not in', ('in_invoice', 'in_receipt', 'in_refund'))]}" />
<field name="invoice_payment_ref"
attrs="{'invisible': ['|',('move_type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt')), ('state', '=', 'draft')], 'readonly': [('state', '!=', 'draft')]}"/>
<field name="invoice_partner_bank_id"
context="{'default_partner_id': commercial_partner_id}"
domain="[('partner_id', '=', bank_partner_id)]"
attrs="{'invisible': [('move_type', 'not in', ('in_invoice', 'in_refund', 'in_receipt'))], 'readonly': [('state', '!=', 'draft')]}"/>
<label name="invoice_vendor_bill_id_label" for="invoice_vendor_bill_id" string="Auto-Complete" class="oe_edit_only"
attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('move_type', '!=', 'in_invoice')]}"/>
<field name="invoice_vendor_bill_id" nolabel="1" class="oe_edit_only"
attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('move_type', '!=', 'in_invoice')]}"
domain="[('company_id', '=', company_id), ('partner_id','child_of', [partner_id]), ('move_type','=','in_invoice')]"
string="Auto-Complete" placeholder="Select an old vendor bill"
placeholder="Select an old vendor bill"
options="{'no_create': True}" context="{'show_total_amount': True}"/>
</group>
<group id="header_right_group">
@@ -649,23 +652,22 @@
placeholder="Terms"/>
</div>
<field name="journal_id"
invisible="context.get('default_journal_id') and context.get('move_type', 'entry') != 'entry'"
groups="account.group_account_readonly"
options="{'no_create': True}"
attrs="{'readonly': [('posted_before', '=', True)]}"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="invoice_payment_ref"
attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))], 'readonly': [('state', '!=', 'draft')]}"/>
<field name="invoice_partner_bank_id"
context="{'default_partner_id': commercial_partner_id}"
domain="[('partner_id', '=', bank_partner_id)]"
attrs="{'invisible': [('move_type', 'not in', ('in_invoice', 'in_refund', 'in_receipt'))], 'readonly': [('state', '!=', 'draft')]}"/>
<field name="currency_id"
groups="base.group_multi_currency"
attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund'))]}"/>
<label for="journal_id"
invisible="context.get('default_journal_id') and context.get('move_type', 'entry') != 'entry'"/>
<div class="d-flex" invisible="context.get('default_journal_id') and context.get('move_type', 'entry') != 'entry'">
<field name="journal_id"
groups="account.group_account_readonly"
options="{'no_create': True}"
attrs="{'readonly': [('posted_before', '=', True)]}"/>
<span class="oe_inline o_form_label mx-3 oe_read_only"
groups="account.group_account_readonly"> in </span>
<!-- Bigger margin on the left because in edit mode the external link button covers the text -->
<span class="oe_inline o_form_label mr-3 ml-5 oe_edit_only"
groups="account.group_account_readonly"> in </span>
<field name="currency_id"
groups="account.group_account_readonly"
attrs="{'readonly': [('posted_before', '=', True)]}"/>
</div>
</group>
</group>
<notebook>
@@ -850,7 +852,7 @@
</field>
<!-- Totals (only invoices / receipts) -->
<group class="oe_subtotal_footer"
<group class="oe_subtotal_footer oe_right"
attrs="{'invisible': ['|', ('move_type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt')),
('payment_state' ,'=', 'invoicing_legacy')]}">
<field name="amount_tax" invisible="1"/>
@@ -861,14 +863,12 @@
<field name="invoice_payments_widget" colspan="2" nolabel="1" widget="payment"/>
<field name="amount_residual" class="oe_subtotal_footer_separator" attrs="{'invisible': [('state', '=', 'draft')]}"/>
</group>
<field name="narration" placeholder="Terms and Conditions" class="oe_inline" nolabel="1"/>
<field name="invoice_outstanding_credits_debits_widget"
class="oe_invoice_outstanding_credits_debits"
colspan="2" nolabel="1" widget="payment"
attrs="{'invisible': ['|', ('state', '!=', 'posted'), ('move_type', 'in', ('out_receipt', 'in_receipt'))]}"/>
<!-- Internal note -->
<field name="narration" placeholder="Terms and Conditions" nolabel="1" height="50"/>
</page>
<page id="aml_tab" string="Journal Items" groups="account.group_account_readonly">
<div class="alert alert-info text-center mb-0" role="alert" attrs="{'invisible': ['|', ('payment_state', '!=', 'invoicing_legacy'), ('move_type', '=', 'entry')]}">
@@ -988,18 +988,21 @@
<group string="Invoice"
name="sale_info_group"
attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund'))]}">
<label for="ref" string="Customer Reference" />
<field name="ref" nolabel="1"/>
<field name="invoice_user_id" domain="[('share', '=', False)]"/>
<field name="invoice_origin" string="Source Document" force_save="1"
attrs="{'invisible': [('invoice_origin', '=', False)]}"/>
<field name="invoice_partner_bank_id"
context="{'default_partner_id': commercial_partner_id}"
domain="[('partner_id', '=', bank_partner_id)]"
attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund', 'out_receipt'))], 'readonly': [('state', '!=', 'draft')]}"/>
attrs="{'readonly': [('state', '!=', 'draft')]}"/>
<field name="qr_code_method" attrs="{'invisible': [('display_qr_code', '=', False)]}"/>
</group>
<group string="Accounting"
name="accounting_info_group"
attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund'))]}">
<field name="company_id" groups="base.group_multi_company"/>
<field name="invoice_incoterm_id"/>
<field name="fiscal_position_id"/>
<field name="invoice_cash_rounding_id" groups="account.group_cash_rounding"/>
@@ -5,7 +5,7 @@
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@id='other_tab']/group[@id='other_tab_group']/group[@name='payments_info_group']" position="after">
<xpath expr="//page[@id='other_tab']//group[@name='accounting_info_group']" position="after">
<group string="Import/Export India">
<field name="l10n_in_import_export" invisible="1"/>
<field name="l10n_in_export_type"
+6 -1
View File
@@ -9,7 +9,9 @@
<!-- Auto-complete could be done from either a bill either a purchase order -->
<field name="invoice_vendor_bill_id" position="after">
<field name="purchase_id" invisible="1"/>
<field name="purchase_vendor_bill_id"
<label for="purchase_vendor_bill_id" string="Auto-Complete" class="oe_edit_only"
attrs="{'invisible': ['|', '|', ('state','not in',['draft']), ('state', '=', 'purchase'), ('move_type', '!=', 'in_invoice')]}" />
<field name="purchase_vendor_bill_id" nolabel="1"
attrs="{'invisible': ['|', '|', ('state','not in',['draft']), ('state', '=', 'purchase'), ('move_type', '!=', 'in_invoice')]}"
class="oe_edit_only"
domain="[('company_id', '=', company_id), ('partner_id','child_of', [partner_id])]"
@@ -17,6 +19,9 @@
context="{'show_total_amount': True}"
options="{'no_create': True, 'no_open': True}"/>
</field>
<label name="invoice_vendor_bill_id_label" position="attributes">
<attribute name="invisible">1</attribute>
</label>
<field name="invoice_vendor_bill_id" position="attributes">
<attribute name="invisible">1</attribute>
</field>