ios - 如何在odoo中创建客户(res.partner)时添加标签(Category_id)?
<p><p>我正在开发 ODOO iOS 应用程序。
我正在使用 <code>res.partner</code> 模型和 <code>create</code> 方法创建客户。
客户创建成功,没有任何错误,但我在创建过程中选择的标签字段没有生成。</p>
<p>我使用以下代码来创建客户:</p>
<pre><code>NSArray *inputParameter = ,,,@"res.partner",@"create",customerDictionary,nil];
// Show progress hud on main thread
[ showProgressHUD:@"Please wait" withView:self.view];
// Depending on Id's read records
WebService *service = [ init];
]] withMethodName:ExecuteFunctionName withParameter:inputParameter withResult:^(id result,NSError *error)
{
[ hideProgressHUD];
if(])
{
;
}
}
</code></pre>
<p>上述调用的输入参数如下:</p>
<pre><code>{
"category_id" = (
17,
10,
9,
13
);
city = California;
email = "[email protected]";
fax = "";
function = "";
"is_company" = 0;
mobile = "";
name = "123 Sample Customer";
phone = "";
street = "Street address";
website = "http://www.sample.com";
}
</code></pre>
<p>在上面的输入参数中 <code>category_id</code> 是我的标签键。</p>
<p>有人遇到过这种问题吗?</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>在<em>res_partner</em> 对象中<em>category_id</em> 有many2many 关系。所以你需要使用 <em>]</em></p> 添加
<p>试试这个值:</p>
<pre><code>{
"category_id" = [(6, 0, )],
city = California;
email = "[email protected]";
fax = "";
function = "";
"is_company" = 0;
mobile = "";
name = "123 Sample Customer";
phone = "";
street = "Street address";
website = "http://www.sample.com";
}
</code></pre>
<p> <a href="https://doc.odoo.com/v6.0/developer/2_5_Objects_Fields_Methods/methods.html#osv.osv.osv.write" rel="noreferrer noopener nofollow">For more details of Many2one, One2many and Many2many field</a> </p></p>
<p style="font-size: 20px;">关于ios - 如何在odoo中创建客户(res.partner)时添加标签(Category_id)?,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/29643834/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/29643834/
</a>
</p>
页:
[1]