Posts Tagged ‘Modules’

Calculating a product cost with OpenERP

Last week I had the opportunity to try a very useful module that, IMHO, should be included in OpenERP core. This module is product_extended and can be found in the extras repository, you can download it with the following command:

#  bzr branch lp:openobject-addons/extra-6.0

This module does many things, among them shows the product last order for a supplier and its date. But what is really interesting is that it calculates a product cost based on its Bill of Materiales. In order to do that, first you need to check the “Compute Standard Price” check box in the product form,

Then, you can either click on the “Compute Standard Price” button or check it in the product bill of materials (a product can have more than one bill of materials). In the latter, you can find the product information on the Bill of Materials form.

You can calculate the standard price by clicking on the “Compute Standard Price” wizard on the right of the BoM form. How is this cost calculated? This is the interesting part, it takes into account the product cost of each product, plus the hours and cycle costs of every workcenter that is involved in its routing. A very useful module.

It needs a minor change in order to make it work with OpenERP 6.1 but you should try it, I highly recommend it


ABC Analysis in OpenERP

December 26, 2011 Leave a comment

ABC analysis is very well covered in this Wikipedia article. So no point of talking about it again here. Thing is, how do you implement it in OpenERP.

Polish OpenERP screenshot

Image via Wikipedia

Truth is, it is not a great deal. You only need to pull the sale order lines for the past six months (for example, could be a year as well or the period under analysis), then by product summarize its sales (not taking into account any discounts) and then divide the sales number by the total sales amount, in order to figure out the product ABC Category. If you are an experienced programmer or data analyst, you can do this in minutes. If not, does not take long to figure out how to query the OpenERP database.

Thing is, this information is not integrated into OpenERP yet (and it makes sense, since you do not need this information for the MRP application. It’s nice to have it, but it is not critical). So I created a module that regularly categorizes OpenERP products according to its sales. I have not finished it yet and I need to upload it to LaunchPad, but I think I will do it this week.

What does this module do? Allows you to create ABC categories (you can have as many as you want) where you define the category and its range. Then regularly (as an scheduler action) categorizes the products taking into account their sales lines. Then updates the product abc_category field (created previously by the module installer).

I still need to polish the module and add a couple of files, such as a XML file with initial information (specially for the scheduler and categories). As soon as I get it done, I will upload it to LaunchPad and publish it.


What is a product in OpenERP?

Supply chain diagram black arrow - flow of mat...

Image via Wikipedia

A product in OpenERP can be many things at the same time. They can be either products to be sold, raw material or componentes purchased from suppliers, or work in progress pieces needed in the manufacturing process.

  • A product that can be sold is a product that will be listed on the products list when you are creating a sales order.
  • A product that is raw material is a product used in the manufacturing process and is procured from suppliers

You specify whether a product can be sold or purchased in the product form:

There is a third option that is not listed in the product definition form, and it is the fact that a product can be a work-in-progress component of the manufacturing process. In order to do that, you need to create a product and keep the “Can be sold” and “Can be purchased” check boxes unchecked. What is important to keep in mind is the Supply Method, where you have two options, “Buy” or “Produce”. If you specify “Buy” the product will be purchased from suppliers. If you specify “Produce”, a production order will be created in order to procure this component.

This  is important to keep in mind when you are importing information from another system. Most of the times you will import the products to be sold or the raw material to be procured, but we forget to import or create the work-in-progress components. We realize this problem when we try to create production orders, since those orders will require Bill of Materials that are missing the required work-in-progress components.

On a next post, I will cover my experiences so far with importing data into OpenERP,


HR Attendance analysis with OpenERP

March 27, 2011 2 comments
KDE 4.0

Image via Wikipedia

My partner, Cristian Sebastian Rocha, has been working the past three months in the development of the hr_attendance_analysis module, which, as its name suggests, helps companies analyze their employees attendance.

This module allows you make calculations on the worked hours by employees. You can apply formulas and calculation rules in order to automate attendance calculation. It can also be integrated with other HR related modules, such as the clock_reader module.

