コンテンツへスキップ
メニュー
この質問にフラグが付けられました
4 返信
3106 ビュー

Hi everyone, 

How to disable The button set to draft of the payment on Odoo 15

Thanks in advance 

アバター
破棄
著作者

Thank you Mr. Ricardo, If we lock posted entries with Hash, as you described, only invoices will be Locked, the payments can be set to draft

最善の回答

Hi,

You can disable the button, by inheriting the Account Payment for view ans set attribute invisible to 1 as below:

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_account_payment_form_inherit_extended" model="ir.ui.view" style="color:#e8bf6a;">>
<field name="name">account.payment.form.inherit.extended style="color:#e8bf6a;"></field>
<field name="model">account.payment</field>
<field name="inherit_id" ref="account.view_account_payment_form"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='action_draft']" position="attributes">
<attribute name='invisible'>1</attribute>
</xpath>
</field>
</record>
</odoo>


Make sure that you are adding the correct path for this file in your module manifest file

Hope this will help you

Thank you

アバター
破棄
最善の回答

you can inherit the view and set the invisible to 1 for the button 

or you can give it a group so other groups cant see it 

or you can also set a which group can do it in python so the button appears but a specific group can use it

アバター
破棄
著作者 最善の回答

Hi, 

As I'm a beginner at odoo, could you give me more details, please? 

アバター
破棄
最善の回答

You can "Lock Posted Entries with Hash" (under accounting->configuration->journals->customer invoices->advanced settings) which will also remove the "reset to draft" button for invoices.

Remembering that this is a decision that must be made with precaution, because after entries are made it becomes irreversible, however necessary according to the accounting law of different countries.

In the hope of being helpful, thank you for comments!

アバター
破棄