Tesla is teaming up with Panasonic to build solar cells and modules at a SolarCity factory in New York.

The electric automaker, which is already working with Panasonic to produce car batteries, wants to start production of photovoltaic components at the SolarCity (SCTY) factory in Buffalo as soon as next year.

Tesla (TSLA) announced the new partnership in a blog post late Sunday. Panasonic (PCRFF) confirmed it signed a basic non-binding agreement with Tesla, but did not comment further.

The plan hinges on Tesla finalizing its purchase of the solar panel seller SolarCity in November.

The two companies have been heading towards a merger since Tesla announced its plans to buy SolarCity in August. Shareholders in the two companies will vote on the acquisition next month.

Some analysts are not happy with the deal, pointing to the speed at which SolarCity has been burning through its cash reserves in recent months.

Tesla CEO Elon Musk owns more than 20% of SolarCity and is the company's chairman. Musk's cousin Lyndon Rive is the chief executive of SolarCity.

Related: Inside Tesla's ginormous Gigafactory

Tesla plans to use the cells and modules produced in Buffalo with its energy storage products Powerwall and Powerpack.

"By working together on solar, we will be able to accelerate production of high-efficiency, extremely reliable solar cells and modules at the best cost," said J.B. Straubel, Tesla's chief technical officer and co-founder.

A combined Tesla and SolarCity event scheduled for Friday, Oct. 28, could shed more light on Musk's plans.