Who is entitled to the rights in case of an invention been commissioned to a third party?
There are always two kinds of rights over the inventions: the economical right of its exploitation, and the moral right to be recognised as the author of it. The moral right always belongs to whoever actually realised the invention, regardless of the type of relation existing between him and whoever financed the work; but the economical right does not always belong to him/them, even if the law only provides for the rights of companies over inventions of their employees, and not the rights over the inventions created by other work suppliers.
If there has been an assigned work and, specifically, to realize an innovative project, substantially an invention, the economical rights over the invention should go to whoever commissioned it. This is per analogy with the Art 64 of the Industrial Property Code, and also because it is normal that the client purchases in his name the assigned work.
Therefore a patent application should be filed in the name of whoever commissioned it, reserving him the economical exploitation, but indicating, as the inventor, who in fact realized the finding, unless there is a special agreement between inventors and the other company regulating this situation differently.