odoo-10

Odoo - View customization with colspan or may be col

不羁的心 提交于 2019-12-08 04:45:03
问题 I am using odoo 10-e . Earlier i asked a question how can we merge two or multiple header to show one header against multiple fields Combine two fields heading in one2many . So answer was good and it worked but now i want to do some more customization in the one2many tree view in form. I want something like this. I want borders also in rows but for specific columns and also sub heading for only once per column. I tried to add div in odoo view but its not supported. I also tried to add it

Create a sequence number odoo 10

这一生的挚爱 提交于 2019-12-08 03:06:05
问题 I want to create a sequence number odoo 10 (some think like OM-201709-001) I have use this code for: *.xml <openerp> <data noupdate="1"> <record id="seq_type_id" model="ir.sequence.type"> <field name="name">omega_sequence</field> <field name="code">hr.employee</field> </record> <record id="seq_id" model="ir.sequence"> <field name="name">omega_sequence</field> <field name="code">hr.employee</field> <field name="prefix">SQ</field> <field name="padding">5</field> <!--<field name="suffix">suffix<

Odoo 10 - Overriding unlink method

南楼画角 提交于 2019-12-08 02:37:53
问题 I am overriding unlink method from account.invoice to allow delete last raised invoice. This is my code: class AccountInvoice(models.Model): _inherit = "account.invoice" @api.multi def unlink(self): for invoice in self: if invoice.state not in ('draft', 'cancel'): raise UserError(('You cannot delete an invoice which is not draft or cancelled. You should refund it instead.')) elif invoice.move_name: if invoice.journal_id.sequence_id: sequence_id = invoice.journal_id.sequence_id last_assigned

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

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 02:05:56
问题 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> 回答1: 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

Show successfully message after close wizard in odoo v9

孤街醉人 提交于 2019-12-07 15:17:23
问题 What is best solution for display successfully message after close wizard in odoo 9? Any small popup in right corner? 回答1: It's not a proper answer to your question but i have faced the same problem, the problem was that i have to display "successfully submitted" message when user click on submit button on a wizard. and i have done this as my solution i have done this i have created one class for the wizard from odoo import api, fields, models, _ class CustomPopMessage(models.TransientModel):

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

霸气de小男生 提交于 2019-12-07 15:09:03
问题 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

Odoo - Hide button for specific user

一个人想着一个人 提交于 2019-12-06 19:51:53
问题 I am using odoo 10 enterpeise . I want to show buttons to specific users not to groups because there would be many users in a group and i want to only show below button who have the previlige to reject/approve a object. Here is button <xpath expr="//sheet" position="before"> <header> <button name="update_approve" attrs="{'invisible':[('first_approve', '=', uid)]}" string="Approve" type="object" class="oe_highlight"/> <button name="update_reject" attrs="{'invisible':[('second_approve', '=',

Create a sequence number odoo 10

天大地大妈咪最大 提交于 2019-12-06 12:42:06
I want to create a sequence number odoo 10 (some think like OM-201709-001) I have use this code for: *.xml <openerp> <data noupdate="1"> <record id="seq_type_id" model="ir.sequence.type"> <field name="name">omega_sequence</field> <field name="code">hr.employee</field> </record> <record id="seq_id" model="ir.sequence"> <field name="name">omega_sequence</field> <field name="code">hr.employee</field> <field name="prefix">SQ</field> <field name="padding">5</field> <!--<field name="suffix">suffix</field>--> </record> </data> </openerp> and for : *.py class omega(models.Model): _name = 'omega.model'

how to get available quantity of Lot number

筅森魡賤 提交于 2019-12-06 09:29:16
问题 how to get available quantity of Lot number in multiple warehouse suppose i have 3 warehouse A,B and C, Lot number LOT0001 i want sum of total currently availabel quantity of LOT0001 in all three location. 回答1: In odoo you can pass filters in context. ex: context= {'lot_id':'','owner_id':'','package_id':'','warehouse':'','force_company':'','location':''} product.with_context(context).qty_available In odoo base module system will automatically calculate quantity based on context. If you not

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

点点圈 提交于 2019-12-06 08:25:56
问题 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? 回答1: 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