openerp-7

Openerp restrict user with one session at a time

别来无恙 提交于 2019-12-12 05:16:51
问题 Hi I am customizing OpenERP. I want to restrict user to login into application once at a time. That means; I have a user called "Accountant". I want only one session should be allowed to login with "Accountant" user name at a time. Others can login with their own user names. Like that application should allow only one session for each user at a time. I have not seen any plugin for this. Can I do this through customization? Please guide me. 回答1: This blog highlights how to do it. But I don't

Function field is not working in OpenERP

柔情痞子 提交于 2019-12-12 04:36:15
问题 In purchase.order.line I added new field pln price and changed unit price field to function: 'price_unit': fields.function(_amount_pln, string='Unit Price', required=True, digits_compute= dp.get_precision('Product Price')), 'plnprice': fields.float('PLN Price', digits_compute= dp.get_precision('PLN Price')), Here is function: def _amount_pln(self, cr, uid, ids, prop, arg, context=None): res = {} for line in self.browse(cr, uid, ids, context=context): res[line.id] = line.plnprice * 0.25 return

RML Test of Page Number

*爱你&永不变心* 提交于 2019-12-12 04:17:13
问题 Moin Moin, I'm working on Openerp 7 and there pdf's get created with rml. Problem is: I need Page Numbers, but just starting of the second Page. I tried some rml if clause statements, but Page 1 gets printed all the time and the things that get printet are pretty wierd. <header> <pageTemplate id="second"> <frame id="second" x1="2.2cm" y1="2.5cm" width="16.9cm" height="22.3cm"/> <pageGraphics> <image file="images/isatech_water_header_medium.jpg" x="0.0cm" y="24.4cm" width="19.0cm" height="6

how to remove Attachment for specific model in openrp?

梦想的初衷 提交于 2019-12-12 02:03:58
问题 I'm developing my own model. I installed Document model. This model is giving attachment button on top of the form. but i want this attachment button in only my module. I want to hide other that button in other form (other model). so I'm getting following code for removing "create and save" for specific model. but this coding is not working my side. please tell me how to use attachment button for specific model? and how to hide other models?. openerp.web_smile_hide_buttons = function(openerp)

Client side validation in openerp

匆匆过客 提交于 2019-12-12 01:35:52
问题 I am still learning Openerp and please bear it if I asked something very simple. My issue is that I need to get validate two fields which represent start_time and end_time. both fields are in char 'start_time': fields.char('Start Time'), 'end_time': fields.char('End Time'), What I need to do is , once the user input this start_time and end_time I need to check if that input is in 24hrs and in hh:mm pattern. please be kind enough to help me with this 回答1: You should add an on_change function

OpenERP 7 : How can I make conditions for a field's default value?

元气小坏坏 提交于 2019-12-12 01:26:52
问题 This is the second step of my question about setting a default date in create form, I move it here to clarify the two questions : My mission also consisted in setting the requested_date field to Monday if it was initially set on Saturday or Sunday with the operation, so I made conditions in _defaults with the "isoweekday" method of Date, but it seems that _defaults doesn't support conditions : _defaults = { 'requested_date': (date.today() + timedelta(days=28)).strftime(DEFAULT_SERVER_DATE

How to skip demo data in Odoo instance

Deadly 提交于 2019-12-11 23:21:00
问题 I'm using Odoo on ubuntu server, I want to skip the demo data, I tried the following way, but it does'nt help me out. --without-demo=True Then I deleted the demo xml files in openerp.py for CRM module, but there is still demo data in customers field. Is there any other potential way to skip the demo data. Any input would be appreciated. 回答1: Use this parameter --without-demo=all Take into account that it requires the parameters -d (database) and -i (modules to install) 回答2: when you create a

OpenERP 7 Adding Field to Existing Module - XML Validate Error

徘徊边缘 提交于 2019-12-11 20:48:32
问题 I'm new to editing/programming OpenERP modules so I'm following this tutorial to simply add a field to the projects module. I've run into a few errors and I've fixed them all, but now my XML simply won't validate. I've read multiple forum posts, read every similar post here on stackoverflow and I can't figure out my problem. So, here's the server's error log output and my files: openerp-server.log: 2014-05-28 17:56:13,120 29680 ERROR mct openerp.osv.orm: Can't find field 'mct_projects_machine

How to call a wizard from a function in OpenERP7?

自古美人都是妖i 提交于 2019-12-11 20:17:15
问题 I've created the next wizard form in XML: <?xml version="1.0" encoding="utf-8"?> <openerp> <data> <record model="ir.ui.view" id="confirm_unlink_res_partner_bank_wizard_form"> <field name="name">confirm.unlink.res.partner.bank.wizard.form</field> <field name="model">confirm.unlink.res.partner.bank.wizard</field> <field name="arch" type="xml"> <form string="Confirm removing bank account" version="7.0"> <group colspan="8"> <group colspan="8"> <label string="Do you want to continue?"/> </group>

OpenERP 7 - Create auto log message in “Log a Note” field as history log record

半腔热情 提交于 2019-12-11 13:45:47
问题 I am now creating a customize module for a lab test purpose in OpenERP 7. The users will require to enter their lab test components and result here. Now i having a field which called "Reason For Changes". I would like to know the method how i can log the input of this content as a "log a note" message to display at the bottom through mail.thread? The step would be: Reason For Changes (ROC) as a required field Any changes in my others fields will calling my onchange method to clearing the