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

I did the following: 

First I created the function:


def invoiceRegisterPayment(self,register_payment_row):       
    confirm_result = self.ODOO_OBJECT.execute_kw(
        self.DATA,
        self.UID,
        self.PASS,
        'account.payment',
        'action_validate_invoice_payment',
        register_payment_row)       
    return confirm_result
Then I passed the following parameters:
    register_payment_row = [
        [payment_id],
        {
            "active_id":invoice_id,
            "active_ids":[invoice_id],
            "active_model": "account.invoice",
            "default_invoice_ids":[[4,invoice_id,None]],
            "journal_type":"sale",
            "lang":"en_US",
            "search_disable_custom_filters": True,
            "type": "out_invoice",
            "tz": False,
            "uid": 2
        } ]

But it shows the following error: "This method should only be called to process a single invoice's payment."

This is the print of register_payment_row:

[[67], {'active_id': 119, 'active_ids': [119], 'active_model': 'account.invoice', 'default_invoice_ids': [4, 119, None], 'journal_type': 'sale', 'lang': 'en_US', 'search_disable_custom_filters': True, 'type': 'out_invoice', 'tz': False, 'uid': 2}]
アバター
破棄
最善の回答

Hello

your passing multiple invoices that's why the error

'default_invoice_ids': [4, 119, None]
you have to pass only one invoice_id then it will work
Try with this 'default_invoice_ids': [invoice_id]
アバター
破棄

I tried the code below and it is still show

register_payment_row = [

[452],

{

"active_id":333,

"active_ids":[333],

"active_model": "account.invoice",

"default_invoice_ids": [333],

"journal_type":"sale",

"lang":"en_US",

"search_disable_custom_filters": True,

"type": "out_invoice",

"tz": False,

"uid": 1

} ]

最善の回答

It's worked:

'invoice_ids' should be like that: 'invoice_ids': [[4, invoice_id, None]]

アバター
破棄
最善の回答

I tried the code below and it is still show



"This method should only be called to process a single invoice's payment"



register_payment_row = [


[452],


{


"active_id":333,


"active_ids":[333],


"active_model": "account.invoice",


"default_invoice_ids": [333],


"journal_type":"sale",


"lang":"en_US",


"search_disable_custom_filters": True,


"type": "out_invoice",


"tz": False,


"uid": 1


} ]

アバター
破棄
最善の回答

I'm getting this error:

RPCError: local variable 'sequence_code' referenced before assignment

any help?

アバター
破棄
関連投稿 返信 ビュー 活動
3
6月 22
6002
1
10月 24
3414
2
12月 22
3515
2
3月 22
3392
4
7月 19
10484