(6, 0, 在 Open ERP 7 代码中做什么?

use*_*743 0 python openerp

我想知道(6, 0,以下代码有什么作用,也许是过滤税?我了解其他部分。这是 account_invoice 类的片段。我当然知道它是 tulpe。只是想知道为什么 Open erp 使用6而不是46号有什么特别之处?顺便说一下,我不是想在上下文中添加一些东西。

  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)
Run Code Online (Sandbox Code Playgroud)

小智 6

(6, 0, [IDs]) 替换链接 ID 列表。

例子:

[(6, 0, [8, 5, 6, 4])] sets the many2many to ids [8, 5, 6, 4]
Run Code Online (Sandbox Code Playgroud)

以下是其他代码:

(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)