openerp

How can I display log message in openerp web client?

爷,独闯天下 提交于 2019-12-31 04:12:12
问题 I try to display a message after create a product object that tell user product with product.name is created successful This is the code: def log_prod(self, cr, uid, ids, context=None): product=self.pool.get('product.product').browse(cr, uid, ids) self.log(cr, uid, ids , _("Product %s has been created") % product.name , context=context) return True def create(self, cr, uid, data, context=None): new_id = super(product_product,self).create(cr, uid, data, context) self.log_prod(cr,uid,new_id

How to get two _rec_names in odoo for two many2one fields in single class?

眉间皱痕 提交于 2019-12-30 14:52:11
问题 I have following code I want this two fields asset_catg_id and folio_num . These should be available for many2one two fields. How to write 2 _rec_name for a single class? class asset_asset(osv.osv): _inherit = "asset.asset" #_name = "asset_asset" _rec_name= "folio_num" #_rec_name = "assetmodelid_add" _columns = { 'name': fields.char('Asset Name', size=64), 'company_id1': fields.many2one('res.company', 'Substation', required=True), #'place1': fields.many2one('asset.parentlocation', 'Location')

Openerp function fields

百般思念 提交于 2019-12-30 13:26:50
问题 Hey I'm new to openerp and I need help to create a function field called Total that calculates the sum of all the fields of the same object... eg. _name = 'hr.performanzze' _columns = { 'p':fields.selection(((1,'Outstanding'), (2,'Well Above Expectations'), (3,'As Expected'), (4,'Below Expectations'), (5,'VeryPoor'), 0,'N/A')),'title.'), 'b':fields.selection(((1,'Outstanding'), (2,'Well Above Expectations'), (3,'As Expected'), (4,'Below Expectations'), (5,'Very Poor'), (0,'N/A')),'title'),

Openerp function fields

那年仲夏 提交于 2019-12-30 13:19:09
问题 Hey I'm new to openerp and I need help to create a function field called Total that calculates the sum of all the fields of the same object... eg. _name = 'hr.performanzze' _columns = { 'p':fields.selection(((1,'Outstanding'), (2,'Well Above Expectations'), (3,'As Expected'), (4,'Below Expectations'), (5,'VeryPoor'), 0,'N/A')),'title.'), 'b':fields.selection(((1,'Outstanding'), (2,'Well Above Expectations'), (3,'As Expected'), (4,'Below Expectations'), (5,'Very Poor'), (0,'N/A')),'title'),

OpenERP always displays inherited view instead of original

回眸只為那壹抹淺笑 提交于 2019-12-30 06:23:09
问题 Original views: <record id='view_1' model='ir.ui.view'> <field name="name">view.name</field> <field name="model">my.object</field> <field name="priority" eval="17"/> <field name="type">form</field> <field name="arch" type="xml"> ... </field> </record> inherited view from the original: <record id='view_2' model='ir.ui.view'> <field name="name">view.name</field> <field name="model">my.object</field> <field name="priority" eval="10"/> <field name="inherit_id" ref="view_1"/> <field name="type"

How to add entry to 'More' menu or top menu to add action on multiple selections?

蹲街弑〆低调 提交于 2019-12-28 16:14:29
问题 Goal I want to create delivery from a selection of order lines, but I can't get the button to appear. Module compose_delivery_order/ ├── delivery_order_button.py ├── delivery_order_button.xml ├── images/ │ └── delivery_order_button.png ├── __init__.py ├── __openerp__.py ├── order_to_invoice_create_delivery_button.py ├── order_to_invoice_create_delivery_button.xml ← I'm working on this ├── sale_order_button.py └── sale_order_confirm_button.xml XML <record> <record id="action_sale_order

No database selection openerp connection

大兔子大兔子 提交于 2019-12-25 16:49:53
问题 I imported a database through psql interface, the database exists but on the OpenERP connection interface, the database imported is not listed. What should I do to get the database imported listed in the connection interface of OpenERP ?? Cheers 回答1: Make sure that the database is owned by the database user configured in the OpenERP configuration file - openerp usually. Another situation when you can see an empty list for database selection is when your openerp-server didn't start for some

Odoo 10 - Show image of a given product template

雨燕双飞 提交于 2019-12-25 09:08:02
问题 I am trying to extend product template form view to incorporate an additional field that will display photo of another related product template (so product_template id 10 displays in this additional field image of product_template 20) I see that the image field is defined in the model as: # image: all image fields are base64 encoded and PIL-supported image = fields.Binary( "Image", attachment=True, help="This field holds the image used as image for the product, limited to 1024x1024px.") image

Odoo automated server action to trigger another server action

ε祈祈猫儿з 提交于 2019-12-25 08:41:52
问题 Let's say I set up Server Action A on the stock.inventory model. This action simply logs a value and then calls Sever Action B (which has a database ID of 366). The python code in the action is just: log('running server action a') value = { "type": "ir.actions.server", "id": 366, } Then, in Server Action B, which is on the product.product model, the python code is just: log('running server aciton b') Now, when I add Server Action A to the "More" menu, and manually trigger it from the browser

dynamicly hide fields and rows in tree view odoo 9

浪子不回头ぞ 提交于 2019-12-25 07:32:56
问题 I have model to store training results for athletes and tree view to insert results from model code is : class GeneralFitnessDetails(Model): _name = 'general_fitness_details' generalFitnessDetails = Many2one("general_fitness") player = Many2one('player') exercise = Many2one("exercise") exercise_state = Selection([('by_reps', 'By Reps'), ('by_time', 'By Time'), ('by_distance', 'By Distance'), ('by_weight', 'By Weight')]) reps = Integer(string='Reps') time_sec = Integer(string='Seconds') weight