openerp-7

Browse another model in openerp depending upon the active-ids

血红的双手。 提交于 2019-12-08 07:21:05
问题 I am creating "delivery slip" report, and I have to check the type of sale which is direct or in indirect, so order_type is in "sale.order" model, so I need to browse the order_type with the help of sale number from openerp.report import report_sxw class ps_report(report_sxw.rml_parse): name_type = '' name_type1 = '' v_name = '' v_model = '' v_year = '' picking = '' def __init__(self, cr, uid, name, context=None): super(ps_report, self).__init__(cr, uid, name, context=context) do_type = self

dependent drop-down in odoo / open erp

允我心安 提交于 2019-12-08 03:45:20
问题 I have made two drop-downs. Second dropdown's data is dependent on first drop-down's chosen value. I have tried multiple methods, but didn't find any relevant solution. Those are my three lists: SELECTION_LIST = (('sela','Selected a'), ('selb','Selected b')) SELECTION_LIST_2 = (('selc','Selected c'), ('seld','Selected d')) SELECTION_LIST_3 = (('sele','Selected e'), ('self','Selected f')) And I defined my fields this way: 'type_selection': fields.selection( [ ('selection1', 'Selection 1'), (

Tree view to be called through button in OpenERP-7

孤者浪人 提交于 2019-12-08 00:08:19
问题 I wanted to know that how may I call the tree view(of different records) through a button . Because returning form view is easy but when I tried to do exact thing for tree view it shows a list only. The scenario is that I have a search product form. Now when the search is generated,a domain of records is filled in the field. I want to add a button to call the tree view showing me the records present in that domain. I added a function to button but it showed me all the record in a list ,

Make a functional field editable in Openerp?

╄→尐↘猪︶ㄣ 提交于 2019-12-07 03:26:40
问题 How to make functional field editable in Openerp? When we create 'capname': fields.function( _convert_capital, string='Display Name', type='char', store=True ), This will be displayed has read-only and we can't able to edit the text. How we make this field has editable? 回答1: You must add a inverse function to make the field editable. This parameter is called fnct_inv in OpenERP v7. An example: def _get_test(self, cr, uid, ids, name, args=None, context=None): result = dict.fromkeys(ids, False)

how to set name of multiple textbox in openerp using qweb template engine?

让人想犯罪 __ 提交于 2019-12-06 16:48:05
问题 Here is my code: <tr t-foreach="keyword" t-as="item"><td><t t-esc="item_value"/></td><td><input type="text" name=""/></td></tr> So here, Textbox are generated dynamically. Now I want to set textbox name to the value that is generated on <t t-esc="item_value"/> 回答1: To set the text box name to item_value you need to use the t-att attribute: <input type="text" t-att-name="item_value"/> Hope this helps! 来源: https://stackoverflow.com/questions/21778744/how-to-set-name-of-multiple-textbox-in

Related type field not showing value

99封情书 提交于 2019-12-06 15:16:15
问题 I have a related field 'region_id' that get the value from a many2one field in another class like this class activity_summary(osv.osv): _name = "budget.activity_summary" _rec_name = "activity_summarycode" _columns = { 'activity_summarycode' : fields.many2one("budget.activity_year", "Activity Summary Code", ondelete= "no action", required=True ), 'region_id' : fields.related("activity_summarycode", "mgmt_code", type="char", string = "Management Code", size=64, store = True), } But it's not

Override Create function in Odoo

南楼画角 提交于 2019-12-06 13:43:24
问题 I'm trying to override the 'create' button in 'hr.employee' object. But I'm getting the error Type Error:must be type , not str my chunck of code is shown below from openerp import models, fields,api class hrEmployee(models.Model): _inherit = "hr.employee" def create(self, cr, uid, ids, context): #Todo code super('hr.employee', self).create(cr, uid, ids, context=context) # return True I don't know what is getting wrong here. Hopes for suggestion 回答1: from openerp import models, fields,api

Tree view to be called through button in OpenERP-7

荒凉一梦 提交于 2019-12-06 07:56:21
I wanted to know that how may I call the tree view(of different records) through a button . Because returning form view is easy but when I tried to do exact thing for tree view it shows a list only. The scenario is that I have a search product form. Now when the search is generated,a domain of records is filled in the field. I want to add a button to call the tree view showing me the records present in that domain. I added a function to button but it showed me all the record in a list , didnot even show only the records in the domain. I have tried to call the following function through a

odoo - get value from many2one field

99封情书 提交于 2019-12-06 03:47:07
My code: class SaleOrder(osv.Model): _inherit = 'sale.order' _columns = { 'xx_delivery_date': fields.date(string='Delivery date'), 'xx_payment_method': fields.many2one('xx.payment.method', string='Payment method'), 'xx_insurance_type': fields.many2one('xx.insurance.type', string='Insurance') } def _amount_insurance(self, cr, uid, val1, context=None): val = 0.0 insurance_chosen = self.pool.get('xx.insurance.type').browse(cr, uid, insurance_percentage.id,context=context) val = val1*insurance_chosen/100 return val class InsuranceType(osv.Model): _name='xx.insurance.type' _columns = { 'name' :

How to add autoincremental field in OpenERP 7?

假如想象 提交于 2019-12-06 03:29:32
问题 I searched and modified the source code of a simple custom module of openerp, I give the code below init .py import sim openerp .py { 'name': 'Student Information Management', 'version': '0.1', 'category': 'Tools', 'description': """This module is for the Student Information Management.""", 'author': 'Mr Praveen Srinivasan', 'website': 'http://praveenlearner.wordpress.com/', 'depends': ['base'], 'data': ['sim_view.xml'], 'demo': [], 'installable': True, 'auto_install': False, 'application':