2016-10-06 5 views
-2

(6, 0,は次のコードで何をしているのでしょうか?ろ過税ですか?私は他の部分を理解していますが、account_invoiceクラスのスニペットです。 tulpe。ただ、なぜオープンERPの使用を不思議ない。私はコンテキストに何かを追加しようとしていないよちなみに数?何が特別であったのか。Open ERP 7コードで何が行われるのですか?

self.pool.get('account.invoice.line').create(cr, uid, { 
    'invoice_id':inv_id, 
    'name': line.product_id.name_template, 
    'account_id': line.product_id.categ_id.property_account_expense_categ.id, 
    'price_unit': line.price_unit or 0.0, 
    'quantity': line.product_qty, 
    'product_id': line.product_id.id, 
    'uos_id': line.product_uom.id, 
    'invoice_line_tax_id': [(6, 0, [x.id for x in line.taxes_id])], 
    }, context=context) 
+0

あなたは、いくつかのコンテキストを追加するつもりですか? –

+0

うわー、私たちが見ることのできないコードでは、無意味な数字が完全に定義されていない文脈の中でどういうことをしているのですか? Uhm ... * shrug * – deceze

+0

Klausの文脈についての質問は:**このコード行がどこにあるかについて私たちにもっと教えてください。**与えられた情報で数字** 6 **について何も教えてくれません。 – deceze

答えて

2

(6, 0, [IDs])リンクされたIDのリストを置き換えます。

例:ここでは

[(6, 0, [8, 5, 6, 4])] sets the many2many to ids [8, 5, 6, 4] 

は、他のコードです:

(0, 0, { values }) link to a new record that needs to be created with the given values dictionary (1, ID, { values }) update the linked record with id = ID (write *values* on it) (2, ID) remove and delete the linked record with id = ID (calls unlink on ID, that will delete the object completely, and the link to it as well) (3, ID) cut the link to the linked record with id = ID (delete the relationship between the two objects but does not delete the target object itself) (4, ID) link to existing record with id = ID (adds a relationship) (5) unlink all (like using (3,ID) for all linked records) (6, 0, [IDs]) replace the list of linked IDs (like using (5) then (4,ID) for each ID in the list of IDs)

+0

ありがとう。本当に感謝しております。 – user3000743

0

参照ORM 6 7つのバージョンのドキュメントページの終わりには、m2mとo2m意味(これはm2mです)

関連する問題