odoo

Odoo IndexError: list assignment index out of range

你离开我真会死。 提交于 2019-12-24 07:26:58
问题 I just create a module. After adding values and got the problem IndexError: list assignment index out of range. How to fix it. Re Edit code please. Here is my code: class calculator(osv.osv): _name = 'calculator.calculator' def get_total(self, cr, uid, ids, field_name, arg, context): res = [] perfos = self.browse(cr, uid, ids, context) for perfo in perfos: res[perfo.id] = perfo.p + perfo.b return res _columns = { 'p':fields.selection(((1,'Outstanding'), (2,'Well Above Expectations'), (3,'As

How to display your own kanban card in calendar view in Odoo 11?

夙愿已清 提交于 2019-12-24 06:21:05
问题 I am trying to customise the calendar view of the calendar.event model, whose code is: <record id="view_calendar_event_calendar" model="ir.ui.view"> <field name="name">calendar.event.calendar</field> <field name="model">calendar.event</field> <field name="priority" eval="2"/> <field name="arch" type="xml"> <calendar string="Meetings" date_start="start" date_stop="stop" date_delay="duration" all_day="allday" display="[name]" color="color_partner_id" attendee="partner_ids" avatar_model="res

How to create new attachments in Odoo? How do they work?

你离开我真会死。 提交于 2019-12-24 04:54:14
问题 I want to create an attachment from python code. So, what I have tried: self.env['ir.attachment'].create({ 'store_fname' : ??, 'checksum' : ?? }) What values should be passed for the column 'store_fname' and 'checksum' in ir_attachment table? 回答1: Those fields should be filled automatically: The store_fname is the folder and the name that the file uses when it is store in the filestore folder The checksum concides with the file name as well. It is the result of applying the sha1 algorythm to

Domain Filter is not working on many2many field in OpenERP 7.0

被刻印的时光 ゝ 提交于 2019-12-24 04:30:05
问题 I have added new many2many fields into the wizard view and also put invoice filed of many2many fields Field on py file : 'sup_inv_entries':fields.many2many('account.invoice', 'sup_inv_rel', 'sup_inv_id1', 'sup_new_inv_id', 'Invoice Entries'), Field on XML view file: <field name="sup_inv_entries" nolabel="1" domain="['|',('period_id','in',period_ids),('&',('date_invoice','>',date_from),('date_invoice','<',date_to)),'&',('type','=','in_invoice'),('state','=','open')]"> I want to make the filter

Hide action/more button in form view in odoo12

天大地大妈咪最大 提交于 2019-12-24 04:15:10
问题 I want to hide only action/more button not print button in odoo12. I found some similar question its not working in odoo12. 回答1: Not a decent answer, but a direction for you. In source code(my version is 11) odoo-11.0/addons/web/static/src/js/chrome/sidebar.js L#34 init: function (parent, options) { this._super.apply(this, arguments); this.options = _.defaults(options || {}, { 'editable': true }); this.env = options.env; this.sections = options.sections || [ {name: 'print', label: _t('Print')

Odoo 11 add different action menu in two different area for the same model

非 Y 不嫁゛ 提交于 2019-12-24 02:56:08
问题 In Odoo 11 I want two different action menu with two different functionality. In the hr payroll I wanted to add email payslip link thats why I used this code to add the email payslip action menu <?xml version="1.0" encoding="utf-8"?> <odoo> <data> <record id="action_email_payslip" model="ir.actions.server"> <field name="name">Email Payslip</field> <field name="model_id" ref="hr_payroll.model_hr_payslip"/> <field name="binding_model_id" ref="hr_payroll.model_hr_payslip"/> <field name="state"

Odoo onchange not working correctly

时光总嘲笑我的痴心妄想 提交于 2019-12-24 02:22:16
问题 I'm inherit purchase.order.line and try change value in field. For product_qty I can change value but for price_unit I can't change value. My custom .py file: class PurchaseOrderLine(models.Model): _inherit = 'purchase.order.line' @api.onchange('product_id') def my_fucn(self): for rec in self: rec.product_qty = 10 #WORKING rec.price_unit = 1 #NOT WORKING Maybe is problem because in original purcahase.py odoo file also have @api.onchange('product_id'). Any solution? 回答1: You can't predict

Debian9 安装odoo12.0手记

前提是你 提交于 2019-12-23 18:08:08
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 使用通常的 apt 升级命令使您的安装保持最新。 apt-get update && apt-get upgrade -y 安装nodejs curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - apt-get install -y nodejs 一旦npm安装,使用它来安装less npm install -g less less-plugin-clean-css apt-get install node-less 安装wkhtmltopdf,要打印PDF报告,必须自己安装wkhtmltopdf:debian存储库中提供的wkhtmltopdf版本不支持页眉和页脚,因此无法自动安装。 推荐版本为0.12.1,可在wkhtmltopdf下载页面的归档部分中找到 wget http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u9_amd64.deb dpkg -i libssl1.0.0_1.0.1t-1+deb8u9_amd64.deb wget http://ftp.cn.debian.org

ODOO Unable To Find Wkhtmltopdf On This System.

元气小坏坏 提交于 2019-12-23 17:52:12
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> if you are using ODOO version 8 and getting some error like – Unable to find Wkhtmltopdf on this system. The report will be shown in html. It means you need to upgrade the version of Wkhtmltopdf library on your server. Let me elaborate this problem first- As we all know, when we install ODOO-version 8 on the server, we have also install some necessary libraries too like – python-decorator, python-werkzeug and many more libraries. ” Wkhtmltopdf ” is also one of them. Now, lets come to the main problem, when we install “wkhtmltopdf” on server, using command

odoo 13.0教程(采购模块增加审批流)

限于喜欢 提交于 2019-12-23 14:59:46
说明 Odoo 13.0采购模块中,询价单的审批只有两级审批,当询价单金额超过设置的数值时须由经理审批通过。如果我们想再加一个或多个审批环节,又该如何处理呢?接下来我们就通过代码来说明如果修改代码实现对采购审批流程的修改。 模块结构 采购相关的模块共有六个,它们分别是:purchase、purchase_mrp、purchase_product_matrix、purchase_requisition、purchase_requisition_stock、purchase_stock。 purchase 采购功能相关主要业务实现 purchase_mrp 采购业务中涉及到制造模块的逻辑 purchase_product_matrix 待续 purchase_requisition 采购协议 purchase_requisition_stock 待续 purchase_stock 采购中涉及到的库存逻辑 purchase模块目录说明: manifest.py Odoo模块配置文件,指定了模块的版本、名依赖、demo数据、数据等信息 data 存放相关数据,在__manifest__.py 文件中指定 i18n 国际化配置 models 包含主要业务代码 report 打印模板 security 权限配置 views 前端页面 i18n目录是Odoo模块的约定目录