odoo-12

how to update One2many list with value [ODOO 12]

让人想犯罪 __ 提交于 2021-02-19 03:53:12
问题 I added a method that does a research of the teacher in the lessons then he added in the yard (the course several lesson, each lesson a single teacher) my problem is when I click on the button it does not the table update, he has added another line below each click it's my code teacher_ids = fields.One2many('school.teacher', 'course_id', string='Teacher') def get_teachers (self): lesson = self.env['school.lesson'].search([]) teacher_list = [] for rec in lesson: if rec.course_id.id == self.id:

How to fix ValueError: Field `active` does not exist in odoo

瘦欲@ 提交于 2021-02-11 13:07:45
问题 I have a view which inherits from view employee form, with fields from a model I created, but whenever I try to upgrade the module it shows me the ValueError: Field active does not exist error. Here is the view from which I inherited the employee form. <record model="ir.ui.view" id="training_log_employee_form_inherit"> <field name="name">training.log.employee.form.inherit</field> <field name="model">training.log.emp</field> <field name="inherit_id" ref="hr.view_employee_form"/> <field name=

How to get specific record in json controller in Odoo 12

吃可爱长大的小学妹 提交于 2021-02-11 13:00:11
问题 My question says it all. I already did a controller to search all records from specific model. Now I want to search just one record (by its id) from the same model. My controller for all records is this: @http.route('/get_sales', type='json', auth='user') def get_sales(self): sales_rec = request.env['sale.order'].search([]) sales = [] for rec in sales_rec: vals = { 'id': rec.id, 'name': rec.name, 'partner_id': rec.partner_id, } sales.append(vals) data = {'status': 200, 'response': sales,

How to get specific record in json controller in Odoo 12

久未见 提交于 2021-02-11 12:56:59
问题 My question says it all. I already did a controller to search all records from specific model. Now I want to search just one record (by its id) from the same model. My controller for all records is this: @http.route('/get_sales', type='json', auth='user') def get_sales(self): sales_rec = request.env['sale.order'].search([]) sales = [] for rec in sales_rec: vals = { 'id': rec.id, 'name': rec.name, 'partner_id': rec.partner_id, } sales.append(vals) data = {'status': 200, 'response': sales,

odoo 12 error - You don't have the permission to access the requested resource. It is either read-protected or not readable by the server

北战南征 提交于 2021-01-29 07:53:07
问题 I'm getting following error while loading my odoo 12 server on windows 7 You don't have the permission to access the requested resource. It is either read-protected or not readable by the server. But while loading through private window, it is loading!. Even though not able to create a database there.I'm getting following error at that time. Database creation error: relation "ir_model" does not exist LINE 1: SELECT * FROM ir_model WHERE state='manual' ^ I have installed postgresql 9.2 which I

Is there a way to add an extra action to the action menu in tree view in Odoo 12?

假如想象 提交于 2021-01-28 19:53:04
问题 i am searchin to add a new button that displays my wizard to the action button display in the tree view My wizard works because i tested it individually, but i need to add it to the action button on the top and i do not know how I tried to use the action.server but did not find any example that helped me Thanks Also i know that from Odoo 10 to Odoo 12 changed, thats why i have not found any clue. Next are the examples i tried but not succed <record model="ir.actions.act_window" id="enviar

Add logo to the backend top navbar

早过忘川 提交于 2021-01-28 18:44:09
问题 I'm trying to add my logo to the top navbar like this: I modified the xml file addons\web\static\src\xml\menu.xml and added this div: <div style="height: 100%;display: block;float: left;margin-right: 15px;margin-left: 15px;"> <img src="https://www.clubsportive.nl/wp-content/uploads/2018/12/logo-example.jpg" height=100%/> </div> inside the header like this: <header t-name="Menu" style="background-color: #4c4c4c;"> <nav class="o_main_navbar"> <ul class="o_menu_apps"/> <div style="height: 100%

Add logo to the backend top navbar

北慕城南 提交于 2021-01-28 18:34:40
问题 I'm trying to add my logo to the top navbar like this: I modified the xml file addons\web\static\src\xml\menu.xml and added this div: <div style="height: 100%;display: block;float: left;margin-right: 15px;margin-left: 15px;"> <img src="https://www.clubsportive.nl/wp-content/uploads/2018/12/logo-example.jpg" height=100%/> </div> inside the header like this: <header t-name="Menu" style="background-color: #4c4c4c;"> <nav class="o_main_navbar"> <ul class="o_menu_apps"/> <div style="height: 100%

XML Odoo field conditional color formatting

混江龙づ霸主 提交于 2021-01-28 04:21:05
问题 I'm working with Odoo and studio. I want to format a selection field text based on the selected value using XML. Here is what I have already tried but it has no effect at all: <field name="my_status" string="Status" colors="orange:my_status == 'negotiation';green:my_status == 'signed';purple:my_status == 'internal'"/> I have also tried: <field name="my_status" string="Status" decoration-success="my_status == 'signed'" decoration-danger="my_status == 'negociation'" decoration-muted="my_status

How to give user groups(XML) in the model ir.actions.server odoo 12?

早过忘川 提交于 2020-12-09 08:37:20
问题 I used this xml code to add a button inside the 'Action',But i need to restrict the button to some user groups, <record id="specialist_no_show_action" model="ir.actions.server"> <field name="name">No Show </field> <field name="type">ir.actions.server</field> <field name="binding_model_id" ref="second_opinion.model_consultation"/> <field name="model_id" ref="second_opinion.model_consultation"/> <field name="state">code</field> <field name="code"> action = model.update_no_show() </field> <