openerp

How to call a method in odoo 7?

吃可爱长大的小学妹 提交于 2019-12-13 19:12:23
问题 I've created a method and I was using field function to call the method. But, the method never executes. here is my code : def _get_data_from_puchase_order(self, cr, ids, field, arg, context=None): print "SUCCESS" print ":::::::::::::::::" result = {} for row in self.browse(cr, uid, ids): print row print "::::::::::::" _columns = { "data_purchase_product" : fields.function(_get_data_from_puchase_order, method=True, string='origin', type='char', strore=False) } i was add : for data in self

How to include view in Odoo 8

纵饮孤独 提交于 2019-12-13 17:53:14
问题 As in the title. How do you include a view file from a view file? If you have a large xml view file with thousand lines would it be great if you can split them into partial view then include them in the main view. I have experimented with t t-call but it doesn't work <notebook> <page string="Page 1"> <t t-call="module.page_1"/> </page> <page string="Page 2"> <t t-call="module.page_2"/> </page> </notebook> 回答1: t-call Attribute : Which is works only in Qweb template but we can not call with

Custom module and creating groups in odoo 10

谁都会走 提交于 2019-12-13 17:23:43
问题 I'm working with odoo 10 on windows. I've created a new custom module now I want to add some menus of my costum modules to certains users. I'm new to odoo so my question is can I do that by creating group, associate the menus to my group then add the users to the group (I trid that but it did not work, when I log in with the user I find nothing). I've search on the web and I found that I need to creat my groups trough ir.model.access.csv (security folder) with this : id,name,model_id:id,group

how many2many defined for custom module

为君一笑 提交于 2019-12-13 16:16:57
问题 I tried to use many2many relational field in my custom module "notebook". Code is given below: notebook.py: from osv import fields, osv import time class notebook(osv.osv): _name = "notebook" _description = "Simple Notebook" _columns = { 'title' : fields.char('Title', size=30, required=True), 'tag_ids': fields.many2many( 'hello', 'title', 'name', string="Tags" ), } notebook() class hello(osv.osv): _name = 'hello' _columns = { 'name':fields.char('Name',size=30), 'note_ids': fields.many2many(

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

NotImplementedError: 'update' not supported on frozendict - Odoo v8

ⅰ亾dé卋堺 提交于 2019-12-13 15:29:58
问题 I have this code on my Odoo v8 module: @api.multi def button_generate_wh_doc(self): context = self._context partner = self.env['res.partner'] res = {} for inv in self: view_id = self.env['ir.ui.view'].search([ ('name', '=', 'account.invoice.wh.iva.customer')]) context.update({ 'invoice_id': inv.id, 'type': inv.type, 'default_partner_id': partner._find_accounting_partner( inv.partner_id).id, 'default_name': inv.name or inv.number, 'view_id': view_id, }) res = { 'name': _('Withholding vat

How to activate OpenERP Developer Mode

泪湿孤枕 提交于 2019-12-13 12:30:02
问题 In my OpenERP HR Project I can not see or no link for access to developer mode as other projects. Please kindly help me to solve this. to image 回答1: Developer Mode Odoo developer mode allows you to make substantial modifications to the Odoo database such as adding fields to your documents and views. You change the default views of your actions and can even create dynamic forms based on other fields within your models. Advantage While Odoo is a powerful application framework the development

odoo - get value from many2one field

老子叫甜甜 提交于 2019-12-13 12:29:36
问题 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

How do I add multiple models to one view?

萝らか妹 提交于 2019-12-13 07:02:26
问题 I'm trying to use three different models in one view. I've created a new model that inherits the models which seems to work fine. from openerp import models, fields, api class ProjectNote(models.Model): _name = "triangle.project.note" _inherit = ["note.note", "project.project", "triangle.note"] My problem is in the view. I use my new model as the model and inherit a view from project. <record id="view_project_notes_form" model="ir.ui.view"> <field name="name">triangle.project.note.form</field

Expected singleton: stock.move - Odoo v9 community

谁都会走 提交于 2019-12-13 06:15:02
问题 I'm creating a stock.picking from fleet_vehicle_log_services with this method: @api.multi def create_picking(self): self.ensure_one() vals = { 'move_lines': self.move_lines.id, 'origin': self.name } picking = self.env['stock.picking'].create(vals) return picking And it's declared on fields like this: move_lines = fields.One2many('stock.move', 'picking_id', string="Stock Moves", copy=True) And my view: <group string="Datos del picking"> <button name="create_picking" string="Crear Picking" type