odoo-9

Odoo disabled edit button depending on state

一世执手 提交于 2019-12-24 00:21:35
问题 this question already asked by someone, this in an example question How to hide the edit button form only when invoice' state is 'paid' Odoo v8? but i dont get true answer, somebody can help me, i really need to hide or disabled this button. For your information im using odoo v.10 Thanks in advance 回答1: The only way to this is by Javascript you need to add this behavior to your form view build a custom addon and just add this javascript file to your backend assets template //file: static/src

Convert char to datetime odoo 9

て烟熏妆下的殇ゞ 提交于 2019-12-23 18:30:51
问题 I have two char fields, data import from excel or csv in odoo. time_1= fields.Char(string = 'Time 1') time_2= fields.Char(string = 'Time 2') result= fields.Float(string = 'Result Time 2 - Time 1') #Need result 06:00 time_1 = 10:00:00, time_2 = 16:00:00 (data from external source) How with @api.onchange('time_1', 'time_2') or @api.depends('time_1', 'time_2') convert char to time and subtract time_2 - time_1 and put result in result field? 回答1: It should be like that, from datetime import

Database schema changed; now odoo won't run

可紊 提交于 2019-12-23 04:43:15
问题 I have a problem when I want to start Odoo my local server (localhost). What happens is I made a change in the database and deleted a field because i didn't need it anymore. But the field was in a tree view and I cannot start the server because the view does not find the field that I removed. The error is as follows: 2016-04-20 11:46:10,863 3393 INFO prueba3 werkzeug: 127.0.0.1 - - [20/Apr/2016 11:46:10] "GET /favicon.ico HTTP/1.1" 500 - 2016-04-20 11:46:10,903 3393 ERROR prueba3 werkzeug:

Odoo Warning “Perhaps a module was partially removed or renamed”

拥有回忆 提交于 2019-12-22 10:29:45
问题 When I run odoo server, I got this warning message below. WARNING dietfacts2 openerp.modules.loading: Model product.nutrientitem is declared but cannot be loaded! (Perhaps a module was partially removed or renamed) I know that it shows this warning message because I created the model name but then I changed it afterward. The model was saved to postgres DB. I tried to delete the table in DB but unsuccessful. dietfacts2=# delete from ir_model where model = 'product.nutrientitem'; ERROR: null

Sum times odoo 9

回眸只為那壹抹淺笑 提交于 2019-12-22 10:05:12
问题 When use compute in tree view sum is not visible. When use onChange sum is visible any solution how fix it. I need compute after insert data from .csv automaticly populate time_total fields. Example: Source: class my_data(models.Model): _name = "my.data" _description = "My Data" user = fields.Char(string = 'User') date = fields.Date(string = 'Date') start_time = fields.Datetime(string='Start', placeholder="Start", default="2016-01-01 00:00:00.624139") finish_time = fields.Datetime(string=

Can we able to inherit and change the noupdate=“1” in odoo?

六月ゝ 毕业季﹏ 提交于 2019-12-21 05:30:21
问题 Is it possible to inherit from one xml and to change its updatable. I tried to inherit "Check Action Rules" to change the "interval_number" from 4 to 1 hours. To make it run every single hour. I don't think it may work because of noupdate="1". Anyone have any idea about this? 回答1: Yes you can change the noupdate file by the help of hook. In the manifest file next to data add 'post_init_hook': 'post_init_hook', create hooks.py file def post_init_hook(cr, registry): env = api.Environment(cr,

How to filter many2one res.parner field in odoo

南笙酒味 提交于 2019-12-14 03:56:54
问题 I have x_trainer_id = fields.Many2one('res.partner', string='Trainer') field, and I want to filter data in it by the value that is put in category_id tag field in partner form . I want to show just those records in it their category_id tag value is defined Trainer. 回答1: If i understand this correct, try to define you field in your view like: <field name="x_trainer_id" domain="[('category_id','=',category_id[0][2])]" /> The field category_id has to be defined in that view, too. But if you

Adding notes to order items in restaurant POS

五迷三道 提交于 2019-12-14 03:36:14
问题 Is there a way to add special instructions or to add a note to restaurant POS orders, like select a pizza, and add a note saying 'no broccoli'? Can't find an option to do that; there seems to be only one search result listing a module which does this for an older version on odoo, but I'm sure many people have such a requirement. 回答1: I found the 'orderline notes' in the 'Restaurant & Bar' section of the POS settings. That does what I need. 来源: https://stackoverflow.com/questions/37626643

How do I add multiple models to one view?

萝らか妹 提交于 2019-12-13 07:02:26
问题 I'm trying to use three different models in one view. I've created a new model that inherits the models which seems to work fine. from openerp import models, fields, api class ProjectNote(models.Model): _name = "triangle.project.note" _inherit = ["note.note", "project.project", "triangle.note"] My problem is in the view. I use my new model as the model and inherit a view from project. <record id="view_project_notes_form" model="ir.ui.view"> <field name="name">triangle.project.note.form</field

Expected singleton: stock.move - Odoo v9 community

谁都会走 提交于 2019-12-13 06:15:02
问题 I'm creating a stock.picking from fleet_vehicle_log_services with this method: @api.multi def create_picking(self): self.ensure_one() vals = { 'move_lines': self.move_lines.id, 'origin': self.name } picking = self.env['stock.picking'].create(vals) return picking And it's declared on fields like this: move_lines = fields.One2many('stock.move', 'picking_id', string="Stock Moves", copy=True) And my view: <group string="Datos del picking"> <button name="create_picking" string="Crear Picking" type