While creating a SQL backed report I faced a weird issue. Let me share the issue with you and how I solved it.
I added the model for the report to one of my existing modules and restarted the OpenERP server. I created views, window action and menu item to show the report. All worked fine. the report was showing perfectly. But when I went to Model list to set access rights to the model, I could not find the model there. I tried to find out the reason behind it… searched the web for any help… but no luck… it made me crazy. The report was running okay but the model was missing.
I thought to take the model out of the old module and create a new module for it. I did so, installed the new module and when I searched for the model in Model listing it was there. I reverted the changes by moving the model to my old module, uninstalled the old module and reinstalled it. Now the model is in the Model list.
I exactly don’t know what happened. I think when a module is installed OpenERP registers the model. As the old module was already installed, the model failed to register but the object was available to the window action and views. That’s why the report was working.
In OpenERP 7, Advanced Search creates OR conditions by default. But you may also search using AND conditions. How? Let see.
For an example, you want to search contacts who have ‘John’ or ‘Jonathon’ in their names. So in Advanced Search for contacts if you add two conditions – one for ‘John’ and another one for ‘Jonathan’ as shown in the below image and click on the Apply button, then these conditions will be added as OR conditions, which is default.
But, if you select the first condition, click on Apply button, then select the second condition and click the Apply button again, the conditions will be added as AND conditions.
Isn’t this easy? Share if you know something like this :).
Recently we faced an issue of form not submitting with all form fields. Let me describe the issue in details.
In CiviCRM, when creating a new Contact or updating an old one, selected tags were not saving. This was working before but suddenly this issue arose. After thorough investigation we discovered that not all fields of the form was posted or in other words the PHP $_POST variable have not listed all fields. In our Windows machine we got all the fields but in Linux box the issue existed. First we thought the issue might have caused due to the PHP directive “post_max_size”, though it was set to 24M. We tried with updating it to 128M. But the issue was still there.
Then we searched Google and got a clue from http://akrabat.com/php/missing-fields-in-_post/. Our server was using PHP 5.3.22. So, we looked for the “max_input_vars” directive which was new since 5.3.9, it was set to 1000 by default. We increased the number to 2000 and the issue was resolved.
Due to the number of groups in the form, the field number increased to more than 1000. So, PHP was truncating the POST data and at most 1000 fields were returned. That’s why Tags fields were not listed in the $_POST variable.