Jul 30,
2011
by Iván Perdomo
We have been working with the previous version of the Mercurial JSLint precommit hook for several months now, and we pretty happy with the results, it catches the most common JavaScript pitfalls.
However this hook was not smart enough, it checked all the modified JavaScript files even if they were not part for the commit, and this situation annoyed some experienced developers:
I have unfinished JavaScript changes, but I’m committing a Java files!! Why this hook is checking files that are not part of the commit!?? I need to do this Java changes now … I’ll disable this hook.
The Solution
The solution is to run the check on the pretxncommit hook, where you have already the list of files that are part of the commit. You can check the modified JavaScript files and if JSLint complains, the transaction is rolled back.
The Code
The changes are simple. Use hg log to get the list of files from $HG_NODE and pass them through JSLint.
Update: The previous version of the script was not working on every case. The problem is that hg log –template ‘{files}’ outputs all the modified files in a single line. That output saw used as input of awk, that was not filtering properly. I found a workaround, perhaps is not the nicest script, but is working.
#!/bin/sh
# Mercurial pretxncommit hook
for i in $(hg log -r $HG_NODE --template '{files}'); do echo $i | awk '/.js$/ | xargs -rn1 /path/to/jslint || exit 1; done;
Credits
As many times, thanks to Juan Pablo and the Mercurial Community for providing the way to check only the files part of the changeset.
posted in development, javascript, jslint, mercurial, Openbravo
Jul 14,
2011
by Iván Perdomo
We have been working hard to finish the new Developer’s Guide targeting Openbravo 3. This guide contains information on how to change, extend and build further the application providing valuable information for starting developers, medium experienced and Openbravo experts.
The New Structure
Following best practices we are now using Categories as the way to structure our documentation. An overview of the categories is shown in the following diagram:
- Concepts: Contains documents that aim to explain core concepts behind Openbravo architecture.
- HowTo: Step by step actions to achieve a goal, e.g. How to create and package a Module
- Data_Model: Automatic generated documentation that contains the Database and Entity Model
- Example: Documents that explain code present in the product that could be used as base for our developments
- Reference:The hibernate mapping, REST XML Schema among other reference documents
Feedback
If you find a document that contains something wrong, outdated or not properly explained, please fix it, after all is a wiki. Note: If you want to make a large change in a document, please contact the original author explaining your proposed changes.
You could also log a defect or feature request in the issue tracker in the Documentation project. Remember to pick the right category: ERP Developers Guide.
I’ve also started a forum thread to collect your feedback and ideas on the Developers Guide.
That’s all folks!
posted in development, documentation, Openbravo
Jul 13,
2011
by Asier Lostalé
Now it is one month since Openbravo 3 was Generally Available released.
But what about people using Openbravo 2.50? Should they continue using 2.50 for the next few years? The answer is NO… Now it is very easy to upgrade to Openbravo 3 for all of them!
From 2.50 MP31 (which is currently in QA Approved maturity status, learn more) upgrade using ERP’s user interface is supported. We have worked hard to provide an easy upgrade path. Being in 2.50 MP31 or higher, after Scanning for updates you will find, in addition to he updates for your modules, upgrade to Openbravo 3. Upgrade is a new flow (similar to update) that will guide you through the steps required to end up with your instance in the new major version. Even “upgrade” can sound as very a difficult and complex task, I suggest you to try it and realize how it is possible to do it in matter of some hours. Here, you can find detailed documentation on this process.

But this is not all the good news:
- We wanted to make Openbravo 3 as accessible as possible, so 2.50 MP31 has been released as a Community version, this means Community Edition 2.50 instances will be able to easily update to this version through user interface.
- For professional subscribers, there is also available an upgrade for the Openbravo Appliance.
Enjoy Openbravo 3!
Filed under:
Openbravo Tagged:
modularity,
Openbravo 3,
upgrade
| tags: functionalities, Openbravo ERP, sourceforge posted in modularity, Openbravo, Openbravo 3, upgrade
Jul 11,
2011
by Rob Goris
We´re working on a redesign of the Copy Lines & Copy From Order flows. After a few iterations, here is the
first draft.

