summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorYannick Tivisse <yti@odoo.com>2018-02-05 11:06:54 +0100
committerYannick Tivisse <yti@odoo.com>2018-02-05 11:06:54 +0100
commit41a9eeff1a6d693d24a0c80830605aa441a2f0a3 (patch)
tree00621934ab90cad16ace41c4c162a13f5a850715 /addons
parent88ff096c9653b33106261705b1d59fd86b538d30 (diff)
parentd65856bdb2403b8abb8672570a82514bf07bcb1c (diff)
[MERGE] account: Apply some usability improvements
Purpose ======= General improvements on the accounting application SPECIFICATION ============= 1. On a supplier invoice, everyhting should be in the language of the user, not in the language of the supplier 2. list view on invoices and vendor bills: Add the amount VAT excl. and the tax amount in the columns https://drive.google.com/file/d/0B9XXHE6oGlGJVXVaYjdUekxZbkE/view 3. remove tax scope in the list view of the taxes coming from the search more of the invoice line https://drive.google.com/a/odoo.com/file/d/0B0ITmdw6h3ZrVWc4NVFQZVFpY0E/view?usp=drivesdk 4. Hide the Filters option (While venders bills search view showing only tax scope purchase and sales bills search view showing only tax scope sales so no need purchase and sales option of the filter, also hide active and inactive filters.) https://drive.google.com/file/d/1rWzGr4X5SswUZLZXiNI15Qg4Oqb5wopC/view?usp=drivesdk 5. Payment terms It should not be possible to delete a payment term that is used in another document. Raise the following error : "You can not delete this payment terms as other records still reference it. However, you can archive it."
Diffstat (limited to 'addons')
-rw-r--r--addons/account/models/account_invoice.py2
-rw-r--r--addons/account/views/account_invoice_view.xml8
-rw-r--r--addons/account/views/account_view.xml23
-rw-r--r--addons/account/views/report_invoice.xml8
-rw-r--r--addons/purchase/views/purchase_views.xml2
-rw-r--r--addons/sale/views/sale_views.xml2
6 files changed, 38 insertions, 7 deletions
diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py
index f756ec42100..d45fa6fd9c5 100644
--- a/addons/account/models/account_invoice.py
+++ b/addons/account/models/account_invoice.py
@@ -1830,6 +1830,8 @@ class AccountPaymentTerm(models.Model):
@api.multi
def unlink(self):
+ if self.env['account.invoice'].search([('payment_term_id', 'in', self.ids)]):
+ raise UserError(_('You can not delete payment terms as other records still reference it. However, you can archive it.'))
property_recs = self.env['ir.property'].search([('value_reference', 'in', ['account.payment.term,%s'%payment_term.id for payment_term in self])])
property_recs.unlink()
return super(AccountPaymentTerm, self).unlink()
diff --git a/addons/account/views/account_invoice_view.xml b/addons/account/views/account_invoice_view.xml
index d699ff237b9..ba8dbc1e54f 100644
--- a/addons/account/views/account_invoice_view.xml
+++ b/addons/account/views/account_invoice_view.xml
@@ -136,6 +136,8 @@
<field name="user_id"/>
<field name="date_due"/>
<field name="origin"/>
+ <field name="amount_untaxed" string="Tax Excluded" sum="Total"/>
+ <field name="amount_tax" sum="Total"/>
<field name="amount_total_signed" string="Total" sum="Total"/>
<field name="residual_signed" string="Amount Due" sum="Amount Due"/>
<field name="currency_id" invisible="1"/>
@@ -199,6 +201,8 @@
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
<field name="date_due"/>
<field name="origin"/>
+ <field name="amount_untaxed" string="Tax Excluded" sum="Total"/>
+ <field name="amount_tax" sum="Total"/>
<field name="amount_total_signed" string="Total" sum="Total"/>
<field name="residual_signed" string="To Pay" sum="To pay"/>
<field name="currency_id" invisible="1"/>
@@ -277,7 +281,7 @@
<field name="uom_id" groups="product.group_uom"/>
<field name="price_unit"/>
<field name="discount" groups="base.group_no_one"/>
- <field name="invoice_line_tax_ids" widget="many2many_tags" options="{'no_create': True}" context="{'type':parent.type}"
+ <field name="invoice_line_tax_ids" widget="many2many_tags" options="{'no_create': True}" context="{'type':parent.type, 'tree_view_ref': 'account.account_tax_view_tree', 'search_view_ref': 'account.account_tax_view_search'}"
domain="[('type_tax_use','=','purchase'),('company_id', '=', parent.company_id)]"/>
<field name="price_subtotal" string="Amount"/>
<field name="currency_id" invisible="1"/>
@@ -434,7 +438,7 @@
<field name="uom_id" groups="product.group_uom"/>
<field name="price_unit"/>
<field name="discount" groups="base.group_no_one"/>
- <field name="invoice_line_tax_ids" widget="many2many_tags" options="{'no_create': True}" context="{'type':parent.type}"
+ <field name="invoice_line_tax_ids" widget="many2many_tags" options="{'no_create': True}" context="{'type':parent.type, 'tree_view_ref': 'account.account_tax_view_tree', 'search_view_ref': 'account.account_tax_view_search'}"
domain="[('type_tax_use','=','sale'),('company_id', '=', parent.company_id)]"/>
<field name="price_subtotal" string="Subtotal"/>
<field name="currency_id" invisible="1"/>
diff --git a/addons/account/views/account_view.xml b/addons/account/views/account_view.xml
index dddaacd1ead..9ce5bab4cdb 100644
--- a/addons/account/views/account_view.xml
+++ b/addons/account/views/account_view.xml
@@ -1000,6 +1000,18 @@
</tree>
</field>
</record>
+
+ <record id="account_tax_view_tree" model="ir.ui.view">
+ <field name="name">account.invoice.line.tax.search</field>
+ <field name="model">account.tax</field>
+ <field name="arch" type="xml">
+ <tree string="Account Tax">
+ <field name="name"/>
+ <field name="description"/>
+ </tree>
+ </field>
+ </record>
+
<record id="view_tax_kanban" model="ir.ui.view">
<field name="name">account.tax.kanban</field>
<field name="model">account.tax</field>
@@ -1043,6 +1055,17 @@
</search>
</field>
</record>
+ <record id="account_tax_view_search" model="ir.ui.view">
+ <field name="name">account.tax.search.filters</field>
+ <field name="model">account.tax</field>
+ <field name="arch" type="xml">
+ <search string="Search Taxes">
+ <field name="name" filter_domain="['|', ('name','ilike',self), ('description','ilike',self)]" string="Tax"/>
+ <field name="company_id" groups="base.group_multi_company"/>
+ </search>
+ </field>
+ </record>
+
<record id="view_tax_form" model="ir.ui.view">
<field name="name">account.tax.form</field>
<field name="model">account.tax</field>
diff --git a/addons/account/views/report_invoice.xml b/addons/account/views/report_invoice.xml
index 270c792c606..486f4c50d07 100644
--- a/addons/account/views/report_invoice.xml
+++ b/addons/account/views/report_invoice.xml
@@ -3,7 +3,7 @@
<data>
<template id="report_invoice_document">
<t t-call="web.external_layout">
- <t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})" />
+ <t t-set="o" t-value="o.with_context({'lang': lang})"/>
<div class="page">
<div class="row">
<div name="invoice_address" class="col-xs-5 col-xs-offset-7">
@@ -180,7 +180,8 @@
<template id="report_invoice">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
- <t t-call="account.report_invoice_document" t-lang="o.partner_id.lang"/>
+ <t t-set="lang" t-value="o.user_id.lang if o.type in ('in_invoice', 'in_refund') else o.partner_id.lang"/>
+ <t t-call="account.report_invoice_document" t-lang="lang"/>
</t>
</t>
</template>
@@ -188,7 +189,8 @@
<template id="report_invoice_with_payments">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
- <t t-call="account.report_invoice_document_with_payments" t-lang="o.partner_id.lang"/>
+ <t t-set="lang" t-value="o.user_id.lang if o.type in ('in_invoice', 'in_refund') else o.partner_id.lang"/>
+ <t t-call="account.report_invoice_document_with_payments" t-lang="lang"/>
</t>
</t>
</template>
diff --git a/addons/purchase/views/purchase_views.xml b/addons/purchase/views/purchase_views.xml
index 73d9732dec0..657804c2f9b 100644
--- a/addons/purchase/views/purchase_views.xml
+++ b/addons/purchase/views/purchase_views.xml
@@ -213,7 +213,7 @@
<field name="qty_invoiced" attrs="{'column_invisible': [('parent.state', 'not in', ('purchase', 'done'))]}"/>
<field name="product_uom" groups="product.group_uom" attrs="{'readonly': [('state', 'in', ('purchase', 'done', 'cancel'))]}" force_save="1"/>
<field name="price_unit"/>
- <field name="taxes_id" widget="many2many_tags" domain="[('type_tax_use','=','purchase')]" context="{'default_type_tax_use': 'purchase'}" options="{'no_create': True}"/>
+ <field name="taxes_id" widget="many2many_tags" domain="[('type_tax_use','=','purchase')]" context="{'default_type_tax_use': 'purchase', 'search_view_ref': 'account.account_tax_view_search'}" options="{'no_create': True}"/>
<field name="price_subtotal" widget="monetary"/>
</tree>
<form string="Purchase Order Line">
diff --git a/addons/sale/views/sale_views.xml b/addons/sale/views/sale_views.xml
index f1d776d6ad2..8321947d9f1 100644
--- a/addons/sale/views/sale_views.xml
+++ b/addons/sale/views/sale_views.xml
@@ -273,7 +273,7 @@
</div>
</group>
<group>
- <field name="tax_id" widget="many2many_tags" options="{'no_create': True}" domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id)]"
+ <field name="tax_id" widget="many2many_tags" options="{'no_create': True}" context="{'search_view_ref': 'account.account_tax_view_search'}" domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id)]"
attrs="{'readonly': [('qty_invoiced', '&gt;', 0)]}"/>
<label for="customer_lead"/>
<div>