openerp

How to create RML Report?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 08:26:27
问题 I'm going to create reports using my module (custom analytic account module). I heard that RML is the easiest way to generate reports. Please give me the required files list to create reports. ex:- __openerp__.py __init__.py ------what are the other files need to create It's easy when you mention sample module (purchase/stock) and give me file names from that, then I can browse them and by the use of that create my own reports for my modules. 回答1: _ openerp _.py for rml location _ init _.py

how to initialize a default one2many fields in OpenERP

六眼飞鱼酱① 提交于 2019-12-08 08:26:22
问题 "python code for account_invoice.py and i want to know how to initialize a default one2many fields in OpenERP " class account_invoice(osv.osv): def _tax_line_default(self, cr ,uid, context=None): obj= self.pool.get('account.invoice.tax') ids= obj.search(self, cr, uid) obj.write(cr, uid, ids[0], {'name' : 'droit de timbre','amount':0.400}) res =obj.browse(cr, uid, ids[0]) return res.name_get(cr, uid, ids[0], context) _ columns = { 'tax_line': fields.one2many('account.invoice.tax', 'invoice_id'

Reports in rml of Openerp

删除回忆录丶 提交于 2019-12-08 08:04:04
问题 In my purchase order report template i have a table that displays purchase order line details.that is the products i added in the purchase order.but when a minimum of 20 products is added the products in the template just overwritten on the footer of my purchase order template. i used tag for breaking page but didnt work. <condPageBreak height="600"/> any help? 回答1: By changing the height of the frame the problem gets resolved. my original frame id defenition was as follows: <frame id="first"

Odoo - Combine two fields heading in one2many

久未见 提交于 2019-12-08 07:54:52
问题 I am working with odoo 10-e. I created custom module and in that module i want to show one2many records like this ---------------- | Long Cell | ---------------- | 1 | 2 | ---------------- right now by default each column have its own heading which is actually string= value. I want to override default behavior. 回答1: First create the xml file which extends the ListView Template like this to add colspan feature in base list view template. colspan.xml <?xml version="1.0" encoding="UTF-8"?>

How to get in openerp all objects from a class?

南笙酒味 提交于 2019-12-08 07:54:50
问题 I need to get all objects from a class and iterate through them. I tried this, but without any results: def my_method(self, cr, uid, ids, context=None): pool_obj = pooler.get_pool(cr.dbname) my_objects=pool_obj.get('project.myobject') #here i'll iterate through them... How can I get in 'my_objects' variable all objects of class 'project.myobject'? 回答1: You have to search with empty parameters to get all the ids of existing objects, like: myobj = pool.get('project.myobject') ids = myobj.search

Mixing apples and oranges :3 odoo8

偶尔善良 提交于 2019-12-08 07:35:41
问题 I'm trying to send notification to employees, i created a computed many2many field to get the partners id and pass them to partner_ids field of the mail.wizard.invite model. here is my inherited class: from openerp import models, fields, api class CustMailInvite(models.Model): _inherit = 'mail.wizard.invite' employee_ids=fields.Many2many('hr.employee','employees') @api.one @api.depends('employee_ids.user_id.partner_id') def compute_partner_ids(self): for a in self.employee_ids: if a.user_id:

Pass custom field values from oppertunity to quotation in odoo 10

徘徊边缘 提交于 2019-12-08 07:27:52
问题 I have added a custom field in opportunity and same field in quotation and I want to add value in that custom field in opportunity and pass that values to Quotation in same field. In odoo 8 it was done by overriding makeOrder method but now in odoo 10 I have no idea how to do it. Someone please help me about it. Thanks! 回答1: When you write your field definitions, you can solve it. It will be change on the fly, if you set 'store' property to True, then it will write it to the db, so this will

Change message order in discuss odoo 9

别等时光非礼了梦想. 提交于 2019-12-08 07:22:35
问题 I can't find where change message order in discuss module in odoo9 Where is location form and class from this image --> https://postimg.org/image/xffsxqqkf/ 回答1: Open addons/mail/static/src/js/thread.js line 59 inside the init function of the thread widget. The display_order is set as ASC . You only have 2 options there. For a specific order you have to extend this widget in order for you to define: 1) How will the order be determined, 2) When your order will be applied, on all the o_mail

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

how to change the default field value from another model in odoo

孤人 提交于 2019-12-08 06:45:00
问题 How can I change the status field default value of formdownload model record to true when a value is picked in form_serial_no_id Many2one field of plot.allocate model? I have written a method to override odoo create function of the PlotAllocation model but it's still not changing the value of status field to true. Instead, it goes to the override function of create method in the parent class(plot.allocate). Anytime I save record, control goes to the create function of the parent method and