openerp

How to Change selection field automatically in odoo

房东的猫 提交于 2019-12-13 06:09:46
问题 I'm working on Odoo 8. I have a view that contains a set of combo-box type fields and a selection field. I want to make a test on the combo-box fields and if there are all checked then the selection field value should change. Here is what i have so far: def get_etat_dossier(self,cr,uid,ids,args,fields,context=None): res = {} for rec in self.browse(cr,uid,ids): if rec.casier_judiciare==True: # test field if = true res[rec.id]= 02 # field etat_dos type selection = Dossier Complet else: res[rec

what is the reason of using _defaults and lambda in python for openerp development?

女生的网名这么多〃 提交于 2019-12-13 05:38:05
问题 I have started learning to develop for OpenERP modules under Python language. I have been looking source code examples over internet and try to learn by my own. I have bben going through a Python code and am unable to understand use of _defaults and lambda. Like : _defaults = { 'name': lambda obj, cr, uid, context: '/', 'state': 'draft', } Plz give a few words to get some know-how on these two . Hopes for suggestion Thanks 回答1: _default dictionary is used for setting defaults values of fields

Error when sending email through code in Odoo

浪尽此生 提交于 2019-12-13 05:25:12
问题 I created a function to send email by clicking a button "send email" in module "linh_warehoues" and I have this error: relation "mail_thread" does not exist I really don't understand what it means. I also checked and the class "mail_thread" exists in "mail_thread.py". Hope everyone can help me. Thank you in advance for your help and advice. Here is my code: ____openerp__.py { 'name': ' New Warehouse ', 'version': '1.0', 'category': 'Tools', 'description': 'Simulation of warehouse module',

Cannot Login to OpenERP in android

你离开我真会死。 提交于 2019-12-13 04:59:25
问题 With reference to the question here, Android OpenErp Search Request XMLRPC I am trying to establish a search and login request to OPENERP from my android project. This what I am doing, private URI uri; uri = URI.create("http://192.168.100.29:8069"); client = new XMLRPCClient(uri); Array[] arr; arr = (Array[]) client.call("search", "DevDB", "admin", "password", "product.product", "execute"); HttpResponse response; response = client.execute(postMethod); String res = null; if (null != response)

hiding a field using Openerp report designer

核能气质少年 提交于 2019-12-13 04:43:43
问题 I am using OpenERP report designer to alter the sales order report a bit. Background: I am trying to remove the internal reference of a product that appears in my invoices, sales orders and quotations.... Actions done: I have created a new field through the delevoper mode and named it x_showintref which is a boolean ('x_showintref': fields.boolean('Show Internal Reference'))... What to do: I am trying to edit the sales - quotation report so that when the x_showintref is ticked, it will

How do the relational fields work internally?

时光总嘲笑我的痴心妄想 提交于 2019-12-13 04:39:32
问题 I have used all these 3 relational fields i.e many2one,one2many,many2many but still now I'm unable to know exactly how do they work internally,So please throw some light on their working . 回答1: I'll give you a simple example. class a(osv.osv): _name = 'a' _columns = { 'f1': fields.many2one('b', 'Creates new column "f1" in "a" table'), 'f2': fields.one2many('b', 'xxx', 'Creates new column "xxx" in "b" table'), 'f3': fields.many2many('b', 'aaa', 'a_id', 'b_id', 'Creates new table "aaa" with

How to convert numbers to words in odoo?

十年热恋 提交于 2019-12-13 04:37:06
问题 In the invoice, I want to convert total amount to words in Indian numbering system(hundreds, thousands, lakhs, crores). I cant use amount_to_text library module since it has been set in euro currency. So how to write function in python to achieve this? (dont worry abt indendation,its correct in my system) When i tried this code in my custom module, i get this error TypeError: _int2word() takes exactly 1 argument (7 given) class account_invoice(models.Model): _inherit = "account.invoice" print

Disable one2many popup odoo 8

梦想与她 提交于 2019-12-13 01:13:55
问题 Good Day! is it possible to disable pop of tree view in the form. I tried no_open="True" readonly="1" edit="False" both on field and tree view but didn't worked. <field name="payment_line"> <tree editable="top" create="false"> <field name="product"/> <field name="description"/> <field name="account"/> <field name="unit"/> <field name="qty"/> <field name="amount"/> <field name="total"/> </tree> </field> 回答1: I've coped with the same issue in odoo 10, my one2many treeview always make a popup on

How to hide an existing field in an OpenERP7 view?

心不动则不痛 提交于 2019-12-13 00:41:15
问题 I am trying to hide a field called street2 in an existing OpenERP7 view only if a field called is_company values True . I have to do this using inheritance, so I created a new view with a form called res.partner.extended.form , which inherits from the view I want to modify ( base.view_partner_form ). To make street2 invisible, I left my inherited form this way: <?xml version="1.0" encoding="utf-8"?> <openerp> <data> <record model="ir.ui.view" id="res_partner_extended_view"> <field name="name"

how to add dynamic empty rows in table with RML code?

我的梦境 提交于 2019-12-12 23:44:01
问题 How can i add empty blank rows in purchase report? and dont know if blank_line is executing perfectly. i followed this link [Openerp purchase report][1] [1]: http://forum.openerp.com/forum/topic8508.html code: <section> <para style="terp_default_8">[[ repeatIn(o.order_line,'line') ]][[line_no() ]]</para> <blockTable colWidths="20.0,100.0,150.0,80.0,50.0,20.0,60.0,50.0" style="Table_Order_Pur_line_Content"> <tr>[[ blank_line(10) ]]<!--[[ setTag('para','para') ]] --> <td> <para style="terp