odoo-8

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 make a tree only editable inline (no creation, no deletion) in Odoo8?

谁说胖子不能爱 提交于 2019-12-12 13:23:33
问题 I'm trying to make a tree editable inline. I don't want to be able to create or remove records from that tree. So what I did is the next: <tree string="Event participants" create="false" delete="false" editable="bottom"> But this is not working properly, because when I set the parameter create to false , the Save button disappears, and the only way to save the changes made on a record is to click on other one after the modification (which is a bit confusing). If I set create to true , the

Configuration of Google spreadsheets with Odoo

廉价感情. 提交于 2019-12-12 11:56:55
问题 I want to get the report data in google spreadsheets in Odoo. I have done following steps to configure google spreadsheet with Odoo: Installed the Google Spreadsheet module in Odoo. Generated Google Authorization Code Tried to get a report on Google Spreadsheet but it gives me Error Some settings are not set in Code. From settings did it manually Server Settings --> URL --> http://127.0.0.1:8069 dbname ---> Database name username -username of database password - password of database Am I

How to send a simple message and status as a response in an Odoo JSON controller?

自闭症网瘾萝莉.ら 提交于 2019-12-12 07:22:34
问题 I tried different ways of doing that, but they didn't work. First I tried this way: import openerp.http as http from openerp.http import Response class ResPartnerController(http.Controller): @http.route('/odoo/create_partner', type='json', auth='none') def index(self, **kwargs): Response.status = '400' return "Result message" I get the right status and the message in the client. But I get this strange warning if I do any action on the Odoo interface Is there a way to avoid this message? I

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.

invisible: True/False parameter exist or not in odoo 8?

梦想的初衷 提交于 2019-12-12 04:59:58
问题 I am new to odoo. I searched too many blogs. In openerp 7, it has an optional parameter invisible: True/False For ex: password = fields.selection([('one','One'),('two','Two')], 'Password', invisible=True) to hide or show the field in view. Whether still it exists in odoo 8. UPDATE: Also I need to clarify existence of domain filter in Odoo 8. For ex: ... domain="[('fiscalyear_id','=',fiscalyear)]",required=False) Need your help to clarify on this. Or else anyother parameter used ? 回答1:

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

How to update field dynamicaly in a many2many relation field and within tree view update field on change of above field

…衆ロ難τιáo~ 提交于 2019-12-12 04:09:37
问题 class ratecard_multiple(models.Model): # pudb.set_trace() _name = 'ratecard.multiple' _rec_name = 'display_name' name = fields.Char(string='Multiple RateCard Product Name ', required=True) code = fields.Char(string='Multiple RateCard Code ', readonly=True) scheduled_for = fields.Integer(string='SCHEDULED FOR', default=1, track_visibility='always', store=True) # scheduled_for = fields.Integer(string='SCHEDULED FOR', compute='_compute_scheduled_for',default=1 ,track_visibility='always',store

Odoo Missing Error while running a cron job for sending scheduled mail

China☆狼群 提交于 2019-12-12 03:45:14
问题 I have the following code. When the scheduler runs I am getting the error message. Some one help me to resolve the error in the code MissingError One of the documents you are trying to access has been deleted, please try again after refreshing. def send_followup_mail(self, cr, uid, context=None): quot_ids=self.search(cr, uid, [('state','=','amend_quote')]) for quot_id in quot_ids: if quot_id: quot_obj=self.browse(cr, uid, quot_id ,context=context) quotation_since=quot_obj.quotation_since for

Odoo 8 override _amount_line

给你一囗甜甜゛ 提交于 2019-12-12 02:46:36
问题 I'm trying to override the _amount_line function in sale.order.line model in order to add custum logic. Here is my code: class SaleOrderLine(models.Model): _inherit = 'sale.order.line' def _amount_line(self): tax_obj = self.env['account.tax'] cur_obj = self.env['res.currency'] res = {} for line in self: print line.tax_id price = self._calc_line_base_price(line) qty = self._calc_line_quantity(line) print" price:{} & quantity: {}".format(price,qty) taxes = tax_obj.compute_all(line.tax_id, price