odoo

@api.onchange called from xml-rpc

拥有回忆 提交于 2019-12-23 10:28:27
问题 I created a function f. e. @api.onchange('zip') def onchange_zip(self): self.name = "%s %s" % (self.name, self.zip) It works perfectly when I change the zip field by interface. But when I do it by xml-rpc or any other api it is not triggered. Is it possible to solve it different than overriding write, create methods? 回答1: @api.onchage is meant to be used to update something on the fly, for example changing something on field in the web interface in edit mode and immediately update the effect

odoo12 database backup no owner?

被刻印的时光 ゝ 提交于 2019-12-23 06:17:12
问题 I can't backup odoo 12 database, i use postgres 10 and docker containers.error: Database backup error: Postgres subprocess ('/usr/bin/pg_dump', '--no-owner', '--file=/tmp/tmpgoyjsd3i/dump.sql', 'odoo') error 1 回答1: This error occurs if you have a different version of Postgresql client (the version on Odoo server) and server (the version on your database server). If you are using the Odoo "official" Docker image or image based on that, e.g. veivaa/odoo image, it is based on debian:stretch

odoo12 database backup no owner?

杀马特。学长 韩版系。学妹 提交于 2019-12-23 06:17:10
问题 I can't backup odoo 12 database, i use postgres 10 and docker containers.error: Database backup error: Postgres subprocess ('/usr/bin/pg_dump', '--no-owner', '--file=/tmp/tmpgoyjsd3i/dump.sql', 'odoo') error 1 回答1: This error occurs if you have a different version of Postgresql client (the version on Odoo server) and server (the version on your database server). If you are using the Odoo "official" Docker image or image based on that, e.g. veivaa/odoo image, it is based on debian:stretch

Odoo 10 - Conditional hide/show of kanban view image

无人久伴 提交于 2019-12-23 05:32:19
问题 I am trying to hide the product image based on the status of default_code field. If default_code is empty, I want to hide it. If not, I want to show image. So far I have modified the kanban view like this: <record id="conditional_product_kanban_view" model="ir.ui.view"> <field name="name">Kanban Extended View</field> <field name="inherit_id" ref="product.product_template_kanban_view"/> <field name="model">product.template</field> <field name="arch" type="xml"> <xpath expr="//div[@class='o

Create two graph view for one model openerp

此生再无相见时 提交于 2019-12-23 03:46:16
问题 I want Create two graph view for one model openerp, I like to define Two menu for each one display a graph view, exemple one content graph by country the ather by gender 回答1: You need to create two graph view in xml. <record id="country_graph_id" model="ir.ui.view"> <field name="name">country.graph</field> <field name="model">your.model</field> <field name="arch" type="xml"> <graph string="By Country" type="bar"> <field name="your fields"/> <field name="your_field2"/> </graph> </field> <

Odoo 8 (Openerp): Setting values using Wizard from list view

烈酒焚心 提交于 2019-12-23 03:45:07
问题 I'm having some issues with an Odoo Wizard in a list view that would take a value from the selected (checked) list items to update another record. For instance, I added a column to res_partner called related_partner_id. Basically, it's used to classify master accounts (partners). When adding a new customer, I have setup a dropdown that I could assign the master account. The database updates the related_partner_id to the child account's id from res_partner. Here is the view I'm using. <?xml

Odoo 11 how to override the auto generated modal views of one2many field

萝らか妹 提交于 2019-12-23 03:09:41
问题 Hi guys i am new to Odoo, for now i have 2 model as below: class HumanResource(models.Model): _name = 'hr.employee' _inherit = 'hr.employee' test = fields.Char('test') # Profiling Details food_ids = fields.One2many( 'hr.employee.food', 'food_id', string='Food Cost' ) class HrFood(models.Model): _name = "hr.employee.food" _description = "Employee Food" # food_id = fields.Many2one('hr.employee', 'Food', default={'food_id': lambda self, cr, uid, context: context.get('food_id')}) food_id = fields

Expected singleton: hr.employee(1, 2)

笑着哭i 提交于 2019-12-23 02:20:00
问题 Good Day! Everybody I have an error while loading the kanban view. I inherit the hr.employee Kanban xml and just add a condition if a certain documents expired, it will add a Expired Documents notification in kanban view, here is the xml code: <record model="ir.ui.view" id="hr_kanban_view_employees_recruitment_kanban"> <field name="name">HR - Employees Kanban Document Status</field> <field name="model">hr.employee</field> <field name="inherit_id" ref="hr.hr_kanban_view_employees"/> <field

how to set a different message for an email template in odoo?

江枫思渺然 提交于 2019-12-22 17:54:31
问题 I created a custom module and had used the calendar object to create an event and the code is as follows def create_calender_event(self,cr,uid,ids,context=None): calendar_obj = self.pool.get('calendar.event') for rec in self.browse(cr,uid,ids,context=context): if rec.action: for rec_res in rec.action: calendar_obj.create(cr,uid,{'name' : rec_res.act_ion, 'user_id' : rec_res.asgnd_to.id, 'start_date' : rec_res.due_date, 'stop_date' : rec_res.due_date, 'allday' : True, 'partner_ids' : [(6,0,

how to set a different message for an email template in odoo?

人走茶凉 提交于 2019-12-22 17:54:13
问题 I created a custom module and had used the calendar object to create an event and the code is as follows def create_calender_event(self,cr,uid,ids,context=None): calendar_obj = self.pool.get('calendar.event') for rec in self.browse(cr,uid,ids,context=context): if rec.action: for rec_res in rec.action: calendar_obj.create(cr,uid,{'name' : rec_res.act_ion, 'user_id' : rec_res.asgnd_to.id, 'start_date' : rec_res.due_date, 'stop_date' : rec_res.due_date, 'allday' : True, 'partner_ids' : [(6,0,