-1

これはばかげているかもしれませんが、私にはわかりません。

Accounting -> Customers -> Customer Invoices (model: account.invoice) に移動すると、「Total」(amount_total) フィールドがあります。

account.voucher にブール値フィールドを追加しました。

 'test': fields.boolean('Test'),

「支払いの登録」ボタンをクリックするとウィザード(請求書の支払い)が開きます。「合計」の値に基づいて、このフィールドを表示または非表示にしたいと考えています。「支払額」(金額) に入力する値が「合計」より小さい場合は、「テスト」フィールドが表示され、それ以外の場合は表示されません。

どうすれば可能になりますか?

事前にサンクス。

4

2 に答える 2

0

In the account_voucher-> invoice.py file there is a method named invoice_pay_customer.

this is the method is called when the you click on the Register Payment button(enable the debug mode), you just need to update the context value, you just need to override this method like,

def invoice_pay_customer(self, cr, uid, ids, context=None):
    vals = super(invoice, self).invoice_pay_customer(cr, uid, ids, context=None)
    inv = self.browse(cr, uid, ids[0], context=context)
    vals.get('context').update({"default_amount": inv.amount_total})
    return vals

it will set the amount in the popup.

于 2013-12-24T09:51:22.223 に答える
-1

あなたの質問を読んだ後、私が理解している限りでは、あなたは請求書フォームで合計金額の値が欲しいということですよね?

これに基づいて、いくつかのフィールドを非表示にしたいですか?

あなたができることは1つ、

請求書の合計の値を含む 1 つのフィールドの合計をウィザードに追加します。

請求書合計の値を取得する

default_get メソッドを上書きする

def default_get(self, cr, uid, fields, context=None):

この方法では、このアクティブIDから現在の請求書のactive_idまたはactive_idsを取得します。請求書の合計フィールド値を取得し、ウィザードの合計値に設定します

この助けを願っています

于 2013-12-24T10:09:52.030 に答える