odoo-9

Peer authentication failed for user “odoo”

ε祈祈猫儿з 提交于 2020-05-26 05:03:49
问题 I'm on Odoo 9, I have an issue when lunching odoo server $odoo.py -r odoo -w password , the localhost:8069 doesn't load and I get an error on terminal "Peer authentication failed for user "odoo"". I already created a user "odoo" on postgres. When lunching $odoo.py I can load the odoo page on browser but I can't create database (as default user). It was working and i already created database but when I logged out I couldn't connect to my database account anymore. Any ideas ? 回答1: You need to

Use name_get in odoo 9

筅森魡賤 提交于 2020-03-06 04:18:41
问题 How to concatenate Many2one field, open drop down list all car is visible. I need [id] and [name]. For example: [01] Audi, [02] BMW car_id = fields.Many2one('my.cars', 'Cars') @api.multi def name_get(self): ??? 回答1: Try with following: @api.multi def name_get(self): result = [] for record in self: name = '[' + str(record.id) + ']' + ' ' + record.name result.append((record.id, name)) return result Note: name_get() method must be set on my.cars object. 来源: https://stackoverflow.com/questions

Inherit field from one model to another model - Odoo v9 Community

独自空忆成欢 提交于 2020-02-01 09:18:26
问题 I'm trying to add a field from a table, into another table, through a module. Specifically, trying to inherit a field from product.product , the price field, to add it into stock.move model. So, I've created a model into this new module I'm making. Like this: # -*- coding: utf-8 -*- from openerp import models, fields, api import openerp.addons.decimal_precision as dp class product(models.Model): _inherit = 'product.product' _rec_name = 'price_unidad' price_unidad = fields.One2many('product

Set default value of field depends on other field in odoo

拜拜、爱过 提交于 2020-01-17 06:32:38
问题 I am setting up default value of analytics_id in account.move.line by below code class account_move_line(models.Model): _inherit = 'account.move.line' _name = "account.move.line" def _get_default_account(self, cr, uid, context=None): obj = self.pool.get('account.move') value = obj.browse(cr, uid, uid) if value.move_id.debit>0 or value.move_id.credit<0: res = self.pool.get('account.analytic.plan.instance').search(cr, uid, [('code','=','LAL')], context=context) return res and res[0] or False

Set default value of field depends on other field in odoo

馋奶兔 提交于 2020-01-17 06:32:08
问题 I am setting up default value of analytics_id in account.move.line by below code class account_move_line(models.Model): _inherit = 'account.move.line' _name = "account.move.line" def _get_default_account(self, cr, uid, context=None): obj = self.pool.get('account.move') value = obj.browse(cr, uid, uid) if value.move_id.debit>0 or value.move_id.credit<0: res = self.pool.get('account.analytic.plan.instance').search(cr, uid, [('code','=','LAL')], context=context) return res and res[0] or False

Remove products from shopping cart - Website Odoo 9

余生长醉 提交于 2020-01-14 04:26:27
问题 I want to know how can i create a model (or extend existing one) for deleting a products from the Shopping cart in Odoo9. The problem is described on the picture. I should add a a button and when i press it will delete the product completely doesn't matter which quantity is given. Thank you in advance, Kind regards, Igor 回答1: A product is removed from your cart when its quantity reaches 0 . Therefore try to use that function that already exists rather than creating your own javascript. You

How do I add products to purchase order in Odoo using xml-rpc?

廉价感情. 提交于 2020-01-14 03:57:06
问题 Im creating the order: new_order = models.execute_kw(db, uid, password, 'purchase.order', 'create', [{'partner_id':VENDOR_ID_soucastky,'product_uom':1, 'bom_id':product.odoo_id, 'product_qty': 1.0}],) and then I need to add the products but I can't find how odoo v9 P.S. I need to use the webservice API as I don't have aces to change the code on server 回答1: Create your purchase order. Then create the purchase order lines and give them an order_id of your newly created purchase order. new_order

Why does my Odoo 9 custom Qweb report with CSS is not working?

谁说我不能喝 提交于 2020-01-07 04:18:07
问题 I'm creating a new report on Odoo 9 which uses css styles in order to position text over a background image. The image is in background and occupies the full A4 page without any margins. In html, it's working fine. However, when I print the report to PDF, I have blank margins at left and right, and the text goes below the background image. It seems that the CSS rules are not applied. Do you find any solution for making it working in PDF? Here is my report: <template id="sub_proposal"> <style

how can i use function value in Domain filter

断了今生、忘了曾经 提交于 2020-01-06 15:25:16
问题 I am getting current login user id by following function def _get_user_name(self, cr, uid, *args): user_obj = self.pool.get('res.users') user_value = user_obj.browse(cr, uid, uid) return user_value.id or False and now i want to use its value in this field's Domain like .... x_trainer_id = fields.Many2one('res.partner', string='Trainer',domain=[('user_id.id','=','get_user_name')]) How is it possible? I'll be very thankful.... 回答1: you can do it as below: x_trainer_id = fields.Many2one('res