콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
4 답글
3130 화면

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!

아바타
취소