openerp

Odoo: _get_state() takes at least 4 arguments (4 given) in xml view

戏子无情 提交于 2019-12-12 21:21:56
问题 Here is mycode. I want to get id_employee of current record before define its model class: def _get_state(self, cr, uid, context=None): idemployee = "" for adv in self.browse(cr, uid, ids, context): id_employee = adv.id_employee if id_employee is None: idemployee = _default_employee(self, cr, uid, context=None) else: idemployee = id_employee sql = " SELECT C.id AS id, C.sequence, C.name \ FROM wf_group_member A \ LEFT JOIN wf_group B ON B.id = A.group_id \ LEFT JOIN wf_process BB ON BB.id = B

openerp: internal server error on ubuntu

孤街醉人 提交于 2019-12-12 19:14:14
问题 I have just installed the new OpenERP 8.0 unto my system replacing the existing OpenERP 7.0 on Ubuntu 12.04. I had already downloaded this on my Ubuntu laptop at home and it works very well and wanted to do the same in my office server. Steps I undertook: sudo apt-get remove openerp Went to /etc/apt/sources-list and edited it, added the line for to add the new erp dependencies sudo apt-get update sudo apt-get install openerp restart system open browser for localhost:8069 But I get an internal

How to achieve “Send by email” functionality in “Quotations” and “Sales Order” module in ODOO?

蹲街弑〆低调 提交于 2019-12-12 16:26:59
问题 I am developing ODOO application in iOS. I want to achieve "Send by email" functionality in "Quotations" and "Sales Order" module in ODOO. So is there any API available to achieve this functionality ? Or shall i generate PDF programmatically in iOS and send this by using MFMailComposeViewController class ? Thanks 回答1: It is best to reuse the Odoo feature. The button calls a method of the Sale Order model. You can identify the method's name if you activate the Developer Mode: The method is

How to hide edit/create button on form by conditions?

只愿长相守 提交于 2019-12-12 14:33:55
问题 I'm a new Odoo developer and I need to hide the edit button when my form is entering a custom state, I need this because of a security problem. This code in XML does not work when I try to give an attribute to the form. <record model="ir.ui.view" id="pesan_form_view"> <field name="name">pesan_service_form</field> <field name="model">pesan.service</field> <field name="arch" type="xml"> <form string="Booking Service" attrs="{edit:'false':[('state','in','baru')]}"> <!-- structure of form --> <

how to write events for formview inside header buttons? odoo 10

為{幸葍}努か 提交于 2019-12-12 14:32:13
问题 I have tried this code in odoo10 community but not working, what is my fault? Or Can anyone guide me how to do it? openerp.module_name= function (instance) { var _t = instance.web._t, QWeb = instance.web.qweb; instance.web.FormView = instance.web.FormView.include({ init: function() { this._super.apply(this, arguments); console.log("test"+this.getParent().dataset.model); }, events: { 'click #target': 'button_clicked', }, button_clicked : function(ev) { console.log("test333555555"); ev

Onchange function in Openerp

戏子无情 提交于 2019-12-12 13:33:17
问题 I have a selection field in account.invoice.line named form_type. It has three selection options: 1) form_a 2) form_b 3) form_c There is also an integer field named flag in account.invoice.line. When form_c is selected, the flag value should be set to 1; otherwise, if either form_a or form_b is selected, the flag value should be set to 0. I wrote an onchange function for the above case but it's not working. Can someone help me out? What is wrong in my code? def onchange_form_type(self, cr,

Apply groups on already created menu

南楼画角 提交于 2019-12-12 08:49:50
问题 I have developed a new module and in that module I have created a group in .xml file. Now I want to apply that group in menus which are already created in other menu. So can I apply groups to those menus? I don't want to override the menu, I just want to apply groups in already created menus. Thanks in advance. 回答1: Adding a group to an existing menu is done via the normal OpenERP record update mechanism. You don't actually have to fully redefine the existing menu record in your module, you

Hide lines on tree view - openerp 7

a 夏天 提交于 2019-12-12 07:05:45
问题 I want to hide all lines (not only there cointaner) in sequence tree view (the default view). I must hide all lines if code != 'foo' but the attrs atribute don't work on tree views, so how can i filter/hide this? I don't have any code already, because i'm newbie in openerp and i dont know what to change. The model is ir.sequence and is view (i think). 回答1: Attrs is to be used to hide columns / fields conditionally but not the record, to hide records domain must be used. If there is default

data transfer from one database to other database in odoo

喜你入骨 提交于 2019-12-12 06:28:48
问题 I have one database. I want to transfer data from one database to new database. all tables have same fields into both databases. I can use export feature of openerp, but I need to maintain the relationship between odoo table and there is so many tables so I don't know which tables I can import first into a new database so it does not give any problem into other tables data import. is there any that I can do this into easy and simple way? 回答1: There are two ways in which you can take backup.

Wizard to create stock.picking from another model - Odoo v8

空扰寡人 提交于 2019-12-12 04:43:43
问题 I have this code for the wizard: class generate_stock_picking(models.TransientModel): _name = 'generate.stock.picking' isbns = fields.One2many('order.lines', 'order_id', 'ISBN') production_order = fields.Many2one('bsi.print.order', 'Print Order') company_id = fields.Many2one('res.company', 'Company',default='_default_company') location_id = fields.Many2one('stock.location', string="Source Location") location_dest_id = fields.Many2one('stock.location', string="Destination Location") @api.model