European Union (Withdrawal) Bill currently passing through the UK Parliament - Holyrood 15th May. The Welsh Assembly gave its consent (46 votes to 9) - BBC 15th May.
The issue centres on how EU powers in devolved areas such as agriculture and fishing are repatriated to the UK. The
UK government has said the vast majority of such powers should go
straight to the devolved institutions apart from some in 24 policy areas
where they want to develop “common frameworks” across the UK. The UK
government has proposed that Westminster should temporarily have control over
those 24 areas for a few years so that those frameworks can be
developed. The 24 areas include agriculture, fisheries, food labelling and public
One of the most contentious clauses has been what has now become Clause 15 (in the Bill as it stood on 8th May 2018). This started life as Clause 11 - (Bill as introduced to Lords). Devolution legislation (e.g. Scotland Act 1998) prevented the devolved institutions from legislating incompatibly with EU law. Clause 15 modifies, in a complex way, that restriction for Scotland, Wales and Northern Ireland.
Originally, the process of legislative consent arose from the Sewel Convention. The convention is named after Lord Sewel,
who was the Scotland Office minister in the Lords responsible for the
conduct of the Scotland bill in 1998. It provides that the UK Parliament
may not legislate for devolved matters without the consent of the
devolved legislature affected. Motions giving consent under the
convention are known as Legislative Consent Motions.
The Scotland Act 2016 section 2 amended the Scotland Act 1998 section 28 by adding subsection 8:
"But it is recognised that the Parliament of the United Kingdom will not normally legislate with regard to devolved matters without the consent of the Scottish Parliament."
In effect, this put the Sewel Convention into legislative form. They key word in the provision is "normally."
Similar action was take regarding Wales - see Wales Act 2017 section 2 amending the Government of Wales Act 2006 section 107.
There is no equivalent statutory provision for Northern Ireland but, in principle, the convention applies. For political reasons, there is currently no operational Northern Ireland Assembly.
For a more detailed look at Devolution and Legislative Consent see House of Commons Briefing Note 08274 (29th March 2018).
View of Supreme Court -
The decision of Parliament to include these legislative provisions in relation to Scotland and Wales had no legal effect on the relationship between the UK Parliament and their respective devolved institutions. The UK Supreme Court confirmed in R (Miller) v Secretary of State for Exiting the European Union  UKSC 5 that Parliament’s decision to put Lord Sewel’s words into statute did not convert the Convention into a judicially enforceable rule.
At para 148 the courts said - "As the Advocate General submitted, by such provisions, the UK Parliament
is not seeking to convert the Sewel Convention into a rule which can be
interpreted, let alone enforced, by the courts; rather, it is recognising the
convention for what it is, namely a political convention, and is effectively
declaring that it is a permanent feature of the relevant devolution settlement.
That follows from the nature of the content, and is acknowledged by the words
(“it is recognised” and “will not normally”), of the relevant subsection. We would
have expected UK Parliament to have used other words if it were seeking to
convert a convention into a legal rule justiciable by the courts."
and at para 151 - " ... we do not underestimate the importance of
constitutional conventions, some of which play a fundamental role in the operation
of our constitution. The Sewel Convention has an important role in facilitating
harmonious relationships between the UK Parliament and the devolved
legislatures. But the policing of its scope and the manner of its operation
does not lie within the constitutional remit of the judiciary, which is to
protect the rule of law."
Does Scotland's refusal stop Brexit?
The short answer is NO. Negotiation will continue between the UK government and Scottish Ministers to try to find a solution. If that is not successful then the UK Parliament is legally entitled to enact the legislation it considers necessary. In the Miller case (para 136) the court said - " .... In each of
the devolution settlements the UK Parliament has preserved its right to
legislate on matters which are within the competence of the devolved legislature ...."
Of course, it is for politicians to weigh the possible consequences of doing so.
Law Society of Scotland - December 2017 - EU Withdrawal Bill - Briefing on Clause 11 - Retaining EU restrictions in devolved legislation
House of Lords Constitution Committee - 29th January 2018 - Report on the EU (Withdrawal) Bill - note especially Chapter 10 regarding Devolution
Institute of Government - March 2018 - EU Withdrawal Bill - Clause 11 and the devolution deadlock