The two scenarios only differ in that one has a preview area and the other does not.
Let me know if this would work for you and your customers. Leave comments below the images in the web album or on the
UX Lab forum on Forge.
posted in interaction design
Jul 7,
2011
by Shankar Balachandran
Callout in Openbravo is the feature that enables us to do runtime operations with the data. Callout is generally attached to a field and triggered in the onchange event. Openbravo has implemented a java class file called SimpleCallout.java, that we can extend and use it for implementing Callouts. For more information on implementing callouts, refer
here and
here.
As Callouts are attached to a field, you can use the field name with the prefix 'inp' to retrieve the run time value. Based upon that, you can do manipulations. But using this method, restrict the usage of that callout to a particular field. Say for instance I have a same logic to be implemented across five different fields, then I have to write 5 different callout, as we are hard coding the field names. But there is also a method provided to retrieve the last changed field and then using that, you can retrieve that value.
I have provided below the code, that retrieves the name of the last changed field and then the value of the corresponding field.
package com.fugoconsulting.xxx.erpCommon.ad_callout;
import javax.servlet.ServletException;
import java.util.*;
import java.lang.*;
import org.openbravo.utils.FormatUtilities;
import org.apache.log4j.Logger;
import org.hibernate.criterion.Expression;
import org.openbravo.erpCommon.ad_callouts.SimpleCallout;
import org.openbravo.base.secureApp.VariablesSecureApp;
import org.openbravo.dal.service.OBDal;
public class NameValidation extends SimpleCallout {
private static final long serialVersionUID = 1L;
private static Logger log = Logger.getLogger(NameValidation.class);
@Override
protected void execute(CalloutInfo info) throws ServletException {
//Gets the last changed field
String lastChanged = info.getStringParameter("inpLastFieldChanged",null);
int length = lastChanged.length();
//Gets the value of the last changed field
String lastChangedValue = info.getStringParameter(lastChanged,null);
log.info("Last field changed:"+lastChanged);
log.info("Last field length:"+length);
}
}
Happy Working...
posted in HOW TO DEVELOP CALLOUT IN OPENBRAVO, LAST CHANGED VALUE IN OPENBRAVO, Openbravo, OPENBRAVO CALLOUT, Openbravo Chennai, Openbravo India, RETRIEVING LAST CHANGED VALUE IN OPENBRAVO CALLOUT, RUNTIME VALIDATIONS IN OPENBRAVO
Jul 6,
2011
by Rob Goris
We noticed that with lots of filtering and scrolling in the grid, you might lose track of your selected row(s). You could scroll up and down to look them up, but this could become tedious when you have hundreds of rows. Sometimes the simplest solutions are the best. Here´s what we did.
So you got this invoice selected in the grid. It is highlighted in orange.

You now decide to filter the grid to look for all "East Coast" invoices that have status "Payment Complete = No".

Ok, cool. We´re done with that and clear the filters. Hang on, where did my selected row go? It must have scrolled outside the visible area.

To get the selected row back in the visible area, we simply click on the selected-row-counter button.

And the selected row moves back in the view port!
Lost-No-More will be available in maintenance pack 1 (Openbravo 3-MP1) due for end of next week.
posted in features, interaction design
Jul 6,
2011
by Rob Goris
Pamplona might be known for as the home of Openbravo but it is probably better known for its yearly
San Fermin festival where millions of people gather to watch the famous
encierro, the running of the bulls.
So if you wonder why the
demo.openbravo.com login screen suddenly turned red or why we seem to be in a festive mood this week, it is probably because of San Fermin.
A special thanks to
Miguel Rodriguez Font who created the bull logo.
posted in Uncategorized