This module also has a workflow for confirming the entered date on each document type, journal and payroll. The first document holds daily attendance information for the employee, whereas payroll holds payroll information on a monthly, bi-weekly or daily basis.

These are some screenshots for the module:

In this image you can see the main menu for accessing the HR module. You can also see the menu items for accessing the Payroll documents (selected) and Attendance Journals.

In this image you can see the document with the summary of employee hours (filtered by a date range). You can leave notes for each employee or for the document. It can have two states: draft and validated. We still have to develop the workflow for cancelling and re-setting the document.

In this screenshot we can see the entry for the employee Journal. Here you can see in detail the in and out time for a given date. You can also see the vacations or time off hours (such as late arrivals, early departures, sick days, etc.) To the left you can also see the result of the hours calculation.

This is a formula for summarizing the values stored in the journal, in order to be shown in the Payroll document.

This is a formula for calculating normal hours in a given  date for a given employee:

In this screenshot, you can see a rule. This rule assigns reasons for the actions of entering or leaving the plant. IN this case we can see how to calculate an early leave without a warning.

We still have things to do, but soon we will upload the module to LaunchPad. If you have any comments, or suggestions, they are more than welcome.


Getting started with the OpenERP MRP module

March 8, 2011 1 comment

Image via Wikipedia

Getting started with the MRP module can be a daunting enterprise, and it is easy  to get lost at it. But actually it is easier than it seems. I will cover the functional elements you need to get started with the MRP module. I will not cover how to do that, it is already covered in the documentation.

In order to start with the MRP module, you just need four pieces of information:

  1. Product information; the first information item you need. Which products you are planning to sell and procure.
  2. Bill of Materials, sometimes called formulas. They are a list of the raw materials, sub-assemblies, intermediate assemblies, sub-components, components, parts and the quantities of each needed to manufacture an end product.
  3. Stock information, pretty much how much inventory you have at hand. If you don’t have this information, you can’t even get started. MRP uses inventory information to determine when and how much to procure.
  4. Master Procurement Schedule; this provides the list of the products you need to procure (either purchase or manufacture) and when you need them. This can be provided by the stock_planning module. Or you could keep an spreadsheet updated with your procurement needs and create the procurement orders from there.

If you are planning on implementing the MRP module, you need to assess the four points I described above. Chances are bill of materials are maintained in paper or spreadsheets. The stock information might be maintained by an information system within the company. But at the end of the day, you will need to assess the quality of the bill of materials. Implementing them will be the longest item in the MRP implementation plan, and you can’t take shortcuts over there. Chances are you will need someone manually checking they are fine, and that you will need to import them manually (which might be the healthiest thing to do).

Well, just wanted to cover some information issues that come up when you are implementing the MRP module.


OpenERP module of the day: base_crypt (or encrypting your user password in OpenERP)

February 22, 2011 2 comments
Category:WikiProject Cryptography participants

Image via Wikipedia

This is a quick post. I found this base module which is quite useful and I wanted to share it with you. The module is base_crypt and it encrypts user passwords in the OpenERP database. By  default OpenERP stores user passwords in the res_users table, they are stored in plain text in the password field. base_crypt module encrypts all passwords with the MD5 algorithm. Below is the link for downloading the module:

IMHO, this module should be part of core since it is a good security practice to store passwords in encrypted form. In some places it is mandated by law. It is also a nice module to look at, checking its code is fun.


OpenERP module of the day: sale_delivery (or managing open orders)

February 20, 2011 Leave a comment

Image via Wikipedia

Quick Sunday post. The sale_delivery module allows you manage open orders on OpenERP. An open order is when your client orders from you a product that needs to be delivered in multiple packings. After installing the module, every time you create a sales order you will notice a new tab with the delivery planning. There you will be able to enter when  you are planning on when and how many units of your product you are planning on delivering. Later, you will be able to invoice the customer from packing

Where is this module useful? In places like Argentina. Many businesses have open orders with their clients. This is a very common use case. Other common use cases are invoicing (that is the first one) and managing stock. Not surprisingly financial accounting is not on the list, since a huge size of the economy is informal.

Have a good Sunday!