openerp

How to Get reports in odt format from rml files in openerp

这一生的挚爱 提交于 2019-12-24 01:58:09
问题 I have an RML file that generates a report in PDF format, but how can I generate the same report in ODT format? 回答1: Under the Administration menu, go to Low Level Objects: Actions: Report Xml. Open the entry for that report, and change the type from pdf to odt. Just to make this programming related so it doesn't get shuffled off to superuser.com, here's how to configure the report's XML file with this change. Add the type attribute to your report declaration: <report id="report_location

How to create email notification function in Odoo?

房东的猫 提交于 2019-12-24 01:44:48
问题 I have calender.event module. In that I have one date field ending_date . I wanted to create function when ending date exceeds current date it should send notification to all employees. This function at calender.event inherited file def send_birthday_email(self, cr, uid, ids=None, context=None): sobj = self.pool.get('calendar.event').browse(cr,uid,ids,context=context) ir_model_data = self.pool.get('ir.model.data') template_obj = self.pool.get('email.template') cc_text = '' if sobj.attendee

Odoo - How to inherit BASE Salary structure as data and add new salary rules to it

半腔热情 提交于 2019-12-24 01:17:54
问题 I need to add a new Salary rule in Base of a data.xml file, so I can compute the total allowances and deductions. The final output should look like this: Here's my code: <?xml version="1.0" encoding="utf-8"?> <openerp> <data noupdate="1"> <record id="ALLOWANCES" model="hr.salary.rule.category"> <field name="name">Allowances</field> <field name="code">ALLOWANCES</field> </record> <record id="DEDUCTIONS" model="hr.salary.rule.category"> <field name="name">Deductions</field> <field name="code"

Odoo overwrite inherited method

半城伤御伤魂 提交于 2019-12-24 00:54:55
问题 Hi I'd like to overwrite the unlink() method from product_template which already has been inherited by the module point_of_sale. Now whenever I inherit this method I need to call the super function (so that the original unlink method within the Odoo ORM is called). But if I do this the unlink within point_of_sale is called first (inheritance chain). Any idea too interupt this inheritance chain and place my custom method instead of the point_of_sale > unlink method? I need this to ignore the

How to manage security with One2many fields in Odoo?

两盒软妹~` 提交于 2019-12-24 00:44:07
问题 I have a doubt about security groups in Odoo 8, I will show a simple example to make it more understandable: I have created two new models, Mother and Child . The relationship between them is that a mother can have several children, but a child will only have one mother. Therefore, we have an One2many field pointing to Child (named child_ids ) in Mother , and a Many2one pointing to Mother (named mother_id ) in Child . Now, I have an user who can create some children, but not mothers. When he

Odoo disabled edit button depending on state

一世执手 提交于 2019-12-24 00:21:35
问题 this question already asked by someone, this in an example question How to hide the edit button form only when invoice' state is 'paid' Odoo v8? but i dont get true answer, somebody can help me, i really need to hide or disabled this button. For your information im using odoo v.10 Thanks in advance 回答1: The only way to this is by Javascript you need to add this behavior to your form view build a custom addon and just add this javascript file to your backend assets template //file: static/src

Convert char to datetime odoo 9

て烟熏妆下的殇ゞ 提交于 2019-12-23 18:30:51
问题 I have two char fields, data import from excel or csv in odoo. time_1= fields.Char(string = 'Time 1') time_2= fields.Char(string = 'Time 2') result= fields.Float(string = 'Result Time 2 - Time 1') #Need result 06:00 time_1 = 10:00:00, time_2 = 16:00:00 (data from external source) How with @api.onchange('time_1', 'time_2') or @api.depends('time_1', 'time_2') convert char to time and subtract time_2 - time_1 and put result in result field? 回答1: It should be like that, from datetime import

Incoming messages send again by openerp

爱⌒轻易说出口 提交于 2019-12-23 17:22:35
问题 When someone sends an email message, it can view on openerp inbox but the outgoing email sends again thru the configuration email address I set up.. why is it so? I'm using Openerp v7.0.. I used the Outgoing Mail Server in the Settings > Technical > Email > Outgoing Mail Servers. When someone sends an email and openerp retrieved it, it sends again and again an email but by using the email address I configure. 回答1: Your question is not quite clear [1] , but this sounds like the default and

Call function from another class - field - Odoo v8

ぃ、小莉子 提交于 2019-12-23 05:49:06
问题 I'm struggling with this and I'm not so clear about it. Let's say I have a function in a class: class my_class(osv.Model): _name = 'my_class' _description = 'my description' def func (self, cr, uid, ids, name, arg, context=None): res = dict((id, 0) for id in ids) sur_res_obj = self.pool.get('contratos.user_input') for id in ids: res[id] = sur_res_obj.search(cr, uid, # SUPERUSER_ID, [('contratos_id', '=', id), ('state', '=', 'done')], context=context, count=True) return res columns = {

Where does Odoo save the contents of My Dashboard

坚强是说给别人听的谎言 提交于 2019-12-23 05:42:18
问题 I need to know where Odoo saves the views that will be shown in (My Dashboard) when we click (Add to My Dashboard). I looked in the table scheme and I could only find one related table: board_create which is used to save the custom dashboards the user creates. But I only want to find out where the contents (the views not the data) of the default Dashboard are saved in the database. 回答1: In OpenERP 7 and 8 you can find the view for dashboard in 'ir_ui_view_custom' table. The view will be saved