odoo-10

Get number of sheet excel in python

不想你离开。 提交于 2019-12-06 08:10:20
问题 How get number of sheet in below python example? file = self.excel_file.decode('base64') excel_fileobj = TemporaryFile('wb+') excel_fileobj.write(file) excel_fileobj.seek(0) workbook = openpyxl.load_workbook(excel_fileobj, data_only=True) sheet_number= ??? sheet = workbook[workbook.get_sheet_names()[0]] for row in sheet.rows: print(row[1].value) sheet_number=???? Any solutin? 回答1: workbook.worksheets contains a list of worksheet objects. To get the number of worksheets: sheet_number = len

How to add a watermark image to Qweb Reports in all PDF pages in Odoo?

别等时光非礼了梦想. 提交于 2019-12-06 06:10:09
I am creating qweb report and I want to add a image to the background in all pages but I am getting watermark in only the first page. What I have tried: <div style="position:absolute;text-align:center;z-index:-1;border:0;opacity:0.1;padding-top:50px;"> <img t-att-src="'data:image/png;base64,%s' %o.employee_id.company_id.watermark_img"/> </div> I have found the solution here Add this code for watermark in header of external layout. Its external id is report.external_layout_header : <style> .watermark { position: absolute; opacity: 0.25; z-index: 1000; transform: rotate(300deg); -webkit

Empty groups in Kanban view of Odoo10

匆匆过客 提交于 2019-12-06 04:46:34
Is it possible to show groups (columns) without any items in Kanban view of Odoo10? I found an article how to do that in Odoo8, but the way that is described there doesn't seem to work anymore. In odoo 10 group_by_default is replaced by group_expand and it takes list of all your stages. for e.g your columns are stage and you want to show all empty stages. @api.model def _read_group_stage_ids(self,stages,domain,order): stage_ids = self.env['stage.stage'].search([]) return stage_ids stage = fields.Many2one('stage.stage', group_expand='_read_group_stage_ids') " _read_group_stage_ids " method

ODOO : Run cron at a specific time

核能气质少年 提交于 2019-12-06 04:40:35
I want to add a cron job that runs at a specific time. I have added the cron in xml but it has interval_number and interval_type . How to make it run at a specific time of day? <record id="ir_cron_module_get_active_sr" model="ir.cron"> <field name="name">Get Active Srs</field> <field eval="True" name="get_active_srs" /> <!--<field name="user_id" ref="base.user_root" />--> <field name="interval_number">1</field> <field name="interval_type">days</field> <field name="numbercall">-1</field> <field eval="False" name="doall" /> <field eval="'hr.attendance'" name="model" /> <field eval="'get_active

Odoo 10 - Adding an Order Line Tree Field to Custom Module

江枫思渺然 提交于 2019-12-06 03:33:15
I would like to add an order line field with a tree view much like those found in the Sales and Repairs modules. In those modules, there is a nice section at the bottom of the form that allows you to enter products and prices in a list. I believe those are handled by the sale.order.line and mrp.repair.line models. Here is a picture of what I am talking about: Sale Order Lines My goal is to get something like this into my own custom module. I have tried: Adding a One2many field with sale.order.line ( sale_order_line = fields.One2many('sale.order.line', 'order_id', string='Order Lines',) ). With

Why my pdf report is not taking the CSS styles well in Odoo?

别说谁变了你拦得住时间么 提交于 2019-12-05 22:40:30
I am using Odoo 10 in Ubuntu Server. I am trying to print my quotation report in pdf format using wkhtmltopdf. But the design doesn't look nice. It looks like the CSS is not working I have tried to change some XML file inside mypath/addons but it doesn't work Here's my quotation pdf file: 1st Possible Reason If your report doesn't have styles try to add some of these parameters in Settings > Parameters > System parameters : web.base.url : <IP address>:<Port> web.base.url.freeze : True . If this parameter is not used then if the administrator log in Odoo the web.base.url parameter is updated

odoo 10 how to create Snippets Javascript option

让人想犯罪 __ 提交于 2019-12-04 16:53:26
I'm trying to Create Snippets in odoo 10 according to https://www.odoo.com/documentation/10.0/howtos/themes.html#create-snippets I created the snippets and add the js option, the code from the example (function() { 'use strict'; var website = odoo.website; website.odoo_website = {}; website.snippet.options.snippet_testimonial_options = website.snippet.Option.extend({ on_focus: function() { alert("On focus!"); } }) })(); fails since odoo.website is not defined see Please help here is the correct code for /theme_tst/static/src/js/tutorial_editor.js odoo.define('snippet_testimonial_options',

How the Delivery orders are created from Sale Order in ODOO 10?

て烟熏妆下的殇ゞ 提交于 2019-12-04 14:25:31
In sale app, where are the inventory delivery orders created from sale order while confirming the quotations? What are the functions which are called during this workflow in ODOO10? Here is an useful trick I do when I am not able to follow the traceback. You said you want to know where the delivery order is being created, don't you? So, as delivery order is an outgoing stock picking, you can write the following lines in your code: class StockPicking(models.Model): _inherit = 'stock.picking' @api.model def create(self, vals): return 1 / 0 Now create a sale order and confirm it, this time you

How to make wkhtmltopdf work in Odoo v10 on Debian 9 “Stretch”?

半世苍凉 提交于 2019-12-04 05:01:18
问题 I know from the Odoo website that Odoo needs an special wkhtmltopdf version: Danger to print PDF reports, you must install wkhtmltopdf yourself: the version of wkhtmltopdf available in debian repositories does not support headers and footers so it can not be installed automatically. The recommended version is 0.12.1 and is available on the wkhtmltopdf download page, in the archive section. As there is no official release for Debian Jessie , you can find ours on the extra section of our

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

邮差的信 提交于 2019-12-03 16:14:04
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? 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, SUPERUSER_ID, {}) orginalxml=env.ref('module.external id') orginalxml.write({'field_name_to_inherit':value, })