She swore an oath regarding her husband, and he did not fulfil her oath because he forgot
Question

A while ago, I swore an oath regarding my children that neither I nor their father would buy them any electronic devices again. When I was visiting my family, my husband called me and told me that he had bought electronic devices for the children, because he forgot that I had sworn an oath that we would not buy such things. Do I have to offer expiation for the breaking of my oath (kaffarat yamin)?
Praise be to Allah.Firstly:
Swearing that someone else should not do a certain thing is a binding oath, the consequences of which are to be borne by the one who swore the oath.
Ibn Qudamah (may Allah have mercy on him) said:
If he said: “By Allah, So-and-so should surely do – or not do – such and such”; or he swore an oath regarding someone who was present, and said: “By Allah, you should surely do such and such,” then he broke the oath and did not do that thing, then expiation must be offered by the one who swore the oath. This was stated by Ibn ‘Umar, the people of Madinah, ‘Ata’, Qatadah, al-Awza‘i, the people of Iraq and ash-Shafa‘i. That is because it is as if the one who swore the oath broke it, so he is required to offer expiation, as if he is the one who did what he swore not to do, and because the reason for offering expiation is either the oath or the breaking of the oath or both. Whichever happened, it has to do with the one who swore the oath. End quote from al-Mughni (13/502).
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said:
What is meant by swearing an oath regarding someone else is when the oath-maker swears that someone else should surely do such and such. If that person breaks the oath and does not fulfil it, then expiation is to be offered by the one who swore the oath, not the one concerning whom the oath was sworn, according to the majority of jurists. For example, if someone swears an oath regarding his slave or his child or his friend, saying that they must surely do something, then the other person does not do it, expiation must be offered by the one who swore the oath that has been broken. End quote from Majmu‘ al-Fatawa (1/206).
Secondly:
If the person concerning whom the oath was sworn does not fulfil the oath because he forgot, then nothing is required of the one who swore the oath, because if the one who swore the oath did that thing himself because he forgot, then nothing is required of him. That is because the one who forgets is excused and there is no sin on him, and expiation is prescribed to absolve the sin of breaking the oath.
Allah, may He be exalted, says (interpretation of the meaning):
{There is no sin on you if you make a mistake in that regard, but [you are accountable] for what your hearts deliberately intend} [al-Ahzaab 33:5].
It was narrated that Ibn ‘Abbaas said: Allah, may He be exalted, revealed the words: { Allah does not place on any soul a burden greater than it can bear. For it is what it has earned, and against it is what it has committed. Our Lord, do not hold us accountable if we forget or fall into error} [al-Baqarah 2:286]. Allah said: I have granted that. Narrated by Muslim (126).
It says in ar-Rawd al-Murbi‘ (3/1554).
If he swears an oath regarding himself or someone else over whom he has authority and who would fulfil his oath, intending to prevent that person, such as his wife or child, from doing something, then that person does it out of forgetfulness or ignorance, the oath is broken and the divorce or manumission of a slave come into effect… That is, in contrast to an oath sworn explicitly by Allah, may He be exalted, and the like, because this is the right of Allah, and He has already forgiven this ummah for what it does by mistake or out of forgetfulness. End quote.
Shaykh Ibn ‘Uthaymin (may Allah have mercy on him) said:
If he does the thing concerning which the oath was sworn out of forgetfulness or ignorance, then the scholars said that in the case of an oath that one’s wife would be divorced or one slave would be manumitted if someone else did the thing mentioned in the oath, then the oath is broken and the divorce and manumission will come into effect. But they said regarding an oath sworn explicitly by Allah that the oath is not broken [if the other person does the thing concerning which the oath was sworn to prevent him doing that thing]. But the correct view is that there is no difference and the oath is not broken in either case, just as it is not broken in the case of an oath sworn explicitly by Allah. This applies if the person who swore the oath swore it regarding himself.
But if he swore an oath regarding someone else, to prevent him from doing something, either swearing explicitly  by Allah, saying that his wife would be divorced or his slave would be manumitted [if he did that thing], or making a vow, then one of two scenarios must apply to the other person.
The first scenario is that the person concerning whom the oath was sworn is someone who would usually comply with his oath and refrain from the matter in question. In other words, if the person swears an oath concerning him, he will comply with his oath, because of ties of kinship, marriage or friendship.
The second scenario is that this other person is someone who would not comply with his oath, and would not care about it, as we will discuss below.
If this other person is someone who would usually comply with his oath and fulfil it, and would not go against it, because of ties of kinship, marriage or friendship, such as if he swears an oath regarding his wife, that she should not do something, then she does it out of forgetfulness or ignorance; or he swears an oath regarding his child, son or daughter, that the child should not do something, then the child does it out of forgetfulness or ignorance, this other person comes under the same ruling as the one who swore the oath, as if he is him. So if he does it out of forgetfulness or ignorance in the case of an oath that was sworn explicitly by Allah, the oath is not broken, but if it has to do with manumission or divorce, then the oath is broken [and the divorce or manumission comes into effect].
For example:
A man says to his son: “If you do such and such, your mother is divorced,” then the child does that thing out of forgetfulness; is the mother divorced? Yes, she is divorced according to the madhhab.
If he says to his son: “If you do such and such, then my slave is free,” then the child does that thing out of forgetfulness, the oath is broken and the slave is manumitted, just as if he swore the oath regarding himself.
But the correct view is that the oath is not broken, just as if he swore the south explicitly by Allah, may He be glorified and exalted."(Ash-Sharh al-Mumti‘  15/2 02).
And Allah knows best.