odoo-view

Set default value while creating record from one2many field - odoo

杀马特。学长 韩版系。学妹 提交于 2019-12-19 05:09:31
问题 I want to set default value for multiple fields while creating records from one2many field, in that default value will be taken from the parent model. Odoo Model Structure class purchase_order(models.Model): _inherit='purchase.order' cash_forecast_ids = fields.One2many(comodel_name='cash.forecast', inverse_name='purchase_order_id', string='Payment Schedules') class cash_forecast(models.Model): _name='cash.forecast' purchase_order_id = fields.Many2one(comodel_name='purchase.order', string='PO'

Add npm pckage in odoo

岁酱吖の 提交于 2019-12-14 03:35:27
问题 I want to use a npm package in odoo so that I can use that in odoo widget. I have seen that odoo web add on somehow uses underscore js and query. But I am not able to use npm package in odoo. I have tried to load it by creating package.json file inside the addon folder but it is not working. Please Help!! 回答1: The common pattern is to put all dependencies directly copied in the static/src/lib/ folder of the addon, and enable them in a templates/assets.xml file. Using npm would be

Manage webservice from odoo

假装没事ソ 提交于 2019-12-11 21:30:47
问题 I am new to Odoo 11, I have created a module called 'coupon' , for this module I have created a security group and a default user that is added to this group: <record id="default_coupon_user" model="res.users"> <field name="login">couponuser</field> <field name="password">couponuser</field> <field name="password_crypt">couponuser</field> <field name="name">Default User Coupon</field> <field name="display_name">Default Coupon User</field> <field name="customer">False</field> </record> <record

How to enable “typing” on selection widget in Odoo?

末鹿安然 提交于 2019-12-11 10:29:53
问题 I have used a selection widget in my program and it has lot of items in the drop down. Is there any method to enable typing on it so user can select item easily. (just like making a JComboBox editable in java) 回答1: If you are using the many2one field with the widget="selection" , you can select the selection box by clicking it and you start typing what you are looking for, the box change to the value that you are writing. By the way, you must write it fast and the drop down must not be

trying to show chessboard js in odoo form widget, no error no pieces

牧云@^-^@ 提交于 2019-12-11 06:55:29
问题 Hi i´m trying to show chessboardjs on a form view in odoo backend, I finally make the widget to show the board, but the pieces are hidden, I don´t know why because seems to work fine, except for the pieces. If I use dragable : true in the options and move a hidden piece then the board is rendered with all the pieces. do I´m missing something, on my code that the chessboard its not rendered well?? here is mi widget code: (function (instance) { var _t = instance.web._t, _lt = instance.web._lt;

Odoo how to filter many2one field values in one2many field

馋奶兔 提交于 2019-12-11 05:59:25
问题 I have many2one field name_id . Usually when I use it in my_model.xml code below in this field I can select from all the values written in my.model.line . In this case I want to filter values and see the list of only these values which are written in current my.model. my_model.xml <record model="ir.ui.view" id="view_my_model_form"> <field name="name">my.model.form</field> <field name="model">my.model</field> <field name="arch" type="xml"> <form string="My Model"> <header> <field name="my

How to add an external jQuery plugin to the list view on Odoo?

妖精的绣舞 提交于 2019-12-10 16:09:07
问题 I am using Odoo 10e. I want to integrate a jquery plugin into my module. I want to integrate the jQuery plugin jquery-resizable-columns. It simple helps user to resize columns of table on the fly and I want to apply this on a specific model's list view Which method should I extend in order to add the plugin? 回答1: I think you should extend (maybe include) some widget in the web module. If you go to the file /addons/web/static/src/js/view_list.js , you can see the widget that renders the table:

Passing Context In Odoo

我是研究僧i 提交于 2019-12-10 11:47:03
问题 How can i pass this scheduled_for in ratecard_multiple to scheduled in ratecard_sin_radio so that i can use it in the radio_sin_radio function action_four_weeks_schedule_form Here i have added all the code that am using class ratecard_multiple(models.Model): # pudb.set_trace() _name = 'ratecard.multiple' _rec_name = 'display_name' name = fields.Char(string='Multiple RateCard Product Name ', required=True) code = fields.Char(string='Multiple RateCard Code ', readonly=True) scheduled_for =

Odoo MissingError One of the documents you are trying to access has been deleted, please try again after refreshing

雨燕双飞 提交于 2019-12-08 13:52:37
问题 Odoo Warning, MissingError One of the documents you are trying to access has been deleted, please try again after refreshing. Am accessing this button action_four_weeks_schedule_form which is shown below on . <field name='multiple_ratecard_id' nolabel="1" options="{'reload_on_button': true}"> <!-- widget="many2many"--> <tree string="ALLOCATE SPOTS" editable="bottom" > <button name="action_four_weeks_schedule_form" type="object" string="CREATE RATECARD SCHEDULE" class="oe_highlight" /> The

How can i generate xls report in odoo

ぐ巨炮叔叔 提交于 2019-12-08 12:15:35
问题 I want to generate my own excel report using Excel report engine in odoo 8. someone please send me a simple excel report sample or any helping URL. I'll be very thankful to you .... 回答1: Here is a simple piece of code. There is really a lot of examples on the internet with good explanations. I suggest you go through the code in detail to see how it works (by the way I have copied the code also from somewhere - I cannot remember where. Also have a look at the examples here:https://github.com