Absolutely not. The article, which you say is in force in Portugal as substantive law, says two things:
1. The obligations arising from legal transactions, as well as the very substance of it, are regulated by the law that the subjects have appointed or had in view.
This statement means that the legal transactions are governed by either the law the parties choose (this is called a "choice of law" provision in a contract) or by the law the parties "had in view" which is to say the law of the jurisdiction in which both reside. However, while parties to transactions can select the law to be applied, many legal events are not transactions, such as crimes, for obvious reasons. One party to a contract may not select the law to be applied -- that must be by agreement with all other parties. Also, real estate titles, wills, and similar matters are governed by the law of the location (so called
in rem jurisdiction. In other words, parties to a real estate sale cannot say that the law of Portugal applies to a real estate title transfer in Michigan.
2. The designation or reference of the parties may, however, fall on law whose applicability corresponds to a serious interest of the "parties" or is in connection with some of the elements of the legal transaction justifiable in the field of private international law.
This second provision merely elaborates on paragraph 1, limiting choice of law to "law whose applicability corresponds to a serious interest of the parties in or a connection to the law chosen, all as is common in or "justifiable" in "private international law." Private international law is the successor to the "law marchant" of the early modern period. You will find the elements of private international law in the INCOTERMS and other publications of entities such as the International Chamber of Commerce. These are standard contract terms, shipping terms (e.g., COD) and similar stuff, like arbitration clauses.
In other words, the quoted article does not say what you think it does.
Also, section 42 says what I just said.