qweb

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

Get images from db by fields.function on QWeb report - Odoo 8

泪湿孤枕 提交于 2019-12-23 01:37:50
问题 I want to print an image getting it by a fields.function for any image in my database. I am trying the following: def _get_image(self, cr, uid, ids, name, args, context=None): res = dict.fromkeys(ids) for record_browse in self.browse(cr, uid, ids): partner = self.pool.get('res.partner').browse(cr,uid,6,context=None).image res[record_browse.id] = base64.encodestring(partner) return res _columns = { 'image': fields.function(_get_image, string="Image", type="binary"), } but in qweb report I got:

Qweb Xpath of child node in odoo / openERP?

江枫思渺然 提交于 2019-12-13 15:42:39
问题 Here i want insert a LI item inside existing UL I tried this, XML <ul id="top_menu"> <li><a>1</a></li> <li><a>2</a></li> <li><a>3</a></li> </ul> XPATH <xpath expr="//ul[@id='top_menu']/li[1]" position="after"> <li><a>100</a></li> </xpath> I got my new item "100" at last item of <ul> . but i need it in after 1st item. Thanks in advance. 回答1: Sometime in tricky solution, we need to override/replace base id and than rearrange it based on our requirement. try with this code: Replace your code

Call action via button with OdooV12

我们两清 提交于 2019-12-11 15:53:26
问题 I'm an Odoo developer and my issue is i wanna call an action from template into xml file. For Odoo docs/guide is so poor, so i need help to do something great. Thanks <!-- This is my action declaration into '''views/action_views.xml''' --> <record model="ir.actions.act_window" id="action_show_something"> <field name="name">Wanna show you something</field> <field name="res_model">product.template</field> <field name="type">ir.actions.act_window</field> <field name="view_type">tree</field>

odoo Qweb report lines in alphabetical order

戏子无情 提交于 2019-12-11 09:53:22
问题 I'm getting crazy for what I believe it is a really silly matter. I need to render the result of an array in alphabetical order: <tr t-foreach="o.order_line" t-as="l"> <td> <span t-field="l.name"/> </td> should I use a SQL query SELECT * FROM table ORDER BY l.name DESC ? but it seams too complicated, I have the feeling there is a simple condition to render it correctly... any help highly appreciated! Thanks! 回答1: Have a look at this You could set a new variable to order_line.sorted() and then

Odoo 10 Qweb Report, define filename for PDF file

只谈情不闲聊 提交于 2019-12-11 07:26:26
问题 I have the following custom report: <?xml version="1.0"?> <odoo> <report id = "report_custom_sale_order" name = "custom_saleorder_v2.custom_report_saleorder" string = "Custom Quotation / Order" model = "sale.order" report_type = "qweb-pdf" report_name = "((object.number or 'SaleOrder').replace('/','')+'.pdf')" attachment_use = "False" /> </odoo> I would like the PDF to be downloaded as SO003.pdf for sales order with reference/sequential SO003 , and as SaleOrder.pdf for sales order in draft

How to use the dot notation in a kanban view in Odoo?

爱⌒轻易说出口 提交于 2019-12-11 03:29:51
问题 I have a model customer and another model company . The model customer has a field named company_id , which is a Many2one pointing to company . Besides, company has a field of type Char named trade_name . Now, I'm creating the kanban view of customer , using Qweb . What I want is to show the trade name of the company of each customer. <t t-field="company_id.trade_name"/> That line is not working, I get a blank space in the kanban view where the field should be. I also tried with t-esc , and

Odoo POS create a dropdown list

六眼飞鱼酱① 提交于 2019-12-11 00:59:44
问题 Can anyone help me with creating a dropdown list in the POS partner screen. I added this in the pos.xml file, but the dropdown is empty. Thanks <div class='client-detail'> <span class='label'>CustomerGroup</span> <select class='*what to place here?*' name='group_id'> <option value=''>None</option> <t t-foreach='*what to place here?*' t-as='group'> <option t-att-value='group.id' t-att-selected="partner_group_id ? ((group.id === partner.group_id[0]) ? true : undefined) : undefined"> <t t-esc=

Odoo 9.0C: How can i access the value of a many2one field (that has been created in sale.order.line module on the invoice qweb report?

末鹿安然 提交于 2019-12-08 12:52:31
问题 I have installed module Sale Sourced by Line by Camptocamp, Eficent, SerpentCS, Odoo Community Association (OCA) for Odoo 9.0. The module creates a new many2one field as the code bellow: class SaleOrderLine(models.Model): _inherit = 'sale.order.line' warehouse_id = fields.Many2one( 'stock.warehouse', 'Source Warehouse', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="If a source warehouse is selected, " "it will be used to define the route. "

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