summaryrefslogtreecommitdiff
path: root/addons/account/views/account_move_views.xml
diff options
context:
space:
mode:
authorwilliam <wan@odoo.com>2020-03-30 11:46:27 +0000
committerwilliam <wan@odoo.com>2020-08-05 11:57:10 +0000
commit82dc0cb7b91ae59beae7e1c865b670afc5958b31 (patch)
tree949b949b249cdac265310798d5abb82675a1741b /addons/account/views/account_move_views.xml
parent276ba8e90c87f8294286f915508766761a58d1e2 (diff)
[IMP] account: soft post entries in the future
Add an easy way to not post the entries in the future when calling post() on it, but rather set it to be auto-posted at accounting date. This is useful when we are creating a lot of entries in batch and some might be in the future, some in the past, and we don't want to separate that in two batch every time. (asset, accrual, transfer,... )
Diffstat (limited to 'addons/account/views/account_move_views.xml')
-rw-r--r--addons/account/views/account_move_views.xml10
1 files changed, 7 insertions, 3 deletions
diff --git a/addons/account/views/account_move_views.xml b/addons/account/views/account_move_views.xml
index 18aa8075699..09f700adb78 100644
--- a/addons/account/views/account_move_views.xml
+++ b/addons/account/views/account_move_views.xml
@@ -486,10 +486,10 @@
<!-- Post -->
<button name="action_post" string="Post" class="oe_highlight"
type="object" groups="account.group_account_invoice"
- attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('move_type', '!=', 'entry')]}"/>
+ attrs="{'invisible': ['|', '|', ('state', '!=', 'draft'), ('auto_post', '=', True), ('move_type', '!=', 'entry')]}"/>
<button name="action_post" string="Validate" class="oe_highlight"
type="object" groups="account.group_account_invoice"
- attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('move_type', '=', 'entry')]}"/>
+ attrs="{'invisible': ['|', '|', ('state', '!=', 'draft'), ('auto_post', '=', True), ('move_type', '=', 'entry')]}"/>
<!-- Send (only invoices) -->
<button name="action_invoice_sent"
type="object"
@@ -542,6 +542,10 @@
attrs="{'invisible': ['|', '|', ('move_type', 'not in', ('in_invoice', 'in_refund')), ('invoice_has_outstanding', '=', False), ('payment_state', 'not in', ('not_paid', 'partial'))]}">
You have <bold><a class="alert-link" href="#outstanding" role="button">outstanding debits</a></bold> for this supplier. You can allocate them to mark this bill as paid.
</div>
+ <div class="alert alert-info" role="alert" style="margin-bottom:0px;"
+ attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('auto_post', '=', False)]}">
+ This move is configured to be posted automatically at the accounting date: <field name="date" readonly="1"/>.
+ </div>
<sheet>
<div name="button_box" class="oe_button_box">
<button name="open_reconcile_view"
@@ -1023,7 +1027,7 @@
widget="email"
attrs="{'invisible': ['|', ('move_type', 'not in', ('in_invoice', 'in_refund')), ('invoice_source_email', '=', False)]}"/>
<field name="auto_post"
- attrs="{'invisible': [('move_type', '!=', 'in_invoice')], 'readonly': ['|',('reversed_entry_id', '!=', False),('state','!=','draft')]}"/>
+ attrs="{'readonly': ['|',('reversed_entry_id', '!=', False),('state','!=','draft')]}"/>
<field name="to_check"/>
</group>
</group>