private void button2_Click(object sender, EventArgs e) { IMDEV.OpenERP.EG.models.product.product_product monProduit; /*List<object> listeProduit; * listeProduit = _monClient.search(new IMDEV.OpenERP.models.query.aQuery("name", "test imdev"), "product.product",true); * richTextBox1.AppendText(((IMDEV.OpenERP.EG.models.product.product_product)(listeProduit[0])).name+"\r\n"); * richTextBox1.AppendText(((IMDEV.OpenERP.EG.models.product.product_product)(listeProduit[1])).name);*/ monProduit = (IMDEV.OpenERP.EG.models.product.product_product)_monClient.read(new IMDEV.OpenERP.models.query.aQuery(6527), typeof(IMDEV.OpenERP.EG.models.product.product_product))[0]; monProduit.authorized_country_ids.addLink(1); richTextBox1.AppendText(monProduit.save(_monClient).ToString()); }
private bool chargeLanguesData(IMDEV.OpenERP.Clients.clientOpenERP clientOpenERP, List <models.common.res_lang> listeLangue) { List <object> retour; List <string> listeChamps = new List <string>(); [email protected] context; listeChamps.Add(_nomChamps); _listeChaines.Clear(); _listeChaines = new Hashtable(); _changed.Clear(); _changed = new Hashtable(); try { if (listeLangue == null) { listeLangue = clientOpenERP.translatableLang(); if (listeLangue == null) { throw new Systeme.exceptionOpenERP(IMDEV.OpenERP.Systeme.exceptionOpenERP.ERRORS.NO_LANGUAGE); } } foreach (models.common.res_lang lang in listeLangue) { context = new [email protected](); context.add("lang", lang.code); retour = clientOpenERP.read(new IMDEV.OpenERP.models.query.aQuery((int)_classeParente.listProperties.value("id", [email protected]_TYPE.INTEGER)), _classeParente.resource_name(), listeChamps, context); _listeChaines.Add(lang.code, (([email protected])(retour[0])).listProperties.value(_nomChamps, [email protected]_TYPE.TEXT)); _changed.Add(lang.code, false); } _alreadyLoaded = true; return(true); } catch (Exception e) { throw new Systeme.exceptionOpenERP(Systeme.exceptionOpenERP.ERRORS.ERR_LOAD_TRANSLATE, e.Message); } }