odoo-8

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

How to inherit Mail.Thread AbstractModel and override function from this class in Odoo?

情到浓时终转凉″ 提交于 2019-12-23 16:34:38
问题 I would like to change something from mail.thread abstract class. So I inherited mail.thread and wrote override message_tracked function. But it did not call override function... just only called base function. Is it cause by mail.thread is Abstract Model? I tried like that osv.osv and osv.AbstractModel and import this py file in init .py and put 'mail' module in depend dic of openerp .py class mail_thread(osv.osv): _inherit = 'mail.thread' class mail_thread(osv.AbstractModel): _inherit =

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 = {

Odoo 8 (Openerp): Setting values using Wizard from list view

烈酒焚心 提交于 2019-12-23 03:45:07
问题 I'm having some issues with an Odoo Wizard in a list view that would take a value from the selected (checked) list items to update another record. For instance, I added a column to res_partner called related_partner_id. Basically, it's used to classify master accounts (partners). When adding a new customer, I have setup a dropdown that I could assign the master account. The database updates the related_partner_id to the child account's id from res_partner. Here is the view I'm using. <?xml

Expected singleton: hr.employee(1, 2)

笑着哭i 提交于 2019-12-23 02:20:00
问题 Good Day! Everybody I have an error while loading the kanban view. I inherit the hr.employee Kanban xml and just add a condition if a certain documents expired, it will add a Expired Documents notification in kanban view, here is the xml code: <record model="ir.ui.view" id="hr_kanban_view_employees_recruitment_kanban"> <field name="name">HR - Employees Kanban Document Status</field> <field name="model">hr.employee</field> <field name="inherit_id" ref="hr.hr_kanban_view_employees"/> <field

Get images from db by fields.function on QWeb report - Odoo 8

泪湿孤枕 提交于 2019-12-23 01:37:50
问题 I want to print an image getting it by a fields.function for any image in my database. I am trying the following: def _get_image(self, cr, uid, ids, name, args, context=None): res = dict.fromkeys(ids) for record_browse in self.browse(cr, uid, ids): partner = self.pool.get('res.partner').browse(cr,uid,6,context=None).image res[record_browse.id] = base64.encodestring(partner) return res _columns = { 'image': fields.function(_get_image, string="Image", type="binary"), } but in qweb report I got:

how to set a different message for an email template in odoo?

江枫思渺然 提交于 2019-12-22 17:54:31
问题 I created a custom module and had used the calendar object to create an event and the code is as follows def create_calender_event(self,cr,uid,ids,context=None): calendar_obj = self.pool.get('calendar.event') for rec in self.browse(cr,uid,ids,context=context): if rec.action: for rec_res in rec.action: calendar_obj.create(cr,uid,{'name' : rec_res.act_ion, 'user_id' : rec_res.asgnd_to.id, 'start_date' : rec_res.due_date, 'stop_date' : rec_res.due_date, 'allday' : True, 'partner_ids' : [(6,0,